Mercurial > hg > Members > kono > Proof > ZF-in-agda
annotate constructible-set.agda @ 26:a53ba59c5bda
dom-ψ
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 18 May 2019 22:40:06 +0900 |
parents | 0f3d98e97593 |
children | bade0a35fdd9 |
rev | line source |
---|---|
16 | 1 open import Level |
24 | 2 module constructible-set where |
3 | 3 |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
4 open import zf |
3 | 5 |
23 | 6 open import Data.Nat renaming ( zero to Zero ; suc to Suc ; ℕ to Nat ; _⊔_ to _n⊔_ ) |
3 | 7 |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
8 open import Relation.Binary.PropositionalEquality |
3 | 9 |
24 | 10 data OrdinalD {n : Level} : (lv : Nat) → Set n where |
11 Φ : (lv : Nat) → OrdinalD lv | |
12 OSuc : (lv : Nat) → OrdinalD {n} lv → OrdinalD lv | |
17 | 13 ℵ_ : (lv : Nat) → OrdinalD (Suc lv) |
3 | 14 |
24 | 15 record Ordinal {n : Level} : Set n where |
16 | 16 field |
17 lv : Nat | |
24 | 18 ord : OrdinalD {n} lv |
16 | 19 |
24 | 20 data _d<_ {n : Level} : {lx ly : Nat} → OrdinalD {n} lx → OrdinalD {n} ly → Set n where |
21 Φ< : {lx : Nat} → {x : OrdinalD {n} lx} → Φ lx d< OSuc lx x | |
22 s< : {lx : Nat} → {x y : OrdinalD {n} lx} → x d< y → OSuc lx x d< OSuc lx y | |
23 ℵΦ< : {lx : Nat} → {x : OrdinalD {n} (Suc lx) } → Φ (Suc lx) d< (ℵ lx) | |
24 ℵ< : {lx : Nat} → {x : OrdinalD {n} (Suc lx) } → OSuc (Suc lx) x d< (ℵ lx) | |
17 | 25 |
26 open Ordinal | |
27 | |
24 | 28 _o<_ : {n : Level} ( x y : Ordinal ) → Set (suc n) |
17 | 29 _o<_ x y = (lv x < lv y ) ∨ ( ord x d< ord y ) |
3 | 30 |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
31 open import Data.Nat.Properties |
6 | 32 open import Data.Empty |
33 open import Relation.Nullary | |
34 | |
35 open import Relation.Binary | |
36 open import Relation.Binary.Core | |
37 | |
24 | 38 o∅ : {n : Level} → Ordinal {n} |
39 o∅ = record { lv = Zero ; ord = Φ Zero } | |
21 | 40 |
41 | |
24 | 42 ≡→¬d< : {n : Level} → {lv : Nat} → {x : OrdinalD {n} lv } → x d< x → ⊥ |
43 ≡→¬d< {n} {lx} {OSuc lx y} (s< t) = ≡→¬d< t | |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
44 |
24 | 45 trio<> : {n : Level} → {lx : Nat} {x : OrdinalD {n} lx } { y : OrdinalD lx } → y d< x → x d< y → ⊥ |
46 trio<> {n} {lx} {.(OSuc lx _)} {.(OSuc lx _)} (s< s) (s< t) = | |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
47 trio<> s t |
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
48 |
24 | 49 trio<≡ : {n : Level} → {lx : Nat} {x : OrdinalD {n} lx } { y : OrdinalD lx } → x ≡ y → x d< y → ⊥ |
17 | 50 trio<≡ refl = ≡→¬d< |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
51 |
24 | 52 trio>≡ : {n : Level} → {lx : Nat} {x : OrdinalD {n} lx } { y : OrdinalD lx } → x ≡ y → y d< x → ⊥ |
17 | 53 trio>≡ refl = ≡→¬d< |
9
5ed16e2d8eb7
try to fix axiom of replacement
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
8
diff
changeset
|
54 |
24 | 55 triO : {n : Level} → {lx ly : Nat} → OrdinalD {n} lx → OrdinalD {n} ly → Tri (lx < ly) ( lx ≡ ly ) ( lx > ly ) |
56 triO {n} {lx} {ly} x y = <-cmp lx ly | |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
57 |
24 | 58 triOrdd : {n : Level} → {lx : Nat} → Trichotomous _≡_ ( _d<_ {n} {lx} {lx} ) |
59 triOrdd {_} {lv} (Φ lv) (Φ lv) = tri≈ ≡→¬d< refl ≡→¬d< | |
60 triOrdd {_} {Suc lv} (ℵ lv) (ℵ lv) = tri≈ ≡→¬d< refl ≡→¬d< | |
61 triOrdd {_} {lv} (Φ lv) (OSuc lv y) = tri< Φ< (λ ()) ( λ lt → trio<> lt Φ< ) | |
62 triOrdd {_} {.(Suc lv)} (Φ (Suc lv)) (ℵ lv) = tri< (ℵΦ< {_} {lv} {Φ (Suc lv)} ) (λ ()) ( λ lt → trio<> lt ((ℵΦ< {_} {lv} {Φ (Suc lv)} )) ) | |
63 triOrdd {_} {Suc lv} (ℵ lv) (Φ (Suc lv)) = tri> ( λ lt → trio<> lt (ℵΦ< {_} {lv} {Φ (Suc lv)} ) ) (λ ()) (ℵΦ< {_} {lv} {Φ (Suc lv)} ) | |
64 triOrdd {_} {Suc lv} (ℵ lv) (OSuc (Suc lv) y) = tri> ( λ lt → trio<> lt (ℵ< {_} {lv} {y} ) ) (λ ()) (ℵ< {_} {lv} {y} ) | |
65 triOrdd {_} {lv} (OSuc lv x) (Φ lv) = tri> (λ lt → trio<> lt Φ<) (λ ()) Φ< | |
66 triOrdd {_} {.(Suc lv)} (OSuc (Suc lv) x) (ℵ lv) = tri< ℵ< (λ ()) (λ lt → trio<> lt ℵ< ) | |
67 triOrdd {_} {lv} (OSuc lv x) (OSuc lv y) with triOrdd x y | |
68 triOrdd {_} {lv} (OSuc lv x) (OSuc lv y) | tri< a ¬b ¬c = tri< (s< a) (λ tx=ty → trio<≡ tx=ty (s< a) ) ( λ lt → trio<> lt (s< a) ) | |
69 triOrdd {_} {lv} (OSuc lv x) (OSuc lv x) | tri≈ ¬a refl ¬c = tri≈ ≡→¬d< refl ≡→¬d< | |
70 triOrdd {_} {lv} (OSuc lv x) (OSuc lv y) | tri> ¬a ¬b c = tri> ( λ lt → trio<> lt (s< c) ) (λ tx=ty → trio>≡ tx=ty (s< c) ) (s< c) | |
9
5ed16e2d8eb7
try to fix axiom of replacement
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
8
diff
changeset
|
71 |
24 | 72 d<→lv : {n : Level} {x y : Ordinal {n}} → ord x d< ord y → lv x ≡ lv y |
17 | 73 d<→lv Φ< = refl |
74 d<→lv (s< lt) = refl | |
75 d<→lv ℵΦ< = refl | |
76 d<→lv ℵ< = refl | |
16 | 77 |
24 | 78 orddtrans : {n : Level} {lx : Nat} {x y z : OrdinalD {n} lx } → x d< y → y d< z → x d< z |
79 orddtrans {_} {lx} {.(Φ lx)} {.(OSuc lx _)} {.(OSuc lx _)} Φ< (s< y<z) = Φ< | |
80 orddtrans {_} {Suc lx} {Φ (Suc lx)} {OSuc (Suc lx) y} {ℵ lx} Φ< ℵ< = ℵΦ< {_} {lx} {y} | |
81 orddtrans {_} {lx} {.(OSuc lx _)} {.(OSuc lx _)} {.(OSuc lx _)} (s< x<y) (s< y<z) = s< ( orddtrans x<y y<z ) | |
82 orddtrans {_} {Suc lx} {.(OSuc (Suc lx) _)} {.(OSuc (Suc lx) _)} {.(ℵ _)} (s< x<y) ℵ< = ℵ< | |
83 orddtrans {_} {Suc lx} {Φ (Suc lx)} {.(ℵ _)} {z} ℵΦ< () | |
84 orddtrans {_} {Suc lx} {OSuc (Suc lx) _} {.(ℵ _)} {z} ℵ< () | |
9
5ed16e2d8eb7
try to fix axiom of replacement
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
8
diff
changeset
|
85 |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
86 max : (x y : Nat) → Nat |
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
87 max Zero Zero = Zero |
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
88 max Zero (Suc x) = (Suc x) |
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
89 max (Suc x) Zero = (Suc x) |
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
90 max (Suc x) (Suc y) = Suc ( max x y ) |
3 | 91 |
24 | 92 maxαd : {n : Level} → { lx : Nat } → OrdinalD {n} lx → OrdinalD lx → OrdinalD lx |
17 | 93 maxαd x y with triOrdd x y |
94 maxαd x y | tri< a ¬b ¬c = y | |
95 maxαd x y | tri≈ ¬a b ¬c = x | |
96 maxαd x y | tri> ¬a ¬b c = x | |
6 | 97 |
24 | 98 maxα : {n : Level} → Ordinal {n} → Ordinal → Ordinal |
17 | 99 maxα x y with <-cmp (lv x) (lv y) |
100 maxα x y | tri< a ¬b ¬c = x | |
101 maxα x y | tri> ¬a ¬b c = y | |
102 maxα x y | tri≈ ¬a refl ¬c = record { lv = lv x ; ord = maxαd (ord x) (ord y) } | |
7 | 103 |
24 | 104 _o≤_ : {n : Level} → Ordinal → Ordinal → Set (suc n) |
23 | 105 a o≤ b = (a ≡ b) ∨ ( a o< b ) |
106 | |
24 | 107 trio< : {n : Level } → Trichotomous {suc n} _≡_ _o<_ |
23 | 108 trio< a b with <-cmp (lv a) (lv b) |
24 | 109 trio< a b | tri< a₁ ¬b ¬c = tri< (case1 a₁) (λ refl → ¬b (cong ( λ x → lv x ) refl ) ) lemma1 where |
110 lemma1 : ¬ (Suc (lv b) ≤ lv a) ∨ (ord b d< ord a) | |
111 lemma1 (case1 x) = ¬c x | |
112 lemma1 (case2 x) with d<→lv x | |
113 lemma1 (case2 x) | refl = ¬b refl | |
114 trio< a b | tri> ¬a ¬b c = tri> lemma1 (λ refl → ¬b (cong ( λ x → lv x ) refl ) ) (case1 c) where | |
115 lemma1 : ¬ (Suc (lv a) ≤ lv b) ∨ (ord a d< ord b) | |
116 lemma1 (case1 x) = ¬a x | |
117 lemma1 (case2 x) with d<→lv x | |
118 lemma1 (case2 x) | refl = ¬b refl | |
23 | 119 trio< a b | tri≈ ¬a refl ¬c with triOrdd ( ord a ) ( ord b ) |
24 | 120 trio< record { lv = .(lv b) ; ord = x } b | tri≈ ¬a refl ¬c | tri< a ¬b ¬c₁ = tri< (case2 a) (λ refl → ¬b (lemma1 refl )) lemma2 where |
121 lemma1 : (record { lv = _ ; ord = x }) ≡ b → x ≡ ord b | |
122 lemma1 refl = refl | |
123 lemma2 : ¬ (Suc (lv b) ≤ lv b) ∨ (ord b d< x) | |
124 lemma2 (case1 x) = ¬a x | |
125 lemma2 (case2 x) = trio<> x a | |
126 trio< record { lv = .(lv b) ; ord = x } b | tri≈ ¬a refl ¬c | tri> ¬a₁ ¬b c = tri> lemma2 (λ refl → ¬b (lemma1 refl )) (case2 c) where | |
127 lemma1 : (record { lv = _ ; ord = x }) ≡ b → x ≡ ord b | |
128 lemma1 refl = refl | |
129 lemma2 : ¬ (Suc (lv b) ≤ lv b) ∨ (x d< ord b) | |
130 lemma2 (case1 x) = ¬a x | |
131 lemma2 (case2 x) = trio<> x c | |
132 trio< record { lv = .(lv b) ; ord = x } b | tri≈ ¬a refl ¬c | tri≈ ¬a₁ refl ¬c₁ = tri≈ lemma1 refl lemma1 where | |
133 lemma1 : ¬ (Suc (lv b) ≤ lv b) ∨ (ord b d< ord b) | |
134 lemma1 (case1 x) = ¬a x | |
135 lemma1 (case2 x) = ≡→¬d< x | |
23 | 136 |
24 | 137 OrdTrans : {n : Level} → Transitive {suc n} _o≤_ |
16 | 138 OrdTrans (case1 refl) (case1 refl) = case1 refl |
139 OrdTrans (case1 refl) (case2 lt2) = case2 lt2 | |
140 OrdTrans (case2 lt1) (case1 refl) = case2 lt1 | |
17 | 141 OrdTrans (case2 (case1 x)) (case2 (case1 y)) = case2 (case1 ( <-trans x y ) ) |
142 OrdTrans (case2 (case1 x)) (case2 (case2 y)) with d<→lv y | |
143 OrdTrans (case2 (case1 x)) (case2 (case2 y)) | refl = case2 (case1 x ) | |
144 OrdTrans (case2 (case2 x)) (case2 (case1 y)) with d<→lv x | |
145 OrdTrans (case2 (case2 x)) (case2 (case1 y)) | refl = case2 (case1 y) | |
146 OrdTrans (case2 (case2 x)) (case2 (case2 y)) with d<→lv x | d<→lv y | |
147 OrdTrans (case2 (case2 x)) (case2 (case2 y)) | refl | refl = case2 (case2 (orddtrans x y )) | |
16 | 148 |
24 | 149 OrdPreorder : {n : Level} → Preorder (suc n) (suc n) (suc n) |
150 OrdPreorder {n} = record { Carrier = Ordinal | |
16 | 151 ; _≈_ = _≡_ |
23 | 152 ; _∼_ = _o≤_ |
16 | 153 ; isPreorder = record { |
154 isEquivalence = record { refl = refl ; sym = sym ; trans = trans } | |
155 ; reflexive = case1 | |
24 | 156 ; trans = OrdTrans |
16 | 157 } |
158 } | |
159 | |
24 | 160 TransFinite : {n : Level} → ( ψ : Ordinal {n} → Set n ) |
22 | 161 → ( ∀ (lx : Nat ) → ψ ( record { lv = Suc lx ; ord = ℵ lx } )) |
24 | 162 → ( ∀ (lx : Nat ) → ψ ( record { lv = lx ; ord = Φ lx } ) ) |
163 → ( ∀ (lx : Nat ) → (x : OrdinalD lx ) → ψ ( record { lv = lx ; ord = x } ) → ψ ( record { lv = lx ; ord = OSuc lx x } ) ) | |
22 | 164 → ∀ (x : Ordinal) → ψ x |
24 | 165 TransFinite ψ caseℵ caseΦ caseOSuc record { lv = lv ; ord = Φ lv } = caseΦ lv |
166 TransFinite ψ caseℵ caseΦ caseOSuc record { lv = lv ; ord = OSuc lv ord₁ } = caseOSuc lv ord₁ | |
22 | 167 ( TransFinite ψ caseℵ caseΦ caseOSuc (record { lv = lv ; ord = ord₁ } )) |
168 TransFinite ψ caseℵ caseΦ caseOSuc record { lv = Suc lv₁ ; ord = ℵ lv₁ } = caseℵ lv₁ | |
169 | |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
170 -- X' = { x ∈ X | ψ x } ∪ X , Mα = ( ∪ (β < α) Mβ ) ' |
7 | 171 |
24 | 172 record ConstructibleSet {n : Level} : Set (suc n) where |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
173 field |
24 | 174 α : Ordinal {suc n} |
175 constructible : Ordinal {suc n} → Set n | |
26 | 176 -- constructible : (x : Ordinal {suc n} ) → x o< α → Set n |
11 | 177 |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
178 open ConstructibleSet |
11 | 179 |
24 | 180 _∋_ : {n : Level} → (ConstructibleSet {n}) → (ConstructibleSet {n} ) → Set (suc n) |
23 | 181 a ∋ x = ( α x o< α a ) ∧ constructible a ( α x ) |
182 | |
24 | 183 c∅ : {n : Level} → ConstructibleSet |
184 c∅ {n} = record {α = o∅ ; constructible = λ x → Lift n ⊥ } | |
23 | 185 |
25 | 186 record SupR {n m : Level} {S : Set n} ( _≤_ : S → S → Set m ) (ψ : S → S ) (X : S) : Set ((suc n) ⊔ m) where |
23 | 187 field |
188 sup : S | |
189 smax : ∀ { x : S } → x ≤ X → ψ x ≤ sup | |
190 suniq : {max : S} → ( ∀ { x : S } → x ≤ X → ψ x ≤ max ) → max ≤ sup | |
191 | |
192 open SupR | |
193 | |
26 | 194 record dom-ψ {n m : Level} (X : ConstructibleSet {n}) (ψ : ConstructibleSet {n} → ConstructibleSet {n} ) : Set (suc (suc n) ⊔ suc m) where |
195 field | |
196 αψ : Ordinal {suc n} | |
197 inψ : (x : Ordinal {suc n} ) → Set m | |
198 X∋x : (x : ConstructibleSet {n} ) → inψ (α x) → X ∋ x | |
199 vψ : (x : Ordinal {suc n} ) → inψ x → ConstructibleSet {n} | |
200 cset≡ψ : (x : ConstructibleSet {n} ) → (t : inψ (α x) ) → x ≡ ψ ( vψ (α x) t ) | |
201 | |
202 open dom-ψ | |
203 | |
204 postulate | |
205 ψ→C : {n m : Level} (X : ConstructibleSet {n}) (ψ : ConstructibleSet {n} → ConstructibleSet {n} ) → dom-ψ {n} {m} X ψ | |
206 | |
24 | 207 _⊆_ : {n : Level} → ( A B : ConstructibleSet ) → ∀{ x : ConstructibleSet } → Set (suc n) |
23 | 208 _⊆_ A B {x} = A ∋ x → B ∋ x |
209 | |
24 | 210 suptraverse : {n : Level} → (X : ConstructibleSet {n}) ( max : ConstructibleSet {n}) ( ψ : ConstructibleSet {n} → ConstructibleSet {n}) → ConstructibleSet {n} |
23 | 211 suptraverse X max ψ = {!!} |
212 | |
24 | 213 Sup : {n : Level } → (ψ : ConstructibleSet → ConstructibleSet ) → (X : ConstructibleSet) → SupR (λ x a → (α a ≡ α x) ∨ (a ∋ x)) ψ X |
214 sup (Sup {n} ψ X ) = suptraverse X (c∅ {n}) ψ | |
215 smax (Sup ψ X ) = {!!} | |
23 | 216 suniq (Sup ψ X ) = {!!} |
217 | |
20 | 218 open import Data.Unit |
23 | 219 open SupR |
20 | 220 |
24 | 221 ConstructibleSet→ZF : {n : Level} → ZF {suc n} {suc n} |
222 ConstructibleSet→ZF {n} = record { | |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
223 ZFSet = ConstructibleSet |
24 | 224 ; _∋_ = _∋_ |
18 | 225 ; _≈_ = _≡_ |
24 | 226 ; ∅ = c∅ |
18 | 227 ; _,_ = _,_ |
228 ; Union = Union | |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
229 ; Power = {!!} |
20 | 230 ; Select = Select |
25 | 231 ; Replace = Replace |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
232 ; infinite = {!!} |
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
233 ; isZF = {!!} |
18 | 234 } where |
26 | 235 Select : (X : ConstructibleSet {n}) → (ConstructibleSet {n} → Set (suc n)) → ConstructibleSet {n} |
25 | 236 Select X ψ = record { α = α X ; constructible = λ x → select x } where |
237 select : Ordinal → Set n | |
238 select x with ψ (record { α = x ; constructible = λ x → constructible X x }) | |
239 ... | t = Lift n ⊤ | |
24 | 240 Replace : (X : ConstructibleSet {n} ) → (ConstructibleSet → ConstructibleSet) → ConstructibleSet |
26 | 241 Replace X ψ = record { α = αψ {n} {suc (suc n)} (ψ→C X ψ) ; constructible = λ x → inψ (ψ→C X ψ) x } |
24 | 242 _,_ : ConstructibleSet {n} → ConstructibleSet → ConstructibleSet |
25 | 243 a , b = record { α = maxα (α a) (α b) ; constructible = a∨b } where |
244 a∨b : Ordinal {suc n} → Set n | |
245 a∨b x with (x ≡ α a ) ∨ ( x ≡ α b ) | |
246 ... | t = Lift n ⊤ | |
18 | 247 Union : ConstructibleSet → ConstructibleSet |
248 Union a = {!!} |