]> matita.cs.unibo.it Git - helm.git/blob - helm/software/matita/contribs/dama/dama/ordered_uniform.ma
1f4f6f6867a772e8b37e21d91e1c02b7446c47a4
[helm.git] / helm / software / matita / contribs / dama / dama / ordered_uniform.ma
1 (**************************************************************************)
2 (*       ___                                                              *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||         The HELM team.                                      *)
8 (*      ||A||         http://helm.cs.unibo.it                             *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU General Public License Version 2                  *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 include "uniform.ma".
16
17 record ordered_uniform_space_ : Type ≝ {
18   ous_os:> ordered_set;
19   ous_us_: uniform_space;
20   with_ : us_carr ous_us_ = bishop_set_of_ordered_set ous_os
21 }.
22
23 lemma ous_unifspace: ordered_uniform_space_ → uniform_space.
24 intro X; apply (mk_uniform_space (bishop_set_of_ordered_set X));
25 unfold bishop_set_OF_ordered_uniform_space_;
26 [1: rewrite < (with_ X); simplify; apply (us_unifbase (ous_us_ X));
27 |2: cases (with_ X); simplify; apply (us_phi1 (ous_us_ X));
28 |3: cases (with_ X); simplify; apply (us_phi2 (ous_us_ X));
29 |4: cases (with_ X); simplify; apply (us_phi3 (ous_us_ X));
30 |5: cases (with_ X); simplify; apply (us_phi4 (ous_us_ X))]
31 qed.
32
33 coercion ous_unifspace.
34
35 record ordered_uniform_space : Type ≝ {
36   ous_stuff :> ordered_uniform_space_;
37   ous_convex: ∀U.us_unifbase ous_stuff U → convex (os_l ous_stuff) U
38 }.   
39
40 definition half_ordered_set_OF_ordered_uniform_space : ordered_uniform_space → half_ordered_set.
41 intro; compose ordered_set_OF_ordered_uniform_space with os_l. apply (f o);
42 qed.
43
44 definition invert_os_relation ≝
45   λC:ordered_set.λU:C squareO → Prop.
46     λx:C squareO. U 〈\snd x,\fst x〉.
47
48 interpretation "relation invertion" 'invert a = (invert_os_relation _ a).
49 interpretation "relation invertion" 'invert_symbol = (invert_os_relation _).
50 interpretation "relation invertion" 'invert_appl a x = (invert_os_relation _ a x).
51
52 lemma hint_segment: ∀O.
53  segment (Type_of_ordered_set O) →
54  segment (hos_carr (os_l O)).
55 intros; assumption;
56 qed.
57
58 coercion hint_segment nocomposites.
59
60 lemma segment_square_of_ordered_set_square: 
61   ∀O:ordered_set.∀s:‡O.∀x:O squareO.
62    \fst x ∈ s → \snd x ∈ s → {[s]} squareO.
63 intros; split; exists; [1: apply (\fst x) |3: apply (\snd x)] assumption;
64 qed.
65
66 coercion segment_square_of_ordered_set_square with 0 2 nocomposites.
67
68 alias symbol "pi1" (instance 4) = "exT \fst".
69 alias symbol "pi1" (instance 2) = "exT \fst".
70 lemma ordered_set_square_of_segment_square : 
71  ∀O:ordered_set.∀s:‡O.{[s]} squareO → O squareO ≝ 
72   λO:ordered_set.λs:‡O.λb:{[s]} squareO.〈\fst(\fst b),\fst(\snd b)〉.
73
74 coercion ordered_set_square_of_segment_square nocomposites.
75
76 lemma restriction_agreement : 
77   ∀O:ordered_uniform_space.∀s:‡O.∀P:{[s]} squareO → Prop.∀OP:O squareO → Prop.Prop.
78 apply(λO:ordered_uniform_space.λs:‡O.
79        λP:{[s]} squareO → Prop. λOP:O squareO → Prop.
80           ∀b:O squareO.∀H1,H2.(P b → OP b) ∧ (OP b → P b));
81 [5,7: apply H1|6,8:apply H2]skip;
82 qed.
83
84 lemma unrestrict: ∀O:ordered_uniform_space.∀s:‡O.∀U,u.∀x:{[s]} squareO.
85   restriction_agreement ? s U u → U x → u x.
86 intros 6; cases x (b b1); cases b (w1 H1); cases b1 (w2 H2); clear b b1 x; 
87 cases (H 〈w1,w2〉 H1 H2) (L _); intro Uw; apply L; apply Uw;
88 qed.
89
90 lemma restrict: ∀O:ordered_uniform_space.∀s:‡O.∀U,u.∀x:{[s]} squareO.
91   restriction_agreement ? s U u → u x → U x.
92 intros 5; cases x (b b1); cases b (w1 H1); cases b1 (w2 H2); clear b1 b x;
93 intros (Ra uw); cases (Ra 〈w1,w2〉 H1 H2) (_ R); apply R; apply uw;
94 qed.
95
96 lemma invert_restriction_agreement: 
97   ∀O:ordered_uniform_space.∀s:‡O.
98    ∀U:{[s]} squareO → Prop.∀u:O squareO → Prop.
99     restriction_agreement ? s U u →
100     restriction_agreement ? s (\inv U) (\inv u).
101 intros 8; split; intro;
102 [1: apply (unrestrict ???? (segment_square_of_ordered_set_square ?? 〈\snd b,\fst b〉 H2 H1) H H3);
103 |2: apply (restrict ???? (segment_square_of_ordered_set_square ?? 〈\snd b,\fst b〉 H2 H1) H H3);]
104 qed. 
105
106 lemma bs2_of_bss2: 
107  ∀O:ordered_set.∀s:‡O.(bishop_set_of_ordered_set {[s]}) squareB → (bishop_set_of_ordered_set O) squareB ≝ 
108   λO:ordered_set.λs:‡O.λb:{[s]} squareO.〈\fst(\fst b),\fst(\snd b)〉.
109
110 coercion bs2_of_bss2 nocomposites.
111
112
113 lemma a2sa :
114  ∀O:ordered_uniform_space.∀s:‡(ordered_set_OF_ordered_uniform_space O).
115  ∀x:
116   bs_carr
117   (square_bishop_set
118    (bishop_set_of_ordered_set
119      (segment_ordered_set 
120        (ordered_set_OF_ordered_uniform_space O) s))).
121  (\fst x) ≈ (\snd x) →
122  (\fst (bs2_of_bss2 (ordered_set_OF_ordered_uniform_space O) s x))
123  ≈
124  (\snd (bs2_of_bss2 (ordered_set_OF_ordered_uniform_space O) s x)).
125 intros 3; cases x (a b); clear x; cases a (x Hx); cases b (y Hy); clear a b;
126 simplify; intros 2 (K H); apply K; clear K; whd; whd in H; cases H;
127 [left|right] apply x2sx; assumption;
128 qed.
129
130
131 lemma segment_ordered_uniform_space: 
132   ∀O:ordered_uniform_space.∀s:‡O.ordered_uniform_space.
133 intros (O s); apply mk_ordered_uniform_space;
134 [1: apply (mk_ordered_uniform_space_ {[s]});
135     [1: alias symbol "and" = "constructive and".
136         letin f ≝ (λP:{[s]} squareO → Prop. ∃OP:O squareO → Prop.
137                     (us_unifbase O OP) ∧ restriction_agreement ?? P OP);
138         apply (mk_uniform_space (bishop_set_of_ordered_set {[s]}) f);
139         [1: intros (U H); intro x; simplify; 
140             cases H (w Hw); cases Hw (Gw Hwp); clear H Hw; intro Hm;
141             lapply (us_phi1 O w Gw x (a2sa ??? Hm)) as IH;
142             apply (restrict ? s ??? Hwp IH); 
143         |2: intros (U V HU HV); cases HU (u Hu); cases HV (v Hv); clear HU HV;
144             cases Hu (Gu HuU); cases Hv (Gv HvV); clear Hu Hv;
145             cases (us_phi2 O u v Gu Gv) (w HW); cases HW (Gw Hw); clear HW;
146             exists; [apply (λb:{[s]} squareB.w b)] split;
147             [1: unfold f; simplify; clearbody f;
148                 exists; [apply w]; split; [assumption] intro b; simplify;
149                 unfold segment_square_of_ordered_set_square;
150                 cases b; intros; split; intros; assumption;
151             |2: intros 2 (x Hx); cases (Hw ? Hx); split;
152                 [apply (restrict O s ??? HuU H)|apply (restrict O s ??? HvV H1);]]
153         |3: intros (U Hu); cases Hu (u HU); cases HU (Gu HuU); clear Hu HU;
154             cases (us_phi3 O u Gu) (w HW); cases HW (Gw Hwu); clear HW;
155             exists; [apply (λx:{[s]} squareB.w x)] split;
156             [1: exists;[apply w];split;[assumption] intros; simplify; intro;
157                 unfold segment_square_of_ordered_set_square;
158                 cases b; intros; split; intro; assumption;
159             |2: intros 2 (x Hx); apply (restrict O s ??? HuU); apply Hwu; 
160                 cases Hx (m Hm); exists[apply (\fst m)] apply Hm;]
161         |4: intros (U HU x); cases HU (u Hu); cases Hu (Gu HuU); clear HU Hu;
162             cases (us_phi4 O u Gu x) (Hul Hur);
163             split; intros; 
164             [1: lapply (invert_restriction_agreement O s ?? HuU) as Ra;
165                 apply (restrict O s ?? x Ra);
166                 apply Hul; apply (unrestrict O s ??? HuU H);
167             |2: apply (restrict O s ??? HuU); apply Hur; 
168                 apply (unrestrict O s ??? (invert_restriction_agreement O s ?? HuU) H);]]
169     |2: simplify; reflexivity;]
170 |2: simplify; unfold convex; intros 3; cases s1; intros;
171     (* TODO: x2sx is for ≰, we need one for ≤ *) 
172     cases H (u HU); cases HU (Gu HuU); clear HU H;
173     lapply depth=0 (ous_convex ?? Gu 〈\fst h,\fst h1〉 ???????) as K3;
174     [2: intro; apply H2; apply (x2sx (os_l O) s h h1 H);
175     |3: apply 〈\fst (\fst y),\fst (\snd y)〉;
176     |4: intro; change in H with (\fst (\fst y) ≰ \fst h1); apply H3;
177         apply (x2sx (os_l O) s (\fst y) h1 H);
178     |5: change with (\fst h ≤ \fst (\fst y)); intro; apply H4;
179         apply (x2sx (os_l O) s h (\fst y) H);
180     |6: change with (\fst (\snd y) ≤ \fst h1); intro; apply H5;
181         apply (x2sx (os_l O) s (\snd y) h1 H);
182     |7: change with (\fst (\fst y) ≤ \fst (\snd y)); intro; apply H6;
183         apply (x2sx (os_l O) s (\fst y) (\snd y) H);
184     |8: apply (restrict O s U u y HuU K3);
185     |1: apply (unrestrict O s ?? 〈h,h1〉 HuU H1);]]  
186 qed.
187
188 interpretation "Ordered uniform space segment" 'segment_set a b = 
189  (segment_ordered_uniform_space _ a b).
190
191 (* Lemma 3.2 *)
192 alias symbol "pi1" = "exT \fst".
193 lemma restric_uniform_convergence:
194  ∀O:ordered_uniform_space.∀s:‡O.
195   ∀x:{[s]}.
196    ∀a:sequence {[s]}.
197     (⌊n, \fst (a n)⌋ : sequence O) uniform_converges (\fst x) → 
198       a uniform_converges x.
199 intros 8; cases H1; cases H2; clear H2 H1;
200 cases (H ? H3) (m Hm); exists [apply m]; intros; 
201 apply (restrict ? l u ??? H4); apply (Hm ? H1);
202 qed.
203
204 definition order_continuity ≝
205   λC:ordered_uniform_space.∀a:sequence C.∀x:C.
206     (a ↑ x → a uniform_converges x) ∧ (a ↓ x → a uniform_converges x).
207
208 lemma hint_boh1: ∀O. Type_OF_ordered_uniform_space O → hos_carr (os_l O).
209 intros; assumption;
210 qed.
211
212 coercion hint_boh1 nocomposites. 
213
214 lemma hint_boh2: ∀O:ordered_uniform_space. hos_carr (os_l O) → Type_OF_ordered_uniform_space O.
215 intros; assumption;
216 qed.
217
218 coercion hint_boh2 nocomposites. 
219