Mercurial > hg > Members > kono > Proof > ZF-in-agda
annotate OD.agda @ 271:2169d948159b
fix incl
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 30 Dec 2019 23:45:59 +0900 |
parents | 53744836020b |
children | 985a1af11bce |
rev | line source |
---|---|
16 | 1 open import Level |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
2 open import Ordinals |
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
3 module OD {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 |
23 | 6 open import Data.Nat renaming ( zero to Zero ; suc to Suc ; ℕ to Nat ; _⊔_ to _n⊔_ ) |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
7 open import Relation.Binary.PropositionalEquality |
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
8 open import Data.Nat.Properties |
6 | 9 open import Data.Empty |
10 open import Relation.Nullary | |
11 open import Relation.Binary | |
12 open import Relation.Binary.Core | |
13 | |
213
22d435172d1a
separate logic and nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
210
diff
changeset
|
14 open import logic |
22d435172d1a
separate logic and nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
210
diff
changeset
|
15 open import nat |
22d435172d1a
separate logic and nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
210
diff
changeset
|
16 |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
17 open inOrdinal O |
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
18 |
27 | 19 -- Ordinal Definable Set |
11 | 20 |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
21 record OD : Set (suc n ) where |
29
fce60b99dc55
posturate OD is isomorphic to Ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
28
diff
changeset
|
22 field |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
23 def : (x : Ordinal ) → Set n |
29
fce60b99dc55
posturate OD is isomorphic to Ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
28
diff
changeset
|
24 |
141 | 25 open OD |
29
fce60b99dc55
posturate OD is isomorphic to Ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
28
diff
changeset
|
26 |
120 | 27 open _∧_ |
213
22d435172d1a
separate logic and nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
210
diff
changeset
|
28 open _∨_ |
22d435172d1a
separate logic and nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
210
diff
changeset
|
29 open Bool |
44
fcac01485f32
od→lv : {n : Level} → OD {n} → Nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
43
diff
changeset
|
30 |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
31 record _==_ ( a b : OD ) : Set n where |
43
0d9b9db14361
equalitu and internal parametorisity
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
42
diff
changeset
|
32 field |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
33 eq→ : ∀ { x : Ordinal } → def a x → def b x |
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
34 eq← : ∀ { x : Ordinal } → def b x → def a x |
43
0d9b9db14361
equalitu and internal parametorisity
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
42
diff
changeset
|
35 |
234
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
36 id : {A : Set n} → A → A |
43
0d9b9db14361
equalitu and internal parametorisity
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
42
diff
changeset
|
37 id x = x |
0d9b9db14361
equalitu and internal parametorisity
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
42
diff
changeset
|
38 |
271 | 39 ==-refl : { x : OD } → x == x |
40 ==-refl {x} = record { eq→ = id ; eq← = id } | |
43
0d9b9db14361
equalitu and internal parametorisity
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
42
diff
changeset
|
41 |
0d9b9db14361
equalitu and internal parametorisity
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
42
diff
changeset
|
42 open _==_ |
0d9b9db14361
equalitu and internal parametorisity
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
42
diff
changeset
|
43 |
271 | 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) } | |
43
0d9b9db14361
equalitu and internal parametorisity
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
42
diff
changeset
|
46 |
271 | 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 | |
43
0d9b9db14361
equalitu and internal parametorisity
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
42
diff
changeset
|
50 |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
51 ⇔→== : { x y : OD } → ( {z : Ordinal } → def x z ⇔ def y z) → x == y |
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
52 eq→ ( ⇔→== {x} {y} eq ) {z} m = proj1 eq m |
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
53 eq← ( ⇔→== {x} {y} eq ) {z} m = proj2 eq m |
120 | 54 |
179 | 55 -- Ordinal in OD ( and ZFSet ) Transitive Set |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
56 Ord : ( a : Ordinal ) → OD |
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
57 Ord a = record { def = λ y → y o< a } |
109
dab56d357fa3
remove o<→c< and add otrans in OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
103
diff
changeset
|
58 |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
59 od∅ : OD |
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
60 od∅ = Ord o∅ |
40 | 61 |
258 | 62 -- next assumptions are our axiom |
63 -- it defines a subset of OD, which is called HOD, usually defined as | |
64 -- HOD = { x | TC x ⊆ OD } | |
65 -- where TC x is a transitive clusure of x, i.e. Union of all elemnts of all subset of x | |
66 | |
29
fce60b99dc55
posturate OD is isomorphic to Ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
28
diff
changeset
|
67 postulate |
141 | 68 -- OD can be iso to a subset of Ordinal ( by means of Godel Set ) |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
69 od→ord : OD → Ordinal |
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
70 ord→od : Ordinal → OD |
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
71 c<→o< : {x y : OD } → def y ( od→ord x ) → od→ord x o< od→ord y |
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
72 oiso : {x : OD } → ord→od ( od→ord x ) ≡ x |
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
73 diso : {x : Ordinal } → od→ord ( ord→od x ) ≡ x |
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
74 ==→o≡ : { x y : OD } → (x == y) → x ≡ y |
258 | 75 -- next assumption causes ∀ x ∋ ∅ . It menas only an ordinal is allowed as OD |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
76 -- o<→c< : {n : Level} {x y : Ordinal } → x o< y → def (ord→od y) x |
159 | 77 -- ord→od x ≡ Ord x results the same |
271 | 78 -- supermum as Replacement Axiom ( this assumes Ordinal has some upper bound ) |
260
8b85949bde00
sup with limit give up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
259
diff
changeset
|
79 sup-o : ( Ordinal → Ordinal ) → Ordinal |
8b85949bde00
sup with limit give up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
259
diff
changeset
|
80 sup-o< : { ψ : Ordinal → Ordinal } → ∀ {x : Ordinal } → ψ x o< sup-o ψ |
111 | 81 -- contra-position of mimimulity of supermum required in Power Set Axiom |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
82 -- sup-x : {n : Level } → ( Ordinal → Ordinal ) → Ordinal |
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
83 -- sup-lb : {n : Level } → { ψ : Ordinal → Ordinal } → {z : Ordinal } → z o< sup-o ψ → z o< osuc (ψ (sup-x ψ)) |
258 | 84 -- mimimul and x∋minimal is an Axiom of choice |
85 minimal : (x : OD ) → ¬ (x == od∅ )→ OD | |
117 | 86 -- this should be ¬ (x == od∅ )→ ∃ ox → x ∋ Ord ox ( minimum of x ) |
258 | 87 x∋minimal : (x : OD ) → ( ne : ¬ (x == od∅ ) ) → def x ( od→ord ( minimal x ne ) ) |
88 -- minimality (may proved by ε-induction ) | |
89 minimal-1 : (x : OD ) → ( ne : ¬ (x == od∅ ) ) → (y : OD ) → ¬ ( def (minimal x ne) (od→ord y)) ∧ (def x (od→ord y) ) | |
90 | |
91 o<→c<→OD=Ord : ( {x y : Ordinal } → x o< y → def (ord→od y) x ) → {x : OD } → x ≡ Ord (od→ord x) | |
92 o<→c<→OD=Ord o<→c< {x} = ==→o≡ ( record { eq→ = lemma1 ; eq← = lemma2 } ) where | |
93 lemma1 : {y : Ordinal} → def x y → def (Ord (od→ord x)) y | |
94 lemma1 {y} lt = subst ( λ k → k o< od→ord x ) diso (c<→o< {ord→od y} {x} (subst (λ k → def x k ) (sym diso) lt)) | |
95 lemma2 : {y : Ordinal} → def (Ord (od→ord x)) y → def x y | |
96 lemma2 {y} lt = subst (λ k → def k y ) oiso (o<→c< {y} {od→ord x} lt ) | |
123 | 97 |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
98 _∋_ : ( a x : OD ) → Set n |
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
99 _∋_ a x = def a ( od→ord x ) |
95 | 100 |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
101 _c<_ : ( x a : OD ) → Set n |
109
dab56d357fa3
remove o<→c< and add otrans in OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
103
diff
changeset
|
102 x c< a = a ∋ x |
103 | 103 |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
104 cseq : {n : Level} → OD → OD |
140
312e27aa3cb5
remove otrans again. start over
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
139
diff
changeset
|
105 cseq x = record { def = λ y → def x (osuc y) } where |
113 | 106 |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
107 def-subst : {Z : OD } {X : Ordinal }{z : OD } {x : Ordinal }→ def Z X → Z ≡ z → X ≡ x → def z x |
95 | 108 def-subst df refl refl = df |
109 | |
260
8b85949bde00
sup with limit give up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
259
diff
changeset
|
110 sup-od : ( OD → OD ) → OD |
8b85949bde00
sup with limit give up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
259
diff
changeset
|
111 sup-od ψ = Ord ( sup-o ( λ x → od→ord (ψ (ord→od x ))) ) |
95 | 112 |
260
8b85949bde00
sup with limit give up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
259
diff
changeset
|
113 sup-c< : ( ψ : OD → OD ) → ∀ {x : OD } → def ( sup-od ψ ) (od→ord ( ψ x )) |
8b85949bde00
sup with limit give up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
259
diff
changeset
|
114 sup-c< ψ {x} = def-subst {_} {_} {Ord ( sup-o ( λ x → od→ord (ψ (ord→od x ))) )} {od→ord ( ψ x )} |
109
dab56d357fa3
remove o<→c< and add otrans in OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
103
diff
changeset
|
115 lemma refl (cong ( λ k → od→ord (ψ k) ) oiso) where |
260
8b85949bde00
sup with limit give up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
259
diff
changeset
|
116 lemma : od→ord (ψ (ord→od (od→ord x))) o< sup-o (λ x → od→ord (ψ (ord→od x))) |
8b85949bde00
sup with limit give up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
259
diff
changeset
|
117 lemma = subst₂ (λ j k → j o< k ) refl diso (o<-subst (sup-o< ) refl (sym diso) ) |
28 | 118 |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
119 otrans : {n : Level} {a x y : Ordinal } → def (Ord a) x → def (Ord x) y → def (Ord a) y |
187 | 120 otrans x<a y<x = ordtrans y<x x<a |
123 | 121 |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
122 def→o< : {X : OD } → {x : Ordinal } → def X x → x o< od→ord X |
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
123 def→o< {X} {x} lt = o<-subst {_} {_} {x} {od→ord X} ( c<→o< ( def-subst {X} {x} lt (sym oiso) (sym diso) )) diso diso |
44
fcac01485f32
od→lv : {n : Level} → OD {n} → Nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
43
diff
changeset
|
124 |
258 | 125 |
51 | 126 -- avoiding lv != Zero error |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
127 orefl : { x : OD } → { y : Ordinal } → od→ord x ≡ y → od→ord x ≡ y |
51 | 128 orefl refl = refl |
129 | |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
130 ==-iso : { x y : OD } → ord→od (od→ord x) == ord→od (od→ord y) → x == y |
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
131 ==-iso {x} {y} eq = record { |
51 | 132 eq→ = λ d → lemma ( eq→ eq (def-subst d (sym oiso) refl )) ; |
133 eq← = λ d → lemma ( eq← eq (def-subst d (sym oiso) refl )) } | |
134 where | |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
135 lemma : {x : OD } {z : Ordinal } → def (ord→od (od→ord x)) z → def x z |
51 | 136 lemma {x} {z} d = def-subst d oiso refl |
137 | |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
138 =-iso : {x y : OD } → (x == y) ≡ (ord→od (od→ord x) == y) |
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
139 =-iso {_} {y} = cong ( λ k → k == y ) (sym oiso) |
57 | 140 |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
141 ord→== : { x y : OD } → od→ord x ≡ od→ord y → x == y |
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
142 ord→== {x} {y} eq = ==-iso (lemma (od→ord x) (od→ord y) (orefl eq)) where |
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
143 lemma : ( ox oy : Ordinal ) → ox ≡ oy → (ord→od ox) == (ord→od oy) |
271 | 144 lemma ox ox refl = ==-refl |
51 | 145 |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
146 o≡→== : { x y : Ordinal } → x ≡ y → ord→od x == ord→od y |
271 | 147 o≡→== {x} {.x} refl = ==-refl |
51 | 148 |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
149 o∅≡od∅ : ord→od (o∅ ) ≡ od∅ |
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
150 o∅≡od∅ = ==→o≡ lemma where |
150 | 151 lemma0 : {x : Ordinal} → def (ord→od o∅) x → def od∅ x |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
152 lemma0 {x} lt = o<-subst (c<→o< {ord→od x} {ord→od o∅} (def-subst {ord→od o∅} {x} lt refl (sym diso)) ) diso diso |
150 | 153 lemma1 : {x : Ordinal} → def od∅ x → def (ord→od o∅) x |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
154 lemma1 {x} lt = ⊥-elim (¬x<0 lt) |
150 | 155 lemma : ord→od o∅ == od∅ |
156 lemma = record { eq→ = lemma0 ; eq← = lemma1 } | |
157 | |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
158 ord-od∅ : od→ord (od∅ ) ≡ o∅ |
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
159 ord-od∅ = sym ( subst (λ k → k ≡ od→ord (od∅ ) ) diso (cong ( λ k → od→ord k ) o∅≡od∅ ) ) |
80 | 160 |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
161 ∅0 : record { def = λ x → Lift n ⊥ } == od∅ |
109
dab56d357fa3
remove o<→c< and add otrans in OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
103
diff
changeset
|
162 eq→ ∅0 {w} (lift ()) |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
163 eq← ∅0 {w} lt = lift (¬x<0 lt) |
109
dab56d357fa3
remove o<→c< and add otrans in OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
103
diff
changeset
|
164 |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
165 ∅< : { x y : OD } → def x (od→ord y ) → ¬ ( x == od∅ ) |
271 | 166 ∅< {x} {y} d eq with eq→ (==-trans eq (==-sym ∅0) ) d |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
167 ∅< {x} {y} d eq | lift () |
57 | 168 |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
169 ∅6 : { x : OD } → ¬ ( x ∋ x ) -- no Russel paradox |
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
170 ∅6 {x} x∋x = o<¬≡ refl ( c<→o< {x} {x} x∋x ) |
51 | 171 |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
172 def-iso : {A B : OD } {x y : Ordinal } → x ≡ y → (def A y → def B y) → def A x → def B x |
76 | 173 def-iso refl t = t |
174 | |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
175 is-o∅ : ( x : Ordinal ) → Dec ( x ≡ o∅ ) |
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
176 is-o∅ x with trio< x o∅ |
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
177 is-o∅ x | tri< a ¬b ¬c = no ¬b |
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
178 is-o∅ x | tri≈ ¬a b ¬c = yes b |
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
179 is-o∅ x | tri> ¬a ¬b c = no ¬b |
57 | 180 |
254 | 181 _,_ : OD → OD → OD |
182 x , y = record { def = λ t → (t ≡ od→ord x ) ∨ ( t ≡ od→ord y ) } -- Ord (omax (od→ord x) (od→ord y)) | |
183 <_,_> : (x y : OD) → OD | |
184 < x , y > = (x , x ) , (x , y ) | |
185 | |
186 exg-pair : { x y : OD } → (x , y ) == ( y , x ) | |
187 exg-pair {x} {y} = record { eq→ = left ; eq← = right } where | |
188 left : {z : Ordinal} → def (x , y) z → def (y , x) z | |
189 left (case1 t) = case2 t | |
190 left (case2 t) = case1 t | |
191 right : {z : Ordinal} → def (y , x) z → def (x , y) z | |
192 right (case1 t) = case2 t | |
193 right (case2 t) = case1 t | |
194 | |
195 ord≡→≡ : { x y : OD } → od→ord x ≡ od→ord y → x ≡ y | |
196 ord≡→≡ eq = subst₂ (λ j k → j ≡ k ) oiso oiso ( cong ( λ k → ord→od k ) eq ) | |
197 | |
198 od≡→≡ : { x y : Ordinal } → ord→od x ≡ ord→od y → x ≡ y | |
199 od≡→≡ eq = subst₂ (λ j k → j ≡ k ) diso diso ( cong ( λ k → od→ord k ) eq ) | |
200 | |
201 eq-prod : { x x' y y' : OD } → x ≡ x' → y ≡ y' → < x , y > ≡ < x' , y' > | |
202 eq-prod refl refl = refl | |
203 | |
204 prod-eq : { x x' y y' : OD } → < x , y > == < x' , y' > → (x ≡ x' ) ∧ ( y ≡ y' ) | |
205 prod-eq {x} {x'} {y} {y'} eq = record { proj1 = lemmax ; proj2 = lemmay } where | |
206 lemma0 : {x y z : OD } → ( x , x ) == ( z , y ) → x ≡ y | |
207 lemma0 {x} {y} eq with trio< (od→ord x) (od→ord y) | |
208 lemma0 {x} {y} eq | tri< a ¬b ¬c with eq← eq {od→ord y} (case2 refl) | |
209 lemma0 {x} {y} eq | tri< a ¬b ¬c | case1 s = ⊥-elim ( o<¬≡ (sym s) a ) | |
210 lemma0 {x} {y} eq | tri< a ¬b ¬c | case2 s = ⊥-elim ( o<¬≡ (sym s) a ) | |
211 lemma0 {x} {y} eq | tri≈ ¬a b ¬c = ord≡→≡ b | |
212 lemma0 {x} {y} eq | tri> ¬a ¬b c with eq← eq {od→ord y} (case2 refl) | |
213 lemma0 {x} {y} eq | tri> ¬a ¬b c | case1 s = ⊥-elim ( o<¬≡ s c ) | |
214 lemma0 {x} {y} eq | tri> ¬a ¬b c | case2 s = ⊥-elim ( o<¬≡ s c ) | |
215 lemma2 : {x y z : OD } → ( x , x ) == ( z , y ) → z ≡ y | |
216 lemma2 {x} {y} {z} eq = trans (sym (lemma0 lemma3 )) ( lemma0 eq ) where | |
217 lemma3 : ( x , x ) == ( y , z ) | |
218 lemma3 = ==-trans eq exg-pair | |
219 lemma1 : {x y : OD } → ( x , x ) == ( y , y ) → x ≡ y | |
220 lemma1 {x} {y} eq with eq← eq {od→ord y} (case2 refl) | |
221 lemma1 {x} {y} eq | case1 s = ord≡→≡ (sym s) | |
222 lemma1 {x} {y} eq | case2 s = ord≡→≡ (sym s) | |
223 lemma4 : {x y z : OD } → ( x , y ) == ( x , z ) → y ≡ z | |
224 lemma4 {x} {y} {z} eq with eq← eq {od→ord z} (case2 refl) | |
225 lemma4 {x} {y} {z} eq | case1 s with ord≡→≡ s -- x ≡ z | |
226 ... | refl with lemma2 (==-sym eq ) | |
227 ... | refl = refl | |
228 lemma4 {x} {y} {z} eq | case2 s = ord≡→≡ (sym s) -- y ≡ z | |
229 lemmax : x ≡ x' | |
230 lemmax with eq→ eq {od→ord (x , x)} (case1 refl) | |
231 lemmax | case1 s = lemma1 (ord→== s ) -- (x,x)≡(x',x') | |
232 lemmax | case2 s with lemma2 (ord→== s ) -- (x,x)≡(x',y') with x'≡y' | |
233 ... | refl = lemma1 (ord→== s ) | |
234 lemmay : y ≡ y' | |
235 lemmay with lemmax | |
236 ... | refl with lemma4 eq -- with (x,y)≡(x,y') | |
237 ... | eq1 = lemma4 (ord→== (cong (λ k → od→ord k ) eq1 )) | |
238 | |
257 | 239 data ord-pair : (p : Ordinal) → Set n where |
240 pair : (x y : Ordinal ) → ord-pair ( od→ord ( < ord→od x , ord→od y > ) ) | |
241 | |
242 ZFProduct : OD | |
243 ZFProduct = record { def = λ x → ord-pair x } | |
244 | |
245 -- open import Relation.Binary.HeterogeneousEquality as HE using (_≅_ ) | |
246 -- eq-pair : { x x' y y' : Ordinal } → x ≡ x' → y ≡ y' → pair x y ≅ pair x' y' | |
247 -- eq-pair refl refl = HE.refl | |
248 | |
249 pi1 : { p : Ordinal } → ord-pair p → Ordinal | |
250 pi1 ( pair x y) = x | |
251 | |
252 π1 : { p : OD } → ZFProduct ∋ p → OD | |
253 π1 lt = ord→od (pi1 lt ) | |
254 | |
255 pi2 : { p : Ordinal } → ord-pair p → Ordinal | |
256 pi2 ( pair x y ) = y | |
257 | |
258 π2 : { p : OD } → ZFProduct ∋ p → OD | |
259 π2 lt = ord→od (pi2 lt ) | |
260 | |
261 op-cons : { ox oy : Ordinal } → ZFProduct ∋ < ord→od ox , ord→od oy > | |
262 op-cons {ox} {oy} = pair ox oy | |
263 | |
264 p-cons : ( x y : OD ) → ZFProduct ∋ < x , y > | |
265 p-cons x y = def-subst {_} {_} {ZFProduct} {od→ord (< x , y >)} (pair (od→ord x) ( od→ord y )) refl ( | |
266 let open ≡-Reasoning in begin | |
267 od→ord < ord→od (od→ord x) , ord→od (od→ord y) > | |
268 ≡⟨ cong₂ (λ j k → od→ord < j , k >) oiso oiso ⟩ | |
269 od→ord < x , y > | |
270 ∎ ) | |
271 | |
272 op-iso : { op : Ordinal } → (q : ord-pair op ) → od→ord < ord→od (pi1 q) , ord→od (pi2 q) > ≡ op | |
273 op-iso (pair ox oy) = refl | |
274 | |
275 p-iso : { x : OD } → (p : ZFProduct ∋ x ) → < π1 p , π2 p > ≡ x | |
276 p-iso {x} p = ord≡→≡ (op-iso p) | |
277 | |
278 p-pi1 : { x y : OD } → (p : ZFProduct ∋ < x , y > ) → π1 p ≡ x | |
279 p-pi1 {x} {y} p = proj1 ( prod-eq ( ord→== (op-iso p) )) | |
280 | |
281 p-pi2 : { x y : OD } → (p : ZFProduct ∋ < x , y > ) → π2 p ≡ y | |
282 p-pi2 {x} {y} p = proj2 ( prod-eq ( ord→== (op-iso p))) | |
188
1f2c8b094908
axiom of choice → p ∨ ¬ p
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
187
diff
changeset
|
283 |
189
540b845ea2de
Axiom of choies implies p ∨ ( ¬ p )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
188
diff
changeset
|
284 -- |
540b845ea2de
Axiom of choies implies p ∨ ( ¬ p )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
188
diff
changeset
|
285 -- Axiom of choice in intutionistic logic implies the exclude middle |
540b845ea2de
Axiom of choies implies p ∨ ( ¬ p )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
188
diff
changeset
|
286 -- https://plato.stanford.edu/entries/axiom-choice/#AxiChoLog |
540b845ea2de
Axiom of choies implies p ∨ ( ¬ p )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
188
diff
changeset
|
287 -- |
257 | 288 |
289 ppp : { p : Set n } { a : OD } → record { def = λ x → p } ∋ a → p | |
290 ppp {p} {a} d = d | |
291 | |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
292 p∨¬p : ( p : Set n ) → p ∨ ( ¬ p ) -- assuming axiom of choice |
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
293 p∨¬p p with is-o∅ ( od→ord ( record { def = λ x → p } )) |
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
294 p∨¬p p | yes eq = case2 (¬p eq) where |
189
540b845ea2de
Axiom of choies implies p ∨ ( ¬ p )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
188
diff
changeset
|
295 ps = record { def = λ x → p } |
540b845ea2de
Axiom of choies implies p ∨ ( ¬ p )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
188
diff
changeset
|
296 lemma : ps == od∅ → p → ⊥ |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
297 lemma eq p0 = ¬x<0 {od→ord ps} (eq→ eq p0 ) |
189
540b845ea2de
Axiom of choies implies p ∨ ( ¬ p )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
188
diff
changeset
|
298 ¬p : (od→ord ps ≡ o∅) → p → ⊥ |
540b845ea2de
Axiom of choies implies p ∨ ( ¬ p )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
188
diff
changeset
|
299 ¬p eq = lemma ( subst₂ (λ j k → j == k ) oiso o∅≡od∅ ( o≡→== eq )) |
258 | 300 p∨¬p p | no ¬p = case1 (ppp {p} {minimal ps (λ eq → ¬p (eqo∅ eq))} lemma) where |
189
540b845ea2de
Axiom of choies implies p ∨ ( ¬ p )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
188
diff
changeset
|
301 ps = record { def = λ x → p } |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
302 eqo∅ : ps == od∅ → od→ord ps ≡ o∅ |
188
1f2c8b094908
axiom of choice → p ∨ ¬ p
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
187
diff
changeset
|
303 eqo∅ eq = subst (λ k → od→ord ps ≡ k) ord-od∅ ( cong (λ k → od→ord k ) (==→o≡ eq)) |
258 | 304 lemma : ps ∋ minimal ps (λ eq → ¬p (eqo∅ eq)) |
305 lemma = x∋minimal ps (λ eq → ¬p (eqo∅ eq)) | |
188
1f2c8b094908
axiom of choice → p ∨ ¬ p
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
187
diff
changeset
|
306 |
234
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
307 decp : ( p : Set n ) → Dec p -- assuming axiom of choice |
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
308 decp p with p∨¬p p |
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
309 decp p | case1 x = yes x |
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
310 decp p | case2 x = no x |
189
540b845ea2de
Axiom of choies implies p ∨ ( ¬ p )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
188
diff
changeset
|
311 |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
312 double-neg-eilm : {A : Set n} → ¬ ¬ A → A -- we don't have this in intutionistic logic |
234
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
313 double-neg-eilm {A} notnot with decp A -- assuming axiom of choice |
189
540b845ea2de
Axiom of choies implies p ∨ ( ¬ p )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
188
diff
changeset
|
314 ... | yes p = p |
540b845ea2de
Axiom of choies implies p ∨ ( ¬ p )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
188
diff
changeset
|
315 ... | no ¬p = ⊥-elim ( notnot ¬p ) |
540b845ea2de
Axiom of choies implies p ∨ ( ¬ p )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
188
diff
changeset
|
316 |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
317 OrdP : ( x : Ordinal ) ( y : OD ) → Dec ( Ord x ∋ y ) |
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
318 OrdP x y with trio< x (od→ord y) |
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
319 OrdP x y | tri< a ¬b ¬c = no ¬c |
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
320 OrdP x y | tri≈ ¬a refl ¬c = no ( o<¬≡ refl ) |
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
321 OrdP x y | tri> ¬a ¬b c = yes c |
119 | 322 |
79 | 323 -- open import Relation.Binary.HeterogeneousEquality as HE using (_≅_ ) |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
324 -- postulate f-extensionality : { n : Level} → Relation.Binary.PropositionalEquality.Extensionality n (suc n) |
59
d13d1351a1fa
lemma = cong₂ (λ x not → minimul x not ) oiso { }6
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
58
diff
changeset
|
325 |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
326 in-codomain : (X : OD ) → ( ψ : OD → OD ) → OD |
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
327 in-codomain X ψ = record { def = λ x → ¬ ( (y : Ordinal ) → ¬ ( def X y ∧ ( x ≡ od→ord (ψ (ord→od y ))))) } |
141 | 328 |
96 | 329 -- Power Set of X ( or constructible by λ y → def X (od→ord y ) |
97
f2b579106770
power set using sup on Def
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
96
diff
changeset
|
330 |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
331 ZFSubset : (A x : OD ) → OD |
191
9eb6a8691f02
choice function cannot jump between ordinal level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
190
diff
changeset
|
332 ZFSubset A x = record { def = λ y → def A y ∧ def x y } -- roughly x = A → Set |
97
f2b579106770
power set using sup on Def
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
96
diff
changeset
|
333 |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
334 Def : (A : OD ) → OD |
260
8b85949bde00
sup with limit give up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
259
diff
changeset
|
335 Def A = Ord ( sup-o ( λ x → od→ord ( ZFSubset A (ord→od x )) ) ) |
190 | 336 |
271 | 337 -- _⊆_ : ( A B : OD ) → ∀{ x : OD } → Set n |
338 -- _⊆_ A B {x} = A ∋ x → B ∋ x | |
339 | |
340 record _⊆_ ( A B : OD ) : Set (suc n) where | |
341 field | |
342 incl : { x : OD } → A ∋ x → B ∋ x | |
343 | |
344 open _⊆_ | |
190 | 345 |
346 infixr 220 _⊆_ | |
347 | |
271 | 348 subset-lemma : {A x : OD } → ( {y : OD } → x ∋ y → ZFSubset A x ∋ y ) ⇔ ( x ⊆ A ) |
349 subset-lemma {A} {x} = record { | |
350 proj1 = λ lt → record { incl = λ x∋z → proj1 (lt x∋z) } | |
351 ; proj2 = λ x⊆A lt → record { proj1 = incl x⊆A lt ; proj2 = lt } | |
190 | 352 } |
353 | |
261
d9d178d1457c
ε-induction from TransFinite induction
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
260
diff
changeset
|
354 open import Data.Unit |
d9d178d1457c
ε-induction from TransFinite induction
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
260
diff
changeset
|
355 |
d9d178d1457c
ε-induction from TransFinite induction
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
260
diff
changeset
|
356 ε-induction : { ψ : OD → Set (suc n)} |
d9d178d1457c
ε-induction from TransFinite induction
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
260
diff
changeset
|
357 → ( {x : OD } → ({ y : OD } → x ∋ y → ψ y ) → ψ x ) |
d9d178d1457c
ε-induction from TransFinite induction
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
260
diff
changeset
|
358 → (x : OD ) → ψ x |
d9d178d1457c
ε-induction from TransFinite induction
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
260
diff
changeset
|
359 ε-induction {ψ} ind x = subst (λ k → ψ k ) oiso (ε-induction-ord (osuc (od→ord x)) <-osuc ) where |
d9d178d1457c
ε-induction from TransFinite induction
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
260
diff
changeset
|
360 induction : (ox : Ordinal) → ((oy : Ordinal) → oy o< ox → ψ (ord→od oy)) → ψ (ord→od ox) |
d9d178d1457c
ε-induction from TransFinite induction
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
260
diff
changeset
|
361 induction ox prev = ind ( λ {y} lt → subst (λ k → ψ k ) oiso (prev (od→ord y) (o<-subst (c<→o< lt) refl diso ))) |
d9d178d1457c
ε-induction from TransFinite induction
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
260
diff
changeset
|
362 ε-induction-ord : (ox : Ordinal) { oy : Ordinal } → oy o< ox → ψ (ord→od oy) |
d9d178d1457c
ε-induction from TransFinite induction
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
260
diff
changeset
|
363 ε-induction-ord ox {oy} lt = TransFinite {λ oy → ψ (ord→od oy)} induction oy |
d9d178d1457c
ε-induction from TransFinite induction
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
260
diff
changeset
|
364 |
262 | 365 -- minimal-2 : (x : OD ) → ( ne : ¬ (x == od∅ ) ) → (y : OD ) → ¬ ( def (minimal x ne) (od→ord y)) ∧ (def x (od→ord y) ) |
366 -- minimal-2 x ne y = contra-position ( ε-induction (λ {z} ind → {!!} ) x ) ( λ p → {!!} ) | |
367 | |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
368 OD→ZF : ZF |
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
369 OD→ZF = record { |
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
370 ZFSet = OD |
43
0d9b9db14361
equalitu and internal parametorisity
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
42
diff
changeset
|
371 ; _∋_ = _∋_ |
0d9b9db14361
equalitu and internal parametorisity
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
42
diff
changeset
|
372 ; _≈_ = _==_ |
29
fce60b99dc55
posturate OD is isomorphic to Ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
28
diff
changeset
|
373 ; ∅ = od∅ |
28 | 374 ; _,_ = _,_ |
375 ; Union = Union | |
29
fce60b99dc55
posturate OD is isomorphic to Ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
28
diff
changeset
|
376 ; Power = Power |
28 | 377 ; Select = Select |
378 ; Replace = Replace | |
161 | 379 ; infinite = infinite |
29
fce60b99dc55
posturate OD is isomorphic to Ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
28
diff
changeset
|
380 ; isZF = isZF |
28 | 381 } where |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
382 ZFSet = OD |
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
383 Select : (X : OD ) → ((x : OD ) → Set n ) → OD |
156
3e7475fb28db
differeent Union approach
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
384 Select X ψ = record { def = λ x → ( def X x ∧ ψ ( ord→od x )) } |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
385 Replace : OD → (OD → OD ) → OD |
260
8b85949bde00
sup with limit give up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
259
diff
changeset
|
386 Replace X ψ = record { def = λ x → (x o< sup-o ( λ x → od→ord (ψ (ord→od x )))) ∧ def (in-codomain X ψ) x } |
144 | 387 _∩_ : ( A B : ZFSet ) → ZFSet |
145 | 388 A ∩ B = record { def = λ x → def A x ∧ def B x } |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
389 Union : OD → OD |
156
3e7475fb28db
differeent Union approach
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
390 Union U = record { def = λ x → ¬ (∀ (u : Ordinal ) → ¬ ((def U u) ∧ (def (ord→od u) x))) } |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
391 _∈_ : ( A B : ZFSet ) → Set n |
29
fce60b99dc55
posturate OD is isomorphic to Ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
28
diff
changeset
|
392 A ∈ B = B ∋ A |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
393 Power : OD → OD |
129 | 394 Power A = Replace (Def (Ord (od→ord A))) ( λ x → A ∩ x ) |
103 | 395 {_} : ZFSet → ZFSet |
396 { x } = ( x , x ) | |
109
dab56d357fa3
remove o<→c< and add otrans in OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
103
diff
changeset
|
397 |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
398 data infinite-d : ( x : Ordinal ) → Set n where |
161 | 399 iφ : infinite-d o∅ |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
400 isuc : {x : Ordinal } → infinite-d x → |
161 | 401 infinite-d (od→ord ( Union (ord→od x , (ord→od x , ord→od x ) ) )) |
402 | |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
403 infinite : OD |
161 | 404 infinite = record { def = λ x → infinite-d x } |
405 | |
29
fce60b99dc55
posturate OD is isomorphic to Ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
28
diff
changeset
|
406 infixr 200 _∈_ |
96 | 407 -- infixr 230 _∩_ _∪_ |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
408 isZF : IsZF (OD ) _∋_ _==_ od∅ _,_ Union Power Select Replace infinite |
29
fce60b99dc55
posturate OD is isomorphic to Ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
28
diff
changeset
|
409 isZF = record { |
271 | 410 isEquivalence = record { refl = ==-refl ; sym = ==-sym; trans = ==-trans } |
247 | 411 ; pair→ = pair→ |
412 ; pair← = pair← | |
72 | 413 ; union→ = union→ |
414 ; union← = union← | |
29
fce60b99dc55
posturate OD is isomorphic to Ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
28
diff
changeset
|
415 ; empty = empty |
129 | 416 ; power→ = power→ |
76 | 417 ; power← = power← |
186 | 418 ; extensionality = λ {A} {B} {w} → extensionality {A} {B} {w} |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
419 -- ; ε-induction = {!!} |
78
9a7a64b2388c
infinite and replacement begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
77
diff
changeset
|
420 ; infinity∅ = infinity∅ |
160 | 421 ; infinity = infinity |
116 | 422 ; selection = λ {X} {ψ} {y} → selection {X} {ψ} {y} |
135 | 423 ; replacement← = replacement← |
424 ; replacement→ = replacement→ | |
183 | 425 ; choice-func = choice-func |
426 ; choice = choice | |
29
fce60b99dc55
posturate OD is isomorphic to Ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
28
diff
changeset
|
427 } where |
129 | 428 |
247 | 429 pair→ : ( x y t : ZFSet ) → (x , y) ∋ t → ( t == x ) ∨ ( t == y ) |
430 pair→ x y t (case1 t≡x ) = case1 (subst₂ (λ j k → j == k ) oiso oiso (o≡→== t≡x )) | |
431 pair→ x y t (case2 t≡y ) = case2 (subst₂ (λ j k → j == k ) oiso oiso (o≡→== t≡y )) | |
432 | |
433 pair← : ( x y t : ZFSet ) → ( t == x ) ∨ ( t == y ) → (x , y) ∋ t | |
434 pair← x y t (case1 t==x) = case1 (cong (λ k → od→ord k ) (==→o≡ t==x)) | |
435 pair← x y t (case2 t==y) = case2 (cong (λ k → od→ord k ) (==→o≡ t==y)) | |
436 | |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
437 empty : (x : OD ) → ¬ (od∅ ∋ x) |
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
438 empty x = ¬x<0 |
129 | 439 |
271 | 440 o<→c< : {x y : Ordinal } → x o< y → (Ord x) ⊆ (Ord y) |
441 o<→c< lt = record { incl = λ z → ordtrans z lt } | |
155 | 442 |
271 | 443 ⊆→o< : {x y : Ordinal } → (Ord x) ⊆ (Ord y) → x o< osuc y |
155 | 444 ⊆→o< {x} {y} lt with trio< x y |
445 ⊆→o< {x} {y} lt | tri< a ¬b ¬c = ordtrans a <-osuc | |
446 ⊆→o< {x} {y} lt | tri≈ ¬a b ¬c = subst ( λ k → k o< osuc y) (sym b) <-osuc | |
271 | 447 ⊆→o< {x} {y} lt | tri> ¬a ¬b c with (incl lt) (o<-subst c (sym diso) refl ) |
155 | 448 ... | ttt = ⊥-elim ( o<¬≡ refl (o<-subst ttt diso refl )) |
151 | 449 |
144 | 450 union→ : (X z u : OD) → (X ∋ u) ∧ (u ∋ z) → Union X ∋ z |
157
afc030b7c8d0
explict logical definition of Union failed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
156
diff
changeset
|
451 union→ X z u xx not = ⊥-elim ( not (od→ord u) ( record { proj1 = proj1 xx |
afc030b7c8d0
explict logical definition of Union failed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
156
diff
changeset
|
452 ; proj2 = subst ( λ k → def k (od→ord z)) (sym oiso) (proj2 xx) } )) |
159 | 453 union← : (X z : OD) (X∋z : Union X ∋ z) → ¬ ( (u : OD ) → ¬ ((X ∋ u) ∧ (u ∋ z ))) |
258 | 454 union← X z UX∋z = FExists _ lemma UX∋z where |
165 | 455 lemma : {y : Ordinal} → def X y ∧ def (ord→od y) (od→ord z) → ¬ ((u : OD) → ¬ (X ∋ u) ∧ (u ∋ z)) |
456 lemma {y} xx not = not (ord→od y) record { proj1 = subst ( λ k → def X k ) (sym diso) (proj1 xx ) ; proj2 = proj2 xx } | |
144 | 457 |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
458 ψiso : {ψ : OD → Set n} {x y : OD } → ψ x → x ≡ y → ψ y |
144 | 459 ψiso {ψ} t refl = t |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
460 selection : {ψ : OD → Set n} {X y : OD} → ((X ∋ y) ∧ ψ y) ⇔ (Select X ψ ∋ y) |
144 | 461 selection {ψ} {X} {y} = record { |
462 proj1 = λ cond → record { proj1 = proj1 cond ; proj2 = ψiso {ψ} (proj2 cond) (sym oiso) } | |
463 ; proj2 = λ select → record { proj1 = proj1 select ; proj2 = ψiso {ψ} (proj2 select) oiso } | |
464 } | |
465 replacement← : {ψ : OD → OD} (X x : OD) → X ∋ x → Replace X ψ ∋ ψ x | |
260
8b85949bde00
sup with limit give up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
259
diff
changeset
|
466 replacement← {ψ} X x lt = record { proj1 = sup-c< ψ {x} ; proj2 = lemma } where |
144 | 467 lemma : def (in-codomain X ψ) (od→ord (ψ x)) |
150 | 468 lemma not = ⊥-elim ( not ( od→ord x ) (record { proj1 = lt ; proj2 = cong (λ k → od→ord (ψ k)) (sym oiso)} )) |
144 | 469 replacement→ : {ψ : OD → OD} (X x : OD) → (lt : Replace X ψ ∋ x) → ¬ ( (y : OD) → ¬ (x == ψ y)) |
150 | 470 replacement→ {ψ} X x lt = contra-position lemma (lemma2 (proj2 lt)) where |
471 lemma2 : ¬ ((y : Ordinal) → ¬ def X y ∧ ((od→ord x) ≡ od→ord (ψ (ord→od y)))) | |
472 → ¬ ((y : Ordinal) → ¬ def X y ∧ (ord→od (od→ord x) == ψ (ord→od y))) | |
144 | 473 lemma2 not not2 = not ( λ y d → not2 y (record { proj1 = proj1 d ; proj2 = lemma3 (proj2 d)})) where |
150 | 474 lemma3 : {y : Ordinal } → (od→ord x ≡ od→ord (ψ (ord→od y))) → (ord→od (od→ord x) == ψ (ord→od y)) |
144 | 475 lemma3 {y} eq = subst (λ k → ord→od (od→ord x) == k ) oiso (o≡→== eq ) |
150 | 476 lemma : ( (y : OD) → ¬ (x == ψ y)) → ( (y : Ordinal) → ¬ def X y ∧ (ord→od (od→ord x) == ψ (ord→od y)) ) |
477 lemma not y not2 = not (ord→od y) (subst (λ k → k == ψ (ord→od y)) oiso ( proj2 not2 )) | |
144 | 478 |
479 --- | |
480 --- Power Set | |
481 --- | |
482 --- First consider ordinals in OD | |
100 | 483 --- |
484 --- ZFSubset A x = record { def = λ y → def A y ∧ def x y } subset of A | |
485 -- | |
486 -- | |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
487 ∩-≡ : { a b : OD } → ({x : OD } → (a ∋ x → b ∋ x)) → a == ( b ∩ a ) |
142 | 488 ∩-≡ {a} {b} inc = record { |
489 eq→ = λ {x} x<a → record { proj2 = x<a ; | |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
490 proj1 = def-subst {_} {_} {b} {x} (inc (def-subst {_} {_} {a} {_} x<a refl (sym diso) )) refl diso } ; |
142 | 491 eq← = λ {x} x<a∩b → proj2 x<a∩b } |
100 | 492 -- |
258 | 493 -- Transitive Set case |
494 -- we have t ∋ x → Ord a ∋ x means t is a subset of Ord a, that is ZFSubset (Ord a) t == t | |
495 -- Def (Ord a) is a sup of ZFSubset (Ord a) t, so Def (Ord a) ∋ t | |
496 -- Def A = Ord ( sup-o ( λ x → od→ord ( ZFSubset A (ord→od x )) ) ) | |
100 | 497 -- |
141 | 498 ord-power← : (a : Ordinal ) (t : OD) → ({x : OD} → (t ∋ x → (Ord a) ∋ x)) → Def (Ord a) ∋ t |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
499 ord-power← a t t→A = def-subst {_} {_} {Def (Ord a)} {od→ord t} |
127 | 500 lemma refl (lemma1 lemma-eq )where |
129 | 501 lemma-eq : ZFSubset (Ord a) t == t |
97
f2b579106770
power set using sup on Def
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
96
diff
changeset
|
502 eq→ lemma-eq {z} w = proj2 w |
f2b579106770
power set using sup on Def
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
96
diff
changeset
|
503 eq← lemma-eq {z} w = record { proj2 = w ; |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
504 proj1 = def-subst {_} {_} {(Ord a)} {z} |
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
505 ( t→A (def-subst {_} {_} {t} {od→ord (ord→od z)} w refl (sym diso) )) refl diso } |
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
506 lemma1 : {a : Ordinal } { t : OD } |
129 | 507 → (eq : ZFSubset (Ord a) t == t) → od→ord (ZFSubset (Ord a) (ord→od (od→ord t))) ≡ od→ord t |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
508 lemma1 {a} {t} eq = subst (λ k → od→ord (ZFSubset (Ord a) k) ≡ od→ord t ) (sym oiso) (cong (λ k → od→ord k ) (==→o≡ eq )) |
260
8b85949bde00
sup with limit give up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
259
diff
changeset
|
509 lemma : od→ord (ZFSubset (Ord a) (ord→od (od→ord t)) ) o< sup-o (λ x → od→ord (ZFSubset (Ord a) (ord→od x))) |
8b85949bde00
sup with limit give up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
259
diff
changeset
|
510 lemma = sup-o< |
129 | 511 |
144 | 512 -- |
258 | 513 -- Every set in OD is a subset of Ordinals, so make Def (Ord (od→ord A)) first |
514 -- then replace of all elements of the Power set by A ∩ y | |
144 | 515 -- |
142 | 516 -- Power A = Replace (Def (Ord (od→ord A))) ( λ y → A ∩ y ) |
166 | 517 |
518 -- we have oly double negation form because of the replacement axiom | |
519 -- | |
520 power→ : ( A t : OD) → Power A ∋ t → {x : OD} → t ∋ x → ¬ ¬ (A ∋ x) | |
258 | 521 power→ A t P∋t {x} t∋x = FExists _ lemma5 lemma4 where |
142 | 522 a = od→ord A |
523 lemma2 : ¬ ( (y : OD) → ¬ (t == (A ∩ y))) | |
524 lemma2 = replacement→ (Def (Ord (od→ord A))) t P∋t | |
166 | 525 lemma3 : (y : OD) → t == ( A ∩ y ) → ¬ ¬ (A ∋ x) |
526 lemma3 y eq not = not (proj1 (eq→ eq t∋x)) | |
142 | 527 lemma4 : ¬ ((y : Ordinal) → ¬ (t == (A ∩ ord→od y))) |
528 lemma4 not = lemma2 ( λ y not1 → not (od→ord y) (subst (λ k → t == ( A ∩ k )) (sym oiso) not1 )) | |
166 | 529 lemma5 : {y : Ordinal} → t == (A ∩ ord→od y) → ¬ ¬ (def A (od→ord x)) |
530 lemma5 {y} eq not = (lemma3 (ord→od y) eq) not | |
531 | |
142 | 532 power← : (A t : OD) → ({x : OD} → (t ∋ x → A ∋ x)) → Power A ∋ t |
533 power← A t t→A = record { proj1 = lemma1 ; proj2 = lemma2 } where | |
534 a = od→ord A | |
535 lemma0 : {x : OD} → t ∋ x → Ord a ∋ x | |
536 lemma0 {x} t∋x = c<→o< (t→A t∋x) | |
537 lemma3 : Def (Ord a) ∋ t | |
538 lemma3 = ord-power← a t lemma0 | |
152 | 539 lemma4 : (A ∩ ord→od (od→ord t)) ≡ t |
540 lemma4 = let open ≡-Reasoning in begin | |
541 A ∩ ord→od (od→ord t) | |
542 ≡⟨ cong (λ k → A ∩ k) oiso ⟩ | |
543 A ∩ t | |
544 ≡⟨ sym (==→o≡ ( ∩-≡ t→A )) ⟩ | |
545 t | |
546 ∎ | |
260
8b85949bde00
sup with limit give up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
259
diff
changeset
|
547 lemma1 : od→ord t o< sup-o (λ x → od→ord (A ∩ ord→od x)) |
8b85949bde00
sup with limit give up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
259
diff
changeset
|
548 lemma1 = subst (λ k → od→ord k o< sup-o (λ x → od→ord (A ∩ ord→od x))) |
8b85949bde00
sup with limit give up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
259
diff
changeset
|
549 lemma4 (sup-o< {λ x → od→ord (A ∩ ord→od x)} {od→ord t} ) |
142 | 550 lemma2 : def (in-codomain (Def (Ord (od→ord A))) (_∩_ A)) (od→ord t) |
151 | 551 lemma2 not = ⊥-elim ( not (od→ord t) (record { proj1 = lemma3 ; proj2 = lemma6 }) ) where |
552 lemma6 : od→ord t ≡ od→ord (A ∩ ord→od (od→ord t)) | |
553 lemma6 = cong ( λ k → od→ord k ) (==→o≡ (subst (λ k → t == (A ∩ k)) (sym oiso) ( ∩-≡ t→A ))) | |
142 | 554 |
271 | 555 ord⊆power : (a : Ordinal) → (Ord (osuc a)) ⊆ (Power (Ord a)) |
556 ord⊆power a = record { incl = λ {x} lt → power← (Ord a) x (lemma lt) } where | |
557 lemma : {x y : OD} → od→ord x o< osuc a → x ∋ y → Ord a ∋ y | |
558 lemma lt y<x with osuc-≡< lt | |
559 lemma lt y<x | case1 refl = c<→o< y<x | |
560 lemma lt y<x | case2 x<a = ordtrans (c<→o< y<x) x<a | |
262 | 561 |
271 | 562 -- continuum-hyphotheis : (a : Ordinal) → Power (Ord a) ⊆ Ord (osuc a) |
563 -- continuum-hyphotheis a = ? | |
262 | 564 |
190 | 565 -- assuming axiom of choice |
141 | 566 regularity : (x : OD) (not : ¬ (x == od∅)) → |
258 | 567 (x ∋ minimal x not) ∧ (Select (minimal x not) (λ x₁ → (minimal x not ∋ x₁) ∧ (x ∋ x₁)) == od∅) |
568 proj1 (regularity x not ) = x∋minimal x not | |
117 | 569 proj2 (regularity x not ) = record { eq→ = lemma1 ; eq← = λ {y} d → lemma2 {y} d } where |
258 | 570 lemma1 : {x₁ : Ordinal} → def (Select (minimal x not) (λ x₂ → (minimal x not ∋ x₂) ∧ (x ∋ x₂))) x₁ → def od∅ x₁ |
571 lemma1 {x₁} s = ⊥-elim ( minimal-1 x not (ord→od x₁) lemma3 ) where | |
572 lemma3 : def (minimal x not) (od→ord (ord→od x₁)) ∧ def x (od→ord (ord→od x₁)) | |
573 lemma3 = record { proj1 = def-subst {_} {_} {minimal x not} {_} (proj1 s) refl (sym diso) | |
142 | 574 ; proj2 = proj2 (proj2 s) } |
258 | 575 lemma2 : {x₁ : Ordinal} → def od∅ x₁ → def (Select (minimal x not) (λ x₂ → (minimal x not ∋ x₂) ∧ (x ∋ x₂))) x₁ |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
576 lemma2 {y} d = ⊥-elim (empty (ord→od y) (def-subst {_} {_} {od∅} {od→ord (ord→od y)} d refl (sym diso) )) |
129 | 577 |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
578 extensionality0 : {A B : OD } → ((z : OD) → (A ∋ z) ⇔ (B ∋ z)) → A == B |
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
579 eq→ (extensionality0 {A} {B} eq ) {x} d = def-iso {A} {B} (sym diso) (proj1 (eq (ord→od x))) d |
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
580 eq← (extensionality0 {A} {B} eq ) {x} d = def-iso {B} {A} (sym diso) (proj2 (eq (ord→od x))) d |
186 | 581 |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
582 extensionality : {A B w : OD } → ((z : OD ) → (A ∋ z) ⇔ (B ∋ z)) → (w ∋ A) ⇔ (w ∋ B) |
186 | 583 proj1 (extensionality {A} {B} {w} eq ) d = subst (λ k → w ∋ k) ( ==→o≡ (extensionality0 {A} {B} eq) ) d |
584 proj2 (extensionality {A} {B} {w} eq ) d = subst (λ k → w ∋ k) (sym ( ==→o≡ (extensionality0 {A} {B} eq) )) d | |
129 | 585 |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
586 infinity∅ : infinite ∋ od∅ |
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
587 infinity∅ = def-subst {_} {_} {infinite} {od→ord (od∅ )} iφ refl lemma where |
161 | 588 lemma : o∅ ≡ od→ord od∅ |
589 lemma = let open ≡-Reasoning in begin | |
590 o∅ | |
591 ≡⟨ sym diso ⟩ | |
592 od→ord ( ord→od o∅ ) | |
593 ≡⟨ cong ( λ k → od→ord k ) o∅≡od∅ ⟩ | |
594 od→ord od∅ | |
595 ∎ | |
596 infinity : (x : OD) → infinite ∋ x → infinite ∋ Union (x , (x , x )) | |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
597 infinity x lt = def-subst {_} {_} {infinite} {od→ord (Union (x , (x , x )))} ( isuc {od→ord x} lt ) refl lemma where |
161 | 598 lemma : od→ord (Union (ord→od (od→ord x) , (ord→od (od→ord x) , ord→od (od→ord x)))) |
599 ≡ od→ord (Union (x , (x , x))) | |
600 lemma = cong (λ k → od→ord (Union ( k , ( k , k ) ))) oiso | |
601 | |
258 | 602 -- Axiom of choice ( is equivalent to the existence of minimal in our case ) |
162 | 603 -- ∀ X [ ∅ ∉ X → (∃ f : X → ⋃ X ) → ∀ A ∈ X ( f ( A ) ∈ A ) ] |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
604 choice-func : (X : OD ) → {x : OD } → ¬ ( x == od∅ ) → ( X ∋ x ) → OD |
258 | 605 choice-func X {x} not X∋x = minimal x not |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
606 choice : (X : OD ) → {A : OD } → ( X∋A : X ∋ A ) → (not : ¬ ( A == od∅ )) → A ∋ choice-func X not X∋A |
258 | 607 choice X {A} X∋A not = x∋minimal A not |
78
9a7a64b2388c
infinite and replacement begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
77
diff
changeset
|
608 |
234
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
609 --- |
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
610 --- With assuption of OD is ordered, p ∨ ( ¬ p ) <=> axiom of choice |
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
611 --- |
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
612 record choiced ( X : OD) : Set (suc n) where |
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
613 field |
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
614 a-choice : OD |
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
615 is-in : X ∋ a-choice |
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
616 |
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
617 choice-func' : (X : OD ) → (p∨¬p : ( p : Set (suc n)) → p ∨ ( ¬ p )) → ¬ ( X == od∅ ) → choiced X |
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
618 choice-func' X p∨¬p not = have_to_find where |
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
619 ψ : ( ox : Ordinal ) → Set (suc n) |
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
620 ψ ox = (( x : Ordinal ) → x o< ox → ( ¬ def X x )) ∨ choiced X |
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
621 lemma-ord : ( ox : Ordinal ) → ψ ox |
235 | 622 lemma-ord ox = TransFinite {ψ} induction ox where |
234
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
623 ∋-p : (A x : OD ) → Dec ( A ∋ x ) |
271 | 624 ∋-p A x with p∨¬p (Lift (suc n) ( A ∋ x )) -- LEM |
234
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
625 ∋-p A x | case1 (lift t) = yes t |
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
626 ∋-p A x | case2 t = no (λ x → t (lift x )) |
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
627 ∀-imply-or : {A : Ordinal → Set n } {B : Set (suc n) } |
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
628 → ((x : Ordinal ) → A x ∨ B) → ((x : Ordinal ) → A x) ∨ B |
271 | 629 ∀-imply-or {A} {B} ∀AB with p∨¬p (Lift ( suc n ) ((x : Ordinal ) → A x)) -- LEM |
234
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
630 ∀-imply-or {A} {B} ∀AB | case1 (lift t) = case1 t |
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
631 ∀-imply-or {A} {B} ∀AB | case2 x = case2 (lemma (λ not → x (lift not ))) where |
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
632 lemma : ¬ ((x : Ordinal ) → A x) → B |
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
633 lemma not with p∨¬p B |
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
634 lemma not | case1 b = b |
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
635 lemma not | case2 ¬b = ⊥-elim (not (λ x → dont-orb (∀AB x) ¬b )) |
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
636 induction : (x : Ordinal) → ((y : Ordinal) → y o< x → ψ y) → ψ x |
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
637 induction x prev with ∋-p X ( ord→od x) |
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
638 ... | yes p = case2 ( record { a-choice = ord→od x ; is-in = p } ) |
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
639 ... | no ¬p = lemma where |
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
640 lemma1 : (y : Ordinal) → (y o< x → def X y → ⊥) ∨ choiced X |
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
641 lemma1 y with ∋-p X (ord→od y) |
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
642 lemma1 y | yes y<X = case2 ( record { a-choice = ord→od y ; is-in = y<X } ) |
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
643 lemma1 y | no ¬y<X = case1 ( λ lt y<X → ¬y<X (subst (λ k → def X k ) (sym diso) y<X ) ) |
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
644 lemma : ((y : Ordinals.ord O) → (O Ordinals.o< y) x → def X y → ⊥) ∨ choiced X |
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
645 lemma = ∀-imply-or lemma1 |
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
646 have_to_find : choiced X |
271 | 647 have_to_find = dont-or (lemma-ord (od→ord X )) ¬¬X∋x where |
234
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
648 ¬¬X∋x : ¬ ((x : Ordinal) → x o< (od→ord X) → def X x → ⊥) |
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
649 ¬¬X∋x nn = not record { |
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
650 eq→ = λ {x} lt → ⊥-elim (nn x (def→o< lt) lt) |
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
651 ; eq← = λ {x} lt → ⊥-elim ( ¬x<0 lt ) |
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
652 } |
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
653 |
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
654 |
226
176ff97547b4
set theortic function definition using sup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
223
diff
changeset
|
655 Union = ZF.Union OD→ZF |
176ff97547b4
set theortic function definition using sup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
223
diff
changeset
|
656 Power = ZF.Power OD→ZF |
176ff97547b4
set theortic function definition using sup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
223
diff
changeset
|
657 Select = ZF.Select OD→ZF |
176ff97547b4
set theortic function definition using sup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
223
diff
changeset
|
658 Replace = ZF.Replace OD→ZF |
176ff97547b4
set theortic function definition using sup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
223
diff
changeset
|
659 isZF = ZF.isZF OD→ZF |