3 Matita Tutorial: inductively generated formal topologies
4 ========================================================
11 The library, inclusion of `sets/sets.ma`, notation defined: Ω^A.
12 Symbols (see menu: View ▹ TeX/UTF-8 Table):
20 Virtuals, ALT-L, for example I changes into 𝕀, finally 𝐈.
24 include "sets/sets.ma".
35 nrecord Ax : Type[1] ≝ {
42 notation "𝐈 \sub( ❨a❩ )" non associative with precedence 70 for @{ 'I $a }.
43 notation "𝐂 \sub ( ❨a,\emsp i❩ )" non associative with precedence 70 for @{ 'C $a $i }.
48 Notation for the axiom set
49 --------------------------
55 notation > "𝐈 term 90 a" non associative with precedence 70 for @{ 'I $a }.
56 notation > "𝐂 term 90 a term 90 i" non associative with precedence 70 for @{ 'C $a $i }.
58 interpretation "I" 'I a = (I ? a).
59 interpretation "C" 'C a i = (C ? a i).
68 ndefinition cover_set ≝ λc:∀A:Ax.Ω^A → A → CProp[0].λA,C,U.
72 notation "hvbox(a break ◃ b)" non associative with precedence 45
73 for @{ 'covers $a $b }.
75 interpretation "covers set temp" 'covers C U = (cover_set ?? C U).
77 ninductive cover (A : Ax) (U : Ω^A) : A → CProp[0] ≝
78 | creflexivity : ∀a:A. a ∈ U → cover ? U a
79 | cinfinity : ∀a:A.∀i:𝐈 a. 𝐂 a i ◃ U → cover ? U a.
83 interpretation "covers" 'covers a U = (cover ? U a).
84 interpretation "covers set" 'covers a U = (cover_set cover ? a U).
86 ndefinition fish_set ≝ λf:∀A:Ax.Ω^A → A → CProp[0].
91 notation "hvbox(a break ⋉ b)" non associative with precedence 45
94 interpretation "fish set temp" 'fish A U = (fish_set ?? U A).
96 ncoinductive fish (A : Ax) (F : Ω^A) : A → CProp[0] ≝
97 | cfish : ∀a. a ∈ F → (∀i:𝐈 a .𝐂 a i ⋉ F) → fish A F a.
101 interpretation "fish set" 'fish A U = (fish_set fish ? U A).
102 interpretation "fish" 'fish a U = (fish ? U a).
104 nlet corec fish_rec (A:Ax) (U: Ω^A)
106 (H2: ∀a:A. a ∈ P → ∀j: 𝐈 a. 𝐂 a j ≬ P):
107 ∀a:A. ∀p: a ∈ P. a ⋉ U ≝ ?.
108 #a; #p; napply cfish; (** screenshot "topology/def-fish-rec". *)
109 ##[ napply H1; napply p;
110 ##| #i; ncases (H2 a p i); #x; *; #xC; #xP; @; ##[napply x]
111 @; ##[ napply xC ] napply (fish_rec ? U P); nassumption;
115 notation "◃U" non associative with precedence 55
116 for @{ 'coverage $U }.
118 ndefinition coverage : ∀A:Ax.∀U:Ω^A.Ω^A ≝ λA,U.{ a | a ◃ U }.
120 interpretation "coverage cover" 'coverage U = (coverage ? U).
122 ndefinition cover_equation : ∀A:Ax.∀U,X:Ω^A.CProp[0] ≝ λA,U,X.
123 ∀a.a ∈ X ↔ (a ∈ U ∨ ∃i:𝐈 a.∀y.y ∈ 𝐂 a i → y ∈ X).
125 ntheorem coverage_cover_equation : ∀A,U. cover_equation A U (◃U).
127 ##[ nelim H; #b; (* manca clear *)
128 ##[ #bU; @1; nassumption;
129 ##| #i; #CaiU; #IH; @2; @ i; #c; #cCbi; ncases (IH ? cCbi);
131 ##| #_; napply CaiU; nassumption; ##] ##]
132 ##| ncases H; ##[ #E; @; nassumption]
133 *; #j; #Hj; @2 j; #w; #wC; napply Hj; nassumption;
137 ntheorem coverage_min_cover_equation :
138 ∀A,U,W. cover_equation A U W → ◃U ⊆ W.
139 #A; #U; #W; #H; #a; #aU; nelim aU; #b;
140 ##[ #bU; ncases (H b); #_; #H1; napply H1; @1; nassumption;
141 ##| #i; #CbiU; #IH; ncases (H b); #_; #H1; napply H1; @2; @i; napply IH;
145 notation "⋉F" non associative with precedence 55
148 ndefinition fished : ∀A:Ax.∀F:Ω^A.Ω^A ≝ λA,F.{ a | a ⋉ F }.
150 interpretation "fished fish" 'fished F = (fished ? F).
152 ndefinition fish_equation : ∀A:Ax.∀F,X:Ω^A.CProp[0] ≝ λA,F,X.
153 ∀a. a ∈ X ↔ a ∈ F ∧ ∀i:𝐈 a.∃y.y ∈ 𝐂 a i ∧ y ∈ X.
155 ntheorem fised_fish_equation : ∀A,F. fish_equation A F (⋉F).
156 #A; #F; #a; @; (* bug, fare case sotto diverso da farlo sopra *) #H; ncases H;
157 ##[ #b; #bF; #H2; @ bF; #i; ncases (H2 i); #c; *; #cC; #cF; @c; @ cC;
159 ##| #aF; #H1; @ aF; napply H1;
163 ntheorem fised_max_fish_equation : ∀A,F,G. fish_equation A F G → G ⊆ ⋉F.
164 #A; #F; #G; #H; #a; #aG; napply (fish_rec … aG);
165 #b; ncases (H b); #H1; #_; #bG; ncases (H1 bG); #E1; #E2; nassumption;
168 nrecord nAx : Type[2] ≝ {
169 nS:> setoid; (*Type[0];*)
171 nD: ∀a:nS. nI a → Type[0];
172 nd: ∀a:nS. ∀i:nI a. nD a i → nS
176 TYPE f A → B, g : B → A, f ∘ g = id, g ∘ g = id.
181 notation "𝐃 \sub ( ❨a,\emsp i❩ )" non associative with precedence 70 for @{ 'D $a $i }.
182 notation "𝐝 \sub ( ❨a,\emsp i,\emsp j❩ )" non associative with precedence 70 for @{ 'd $a $i $j}.
184 notation > "𝐃 term 90 a term 90 i" non associative with precedence 70 for @{ 'D $a $i }.
185 notation > "𝐝 term 90 a term 90 i term 90 j" non associative with precedence 70 for @{ 'd $a $i $j}.
187 interpretation "D" 'D a i = (nD ? a i).
188 interpretation "d" 'd a i j = (nd ? a i j).
189 interpretation "new I" 'I a = (nI ? a).
191 ndefinition image ≝ λA:nAx.λa:A.λi. { x | ∃j:𝐃 a i. x = 𝐝 a i j }.
193 notation > "𝐈𝐦 [𝐝 term 90 a term 90 i]" non associative with precedence 70 for @{ 'Im $a $i }.
194 notation "𝐈𝐦 [𝐝 \sub ( ❨a,\emsp i❩ )]" non associative with precedence 70 for @{ 'Im $a $i }.
196 interpretation "image" 'Im a i = (image ? a i).
198 ndefinition Ax_of_nAx : nAx → Ax.
199 #A; @ A (nI ?); #a; #i; napply (𝐈𝐦 [𝐝 a i]);
202 ninductive sigma (A : Type[0]) (P : A → CProp[0]) : Type[0] ≝
203 sig_intro : ∀x:A.P x → sigma A P.
205 interpretation "sigma" 'sigma \eta.p = (sigma ? p).
207 ndefinition nAx_of_Ax : Ax → nAx.
209 ##[ #a; #i; napply (Σx:A.x ∈ 𝐂 a i);
210 ##| #a; #i; *; #x; #_; napply x;
214 ninductive Ord (A : nAx) : Type[0] ≝
217 | oL : ∀a:A.∀i.∀f:𝐃 a i → Ord A. Ord A.
219 notation "Λ term 90 f" non associative with precedence 50 for @{ 'oL $f }.
220 notation "x+1" non associative with precedence 50 for @{'oS $x }.
222 interpretation "ordinals Lambda" 'oL f = (oL ? ? ? f).
223 interpretation "ordinals Succ" 'oS x = (oS ? x).
225 nlet rec famU (A : nAx) (U : Ω^A) (x : Ord A) on x : Ω^A ≝
228 | oS y ⇒ let Un ≝ famU A U y in Un ∪ { x | ∃i.𝐈𝐦[𝐝 x i] ⊆ Un}
229 | oL a i f ⇒ { x | ∃j.x ∈ famU A U (f j) } ].
231 notation < "term 90 U \sub (term 90 x)" non associative with precedence 50 for @{ 'famU $U $x }.
232 notation > "U ⎽ term 90 x" non associative with precedence 50 for @{ 'famU $U $x }.
234 interpretation "famU" 'famU U x = (famU ? U x).
236 ndefinition ord_coverage : ∀A:nAx.∀U:Ω^A.Ω^A ≝ λA,U.{ y | ∃x:Ord A. y ∈ famU ? U x }.
238 ndefinition ord_cover_set ≝ λc:∀A:nAx.Ω^A → Ω^A.λA,C,U.
239 ∀y.y ∈ C → y ∈ c A U.
241 interpretation "coverage new cover" 'coverage U = (ord_coverage ? U).
242 interpretation "new covers set" 'covers a U = (ord_cover_set ord_coverage ? a U).
243 interpretation "new covers" 'covers a U = (mem ? (ord_coverage ? U) a).
245 ntheorem new_coverage_reflexive:
246 ∀A:nAx.∀U:Ω^A.∀a. a ∈ U → a ◃ U.
247 #A; #U; #a; #H; @ (oO A); napply H;
251 ∀A:nAx.∀a:A.∀i,f,U.∀j:𝐃 a i.U⎽(f j) ⊆ U⎽(Λ f).
252 #A; #a; #i; #f; #U; #j; #b; #bUf; @ j; nassumption;
255 naxiom AC : ∀A,a,i,U.(∀j:𝐃 a i.∃x:Ord A.𝐝 a i j ∈ U⎽x) → (Σf.∀j:𝐃 a i.𝐝 a i j ∈ U⎽(f j)).
257 naxiom setoidification :
258 ∀A:nAx.∀a,b:A.∀U.a=b → b ∈ U → a ∈ U.
264 <div id="figure1" class="img" ><img src="figure1.png"/>foo</div>
268 alias symbol "covers" = "new covers".
269 alias symbol "covers" = "new covers set".
270 alias symbol "covers" = "new covers".
271 alias symbol "covers" = "new covers set".
272 alias symbol "covers" = "new covers".
273 alias symbol "covers" = "new covers set".
274 alias symbol "covers" = "new covers".
275 ntheorem new_coverage_infinity:
276 ∀A:nAx.∀U:Ω^A.∀a:A. (∃i:𝐈 a. 𝐈𝐦[𝐝 a i] ◃ U) → a ◃ U.
277 #A; #U; #a;(** screenshot "topology/figure1". *)
278 *; #i; #H; nnormalize in H;
279 ncut (∀y:𝐃 a i.∃x:Ord A.𝐝 a i y ∈ U⎽x); ##[
280 #y; napply H; @ y; napply #; ##] #H';
281 ncases (AC … H'); #f; #Hf;
282 ncut (∀j.𝐝 a i j ∈ U⎽(Λ f));
283 ##[ #j; napply (ord_subset … f … (Hf j));##] #Hf';
284 @ ((Λ f)+1); @2; nwhd; @i; #x; *; #d; #Hd;
285 napply (setoidification … Hd); napply Hf';
289 nlemma subseteq_union: ∀A.∀U,V,W:Ω^A.U ⊆ W → V ⊆ W → U ∪ V ⊆ W.
290 #A; #U; #V; #W; #H; #H1; #x; *; #Hx; ##[ napply H; ##| napply H1; ##] nassumption;
293 nlemma new_coverage_min :
294 ∀A:nAx.∀U:qpowerclass A.∀V.U ⊆ V → (∀a:A.∀i.𝐈𝐦[𝐝 a i] ⊆ V → a ∈ V) → ◃(pc ? U) ⊆ V.
295 #A; #U; #V; #HUV; #Im; #b; *; #o; ngeneralize in match b; nchange with ((pc ? U)⎽o ⊆ V);
297 ##[ #b; #bU0; napply HUV; napply bU0;
298 ##| #p; #IH; napply subseteq_union; ##[ nassumption; ##]
299 #x; *; #i; #H; napply (Im ? i); napply (subseteq_trans … IH); napply H;
300 ##| #a; #i; #f; #IH; #x; *; #d; napply IH; ##]
303 nlet rec famF (A: nAx) (F : Ω^A) (x : Ord A) on x : Ω^A ≝
306 | oS o ⇒ let Fo ≝ famF A F o in Fo ∩ { x | ∀i:𝐈 x.∃j:𝐃 x i.𝐝 x i j ∈ Fo }
307 | oL a i f ⇒ { x | ∀j:𝐃 a i.x ∈ famF A F (f j) }
310 interpretation "famF" 'famU U x = (famF ? U x).
312 ndefinition ord_fished : ∀A:nAx.∀F:Ω^A.Ω^A ≝ λA,F.{ y | ∀x:Ord A. y ∈ F⎽x }.
314 interpretation "fished new fish" 'fished U = (ord_fished ? U).
315 interpretation "new fish" 'fish a U = (mem ? (ord_fished ? U) a).
317 ntheorem new_fish_antirefl:
318 ∀A:nAx.∀F:Ω^A.∀a. a ⋉ F → a ∈ F.
319 #A; #F; #a; #H; nlapply (H (oO ?)); #aFo; napply aFo;
322 nlemma co_ord_subset:
323 ∀A:nAx.∀F:Ω^A.∀a,i.∀f:𝐃 a i → Ord A.∀j. F⎽(Λ f) ⊆ F⎽(f j).
324 #A; #F; #a; #i; #f; #j; #x; #H; napply H;
328 ∀A:nAx.∀a:A.∀i,F. (∀f:𝐃 a i → Ord A.∃x:𝐃 a i.𝐝 a i x ∈ F⎽(f x)) → ∃j:𝐃 a i.∀x:Ord A.𝐝 a i j ∈ F⎽x.
331 ntheorem new_fish_compatible:
332 ∀A:nAx.∀F:Ω^A.∀a. a ⋉ F → ∀i:𝐈 a.∃j:𝐃 a i.𝐝 a i j ⋉ F.
333 #A; #F; #a; #aF; #i; nnormalize;
335 nlapply (aF (Λf+1)); #aLf;
336 nchange in aLf with (a ∈ F⎽(Λ f) ∧ ∀i:𝐈 a.∃j:𝐃 a i.𝐝 a i j ∈ F⎽(Λ f));
337 ncut (∃j:𝐃 a i.𝐝 a i j ∈ F⎽(f j));##[
338 ncases aLf; #_; #H; nlapply (H i); *; #j; #Hj; @j; napply Hj;##] #aLf';
343 nlemma subseteq_intersection_l: ∀A.∀U,V,W:Ω^A.U ⊆ W ∨ V ⊆ W → U ∩ V ⊆ W.
344 #A; #U; #V; #W; *; #H; #x; *; #xU; #xV; napply H; nassumption;
347 nlemma subseteq_intersection_r: ∀A.∀U,V,W:Ω^A.W ⊆ U → W ⊆ V → W ⊆ U ∩ V.
348 #A; #U; #V; #W; #H1; #H2; #x; #Hx; @; ##[ napply H1; ##| napply H2; ##] nassumption;
351 ntheorem max_new_fished:
352 ∀A:nAx.∀G,F:Ω^A.G ⊆ F → (∀a.a ∈ G → ∀i.𝐈𝐦[𝐝 a i] ≬ G) → G ⊆ ⋉F.
353 #A; #G; #F; #GF; #H; #b; #HbG; #o; ngeneralize in match HbG; ngeneralize in match b;
354 nchange with (G ⊆ F⎽o);
357 ##| #p; #IH; napply (subseteq_intersection_r … IH);
358 #x; #Hx; #i; ncases (H … Hx i); #c; *; *; #d; #Ed; #cG;
359 @d; napply IH; napply (setoidification … Ed^-1); napply cG;
360 ##| #a; #i; #f; #Hf; nchange with (G ⊆ { y | ∀x. y ∈ F⎽(f x) });
361 #b; #Hb; #d; napply (Hf d); napply Hb;