1466
|
1 {-# OPTIONS --cubical-compatible --safe #-}
|
431
|
2 open import Level
|
|
3 open import Ordinals
|
|
4 open import logic
|
|
5 open import Relation.Nullary
|
|
6
|
1466
|
7 open import Level
|
|
8 open import Ordinals
|
|
9 import HODBase
|
431
|
10 import OD
|
1466
|
11 open import Relation.Nullary
|
|
12 module LEMC {n : Level } (O : Ordinals {n} ) (HODAxiom : HODBase.ODAxiom O) (ho< : OD.ODAxiom-ho< O HODAxiom )( p∨¬p : ( p : Set n) → p ∨ ( ¬ p ) ) where
|
431
|
13
|
1466
|
14 open import Relation.Binary.PropositionalEquality hiding ( [_] )
|
|
15 open import Data.Empty
|
|
16
|
431
|
17 import OrdUtil
|
1466
|
18
|
431
|
19 open Ordinals.Ordinals O
|
|
20 open Ordinals.IsOrdinals isOrdinal
|
1466
|
21 import ODUtil
|
|
22
|
|
23 open import logic
|
|
24 open import nat
|
|
25
|
431
|
26 open OrdUtil O
|
1466
|
27 open ODUtil O HODAxiom ho<
|
431
|
28
|
1466
|
29 open _∧_
|
|
30 open _∨_
|
|
31 open Bool
|
431
|
32
|
1466
|
33 open HODBase._==_
|
431
|
34
|
1466
|
35 open HODBase.ODAxiom HODAxiom
|
|
36 open OD O HODAxiom
|
|
37
|
|
38 open HODBase.HOD
|
1120
|
39
|
431
|
40 decp : ( p : Set n ) → Dec p -- assuming axiom of choice
|
|
41 decp p with p∨¬p p
|
|
42 decp p | case1 x = yes x
|
|
43 decp p | case2 x = no x
|
|
44
|
|
45 ∋-p : (A x : HOD ) → Dec ( A ∋ x )
|
|
46 ∋-p A x with p∨¬p ( A ∋ x) -- LEM
|
|
47 ∋-p A x | case1 t = yes t
|
|
48 ∋-p A x | case2 t = no (λ x → t x)
|
|
49
|
1120
|
50 double-neg-elim : {A : Set n} → ¬ ¬ A → A -- we don't have this in intutionistic logic
|
|
51 double-neg-elim {A} notnot with decp A -- assuming axiom of choice
|
431
|
52 ... | yes p = p
|
|
53 ... | no ¬p = ⊥-elim ( notnot ¬p )
|
|
54
|
|
55 --- With assuption of HOD is ordered, p ∨ ( ¬ p ) <=> axiom of choice
|
|
56 ---
|
|
57 record choiced ( X : Ordinal ) : Set n where
|
|
58 field
|
|
59 a-choice : Ordinal
|
|
60 is-in : odef (* X) a-choice
|
|
61
|
|
62 open choiced
|
|
63
|
|
64 oo∋ : { a : HOD} { x : Ordinal } → odef (* (& a)) x → a ∋ * x
|
1466
|
65 oo∋ {a} {x} lt = eq→ *iso (subst (λ k → odef (* (& a)) k ) (sym &iso) lt )
|
431
|
66
|
|
67 ∋oo : { a : HOD} { x : Ordinal } → a ∋ * x → odef (* (& a)) x
|
1466
|
68 ∋oo {a} {x} lt = eq← *iso (subst (λ k → odef a k ) &iso lt )
|
|
69
|
|
70 open import zfc
|
431
|
71
|
|
72 OD→ZFC : ZFC
|
|
73 OD→ZFC = record {
|
|
74 ZFSet = HOD
|
|
75 ; _∋_ = _∋_
|
|
76 ; _≈_ = _=h=_
|
|
77 ; ∅ = od∅
|
|
78 ; isZFC = isZFC
|
|
79 } where
|
|
80 -- infixr 200 _∈_
|
|
81 -- infixr 230 _∩_ _∪_
|
1466
|
82 isZFC : IsZFC (HOD ) _∋_ _=h=_ od∅
|
431
|
83 isZFC = record {
|
|
84 choice-func = λ A {X} not A∋X → * (a-choice (choice-func X not) );
|
|
85 choice = λ A {X} A∋X not → oo∋ (is-in (choice-func X not))
|
|
86 } where
|
|
87 --
|
|
88 -- the axiom choice from LEM and OD ordering
|
|
89 --
|
|
90 choice-func : (X : HOD ) → ¬ ( X =h= od∅ ) → choiced (& X)
|
|
91 choice-func X not = have_to_find where
|
|
92 ψ : ( ox : Ordinal ) → Set n
|
|
93 ψ ox = (( x : Ordinal ) → x o< ox → ( ¬ odef X x )) ∨ choiced (& X)
|
|
94 lemma-ord : ( ox : Ordinal ) → ψ ox
|
1466
|
95 lemma-ord ox = inOrdinal.TransFinite0 O {ψ} induction ox where
|
431
|
96 ∀-imply-or : {A : Ordinal → Set n } {B : Set n }
|
|
97 → ((x : Ordinal ) → A x ∨ B) → ((x : Ordinal ) → A x) ∨ B
|
|
98 ∀-imply-or {A} {B} ∀AB with p∨¬p ((x : Ordinal ) → A x) -- LEM
|
|
99 ∀-imply-or {A} {B} ∀AB | case1 t = case1 t
|
|
100 ∀-imply-or {A} {B} ∀AB | case2 x = case2 (lemma (λ not → x not )) where
|
|
101 lemma : ¬ ((x : Ordinal ) → A x) → B
|
|
102 lemma not with p∨¬p B
|
|
103 lemma not | case1 b = b
|
|
104 lemma not | case2 ¬b = ⊥-elim (not (λ x → dont-orb (∀AB x) ¬b ))
|
|
105 induction : (x : Ordinal) → ((y : Ordinal) → y o< x → ψ y) → ψ x
|
|
106 induction x prev with ∋-p X ( * x)
|
|
107 ... | yes p = case2 ( record { a-choice = x ; is-in = ∋oo p } )
|
|
108 ... | no ¬p = lemma where
|
|
109 lemma1 : (y : Ordinal) → (y o< x → odef X y → ⊥) ∨ choiced (& X)
|
|
110 lemma1 y with ∋-p X (* y)
|
|
111 lemma1 y | yes y<X = case2 ( record { a-choice = y ; is-in = ∋oo y<X } )
|
|
112 lemma1 y | no ¬y<X = case1 ( λ lt y<X → ¬y<X (d→∋ X y<X) )
|
|
113 lemma : ((y : Ordinal) → y o< x → odef X y → ⊥) ∨ choiced (& X)
|
|
114 lemma = ∀-imply-or lemma1
|
|
115 odef→o< : {X : HOD } → {x : Ordinal } → odef X x → x o< & X
|
1466
|
116 odef→o< {X} {x} lt = o<-subst {_} {_} {x} {& X} ( c<→o< (eq← *iso (subst (λ k → odef X k) (sym &iso) lt ))) &iso &iso
|
431
|
117 have_to_find : choiced (& X)
|
|
118 have_to_find = dont-or (lemma-ord (& X )) ¬¬X∋x where
|
|
119 ¬¬X∋x : ¬ ((x : Ordinal) → x o< (& X) → odef X x → ⊥)
|
|
120 ¬¬X∋x nn = not record {
|
|
121 eq→ = λ {x} lt → ⊥-elim (nn x (odef→o< lt) lt)
|
|
122 ; eq← = λ {x} lt → ⊥-elim ( ¬x<0 lt )
|
|
123 }
|
|
124
|
|
125 --
|
|
126 -- axiom regurality from ε-induction (using axiom of choice above)
|
|
127 --
|
|
128 -- from https://math.stackexchange.com/questions/2973777/is-it-possible-to-prove-regularity-with-transfinite-induction-only
|
|
129 --
|
|
130 record Minimal (x : HOD) : Set (suc n) where
|
|
131 field
|
|
132 min : HOD
|
|
133 x∋min : x ∋ min
|
|
134 min-empty : (y : HOD ) → ¬ ( min ∋ y) ∧ (x ∋ y)
|
|
135 open Minimal
|
|
136 open _∧_
|
|
137 induction : {x : HOD} → ({y : HOD} → x ∋ y → (u : HOD ) → (u∋x : u ∋ y) → Minimal u )
|
|
138 → (u : HOD ) → (u∋x : u ∋ x) → Minimal u
|
|
139 induction {x} prev u u∋x with p∨¬p ((y : Ordinal ) → ¬ (odef x y) ∧ (odef u y))
|
|
140 ... | case1 P =
|
|
141 record { min = x
|
|
142 ; x∋min = u∋x
|
|
143 ; min-empty = λ y → P (& y)
|
|
144 }
|
|
145 ... | case2 NP = min2 where
|
|
146 p : HOD
|
|
147 p = record { od = record { def = λ y1 → odef x y1 ∧ odef u y1 } ; odmax = omin (odmax x) (odmax u) ; <odmax = lemma } where
|
1466
|
148 lemma : {y : Ordinal} → odef x y ∧ odef u y → y o< omin (odmax x) (odmax u)
|
431
|
149 lemma {y} lt = min1 (<odmax x (proj1 lt)) (<odmax u (proj2 lt))
|
|
150 np : ¬ (p =h= od∅)
|
|
151 np p∅ = NP (λ y p∋y → ∅< {p} {_} (d→∋ p p∋y) p∅ )
|
|
152 y1choice : choiced (& p)
|
|
153 y1choice = choice-func p np
|
|
154 y1 : HOD
|
|
155 y1 = * (a-choice y1choice)
|
|
156 y1prop : (x ∋ y1) ∧ (u ∋ y1)
|
|
157 y1prop = oo∋ (is-in y1choice)
|
|
158 min2 : Minimal u
|
|
159 min2 = prev (proj1 y1prop) u (proj2 y1prop)
|
|
160 Min2 : (x : HOD) → (u : HOD ) → (u∋x : u ∋ x) → Minimal u
|
|
161 Min2 x u u∋x = (ε-induction {λ y → (u : HOD ) → (u∋x : u ∋ y) → Minimal u } induction x u u∋x )
|
|
162 cx : {x : HOD} → ¬ (x =h= od∅ ) → choiced (& x )
|
|
163 cx {x} nx = choice-func x nx
|
|
164 minimal : (x : HOD ) → ¬ (x =h= od∅ ) → HOD
|
|
165 minimal x ne = min (Min2 (* (a-choice (cx {x} ne) )) x ( oo∋ (is-in (cx ne))) )
|
|
166 x∋minimal : (x : HOD ) → ( ne : ¬ (x =h= od∅ ) ) → odef x ( & ( minimal x ne ) )
|
|
167 x∋minimal x ne = x∋min (Min2 (* (a-choice (cx {x} ne) )) x ( oo∋ (is-in (cx ne))) )
|
|
168 minimal-1 : (x : HOD ) → ( ne : ¬ (x =h= od∅ ) ) → (y : HOD ) → ¬ ( odef (minimal x ne) (& y)) ∧ (odef x (& y) )
|
|
169 minimal-1 x ne y = min-empty (Min2 (* (a-choice (cx ne) )) x ( oo∋ (is-in (cx ne)))) y
|
|
170
|
|
171
|
|
172
|
|
173
|