]> matita.cs.unibo.it Git - helm.git/blob - helm/software/matita/contribs/dama/dama/ordered_uniform.ma
...
[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 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 xxx :
114  ∀O,s,x.bs2_of_bss2 (ordered_set_OF_ordered_uniform_space O) s x
115               =
116               x.
117 intros; reflexivity;
118 *)
119
120 lemma segment_ordered_uniform_space: 
121   ∀O:ordered_uniform_space.∀s:‡O.ordered_uniform_space.
122 intros (O s); apply mk_ordered_uniform_space;
123 [1: apply (mk_ordered_uniform_space_ {[s]});
124     [1: alias symbol "and" = "constructive and".
125         letin f ≝ (λP:{[s]} squareO → Prop. ∃OP:O squareO → Prop.
126                     (us_unifbase O OP) ∧ restriction_agreement ?? P OP);
127         apply (mk_uniform_space (bishop_set_of_ordered_set {[s]}) f);
128         [1: intros (U H); intro x; simplify; 
129             cases H (w Hw); cases Hw (Gw Hwp); clear H Hw; intro Hm;
130             lapply (us_phi1 O w Gw x) as IH;[2:intro;apply Hm;cases H; clear H;
131               [left;apply (x2sx ? s (\fst x) (\snd x) H1);
132               |right;apply (x2sx ? s ?? H1);]
133
134             apply (restrict ? s ??? Hwp IH); 
135         |2: intros (U V HU HV); cases HU (u Hu); cases HV (v Hv); clear HU HV;
136             cases Hu (Gu HuU); cases Hv (Gv HvV); clear Hu Hv;
137             cases (us_phi2 O u v Gu Gv) (w HW); cases HW (Gw Hw); clear HW;
138             exists; [apply (λb:{[l,r]} squareB.w b)] split;
139             [1: unfold f; simplify; clearbody f;
140                 exists; [apply w]; split; [assumption] intro b; simplify;
141                 unfold segment_square_of_ordered_set_square;
142                 cases b; intros; split; intros; assumption;
143             |2: intros 2 (x Hx); cases (Hw ? Hx); split;
144                 [apply (restrict O l r ??? HuU H)|apply (restrict O l r ??? HvV H1);]]
145         |3: intros (U Hu); cases Hu (u HU); cases HU (Gu HuU); clear Hu HU;
146             cases (us_phi3 O u Gu) (w HW); cases HW (Gw Hwu); clear HW;
147             exists; [apply (λx:{[l,r]} squareB.w x)] split;
148             [1: exists;[apply w];split;[assumption] intros; simplify; intro;
149                 unfold segment_square_of_ordered_set_square;
150                 cases b; intros; split; intro; assumption;
151             |2: intros 2 (x Hx); apply (restrict O l r ??? HuU); apply Hwu; 
152                 cases Hx (m Hm); exists[apply (\fst m)] apply Hm;]
153         |4: intros (U HU x); cases HU (u Hu); cases Hu (Gu HuU); clear HU Hu;
154             cases (us_phi4 O u Gu x) (Hul Hur);
155             split; intros; 
156             [1: lapply (invert_restriction_agreement O l r ?? HuU) as Ra;
157                 apply (restrict O l r ?? x Ra);
158                 apply Hul; apply (unrestrict O l r ??? HuU H);
159             |2: apply (restrict O l r ??? HuU); apply Hur; 
160                 apply (unrestrict O l r ??? (invert_restriction_agreement O l r ?? HuU) H);]]
161     |2: simplify; reflexivity;]
162 |2: simplify; unfold convex; intros;
163     cases H (u HU); cases HU (Gu HuU); clear HU H; 
164     lapply (ous_convex ?? Gu p ? H2 y H3) as Cu;
165     [1: apply (unrestrict O l r ??? HuU); apply H1;
166     |2: apply (restrict O l r ??? HuU Cu);]]
167 qed.
168
169 interpretation "Ordered uniform space segment" 'segment_set a b = 
170  (segment_ordered_uniform_space _ a b).
171
172 (* Lemma 3.2 *)
173 alias symbol "pi1" = "exT \fst".
174 lemma restric_uniform_convergence:
175  ∀O:ordered_uniform_space.∀l,u:O.
176   ∀x:{[l,u]}.
177    ∀a:sequence {[l,u]}.
178     (⌊n, \fst (a n)⌋ : sequence O) uniform_converges (\fst x) → 
179       a uniform_converges x.
180 intros 8; cases H1; cases H2; clear H2 H1;
181 cases (H ? H3) (m Hm); exists [apply m]; intros; 
182 apply (restrict ? l u ??? H4); apply (Hm ? H1);
183 qed.
184
185 definition order_continuity ≝
186   λC:ordered_uniform_space.∀a:sequence C.∀x:C.
187     (a ↑ x → a uniform_converges x) ∧ (a ↓ x → a uniform_converges x).
188
189 lemma hint_boh1: ∀O. Type_OF_ordered_uniform_space O → hos_carr (os_l O).
190 intros; assumption;
191 qed.
192
193 coercion hint_boh1 nocomposites. 
194
195 lemma hint_boh2: ∀O:ordered_uniform_space. hos_carr (os_l O) → Type_OF_ordered_uniform_space O.
196 intros; assumption;
197 qed.
198
199 coercion hint_boh2 nocomposites. 
200