1 include "sets/sets.ma".
3 nrecord powerset (X : Type[0]) : Type[1] ≝ { char : X → CProp[0] }.
5 interpretation "char" 'subset p = (mk_powerset ? p).
7 interpretation "pwset" 'powerset a = (powerset a).
9 interpretation "in" 'mem a X = (char ? X a).
11 ndefinition subseteq ≝ λA.λU,V : Ω^A.
14 interpretation "subseteq" 'subseteq u v = (subseteq ? u v).
16 ndefinition overlaps ≝ λA.λU,V : Ω^A.
19 interpretation "overlaps" 'overlaps u v = (overlaps ? u v).
21 ndefinition intersect ≝ λA.λu,v:Ω\sup A.{ y | y ∈ u ∧ y ∈ v }.
23 interpretation "intersect" 'intersects u v = (intersect ? u v).
25 nrecord axiom_set : Type[1] ≝ {
31 ndefinition cover_set ≝ λc:∀A:axiom_set.Ω^A → A → CProp[0].λA,C,U.
34 notation "hvbox(a break ◃ b)" non associative with precedence 45
35 for @{ 'covers $a $b }. (* a \ltri b *)
37 interpretation "covers set temp" 'covers C U = (cover_set ?? C U).
39 ninductive cover (A : axiom_set) (U : Ω^A) : A → CProp[0] ≝
40 | creflexivity : ∀a:A. a ∈ U → cover ? U a
41 | cinfinity : ∀a:A. ∀i:I ? a. (C ? a i ◃ U) → cover ? U a.
45 interpretation "covers" 'covers a U = (cover ? U a).
46 interpretation "covers set" 'covers a U = (cover_set cover ? a U).
48 ndefinition fish_set ≝ λf:∀A:axiom_set.Ω^A → A → CProp[0].
52 notation "hvbox(a break ⋉ b)" non associative with precedence 45
53 for @{ 'fish $a $b }. (* a \ltimes b *)
55 interpretation "fish set temp" 'fish A U = (fish_set ?? U A).
57 ncoinductive fish (A : axiom_set) (F : Ω^A) : A → CProp[0] ≝
58 | cfish : ∀a. a ∈ F → (∀i:I ? a.C A a i ⋉ F) → fish A F a.
62 interpretation "fish set" 'fish A U = (fish_set fish ? U A).
63 interpretation "fish" 'fish a U = (fish ? U a).
65 nlet corec fish_rec (A:axiom_set) (U: Ω^A)
67 (H2: ∀a:A. a ∈ P → ∀j: I ? a. C ? a j ≬ P):
68 ∀a:A. ∀p: a ∈ P. a ⋉ U ≝ ?.
70 ##[ napply H1; napply p;
71 ##| #i; ncases (H2 a p i); #x; *; #xC; #xP; napply ex_intro; ##[napply x]
72 napply conj; ##[ napply xC ] napply (fish_rec ? U P); nassumption;
77 alias symbol "covers" (instance 0) = "covers".
78 alias symbol "covers" (instance 2) = "covers".
79 alias symbol "covers" (instance 1) = "covers set".
80 ntheorem covers_elim2:
81 ∀A: axiom_set. ∀U:Ω^A.∀P: A → CProp[0].
83 (∀a:A.∀V:Ω^A. a ◃ V → V ◃ U → (∀y. y ∈ V → P y) → P a) →
85 #A; #U; #P; #H1; #H2; #a; #aU; nelim aU;
86 ##[ #b; #H; napply H1; napply H;
87 ##| #b; #i; #CaiU; #H; napply H2;
89 ##| napply cinfinity; ##[ napply i ] nwhd; #y; #H3; napply creflexivity; ##]
95 alias symbol "fish" (instance 1) = "fish set".
96 alias symbol "covers" = "covers".
97 ntheorem compatibility: ∀A:axiom_set.∀a:A.∀U,V. a ⋉ V → a ◃ U → U ⋉ V.
98 #A; #a; #U; #V; #aV; #aU; ngeneralize in match aV; (* clear aV *)
100 ##[ #b; #bU; #bV; napply ex_intro; ##[ napply b] napply conj; nassumption;
101 ##| #b; #i; #CaiU; #H; #bV; ncases bV in i CaiU H;
102 #c; #cV; #CciV; #i; #CciU; #H; ncases (CciV i); #x; *; #xCci; #xV;
103 napply H; nassumption;
109 definition leq ≝ λA:axiom_set.λa,b:A. a ◃ {y|b=y}.
111 interpretation "covered by one" 'leq a b = (leq ? a b).
113 theorem leq_refl: ∀A:axiom_set.∀a:A. a ≤ a.
120 theorem leq_trans: ∀A:axiom_set.∀a,b,c:A. a ≤ b → b ≤ c → a ≤ c.
123 apply (transitivity ???? H);
131 definition uparrow ≝ λA:axiom_set.λa:A.mk_powerset ? (λb:A. a ≤ b).
133 interpretation "uparrow" 'uparrow a = (uparrow ? a).
135 definition downarrow ≝ λA:axiom_set.λU:Ω \sup A.mk_powerset ? (λa:A. (↑a) ≬ U).
137 interpretation "downarrow" 'downarrow a = (downarrow ? a).
139 definition fintersects ≝ λA:axiom_set.λU,V:Ω \sup A.↓U ∩ ↓V.
141 interpretation "fintersects" 'fintersects U V = (fintersects ? U V).
143 record convergent_generated_topology : Type ≝
145 convergence: ∀a:AA.∀U,V:Ω \sup AA. a ◃ U → a ◃ V → a ◃ (U ↓ V)