Mercurial > hg > Members > kono > Proof > ZF-in-agda
annotate cardinal.agda @ 249:2ecda48298e3
...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 28 Aug 2019 20:32:35 +0900 |
parents | 9fd85b954477 |
children | 08428a661677 |
rev | line source |
---|---|
16 | 1 open import Level |
224 | 2 open import Ordinals |
3 module cardinal {n : Level } (O : Ordinals {n}) where | |
3 | 4 |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
5 open import zf |
219 | 6 open import logic |
224 | 7 import OD |
23 | 8 open import Data.Nat renaming ( zero to Zero ; suc to Suc ; ℕ to Nat ; _⊔_ to _n⊔_ ) |
224 | 9 open import Relation.Binary.PropositionalEquality |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
10 open import Data.Nat.Properties |
6 | 11 open import Data.Empty |
12 open import Relation.Nullary | |
13 open import Relation.Binary | |
14 open import Relation.Binary.Core | |
15 | |
224 | 16 open inOrdinal O |
17 open OD O | |
219 | 18 open OD.OD |
29
fce60b99dc55
posturate OD is isomorphic to Ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
28
diff
changeset
|
19 |
120 | 20 open _∧_ |
213
22d435172d1a
separate logic and nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
210
diff
changeset
|
21 open _∨_ |
22d435172d1a
separate logic and nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
210
diff
changeset
|
22 open Bool |
44
fcac01485f32
od→lv : {n : Level} → OD {n} → Nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
43
diff
changeset
|
23 |
230 | 24 -- we have to work on Ordinal to keep OD Level n |
25 -- since we use p∨¬p which works only on Level n | |
225 | 26 |
233 | 27 <_,_> : (x y : OD) → OD |
28 < x , y > = (x , x ) , (x , y ) | |
226
176ff97547b4
set theortic function definition using sup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
225
diff
changeset
|
29 |
243 | 30 open import Relation.Binary.HeterogeneousEquality as HE using (_≅_ ) |
31 | |
32 | |
248 | 33 open _==_ |
34 | |
35 exg-pair : { x y : OD } → (x , y ) == ( y , x ) | |
36 exg-pair {x} {y} = record { eq→ = left ; eq← = right } where | |
37 left : {z : Ordinal} → def (x , y) z → def (y , x) z | |
38 left (case1 t) = case2 t | |
39 left (case2 t) = case1 t | |
40 right : {z : Ordinal} → def (y , x) z → def (x , y) z | |
41 right (case1 t) = case2 t | |
42 right (case2 t) = case1 t | |
43 | |
44 ==-trans : { x y z : OD } → x == y → y == z → x == z | |
45 ==-trans x=y y=z = record { eq→ = λ {m} t → eq→ y=z (eq→ x=y t) ; eq← = λ {m} t → eq← x=y (eq← y=z t) } | |
46 | |
47 ==-sym : { x y : OD } → x == y → y == x | |
48 ==-sym x=y = record { eq→ = λ {m} t → eq← x=y t ; eq← = λ {m} t → eq→ x=y t } | |
49 | |
50 ord≡→≡ : { x y : OD } → od→ord x ≡ od→ord y → x ≡ y | |
51 ord≡→≡ eq = subst₂ (λ j k → j ≡ k ) oiso oiso ( cong ( λ k → ord→od k ) eq ) | |
52 | |
249 | 53 eq-prod : { x x' y y' : OD } → x ≡ x' → y ≡ y' → < x , y > ≡ < x' , y' > |
54 eq-prod refl refl = refl | |
55 | |
248 | 56 prod-eq : { x x' y y' : OD } → < x , y > == < x' , y' > → (x ≡ x' ) ∧ ( y ≡ y' ) |
57 prod-eq {x} {x'} {y} {y'} eq = record { proj1 = lemmax ; proj2 = lemmay } where | |
58 lemma0 : {x y z : OD } → ( x , x ) == ( z , y ) → x ≡ y | |
59 lemma0 {x} {y} eq with trio< (od→ord x) (od→ord y) | |
60 lemma0 {x} {y} eq | tri< a ¬b ¬c with eq← eq {od→ord y} (case2 refl) | |
61 lemma0 {x} {y} eq | tri< a ¬b ¬c | case1 s = ⊥-elim ( o<¬≡ (sym s) a ) | |
62 lemma0 {x} {y} eq | tri< a ¬b ¬c | case2 s = ⊥-elim ( o<¬≡ (sym s) a ) | |
63 lemma0 {x} {y} eq | tri≈ ¬a b ¬c = ord≡→≡ b | |
64 lemma0 {x} {y} eq | tri> ¬a ¬b c with eq← eq {od→ord y} (case2 refl) | |
65 lemma0 {x} {y} eq | tri> ¬a ¬b c | case1 s = ⊥-elim ( o<¬≡ s c ) | |
66 lemma0 {x} {y} eq | tri> ¬a ¬b c | case2 s = ⊥-elim ( o<¬≡ s c ) | |
67 lemma2 : {x y z : OD } → ( x , x ) == ( z , y ) → z ≡ y | |
68 lemma2 {x} {y} {z} eq = trans (sym (lemma0 lemma3 )) ( lemma0 eq ) where | |
69 lemma3 : ( x , x ) == ( y , z ) | |
70 lemma3 = ==-trans eq exg-pair | |
71 lemma1 : {x y : OD } → ( x , x ) == ( y , y ) → x ≡ y | |
72 lemma1 {x} {y} eq with eq← eq {od→ord y} (case2 refl) | |
73 lemma1 {x} {y} eq | case1 s = ord≡→≡ (sym s) | |
74 lemma1 {x} {y} eq | case2 s = ord≡→≡ (sym s) | |
75 lemma4 : {x y z : OD } → ( x , y ) == ( x , z ) → y ≡ z | |
76 lemma4 {x} {y} {z} eq with eq← eq {od→ord z} (case2 refl) | |
77 lemma4 {x} {y} {z} eq | case1 s with ord≡→≡ s -- x ≡ z | |
78 ... | refl with lemma2 (==-sym eq ) | |
79 ... | refl = refl | |
80 lemma4 {x} {y} {z} eq | case2 s = ord≡→≡ (sym s) -- y ≡ z | |
81 lemmax : x ≡ x' | |
82 lemmax with eq→ eq {od→ord (x , x)} (case1 refl) | |
83 lemmax | case1 s = lemma1 (ord→== s ) -- (x,x)≡(x',x') | |
84 lemmax | case2 s with lemma2 (ord→== s ) -- (x,x)≡(x',y') with x'≡y' | |
85 ... | refl = lemma1 (ord→== s ) | |
86 lemmay : y ≡ y' | |
87 lemmay with lemmax | |
88 ... | refl with lemma4 eq -- with (x,y)≡(x,y') | |
89 ... | eq1 = lemma4 (ord→== (cong (λ k → od→ord k ) eq1 )) | |
247 | 90 |
249 | 91 data ord-pair : (p : Ordinal) → Set n where |
92 pair : (x y : Ordinal ) → ord-pair ( od→ord ( < ord→od x , ord→od y > ) ) | |
247 | 93 |
249 | 94 ZFProduct : OD |
95 ZFProduct = record { def = λ x → ord-pair x } | |
247 | 96 |
249 | 97 eq-pair : { x x' y y' : Ordinal } → x ≡ x' → y ≡ y' → pair x y ≅ pair x' y' |
98 eq-pair refl refl = HE.refl | |
247 | 99 |
249 | 100 pi1 : { p : Ordinal } → ord-pair p → Ordinal |
101 pi1 ( pair x y) = x | |
102 | |
103 π1 : { p : OD } → ZFProduct ∋ p → Ordinal | |
104 π1 lt = pi1 lt | |
247 | 105 |
249 | 106 pi2 : { p : Ordinal } → ord-pair p → Ordinal |
107 pi2 ( pair x y ) = y | |
108 | |
109 π2 : { p : OD } → ZFProduct ∋ p → Ordinal | |
110 π2 lt = pi2 lt | |
247 | 111 |
249 | 112 p-cons : ( x y : OD ) → ZFProduct ∋ < x , y > |
113 p-cons x y = def-subst {_} {_} {ZFProduct} {od→ord (< x , y >)} (pair (od→ord x) ( od→ord y )) refl ( | |
114 let open ≡-Reasoning in begin | |
115 od→ord < ord→od (od→ord x) , ord→od (od→ord y) > | |
116 ≡⟨ cong₂ (λ j k → od→ord < j , k >) oiso oiso ⟩ | |
117 od→ord < x , y > | |
118 ∎ ) | |
247 | 119 |
244 | 120 |
249 | 121 p-iso-1 : { x y : OD } → (p : ZFProduct ∋ < x , y > ) → π1 p ≡ od→ord x |
122 p-iso-1 {x} {y} p = lemma1 {od→ord < x , y >} {od→ord x} {od→ord y} p (cong₂ (λ j k → ord-pair (od→ord < j , k >)) (sym oiso) (sym oiso) ) where | |
123 lemma1 : {op ox oy : Ordinal } → ( p : ord-pair op ) → ord-pair op ≡ ord-pair (od→ord ( < ord→od ox , ord→od oy > )) → pi1 p ≡ ox | |
124 lemma1 (pair ox oy) eq = {!!} | |
125 lemma2 : {op ox oy : Ordinal } → ord-pair op ≡ ord-pair (od→ord ( < ord→od ox , ord→od oy > )) | |
126 lemma2 = {!!} | |
127 lemma0 : {op ox oy : Ordinal } → ( p : ord-pair (od→ord ( < ord→od ox , ord→od oy > ))) → pi1 p ≡ ox | |
128 lemma0 = {!!} | |
129 lemma3 : {ox oy : Ordinal } ( p : ord-pair (od→ord ( < ord→od ox , ord→od oy > )) ) → pi1 p ≡ ox | |
130 lemma3 {ox} {oy} p = {!!} | |
131 lemma4 : {ox oy : Ordinal } → ord-pair (od→ord < ord→od ox , ord→od oy > ) ≡ ZFProduct ∋ < ord→od ox , ord→od oy > | |
132 lemma4 = refl | |
133 lemma : {p : OD } → ord-pair (od→ord p) ≡ ZFProduct ∋ p | |
134 lemma = refl | |
242 | 135 |
249 | 136 p-iso : { x : OD } → (p : ZFProduct ∋ x ) → < ord→od (π1 p) , ord→od (π2 p) > ≡ x |
137 p-iso {x} p = {!!} | |
238 | 138 |
234
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
233
diff
changeset
|
139 ∋-p : (A x : OD ) → Dec ( A ∋ x ) |
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
233
diff
changeset
|
140 ∋-p A x with p∨¬p ( A ∋ x ) |
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
233
diff
changeset
|
141 ∋-p A x | case1 t = yes t |
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
233
diff
changeset
|
142 ∋-p A x | case2 t = no t |
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
233
diff
changeset
|
143 |
233 | 144 _⊗_ : (A B : OD) → OD |
239 | 145 A ⊗ B = record { def = λ x → def ZFProduct x ∧ ( { x : Ordinal } → (p : def ZFProduct x ) → checkAB p ) } where |
146 checkAB : { p : Ordinal } → def ZFProduct p → Set n | |
147 checkAB (pair x y) = def A x ∧ def B y | |
233 | 148 |
242 | 149 func→od0 : (f : Ordinal → Ordinal ) → OD |
150 func→od0 f = record { def = λ x → def ZFProduct x ∧ ( { x : Ordinal } → (p : def ZFProduct x ) → checkfunc p ) } where | |
151 checkfunc : { p : Ordinal } → def ZFProduct p → Set n | |
152 checkfunc (pair x y) = f x ≡ y | |
153 | |
233 | 154 -- Power (Power ( A ∪ B )) ∋ ( A ⊗ B ) |
225 | 155 |
233 | 156 Func : ( A B : OD ) → OD |
157 Func A B = record { def = λ x → def (Power (A ⊗ B)) x } | |
158 | |
159 -- power→ : ( A t : OD) → Power A ∋ t → {x : OD} → t ∋ x → ¬ ¬ (A ∋ x) | |
226
176ff97547b4
set theortic function definition using sup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
225
diff
changeset
|
160 |
236 | 161 |
233 | 162 func→od : (f : Ordinal → Ordinal ) → ( dom : OD ) → OD |
163 func→od f dom = Replace dom ( λ x → < x , ord→od (f (od→ord x)) > ) | |
164 | |
242 | 165 record Func←cd { dom cod : OD } {f : Ordinal } : Set n where |
236 | 166 field |
167 func-1 : Ordinal → Ordinal | |
242 | 168 func→od∈Func-1 : Func dom cod ∋ func→od func-1 dom |
236 | 169 |
242 | 170 od→func : { dom cod : OD } → {f : Ordinal } → def (Func dom cod ) f → Func←cd {dom} {cod} {f} |
240 | 171 od→func {dom} {cod} {f} lt = record { func-1 = λ x → sup-o ( λ y → lemma x y ) ; func→od∈Func-1 = record { proj1 = {!!} ; proj2 = {!!} } } where |
236 | 172 lemma : Ordinal → Ordinal → Ordinal |
173 lemma x y with IsZF.power→ isZF (dom ⊗ cod) (ord→od f) (subst (λ k → def (Power (dom ⊗ cod)) k ) (sym diso) lt ) | ∋-p (ord→od f) (ord→od y) | |
174 lemma x y | p | no n = o∅ | |
240 | 175 lemma x y | p | yes f∋y = lemma2 (proj1 (double-neg-eilm ( p {ord→od y} f∋y ))) where -- p : {y : OD} → f ∋ y → ¬ ¬ (dom ⊗ cod ∋ y) |
176 lemma2 : {p : Ordinal} → ord-pair p → Ordinal | |
177 lemma2 (pair x1 y1) with decp ( x1 ≡ x) | |
178 lemma2 (pair x1 y1) | yes p = y1 | |
179 lemma2 (pair x1 y1) | no ¬p = o∅ | |
242 | 180 fod : OD |
181 fod = Replace dom ( λ x → < x , ord→od (sup-o ( λ y → lemma (od→ord x) y )) > ) | |
240 | 182 |
183 | |
184 open Func←cd | |
236 | 185 |
227 | 186 -- contra position of sup-o< |
187 -- | |
188 | |
235 | 189 -- postulate |
190 -- -- contra-position of mimimulity of supermum required in Cardinal | |
191 -- sup-x : ( Ordinal → Ordinal ) → Ordinal | |
192 -- sup-lb : { ψ : Ordinal → Ordinal } → {z : Ordinal } → z o< sup-o ψ → z o< osuc (ψ (sup-x ψ)) | |
227 | 193 |
219 | 194 ------------ |
195 -- | |
196 -- Onto map | |
197 -- def X x -> xmap | |
198 -- X ---------------------------> Y | |
199 -- ymap <- def Y y | |
200 -- | |
224 | 201 record Onto (X Y : OD ) : Set n where |
219 | 202 field |
226
176ff97547b4
set theortic function definition using sup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
225
diff
changeset
|
203 xmap : Ordinal |
176ff97547b4
set theortic function definition using sup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
225
diff
changeset
|
204 ymap : Ordinal |
176ff97547b4
set theortic function definition using sup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
225
diff
changeset
|
205 xfunc : def (Func X Y) xmap |
176ff97547b4
set theortic function definition using sup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
225
diff
changeset
|
206 yfunc : def (Func Y X) ymap |
234
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
233
diff
changeset
|
207 onto-iso : {y : Ordinal } → (lty : def Y y ) → |
240 | 208 func-1 ( od→func {X} {Y} {xmap} xfunc ) ( func-1 (od→func yfunc) y ) ≡ y |
230 | 209 |
210 open Onto | |
211 | |
212 onto-restrict : {X Y Z : OD} → Onto X Y → ({x : OD} → _⊆_ Z Y {x}) → Onto X Z | |
213 onto-restrict {X} {Y} {Z} onto Z⊆Y = record { | |
214 xmap = xmap1 | |
215 ; ymap = zmap | |
216 ; xfunc = xfunc1 | |
217 ; yfunc = zfunc | |
218 ; onto-iso = onto-iso1 | |
219 } where | |
220 xmap1 : Ordinal | |
221 xmap1 = od→ord (Select (ord→od (xmap onto)) {!!} ) | |
222 zmap : Ordinal | |
223 zmap = {!!} | |
224 xfunc1 : def (Func X Z) xmap1 | |
225 xfunc1 = {!!} | |
226 zfunc : def (Func Z X) zmap | |
227 zfunc = {!!} | |
240 | 228 onto-iso1 : {z : Ordinal } → (ltz : def Z z ) → func-1 (od→func xfunc1 ) (func-1 (od→func zfunc ) z ) ≡ z |
230 | 229 onto-iso1 = {!!} |
230 | |
51 | 231 |
224 | 232 record Cardinal (X : OD ) : Set n where |
219 | 233 field |
224 | 234 cardinal : Ordinal |
230 | 235 conto : Onto X (Ord cardinal) |
236 cmax : ( y : Ordinal ) → cardinal o< y → ¬ Onto X (Ord y) | |
151 | 237 |
224 | 238 cardinal : (X : OD ) → Cardinal X |
239 cardinal X = record { | |
219 | 240 cardinal = sup-o ( λ x → proj1 ( cardinal-p x) ) |
226
176ff97547b4
set theortic function definition using sup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
225
diff
changeset
|
241 ; conto = onto |
219 | 242 ; cmax = cmax |
243 } where | |
230 | 244 cardinal-p : (x : Ordinal ) → ( Ordinal ∧ Dec (Onto X (Ord x) ) ) |
245 cardinal-p x with p∨¬p ( Onto X (Ord x) ) | |
246 cardinal-p x | case1 True = record { proj1 = x ; proj2 = yes True } | |
219 | 247 cardinal-p x | case2 False = record { proj1 = o∅ ; proj2 = no False } |
229 | 248 S = sup-o (λ x → proj1 (cardinal-p x)) |
230 | 249 lemma1 : (x : Ordinal) → ((y : Ordinal) → y o< x → Lift (suc n) (y o< (osuc S) → Onto X (Ord y))) → |
250 Lift (suc n) (x o< (osuc S) → Onto X (Ord x) ) | |
229 | 251 lemma1 x prev with trio< x (osuc S) |
252 lemma1 x prev | tri< a ¬b ¬c with osuc-≡< a | |
230 | 253 lemma1 x prev | tri< a ¬b ¬c | case1 x=S = lift ( λ lt → {!!} ) |
254 lemma1 x prev | tri< a ¬b ¬c | case2 x<S = lift ( λ lt → lemma2 ) where | |
255 lemma2 : Onto X (Ord x) | |
256 lemma2 with prev {!!} {!!} | |
257 ... | lift t = t {!!} | |
229 | 258 lemma1 x prev | tri≈ ¬a b ¬c = lift ( λ lt → ⊥-elim ( o<¬≡ b lt )) |
259 lemma1 x prev | tri> ¬a ¬b c = lift ( λ lt → ⊥-elim ( o<> c lt )) | |
230 | 260 onto : Onto X (Ord S) |
261 onto with TransFinite {λ x → Lift (suc n) ( x o< osuc S → Onto X (Ord x) ) } lemma1 S | |
262 ... | lift t = t <-osuc | |
263 cmax : (y : Ordinal) → S o< y → ¬ Onto X (Ord y) | |
229 | 264 cmax y lt ontoy = o<> lt (o<-subst {_} {_} {y} {S} |
224 | 265 (sup-o< {λ x → proj1 ( cardinal-p x)}{y} ) lemma refl ) where |
219 | 266 lemma : proj1 (cardinal-p y) ≡ y |
230 | 267 lemma with p∨¬p ( Onto X (Ord y) ) |
219 | 268 lemma | case1 x = refl |
269 lemma | case2 not = ⊥-elim ( not ontoy ) | |
217 | 270 |
226
176ff97547b4
set theortic function definition using sup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
225
diff
changeset
|
271 |
176ff97547b4
set theortic function definition using sup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
225
diff
changeset
|
272 ----- |
219 | 273 -- All cardinal is ℵ0, since we are working on Countable Ordinal, |
274 -- Power ω is larger than ℵ0, so it has no cardinal. | |
218 | 275 |
276 | |
277 |