Mercurial > hg > Members > kono > Proof > ZF-in-agda
annotate cardinal.agda @ 227:a4cdfc84f65f
...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 11 Aug 2019 18:37:33 +0900 |
parents | 176ff97547b4 |
children | 49736efc822b |
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 |
225 | 24 |
226
176ff97547b4
set theortic function definition using sup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
225
diff
changeset
|
25 func : (f : Ordinal → Ordinal ) → ( dom : OD ) → OD |
176ff97547b4
set theortic function definition using sup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
225
diff
changeset
|
26 func f dom = Replace dom ( λ x → x , (ord→od (f (od→ord x) ))) |
176ff97547b4
set theortic function definition using sup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
225
diff
changeset
|
27 |
176ff97547b4
set theortic function definition using sup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
225
diff
changeset
|
28 record _⊗_ (A B : Ordinal) : Set n where |
176ff97547b4
set theortic function definition using sup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
225
diff
changeset
|
29 field |
176ff97547b4
set theortic function definition using sup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
225
diff
changeset
|
30 π1 : Ordinal |
176ff97547b4
set theortic function definition using sup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
225
diff
changeset
|
31 π2 : Ordinal |
176ff97547b4
set theortic function definition using sup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
225
diff
changeset
|
32 A∋π1 : def (ord→od A) π1 |
176ff97547b4
set theortic function definition using sup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
225
diff
changeset
|
33 B∋π2 : def (ord→od B) π2 |
176ff97547b4
set theortic function definition using sup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
225
diff
changeset
|
34 |
176ff97547b4
set theortic function definition using sup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
225
diff
changeset
|
35 Func : ( A B : OD ) → OD |
176ff97547b4
set theortic function definition using sup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
225
diff
changeset
|
36 Func A B = record { def = λ x → (od→ord A) ⊗ (od→ord B) } |
225 | 37 |
226
176ff97547b4
set theortic function definition using sup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
225
diff
changeset
|
38 π1 : { A B x : OD } → Func A B ∋ x → OD |
176ff97547b4
set theortic function definition using sup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
225
diff
changeset
|
39 π1 {A} {B} {x} p = ord→od (_⊗_.π1 p) |
176ff97547b4
set theortic function definition using sup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
225
diff
changeset
|
40 |
176ff97547b4
set theortic function definition using sup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
225
diff
changeset
|
41 π2 : { A B x : OD } → Func A B ∋ x → OD |
176ff97547b4
set theortic function definition using sup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
225
diff
changeset
|
42 π2 {A} {B} {x} p = ord→od (_⊗_.π2 p) |
176ff97547b4
set theortic function definition using sup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
225
diff
changeset
|
43 |
176ff97547b4
set theortic function definition using sup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
225
diff
changeset
|
44 Func→func : { dom cod : OD } → (f : OD ) → Func dom cod ∋ f → (Ordinal → Ordinal ) |
176ff97547b4
set theortic function definition using sup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
225
diff
changeset
|
45 Func→func {dom} {cod} f lt x = sup-o ( λ y → lemma y ) where |
176ff97547b4
set theortic function definition using sup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
225
diff
changeset
|
46 lemma : Ordinal → Ordinal |
176ff97547b4
set theortic function definition using sup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
225
diff
changeset
|
47 lemma y with p∨¬p ( _⊗_.π1 lt ≡ x ) |
176ff97547b4
set theortic function definition using sup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
225
diff
changeset
|
48 lemma y | case1 refl = _⊗_.π2 lt |
176ff97547b4
set theortic function definition using sup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
225
diff
changeset
|
49 lemma y | case2 not = o∅ |
225 | 50 |
227 | 51 -- contra position of sup-o< |
52 -- | |
53 | |
54 record Sup ( ψ : Ordinal → Ordinal ) : Set n where | |
55 field | |
56 sup-x : Ordinal | |
57 sup-lb : {z : Ordinal } → z o< sup-o ψ → z o< osuc (ψ sup-x ) | |
58 | |
59 sup-o> : ( ψ : Ordinal → Ordinal ) → Sup ψ | |
60 sup-o> ψ = record { | |
61 sup-x = od→ord ( minimul (Ord (osuc (sup-o ψ))) lemma ) | |
62 ; sup-lb = λ {z} z<sψ → lemma1 z<sψ | |
63 } where | |
64 lemma0 : {x : Ordinal} → o∅ o< osuc x | |
65 lemma0 {x} with trio< o∅ (osuc x) | |
66 lemma0 {x} | tri< a ¬b ¬c = a | |
67 lemma0 {x} | tri≈ ¬a refl ¬c = ⊥-elim (¬x<0 <-osuc ) | |
68 lemma0 {x} | tri> ¬a ¬b c = ⊥-elim (¬x<0 c) | |
69 lemma : ¬ (Ord (osuc (sup-o ψ)) == od∅) | |
70 lemma record { eq→ = eq→ ; eq← = eq← } = ¬x<0 {o∅} ( eq→ lemma0 ) | |
71 lemma1 : {z : Ordinal} → z o< sup-o ψ → z o< osuc (ψ (od→ord (minimul (Ord (osuc (sup-o ψ))) lemma))) | |
72 lemma1 {z} lt with trio< z (ψ (od→ord (minimul (Ord (osuc (sup-o ψ))) lemma))) | |
73 lemma1 {z} lt | tri< a ¬b ¬c = ordtrans a <-osuc | |
74 lemma1 {z} lt | tri≈ ¬a refl ¬c = <-osuc | |
75 lemma1 {z} lt | tri> ¬a ¬b c = ⊥-elim (o<> c lemma2 ) where | |
76 lemma2 : z o< ψ (od→ord (minimul (Ord (osuc (sup-o ψ))) lemma)) | |
77 lemma2 = ordtrans sup-o< ( o<-subst (x∋minimul (Ord (osuc (sup-o ψ))) lemma ) ? ?) | |
78 | |
219 | 79 ------------ |
80 -- | |
81 -- Onto map | |
82 -- def X x -> xmap | |
83 -- X ---------------------------> Y | |
84 -- ymap <- def Y y | |
85 -- | |
224 | 86 record Onto (X Y : OD ) : Set n where |
219 | 87 field |
226
176ff97547b4
set theortic function definition using sup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
225
diff
changeset
|
88 xmap : Ordinal |
176ff97547b4
set theortic function definition using sup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
225
diff
changeset
|
89 ymap : Ordinal |
176ff97547b4
set theortic function definition using sup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
225
diff
changeset
|
90 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
|
91 yfunc : def (Func Y X) ymap |
176ff97547b4
set theortic function definition using sup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
225
diff
changeset
|
92 onto-iso : {y : Ordinal } → (lty : def Y y ) → Func→func (ord→od xmap) xfunc ( Func→func (ord→od ymap) yfunc y ) ≡ y |
51 | 93 |
224 | 94 record Cardinal (X : OD ) : Set n where |
219 | 95 field |
224 | 96 cardinal : Ordinal |
219 | 97 conto : Onto (Ord cardinal) X |
224 | 98 cmax : ( y : Ordinal ) → cardinal o< y → ¬ Onto (Ord y) X |
151 | 99 |
224 | 100 cardinal : (X : OD ) → Cardinal X |
101 cardinal X = record { | |
219 | 102 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
|
103 ; conto = onto |
219 | 104 ; cmax = cmax |
105 } where | |
224 | 106 cardinal-p : (x : Ordinal ) → ( Ordinal ∧ Dec (Onto (Ord x) X) ) |
219 | 107 cardinal-p x with p∨¬p ( Onto (Ord x) X ) |
108 cardinal-p x | case1 True = record { proj1 = x ; proj2 = yes True } | |
109 cardinal-p x | case2 False = record { proj1 = o∅ ; proj2 = no False } | |
226
176ff97547b4
set theortic function definition using sup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
225
diff
changeset
|
110 onto : Onto (Ord (sup-o (λ x → proj1 (cardinal-p x)))) X |
176ff97547b4
set theortic function definition using sup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
225
diff
changeset
|
111 onto = {!!} |
219 | 112 cmax : (y : Ordinal) → sup-o (λ x → proj1 (cardinal-p x)) o< y → ¬ Onto (Ord y) X |
224 | 113 cmax y lt ontoy = o<> lt (o<-subst {_} {_} {y} {sup-o (λ x → proj1 (cardinal-p x))} |
114 (sup-o< {λ x → proj1 ( cardinal-p x)}{y} ) lemma refl ) where | |
219 | 115 lemma : proj1 (cardinal-p y) ≡ y |
116 lemma with p∨¬p ( Onto (Ord y) X ) | |
117 lemma | case1 x = refl | |
118 lemma | case2 not = ⊥-elim ( not ontoy ) | |
217 | 119 |
226
176ff97547b4
set theortic function definition using sup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
225
diff
changeset
|
120 |
176ff97547b4
set theortic function definition using sup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
225
diff
changeset
|
121 ----- |
219 | 122 -- All cardinal is ℵ0, since we are working on Countable Ordinal, |
123 -- Power ω is larger than ℵ0, so it has no cardinal. | |
218 | 124 |
125 | |
126 |