]> matita.cs.unibo.it Git - helm.git/blob - helm/software/matita/contribs/dama/dama/ordered_uniform.ma
removed <_,_> notation second interpretation for dependent pair, since it used
[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 cic:/matita/dama/ordered_uniform/ous_unifspace.con.
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 invert_os_relation ≝
41   λC:ordered_set.λU:C square → Prop.
42     λx:C square. U 〈\snd x,\fst x〉.
43
44 interpretation "relation invertion" 'invert a = (invert_os_relation _ a).
45 interpretation "relation invertion" 'invert_symbol = (invert_os_relation _).
46 interpretation "relation invertion" 'invert_appl a x = (invert_os_relation _ a x).
47
48 lemma segment_square_of_ordered_set_square: 
49   ∀O:ordered_set.∀u,v:O.∀x:O square.
50    \fst x ∈ [u,v] → \snd x ∈ [u,v] → {[u,v]} square.
51 intros; split; exists; [1: apply (\fst x) |3: apply (\snd x)] assumption;
52 qed.
53
54 coercion cic:/matita/dama/ordered_uniform/segment_square_of_ordered_set_square.con 0 2.
55
56 alias symbol "pi1" (instance 4) = "exT \fst".
57 alias symbol "pi1" (instance 2) = "exT \fst".
58 lemma ordered_set_square_of_segment_square : 
59  ∀O:ordered_set.∀u,v:O.{[u,v]} square → O square ≝ 
60   λO:ordered_set.λu,v:O.λb:{[u,v]} square.〈\fst(\fst b),\fst(\snd b)〉.
61
62 coercion cic:/matita/dama/ordered_uniform/ordered_set_square_of_segment_square.con.
63
64 lemma restriction_agreement : 
65   ∀O:ordered_uniform_space.∀l,r:O.∀P:{[l,r]} square → Prop.∀OP:O square → Prop.Prop.
66 apply(λO:ordered_uniform_space.λl,r:O.
67        λP:{[l,r]} square → Prop.λOP:O square → Prop.
68           ∀b:O square.∀H1,H2.(P b → OP b) ∧ (OP b → P b));
69 [5,7: apply H1|6,8:apply H2]skip;
70 qed.
71
72 lemma unrestrict: ∀O:ordered_uniform_space.∀l,r:O.∀U,u.∀x:{[l,r]} square.
73   restriction_agreement ? l r U u → U x → u x.
74 intros 7; cases x (b b1); cases b (w1 H1); cases b1 (w2 H2); clear b b1 x; 
75 cases (H 〈w1,w2〉 H1 H2) (L _); intro Uw; apply L; apply Uw;
76 qed.
77
78 lemma restrict: ∀O:ordered_uniform_space.∀l,r:O.∀U,u.∀x:{[l,r]} square.
79   restriction_agreement ? l r U u → u x → U x.
80 intros 6; cases x (b b1); cases b (w1 H1); cases b1 (w2 H2); clear b1 b x;
81 intros (Ra uw); cases (Ra 〈w1,w2〉 H1 H2) (_ R); apply R; apply uw;
82 qed.
83
84 lemma invert_restriction_agreement: 
85   ∀O:ordered_uniform_space.∀l,r:O.
86    ∀U:{[l,r]} square → Prop.∀u:O square → Prop.
87     restriction_agreement ? l r U u →
88     restriction_agreement ? l r (inv U) (inv u).
89 intros 9; split; intro;
90 [1: apply (unrestrict ????? (segment_square_of_ordered_set_square ??? 〈\snd b,\fst b〉 H2 H1) H H3);
91 |2: apply (restrict ????? (segment_square_of_ordered_set_square ??? 〈\snd b,\fst b〉 H2 H1) H H3);]
92 qed. 
93     
94 alias symbol "square" (instance 8) = "bishop set square".
95 lemma bs_of_ss: 
96  ∀O:ordered_set.∀u,v:O.{[u,v]} square → (bishop_set_of_ordered_set O) square ≝ 
97   λO:ordered_set.λu,v:O.λb:{[u,v]} square.〈\fst(\fst b),\fst(\snd b)〉.
98
99 notation < "x \sub \neq" with precedence 91 for @{'bsss $x}.
100 interpretation "bs_of_ss" 'bsss x = (bs_of_ss _ _ _ x).
101
102 alias symbol "square" (instance 7) = "ordered set square".
103 lemma ss_of_bs: 
104  ∀O:ordered_set.∀u,v:O.
105   ∀b:O square.\fst b ∈ [u,v] → \snd b ∈ [u,v] → {[u,v]} square ≝ 
106  λO:ordered_set.λu,v:O.
107   λb:(O:bishop_set) square.λH1,H2.〈≪\fst b,H1≫,≪\snd b,H2≫〉.
108
109 notation < "x \sub \nleq" with precedence 91 for @{'ssbs $x}.
110 interpretation "ss_of_bs" 'ssbs x = (ss_of_bs _ _ _ x _ _).
111
112 lemma segment_ordered_uniform_space: 
113   ∀O:ordered_uniform_space.∀u,v:O.ordered_uniform_space.
114 intros (O l r); apply mk_ordered_uniform_space;
115 [1: apply (mk_ordered_uniform_space_ {[l,r]});
116     [1: alias symbol "and" = "constructive and".
117         letin f ≝ (λP:{[l,r]} square → Prop. ∃OP:O square → Prop.
118                     (us_unifbase O OP) ∧ restriction_agreement ??? P OP);
119         apply (mk_uniform_space (bishop_set_of_ordered_set {[l,r]}) f);
120         [1: intros (U H); intro x; simplify; 
121             cases H (w Hw); cases Hw (Gw Hwp); clear H Hw; intro Hm;
122             lapply (us_phi1 ?? Gw x Hm) as IH;
123             apply (restrict ?????? Hwp IH);
124         |2: intros (U V HU HV); cases HU (u Hu); cases HV (v Hv); clear HU HV;
125             cases Hu (Gu HuU); cases Hv (Gv HvV); clear Hu Hv;
126             cases (us_phi2 ??? Gu Gv) (w HW); cases HW (Gw Hw); clear HW;
127             exists; [apply (λb:{[l,r]} square.w b)] split;
128             [1: unfold f; simplify; clearbody f;
129                 exists; [apply w]; split; [assumption] intro b; simplify;
130                 unfold segment_square_of_ordered_set_square;
131                 cases b; intros; split; intros; assumption;
132             |2: intros 2 (x Hx); cases (Hw ? Hx); split;
133                 [apply (restrict ?????? HuU H)|apply (restrict ?????? HvV H1);]]
134         |3: intros (U Hu); cases Hu (u HU); cases HU (Gu HuU); clear Hu HU;
135             cases (us_phi3 ?? Gu) (w HW); cases HW (Gw Hwu); clear HW;
136             exists; [apply (λx:{[l,r]} square.w x)] split;
137             [1: exists;[apply w];split;[assumption] intros; simplify; intro;
138                 unfold segment_square_of_ordered_set_square;
139                 cases b; intros; split; intro; assumption;
140             |2: intros 2 (x Hx); apply (restrict ?????? HuU); apply Hwu; 
141                 cases Hx (m Hm); exists[apply (\fst m)] apply Hm;]
142         |4: intros (U HU x); cases HU (u Hu); cases Hu (Gu HuU); clear HU Hu;
143             cases (us_phi4 ?? Gu x) (Hul Hur);
144             split; intros; 
145             [1: lapply (invert_restriction_agreement ????? HuU) as Ra;
146                 apply (restrict ????? x Ra);
147                 apply Hul; apply (unrestrict ?????? HuU H);
148             |2: apply (restrict ?????? HuU); apply Hur; 
149                 apply (unrestrict ?????? (invert_restriction_agreement ????? HuU) H);]]
150     |2: simplify; reflexivity;]
151 |2: simplify; unfold convex; intros;
152     cases H (u HU); cases HU (Gu HuU); clear HU H; 
153     lapply (ous_convex ?? Gu (bs_of_ss ? l r p) ? H2 (bs_of_ss ? l r y) H3) as Cu;
154     [1: apply (unrestrict ?????? HuU); apply H1;
155     |2: apply (restrict ?????? HuU Cu);]]
156 qed.
157
158 interpretation "Ordered uniform space segment" 'segment_set a b = 
159  (segment_ordered_uniform_space _ a b).
160
161 (* Lemma 3.2 *)
162 alias symbol "pi1" = "exT \fst".
163 lemma restric_uniform_convergence:
164  ∀O:ordered_uniform_space.∀l,u:O.
165   ∀x:{[l,u]}.
166    ∀a:sequence {[l,u]}.
167      ⌊n,\fst (a n)⌋ uniform_converges (\fst x) → 
168       a uniform_converges x.
169 intros 8; cases H1; cases H2; clear H2 H1;
170 cases (H ? H3) (m Hm); exists [apply m]; intros; 
171 apply (restrict ? l u ??? H4); apply (Hm ? H1);
172 qed.
173
174 definition order_continuity ≝
175   λC:ordered_uniform_space.∀a:sequence C.∀x:C.
176     (a ↑ x → a uniform_converges x) ∧ (a ↓ x → a uniform_converges x).