Mercurial > hg > Members > kono > Proof > ZF-in-agda
annotate LEMC.agda @ 424:cc7909f86841
remvoe TransFinifte1
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 01 Aug 2020 23:37:10 +0900 |
parents | 44a484f17f26 |
children |
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 |
277
d9d3654baee1
seperate choice from LEM
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
276
diff
changeset
|
3 open import logic |
d9d3654baee1
seperate choice from LEM
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
276
diff
changeset
|
4 open import Relation.Nullary |
387 | 5 module LEMC {n : Level } (O : Ordinals {n} ) (p∨¬p : ( p : Set n) → p ∨ ( ¬ p )) where |
3 | 6 |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
7 open import zf |
23 | 8 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
|
9 open import Relation.Binary.PropositionalEquality |
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.Binary | |
13 open import Relation.Binary.Core | |
14 | |
213
22d435172d1a
separate logic and nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
210
diff
changeset
|
15 open import nat |
276 | 16 import OD |
213
22d435172d1a
separate logic and nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
210
diff
changeset
|
17 |
223
2e1f19c949dc
sepration of ordinal from OD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
219
diff
changeset
|
18 open inOrdinal O |
276 | 19 open OD O |
20 open OD.OD | |
21 open OD._==_ | |
277
d9d3654baee1
seperate choice from LEM
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
276
diff
changeset
|
22 open ODAxiom odAxiom |
424 | 23 import OrdUtil |
24 import ODUtil | |
25 open Ordinals.Ordinals O | |
26 open Ordinals.IsOrdinals isOrdinal | |
27 open Ordinals.IsNext isNext | |
28 open OrdUtil O | |
29 open ODUtil O | |
119 | 30 |
276 | 31 open import zfc |
190 | 32 |
387 | 33 open HOD |
34 | |
35 open _⊆_ | |
36 | |
37 decp : ( p : Set n ) → Dec p -- assuming axiom of choice | |
38 decp p with p∨¬p p | |
39 decp p | case1 x = yes x | |
40 decp p | case2 x = no x | |
41 | |
42 ∋-p : (A x : HOD ) → Dec ( A ∋ x ) | |
43 ∋-p A x with p∨¬p ( A ∋ x) -- LEM | |
44 ∋-p A x | case1 t = yes t | |
45 ∋-p A x | case2 t = no (λ x → t x) | |
46 | |
47 double-neg-eilm : {A : Set n} → ¬ ¬ A → A -- we don't have this in intutionistic logic | |
48 double-neg-eilm {A} notnot with decp A -- assuming axiom of choice | |
49 ... | yes p = p | |
50 ... | no ¬p = ⊥-elim ( notnot ¬p ) | |
51 | |
52 power→⊆ : ( A t : HOD) → Power A ∋ t → t ⊆ A | |
53 power→⊆ A t PA∋t = record { incl = λ {x} t∋x → double-neg-eilm (λ not → t1 t∋x (λ x → not x) ) } where | |
54 t1 : {x : HOD } → t ∋ x → ¬ ¬ (A ∋ x) | |
396 | 55 t1 = power→ A t PA∋t |
387 | 56 |
330 | 57 --- With assuption of HOD is ordered, p ∨ ( ¬ p ) <=> axiom of choice |
277
d9d3654baee1
seperate choice from LEM
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
276
diff
changeset
|
58 --- |
387 | 59 record choiced ( X : Ordinal ) : Set n where |
277
d9d3654baee1
seperate choice from LEM
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
276
diff
changeset
|
60 field |
387 | 61 a-choice : Ordinal |
422 | 62 is-in : odef (* X) a-choice |
330 | 63 |
277
d9d3654baee1
seperate choice from LEM
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
276
diff
changeset
|
64 open choiced |
d9d3654baee1
seperate choice from LEM
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
276
diff
changeset
|
65 |
422 | 66 -- ∋→d : ( a : HOD ) { x : HOD } → * (& a) ∋ x → X ∋ * (a-choice (choice-func X not)) |
67 -- ∋→d a lt = subst₂ (λ j k → odef j k) *iso (sym &iso) lt | |
387 | 68 |
422 | 69 oo∋ : { a : HOD} { x : Ordinal } → odef (* (& a)) x → a ∋ * x |
70 oo∋ lt = subst₂ (λ j k → odef j k) *iso (sym &iso) lt | |
387 | 71 |
422 | 72 ∋oo : { a : HOD} { x : Ordinal } → a ∋ * x → odef (* (& a)) x |
73 ∋oo lt = subst₂ (λ j k → odef j k ) (sym *iso) &iso lt | |
387 | 74 |
276 | 75 OD→ZFC : ZFC |
76 OD→ZFC = record { | |
330 | 77 ZFSet = HOD |
43
0d9b9db14361
equalitu and internal parametorisity
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
42
diff
changeset
|
78 ; _∋_ = _∋_ |
330 | 79 ; _≈_ = _=h=_ |
29
fce60b99dc55
posturate OD is isomorphic to Ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
28
diff
changeset
|
80 ; ∅ = od∅ |
376 | 81 ; Select = Select |
276 | 82 ; isZFC = isZFC |
28 | 83 } where |
276 | 84 -- infixr 200 _∈_ |
96 | 85 -- infixr 230 _∩_ _∪_ |
376 | 86 isZFC : IsZFC (HOD ) _∋_ _=h=_ od∅ Select |
276 | 87 isZFC = record { |
422 | 88 choice-func = λ A {X} not A∋X → * (a-choice (choice-func X not) ); |
387 | 89 choice = λ A {X} A∋X not → oo∋ (is-in (choice-func X not)) |
29
fce60b99dc55
posturate OD is isomorphic to Ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
28
diff
changeset
|
90 } where |
360 | 91 -- |
92 -- the axiom choice from LEM and OD ordering | |
93 -- | |
422 | 94 choice-func : (X : HOD ) → ¬ ( X =h= od∅ ) → choiced (& X) |
277
d9d3654baee1
seperate choice from LEM
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
276
diff
changeset
|
95 choice-func X not = have_to_find where |
387 | 96 ψ : ( ox : Ordinal ) → Set n |
422 | 97 ψ ox = (( x : Ordinal ) → x o< ox → ( ¬ odef X x )) ∨ choiced (& X) |
234
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
98 lemma-ord : ( ox : Ordinal ) → ψ ox |
424 | 99 lemma-ord ox = TransFinite0 {ψ} induction ox where |
387 | 100 ∀-imply-or : {A : Ordinal → Set n } {B : Set n } |
234
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
101 → ((x : Ordinal ) → A x ∨ B) → ((x : Ordinal ) → A x) ∨ B |
387 | 102 ∀-imply-or {A} {B} ∀AB with p∨¬p ((x : Ordinal ) → A x) -- LEM |
103 ∀-imply-or {A} {B} ∀AB | case1 t = case1 t | |
104 ∀-imply-or {A} {B} ∀AB | case2 x = case2 (lemma (λ not → x not )) where | |
234
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
105 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
|
106 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
|
107 lemma not | case1 b = b |
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
108 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
|
109 induction : (x : Ordinal) → ((y : Ordinal) → y o< x → ψ y) → ψ x |
422 | 110 induction x prev with ∋-p X ( * x) |
387 | 111 ... | yes p = case2 ( record { a-choice = x ; is-in = ∋oo p } ) |
234
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
112 ... | no ¬p = lemma where |
422 | 113 lemma1 : (y : Ordinal) → (y o< x → odef X y → ⊥) ∨ choiced (& X) |
114 lemma1 y with ∋-p X (* y) | |
387 | 115 lemma1 y | yes y<X = case2 ( record { a-choice = y ; is-in = ∋oo y<X } ) |
396 | 116 lemma1 y | no ¬y<X = case1 ( λ lt y<X → ¬y<X (d→∋ X y<X) ) |
424 | 117 lemma : ((y : Ordinal) → y o< x → odef X y → ⊥) ∨ choiced (& X) |
234
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
118 lemma = ∀-imply-or lemma1 |
424 | 119 odef→o< : {X : HOD } → {x : Ordinal } → odef X x → x o< & X |
120 odef→o< {X} {x} lt = o<-subst {_} {_} {x} {& X} ( c<→o< ( subst₂ (λ j k → odef j k ) (sym *iso) (sym &iso) lt )) &iso &iso | |
422 | 121 have_to_find : choiced (& X) |
122 have_to_find = dont-or (lemma-ord (& X )) ¬¬X∋x where | |
123 ¬¬X∋x : ¬ ((x : Ordinal) → x o< (& X) → odef X x → ⊥) | |
234
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
124 ¬¬X∋x nn = not record { |
424 | 125 eq→ = λ {x} lt → ⊥-elim (nn x (odef→o< lt) lt) |
234
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
126 ; 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
|
127 } |
360 | 128 |
129 -- | |
130 -- axiom regurality from ε-induction (using axiom of choice above) | |
131 -- | |
132 -- from https://math.stackexchange.com/questions/2973777/is-it-possible-to-prove-regularity-with-transfinite-induction-only | |
133 -- | |
388 | 134 -- FIXME : don't use HOD make this level n, so we can remove ε-induction1 |
330 | 135 record Minimal (x : HOD) : Set (suc n) where |
280 | 136 field |
330 | 137 min : HOD |
281 | 138 x∋min : x ∋ min |
330 | 139 min-empty : (y : HOD ) → ¬ ( min ∋ y) ∧ (x ∋ y) |
280 | 140 open Minimal |
281 | 141 open _∧_ |
330 | 142 induction : {x : HOD} → ({y : HOD} → x ∋ y → (u : HOD ) → (u∋x : u ∋ y) → Minimal u ) |
143 → (u : HOD ) → (u∋x : u ∋ x) → Minimal u | |
387 | 144 induction {x} prev u u∋x with p∨¬p ((y : Ordinal ) → ¬ (odef x y) ∧ (odef u y)) |
284 | 145 ... | case1 P = |
146 record { min = x | |
387 | 147 ; x∋min = u∋x |
422 | 148 ; min-empty = λ y → P (& y) |
284 | 149 } |
285 | 150 ... | case2 NP = min2 where |
330 | 151 p : HOD |
152 p = record { od = record { def = λ y1 → odef x y1 ∧ odef u y1 } ; odmax = omin (odmax x) (odmax u) ; <odmax = lemma } where | |
153 lemma : {y : Ordinal} → OD.def (od x) y ∧ OD.def (od u) y → y o< omin (odmax x) (odmax u) | |
154 lemma {y} lt = min1 (<odmax x (proj1 lt)) (<odmax u (proj2 lt)) | |
155 np : ¬ (p =h= od∅) | |
396 | 156 np p∅ = NP (λ y p∋y → ∅< {p} {_} (d→∋ p p∋y) p∅ ) |
422 | 157 y1choice : choiced (& p) |
284 | 158 y1choice = choice-func p np |
330 | 159 y1 : HOD |
422 | 160 y1 = * (a-choice y1choice) |
284 | 161 y1prop : (x ∋ y1) ∧ (u ∋ y1) |
387 | 162 y1prop = oo∋ (is-in y1choice) |
285 | 163 min2 : Minimal u |
284 | 164 min2 = prev (proj1 y1prop) u (proj2 y1prop) |
330 | 165 Min2 : (x : HOD) → (u : HOD ) → (u∋x : u ∋ x) → Minimal u |
424 | 166 Min2 x u u∋x = (ε-induction {λ y → (u : HOD ) → (u∋x : u ∋ y) → Minimal u } induction x u u∋x ) |
422 | 167 cx : {x : HOD} → ¬ (x =h= od∅ ) → choiced (& x ) |
284 | 168 cx {x} nx = choice-func x nx |
330 | 169 minimal : (x : HOD ) → ¬ (x =h= od∅ ) → HOD |
422 | 170 minimal x ne = min (Min2 (* (a-choice (cx {x} ne) )) x ( oo∋ (is-in (cx ne))) ) |
171 x∋minimal : (x : HOD ) → ( ne : ¬ (x =h= od∅ ) ) → odef x ( & ( minimal x ne ) ) | |
172 x∋minimal x ne = x∋min (Min2 (* (a-choice (cx {x} ne) )) x ( oo∋ (is-in (cx ne))) ) | |
173 minimal-1 : (x : HOD ) → ( ne : ¬ (x =h= od∅ ) ) → (y : HOD ) → ¬ ( odef (minimal x ne) (& y)) ∧ (odef x (& y) ) | |
174 minimal-1 x ne y = min-empty (Min2 (* (a-choice (cx ne) )) x ( oo∋ (is-in (cx ne)))) y | |
279 | 175 |
176 | |
177 | |
234
e06b76e5b682
ac from LEM in abstract ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
228
diff
changeset
|
178 |