]> matita.cs.unibo.it Git - helm.git/blob - helm/software/matita/contribs/dama/dama/ordered_uniform.ma
Another bug.
[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_l: ∀U.us_unifbase ous_stuff U → convex (os_l ous_stuff) U;
38   ous_convex_r: ∀U.us_unifbase ous_stuff U → convex (os_r ous_stuff) U
39 }.   
40
41 definition half_ordered_set_OF_ordered_uniform_space : ordered_uniform_space → half_ordered_set.
42 intro; compose ordered_set_OF_ordered_uniform_space with os_l. apply (f o);
43 qed.
44
45 definition invert_os_relation ≝
46   λC:ordered_set.λU:C squareO → Prop.
47     λx:C squareO. U 〈\snd x,\fst x〉.
48
49 interpretation "relation invertion" 'invert a = (invert_os_relation _ a).
50 interpretation "relation invertion" 'invert_symbol = (invert_os_relation _).
51 interpretation "relation invertion" 'invert_appl a x = (invert_os_relation _ a x).
52
53 lemma hint_segment: ∀O.
54  segment (Type_of_ordered_set O) →
55  segment (hos_carr (os_l O)).
56 intros; assumption;
57 qed.
58
59 coercion hint_segment nocomposites.
60
61 lemma segment_square_of_ordered_set_square: 
62   ∀O:ordered_set.∀s:‡O.∀x:O squareO.
63    \fst x ∈ s → \snd x ∈ s → {[s]} squareO.
64 intros; split; exists; [1: apply (\fst x) |3: apply (\snd x)] assumption;
65 qed.
66
67 coercion segment_square_of_ordered_set_square with 0 2 nocomposites.
68
69 alias symbol "pi1" (instance 4) = "exT \fst".
70 alias symbol "pi1" (instance 2) = "exT \fst".
71 lemma ordered_set_square_of_segment_square : 
72  ∀O:ordered_set.∀s:‡O.{[s]} squareO → O squareO ≝ 
73   λO:ordered_set.λs:‡O.λb:{[s]} squareO.〈\fst(\fst b),\fst(\snd b)〉.
74
75 coercion ordered_set_square_of_segment_square nocomposites.
76
77 lemma restriction_agreement : 
78   ∀O:ordered_uniform_space.∀s:‡O.∀P:{[s]} squareO → Prop.∀OP:O squareO → Prop.Prop.
79 apply(λO:ordered_uniform_space.λs:‡O.
80        λP:{[s]} squareO → Prop. λOP:O squareO → Prop.
81           ∀b:{[s]} squareO.(P b → OP b) ∧ (OP b → P b));
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 (H x); assumption;
87 qed.
88
89 lemma restrict: ∀O:ordered_uniform_space.∀s:‡O.∀U,u.∀x:{[s]} squareO.
90   restriction_agreement ? s U u → u x → U x.
91 intros 6; cases (H x); assumption;
92 qed.
93
94 lemma invert_restriction_agreement: 
95   ∀O:ordered_uniform_space.∀s:‡O.
96    ∀U:{[s]} squareO → Prop.∀u:O squareO → Prop.
97     restriction_agreement ? s U u →
98     restriction_agreement ? s (\inv U) (\inv u).
99 intros 6; cases b;
100 generalize in match (H 〈h1,h〉); cases h; cases h1; simplify; 
101 intro X; cases X; split; assumption; 
102 qed. 
103
104 lemma bs2_of_bss2: 
105  ∀O:ordered_set.∀s:‡O.(bishop_set_of_ordered_set {[s]}) squareB → (bishop_set_of_ordered_set O) squareB ≝ 
106   λO:ordered_set.λs:‡O.λb:{[s]} squareO.〈\fst(\fst b),\fst(\snd b)〉.
107
108 coercion bs2_of_bss2 nocomposites.
109
110
111 lemma a2sa :
112  ∀O:ordered_uniform_space.∀s:‡(ordered_set_OF_ordered_uniform_space O).
113  ∀x:
114   bs_carr
115   (square_bishop_set
116    (bishop_set_of_ordered_set
117      (segment_ordered_set 
118        (ordered_set_OF_ordered_uniform_space O) s))).
119  (\fst x) ≈ (\snd x) →
120  (\fst (bs2_of_bss2 (ordered_set_OF_ordered_uniform_space O) s x))
121  ≈
122  (\snd (bs2_of_bss2 (ordered_set_OF_ordered_uniform_space O) s x)).
123 intros 3; cases x (a b); clear x; cases a (x Hx); cases b (y Hy); clear a b;
124 simplify; intros 2 (K H); apply K; clear K; whd; whd in H; cases H;
125 [left|right] apply x2sx; assumption;
126 qed.
127
128
129 lemma segment_ordered_uniform_space: 
130   ∀O:ordered_uniform_space.∀s:‡O.ordered_uniform_space.
131 intros (O s); apply mk_ordered_uniform_space;
132 [1: apply (mk_ordered_uniform_space_ {[s]});
133     [1: alias symbol "and" = "constructive and".
134         letin f ≝ (λP:{[s]} squareO → Prop. ∃OP:O squareO → Prop.
135                     (us_unifbase O OP) ∧ restriction_agreement ?? P OP);
136         apply (mk_uniform_space (bishop_set_of_ordered_set {[s]}) f);
137         [1: intros (U H); intro x; simplify; 
138             cases H (w Hw); cases Hw (Gw Hwp); clear H Hw; intro Hm;
139             lapply (us_phi1 O w Gw x (a2sa ??? Hm)) as IH;
140             apply (restrict ? s ??? Hwp IH); 
141         |2: intros (U V HU HV); cases HU (u Hu); cases HV (v Hv); clear HU HV;
142             cases Hu (Gu HuU); cases Hv (Gv HvV); clear Hu Hv;
143             cases (us_phi2 O u v Gu Gv) (w HW); cases HW (Gw Hw); clear HW;
144             exists; [apply (λb:{[s]} squareB.w b)] split;
145             [1: unfold f; simplify; clearbody f;
146                 exists; [apply w]; split; [assumption] intro b; simplify;
147                 unfold segment_square_of_ordered_set_square;
148                 cases b; intros; split; intros; assumption;
149             |2: intros 2 (x Hx); cases (Hw ? Hx); split;
150                 [apply (restrict O s ??? HuU H)|apply (restrict O s ??? HvV H1);]]
151         |3: intros (U Hu); cases Hu (u HU); cases HU (Gu HuU); clear Hu HU;
152             cases (us_phi3 O u Gu) (w HW); cases HW (Gw Hwu); clear HW;
153             exists; [apply (λx:{[s]} squareB.w x)] split;
154             [1: exists;[apply w];split;[assumption] intros; simplify; intro;
155                 unfold segment_square_of_ordered_set_square;
156                 cases b; intros; split; intro; assumption;
157             |2: intros 2 (x Hx); apply (restrict O s ??? HuU); apply Hwu; 
158                 cases Hx (m Hm); exists[apply (\fst m)] apply Hm;]
159         |4: intros (U HU x); cases HU (u Hu); cases Hu (Gu HuU); clear HU Hu;
160             cases (us_phi4 O u Gu x) (Hul Hur);
161             split; intros; 
162             [1: lapply (invert_restriction_agreement O s ?? HuU) as Ra;
163                 apply (restrict O s ?? x Ra);
164                 apply Hul; apply (unrestrict O s ??? HuU H);
165             |2: apply (restrict O s ??? HuU); apply Hur; 
166                 apply (unrestrict O s ??? (invert_restriction_agreement O s ?? HuU) H);]]
167     |2: simplify; reflexivity;]
168 |2: simplify; unfold convex; intros 3; cases s1; intros;
169     (* TODO: x2sx is for ≰, we need one for ≤ *) 
170     cases H (u HU); cases HU (Gu HuU); clear HU H;
171     lapply depth=0 (ous_convex_l ?? Gu 〈\fst h,\fst h1〉 ???????) as K3;
172     [2: intro; apply H2; apply (x2sx (os_l O) s h h1 H);
173     |3: apply 〈\fst (\fst y),\fst (\snd y)〉;
174     |4: intro; change in H with (\fst (\fst y) ≰ \fst h1); apply H3;
175         apply (x2sx (os_l O) s (\fst y) h1 H);
176     |5: change with (\fst h ≤ \fst (\fst y)); intro; apply H4;
177         apply (x2sx (os_l O) s h (\fst y) H);
178     |6: change with (\fst (\snd y) ≤ \fst h1); intro; apply H5;
179         apply (x2sx (os_l O) s (\snd y) h1 H);
180     |7: change with (\fst (\fst y) ≤ \fst (\snd y)); intro; apply H6;
181         apply (x2sx (os_l O) s (\fst y) (\snd y) H);
182     |8: apply (restrict O s U u y HuU K3);
183     |1: apply (unrestrict O s ?? 〈h,h1〉 HuU H1);]
184 |3: simplify; unfold convex; intros 3; cases s1; intros; (* TODO *)
185     cases H (u HU); cases HU (Gu HuU); clear HU H;
186     lapply depth=0 (ous_convex_r ?? Gu 〈\fst h,\fst h1〉 ???????) as K3;
187     [2: intro; apply H2; apply (x2sx (os_r O) s h h1 H);
188     |3: apply 〈\fst (\fst y),\fst (\snd y)〉;
189     |4: intro; (*change in H with (\fst (\fst y) ≱ \fst h1);*) apply H3;
190         apply (x2sx (os_r O) s (\fst y) h1 H);
191     |5: (*change with (\fst h ≥ \fst (\fst y));*) intro; apply H4;
192         apply (x2sx (os_r O) s h (\fst y) H);
193     |6: (*change with (\fst (\snd y) ≤ \fst h1);*) intro; apply H5;
194         apply (x2sx (os_r O) s (\snd y) h1 H);
195     |7: (*change with (\fst (\fst y) ≤ \fst (\snd y));*) intro; apply H6;
196         apply (x2sx (os_r O) s (\fst y) (\snd y) H);
197     |8: apply (restrict O s U u y HuU K3);
198     |1: apply (unrestrict O s ?? 〈h,h1〉 HuU H1);]
199 ]  
200 qed.
201
202 interpretation "Ordered uniform space segment" 'segset a = 
203  (segment_ordered_uniform_space _ a).
204
205 (* Lemma 3.2 *)
206 alias symbol "pi1" = "exT \fst".
207 lemma restric_uniform_convergence:
208  ∀O:ordered_uniform_space.∀s:‡O.
209   ∀x:{[s]}.
210    ∀a:sequence {[s]}.
211     (⌊n, \fst (a n)⌋ : sequence O) uniform_converges (\fst x) → 
212       a uniform_converges x.
213 intros 7; cases H1; cases H2; clear H2 H1;
214 cases (H ? H3) (m Hm); exists [apply m]; intros; 
215 apply (restrict ? s ??? H4); apply (Hm ? H1);
216 qed.
217
218 definition order_continuity ≝
219   λC:ordered_uniform_space.∀a:sequence C.∀x:C.
220     (a ↑ x → a uniform_converges x) ∧ (a ↓ x → a uniform_converges x).
221
222 lemma hint_boh1: ∀O. Type_OF_ordered_uniform_space O → hos_carr (os_l O).
223 intros; assumption;
224 qed.
225
226 coercion hint_boh1 nocomposites. 
227
228 lemma hint_boh2: ∀O:ordered_uniform_space. hos_carr (os_l O) → Type_OF_ordered_uniform_space O.
229 intros; assumption;
230 qed.
231
232 coercion hint_boh2 nocomposites. 
233