Mercurial > hg > Members > kono > Proof > ZF-in-agda
changeset 112:c42352a7ee07
HOD
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 25 Jun 2019 05:50:22 +0900 (2019-06-24) |
parents | 1daa1d24348c |
children | 5f97ebaeb89b |
files | HOD.agda ordinal-definable.agda |
diffstat | 2 files changed, 592 insertions(+), 100 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/HOD.agda Tue Jun 25 05:50:22 2019 +0900 @@ -0,0 +1,425 @@ +open import Level +module HOD where + +open import zf +open import ordinal + +open import Data.Nat renaming ( zero to Zero ; suc to Suc ; ℕ to Nat ; _⊔_ to _n⊔_ ) +open import Relation.Binary.PropositionalEquality +open import Data.Nat.Properties +open import Data.Empty +open import Relation.Nullary +open import Relation.Binary +open import Relation.Binary.Core + +-- Ordinal Definable Set + +record HOD {n : Level} : Set (suc n) where + field + def : (x : Ordinal {n} ) → Set n + otrans : {x y : Ordinal {n} } → def x → y o< x → def y + +open HOD +open import Data.Unit + +open Ordinal + +record _==_ {n : Level} ( a b : HOD {n} ) : Set n where + field + eq→ : ∀ { x : Ordinal {n} } → def a x → def b x + eq← : ∀ { x : Ordinal {n} } → def b x → def a x + +id : {n : Level} {A : Set n} → A → A +id x = x + +eq-refl : {n : Level} { x : HOD {n} } → x == x +eq-refl {n} {x} = record { eq→ = id ; eq← = id } + +open _==_ + +eq-sym : {n : Level} { x y : HOD {n} } → x == y → y == x +eq-sym eq = record { eq→ = eq← eq ; eq← = eq→ eq } + +eq-trans : {n : Level} { x y z : HOD {n} } → x == y → y == z → x == z +eq-trans x=y y=z = record { eq→ = λ t → eq→ y=z ( eq→ x=y t) ; eq← = λ t → eq← x=y ( eq← y=z t) } + +-- Ordinal in HOD ( and ZFSet ) +Ord : { n : Level } → ( a : Ordinal {n} ) → HOD {n} +Ord {n} a = record { def = λ y → y o< a ; otrans = lemma } where + lemma : {x y : Ordinal} → x o< a → y o< x → y o< a + lemma {x} {y} x<a y<x = ordtrans {n} {y} {x} {a} y<x x<a + +-- od∅ : {n : Level} → HOD {n} +-- od∅ {n} = record { def = λ _ → Lift n ⊥ } +od∅ : {n : Level} → HOD {n} +od∅ {n} = Ord o∅ + +data SinO {n : Level} : (ox : Ordinal {n}) (x : HOD {n}) → Set (suc n) where + o-in-o : {ox : Ordinal {n} } → SinO ox (Ord ox) + s-in-o : {ox : Ordinal {n} } → {y x : HOD {n} } → SinO ox y → x == y → SinO ox x + +postulate + -- HOD can be iso to a subset of Ordinal ( by means of Godel Set ) + od→ord : {n : Level} → HOD {n} → Ordinal {n} + c<→o< : {n : Level} {x y : HOD {n} } → def y ( od→ord x ) → od→ord x o< od→ord y + -- next assumption causes ∀ x ∋ ∅ . It menas only an ordinal becomes a set + -- o<→c< : {n : Level} {x y : Ordinal {n} } → x o< y → def (ord→od y) x + sino : {n : Level} {x : HOD {n}} → SinO ( od→ord x ) x + -- supermum as Replacement Axiom + sup-o : {n : Level } → ( Ordinal {n} → Ordinal {n}) → Ordinal {n} + sup-o< : {n : Level } → { ψ : Ordinal {n} → Ordinal {n}} → ∀ {x : Ordinal {n}} → ψ x o< sup-o ψ + -- contra-position of mimimulity of supermum required in Power Set Axiom + sup-x : {n : Level } → ( Ordinal {n} → Ordinal {n}) → Ordinal {n} + sup-lb : {n : Level } → { ψ : Ordinal {n} → Ordinal {n}} → {z : Ordinal {n}} → z o< sup-o ψ → z o< osuc (ψ (sup-x ψ)) + -- sup-lb : {n : Level } → ( ψ : Ordinal {n} → Ordinal {n}) → ( ∀ {x : Ordinal {n}} → ψx o< z ) → z o< osuc ( sup-o ψ ) + + +_∋_ : { n : Level } → ( a x : HOD {n} ) → Set n +_∋_ {n} a x = def a ( od→ord x ) + +_c<_ : { n : Level } → ( x a : HOD {n} ) → Set n +x c< a = a ∋ x + +postulate + o<→c< : {n : Level} {x y : Ordinal {n} } → x o< y → Ord y ∋ Ord x + +ord→od : {n : Level} → Ordinal {n} → HOD {n} +ord→od = ? + +oiso : {n : Level} {x : HOD {n}} → ? ≡ x +oiso = ? + +diso : {n : Level} {x : Ordinal {n}} → od→ord ? ≡ x +diso = ? + +_c≤_ : {n : Level} → HOD {n} → HOD {n} → Set (suc n) +a c≤ b = (a ≡ b) ∨ ( b ∋ a ) + +def-subst : {n : Level } {Z : HOD {n}} {X : Ordinal {n} }{z : HOD {n}} {x : Ordinal {n} }→ def Z X → Z ≡ z → X ≡ x → def z x +def-subst df refl refl = df + +sup-od : {n : Level } → ( HOD {n} → HOD {n}) → HOD {n} +sup-od ψ = Ord ( sup-o ( λ x → od→ord (ψ (ord→od x ))) ) + +sup-c< : {n : Level } → ( ψ : HOD {n} → HOD {n}) → ∀ {x : HOD {n}} → def ( sup-od ψ ) (od→ord ( ψ x )) +sup-c< {n} ψ {x} = def-subst {n} {_} {_} {Ord ( sup-o ( λ x → od→ord (ψ (ord→od x ))) )} {od→ord ( ψ x )} + lemma refl (cong ( λ k → od→ord (ψ k) ) oiso) where + lemma : od→ord (ψ (ord→od (od→ord x))) o< sup-o (λ x → od→ord (ψ (ord→od x))) + lemma = subst₂ (λ j k → j o< k ) refl diso (o<-subst sup-o< refl (sym diso) ) + +∅3 : {n : Level} → { x : Ordinal {n}} → ( ∀(y : Ordinal {n}) → ¬ (y o< x ) ) → x ≡ o∅ {n} +∅3 {n} {x} = TransFinite {n} c2 c3 x where + c0 : Nat → Ordinal {n} → Set n + c0 lx x = (∀(y : Ordinal {n}) → ¬ (y o< x)) → x ≡ o∅ {n} + c2 : (lx : Nat) → c0 lx (record { lv = lx ; ord = Φ lx } ) + c2 Zero not = refl + c2 (Suc lx) not with not ( record { lv = lx ; ord = Φ lx } ) + ... | t with t (case1 ≤-refl ) + c2 (Suc lx) not | t | () + c3 : (lx : Nat) (x₁ : OrdinalD lx) → c0 lx (record { lv = lx ; ord = x₁ }) → c0 lx (record { lv = lx ; ord = OSuc lx x₁ }) + c3 lx (Φ .lx) d not with not ( record { lv = lx ; ord = Φ lx } ) + ... | t with t (case2 Φ< ) + c3 lx (Φ .lx) d not | t | () + c3 lx (OSuc .lx x₁) d not with not ( record { lv = lx ; ord = OSuc lx x₁ } ) + ... | t with t (case2 (s< s<refl ) ) + c3 lx (OSuc .lx x₁) d not | t | () + +transitive : {n : Level } { z y x : HOD {suc n} } → z ∋ y → y ∋ x → z ∋ x +transitive {n} {z} {y} {x} z∋y x∋y with ordtrans ( c<→o< {suc n} {x} {y} x∋y ) ( c<→o< {suc n} {y} {z} z∋y ) +... | t = otrans z z∋y (c<→o< {suc n} {x} {y} x∋y ) + +record Minimumo {n : Level } (x : Ordinal {n}) : Set (suc n) where + field + mino : Ordinal {n} + min<x : mino o< x + +∅5 : {n : Level} → { x : Ordinal {n} } → ¬ ( x ≡ o∅ {n} ) → o∅ {n} o< x +∅5 {n} {record { lv = Zero ; ord = (Φ .0) }} not = ⊥-elim (not refl) +∅5 {n} {record { lv = Zero ; ord = (OSuc .0 ord) }} not = case2 Φ< +∅5 {n} {record { lv = (Suc lv) ; ord = ord }} not = case1 (s≤s z≤n) + +ord-iso : {n : Level} {y : Ordinal {n} } → record { lv = lv (od→ord (ord→od y)) ; ord = ord (od→ord (ord→od y)) } ≡ record { lv = lv y ; ord = ord y } +ord-iso = cong ( λ k → record { lv = lv k ; ord = ord k } ) diso + +-- avoiding lv != Zero error +orefl : {n : Level} → { x : HOD {n} } → { y : Ordinal {n} } → od→ord x ≡ y → od→ord x ≡ y +orefl refl = refl + +==-iso : {n : Level} → { x y : HOD {n} } → ord→od (od→ord x) == ord→od (od→ord y) → x == y +==-iso {n} {x} {y} eq = record { + eq→ = λ d → lemma ( eq→ eq (def-subst d (sym oiso) refl )) ; + eq← = λ d → lemma ( eq← eq (def-subst d (sym oiso) refl )) } + where + lemma : {x : HOD {n} } {z : Ordinal {n}} → def (ord→od (od→ord x)) z → def x z + lemma {x} {z} d = def-subst d oiso refl + +=-iso : {n : Level } {x y : HOD {suc n} } → (x == y) ≡ (ord→od (od→ord x) == y) +=-iso {_} {_} {y} = cong ( λ k → k == y ) (sym oiso) + +ord→== : {n : Level} → { x y : HOD {n} } → od→ord x ≡ od→ord y → x == y +ord→== {n} {x} {y} eq = ==-iso (lemma (od→ord x) (od→ord y) (orefl eq)) where + lemma : ( ox oy : Ordinal {n} ) → ox ≡ oy → (ord→od ox) == (ord→od oy) + lemma ox ox refl = eq-refl + +o≡→== : {n : Level} → { x y : Ordinal {n} } → x ≡ y → ord→od x == ord→od y +o≡→== {n} {x} {.x} refl = eq-refl + +>→¬< : {x y : Nat } → (x < y ) → ¬ ( y < x ) +>→¬< (s≤s x<y) (s≤s y<x) = >→¬< x<y y<x + +c≤-refl : {n : Level} → ( x : HOD {n} ) → x c≤ x +c≤-refl x = case1 refl + +∋→o< : {n : Level} → { a x : HOD {suc n} } → a ∋ x → od→ord x o< od→ord a +∋→o< {n} {a} {x} lt = t where + t : (od→ord x) o< (od→ord a) + t = c<→o< {suc n} {x} {a} lt + +o∅≡od∅ : {n : Level} → ord→od (o∅ {suc n}) ≡ od∅ {suc n} +o∅≡od∅ {n} with trio< {n} (o∅ {suc n}) (od→ord (od∅ {suc n} )) +o∅≡od∅ {n} | tri< a ¬b ¬c = ⊥-elim (lemma a) where + lemma : o∅ {suc n } o< (od→ord (od∅ {suc n} )) → ⊥ + lemma lt with def-subst {!!} oiso refl + lemma lt | t = {!!} +o∅≡od∅ {n} | tri≈ ¬a b ¬c = trans (cong (λ k → ord→od k ) b ) oiso +o∅≡od∅ {n} | tri> ¬a ¬b c = ⊥-elim (¬x<0 c) + +ord-od∅ : {n : Level} → o∅ {suc n} ≡ od→ord (Ord (o∅ {suc n})) +ord-od∅ {n} with trio< {n} (o∅ {suc n}) (od→ord (Ord (o∅ {suc n}))) +ord-od∅ {n} | tri< a ¬b ¬c = ⊥-elim (lemma a) where + lemma : o∅ {suc n } o< (od→ord (Ord (o∅ {suc n}))) → ⊥ + lemma lt with o<→c< lt + lemma lt | t = o<¬≡ refl t +ord-od∅ {n} | tri≈ ¬a b ¬c = b +ord-od∅ {n} | tri> ¬a ¬b c = ⊥-elim (¬x<0 c) + +o<→¬c> : {n : Level} → { x y : HOD {n} } → (od→ord x ) o< ( od→ord y) → ¬ (y c< x ) +o<→¬c> {n} {x} {y} olt clt = o<> olt (c<→o< clt ) where + +o≡→¬c< : {n : Level} → { x y : HOD {n} } → (od→ord x ) ≡ ( od→ord y) → ¬ x c< y +o≡→¬c< {n} {x} {y} oeq lt = o<¬≡ (orefl oeq ) (c<→o< lt) + +∅0 : {n : Level} → record { def = λ x → Lift n ⊥ ; otrans = λ () } == od∅ {n} +eq→ ∅0 {w} (lift ()) +eq← ∅0 {w} (case1 ()) +eq← ∅0 {w} (case2 ()) + +∅< : {n : Level} → { x y : HOD {n} } → def x (od→ord y ) → ¬ ( x == od∅ {n} ) +∅< {n} {x} {y} d eq with eq→ (eq-trans eq (eq-sym ∅0) ) d +∅< {n} {x} {y} d eq | lift () + +-- ∅6 : {n : Level} → { x : HOD {suc n} } → ¬ ( x ∋ x ) -- no Russel paradox +-- ∅6 {n} {x} x∋x = c<> {n} {x} {x} x∋x x∋x + +def-iso : {n : Level} {A B : HOD {n}} {x y : Ordinal {n}} → x ≡ y → (def A y → def B y) → def A x → def B x +def-iso refl t = t + +is-o∅ : {n : Level} → ( x : Ordinal {suc n} ) → Dec ( x ≡ o∅ {suc n} ) +is-o∅ {n} record { lv = Zero ; ord = (Φ .0) } = yes refl +is-o∅ {n} record { lv = Zero ; ord = (OSuc .0 ord₁) } = no ( λ () ) +is-o∅ {n} record { lv = (Suc lv₁) ; ord = ord } = no (λ()) + +open _∧_ + +-- open import Relation.Binary.HeterogeneousEquality as HE using (_≅_ ) +-- postulate f-extensionality : { n : Level} → Relation.Binary.PropositionalEquality.Extensionality (suc n) (suc (suc n)) + +csuc : {n : Level} → HOD {suc n} → HOD {suc n} +csuc x = ord→od ( osuc ( od→ord x )) + +-- Power Set of X ( or constructible by λ y → def X (od→ord y ) + +ZFSubset : {n : Level} → (A x : HOD {suc n} ) → HOD {suc n} +ZFSubset A x = record { def = λ y → def A y ∧ def x y ; otrans = {!!} } + +Def : {n : Level} → (A : HOD {suc n}) → HOD {suc n} +Def {n} A = ord→od ( sup-o ( λ x → od→ord ( ZFSubset A (ord→od x )) ) ) + +-- Constructible Set on α +L : {n : Level} → (α : Ordinal {suc n}) → HOD {suc n} +L {n} record { lv = Zero ; ord = (Φ .0) } = od∅ +L {n} record { lv = lx ; ord = (OSuc lv ox) } = Def ( L {n} ( record { lv = lx ; ord = ox } ) ) +L {n} record { lv = (Suc lx) ; ord = (Φ (Suc lx)) } = -- Union ( L α ) + record { def = λ y → osuc y o< (od→ord (L {n} (record { lv = lx ; ord = Φ lx }) )) ; otrans = {!!} } + +omega : { n : Level } → Ordinal {n} +omega = record { lv = Suc Zero ; ord = Φ 1 } + +HOD→ZF : {n : Level} → ZF {suc (suc n)} {suc n} +HOD→ZF {n} = record { + ZFSet = HOD {suc n} + ; _∋_ = _∋_ + ; _≈_ = _==_ + ; ∅ = od∅ + ; _,_ = _,_ + ; Union = Union + ; Power = Power + ; Select = Select + ; Replace = Replace + ; infinite = Ord omega + ; isZF = isZF + } where + Replace : HOD {suc n} → (HOD {suc n} → HOD {suc n} ) → HOD {suc n} + Replace X ψ = sup-od ψ + Select : (X : HOD {suc n} ) → ((x : HOD {suc n} ) → X ∋ x → Set (suc n) ) → HOD {suc n} + Select X ψ = record { def = λ x → ( (d : def X x ) → ψ (ord→od x) (subst (λ k → def X k ) (sym diso) d)) ; otrans = lemma } where + lemma : {x y : Ordinal} → ((d : def X x) → ψ (ord→od x) (subst (def X) (sym diso) d)) → + y o< x → (d : def X y) → ψ (ord→od y) (subst (def X) (sym diso) d) + lemma {x} {y} f y<x d = {!!} + _,_ : HOD {suc n} → HOD {suc n} → HOD {suc n} + x , y = Ord (omax (od→ord x) (od→ord y)) + Union : HOD {suc n} → HOD {suc n} + Union U = record { def = λ y → osuc y o< (od→ord U) ; otrans = {!!} } + -- power : ∀ X ∃ A ∀ t ( t ∈ A ↔ ( ∀ {x} → t ∋ x → X ∋ x ) + Power : HOD {suc n} → HOD {suc n} + Power A = Def A + ZFSet = HOD {suc n} + _∈_ : ( A B : ZFSet ) → Set (suc n) + A ∈ B = B ∋ A + _⊆_ : ( A B : ZFSet ) → ∀{ x : ZFSet } → Set (suc n) + _⊆_ A B {x} = A ∋ x → B ∋ x + _∩_ : ( A B : ZFSet ) → ZFSet + A ∩ B = Select (A , B) ( λ x d → ( A ∋ x ) ∧ (B ∋ x) ) + -- _∪_ : ( A B : ZFSet ) → ZFSet + -- A ∪ B = Select (A , B) ( λ x → (A ∋ x) ∨ ( B ∋ x ) ) + {_} : ZFSet → ZFSet + { x } = ( x , x ) + + infixr 200 _∈_ + -- infixr 230 _∩_ _∪_ + infixr 220 _⊆_ + isZF : IsZF (HOD {suc n}) _∋_ _==_ od∅ _,_ Union Power Select Replace (Ord omega) + isZF = record { + isEquivalence = record { refl = eq-refl ; sym = eq-sym; trans = eq-trans } + ; pair = pair + ; union-u = λ _ z _ → csuc z + ; union→ = union→ + ; union← = union← + ; empty = empty + ; power→ = power→ + ; power← = power← + ; extensionality = extensionality + ; minimul = minimul + ; regularity = regularity + ; infinity∅ = infinity∅ + ; infinity = λ _ → infinity + ; selection = λ {ψ} {X} {y} → selection {ψ} {X} {y} + ; replacement = replacement + } where + open _∧_ + open Minimumo + pair : (A B : HOD {suc n} ) → ((A , B) ∋ A) ∧ ((A , B) ∋ B) + proj1 (pair A B ) = omax-x {n} (od→ord A) (od→ord B) + proj2 (pair A B ) = omax-y {n} (od→ord A) (od→ord B) + empty : (x : HOD {suc n} ) → ¬ (od∅ ∋ x) + empty x (case1 ()) + empty x (case2 ()) + --- + --- ZFSubset A x = record { def = λ y → def A y ∧ def x y } subset of A + --- Power X = ord→od ( sup-o ( λ x → od→ord ( ZFSubset A (ord→od x )) ) ) Power X is a sup of all subset of A + -- + -- if Power A ∋ t, from a propertiy of minimum sup there is osuc ZFSubset A ∋ t + -- then ZFSubset A ≡ t or ZFSubset A ∋ t. In the former case ZFSubset A ∋ x implies A ∋ x + -- In case of later, ZFSubset A ∋ t and t ∋ x implies ZFSubset A ∋ x by transitivity + -- + power→ : (A t : HOD) → Power A ∋ t → {x : HOD} → t ∋ x → A ∋ x + power→ A t P∋t {x} t∋x = proj1 lemma-s where + minsup : HOD + minsup = ZFSubset A ( ord→od ( sup-x (λ x → od→ord ( ZFSubset A (ord→od x))))) + lemma-t : csuc minsup ∋ t + lemma-t = {!!} -- o<→c< (o<-subst (sup-lb (o<-subst (c<→o< P∋t) refl diso )) refl refl ) + lemma-s : ZFSubset A ( ord→od ( sup-x (λ x → od→ord ( ZFSubset A (ord→od x))))) ∋ x + lemma-s with osuc-≡< ( o<-subst (c<→o< lemma-t ) refl diso ) + lemma-s | case1 eq = def-subst {!!} oiso refl + lemma-s | case2 lt = transitive {n} {minsup} {t} {x} (def-subst {!!} oiso refl ) t∋x + -- + -- we have t ∋ x → A ∋ x means t is a subset of A, that is ZFSubset A t == t + -- Power A is a sup of ZFSubset A t, so Power A ∋ t + -- + power← : (A t : HOD) → ({x : HOD} → (t ∋ x → A ∋ x)) → Power A ∋ t + power← A t t→A = def-subst {suc n} {_} {_} {Power A} {od→ord t} + {!!} refl lemma1 where + lemma-eq : ZFSubset A t == t + eq→ lemma-eq {z} w = proj2 w + eq← lemma-eq {z} w = record { proj2 = w ; + proj1 = def-subst {suc n} {_} {_} {A} {z} ( t→A (def-subst {suc n} {_} {_} {t} {od→ord (ord→od z)} w refl (sym diso) )) refl diso } + lemma1 : od→ord (ZFSubset A (ord→od (od→ord t))) ≡ od→ord t + lemma1 = subst (λ k → od→ord (ZFSubset A k) ≡ od→ord t ) (sym oiso) {!!} + lemma : od→ord (ZFSubset A (ord→od (od→ord t)) ) o< sup-o (λ x → od→ord (ZFSubset A (ord→od x))) + lemma = sup-o< + union-lemma-u : {X z : HOD {suc n}} → (U>z : Union X ∋ z ) → csuc z ∋ z + union-lemma-u {X} {z} U>z = lemma <-osuc where + lemma : {oz ooz : Ordinal {suc n}} → oz o< ooz → def (ord→od ooz) oz + lemma {oz} {ooz} lt = def-subst {suc n} {ord→od ooz} {!!} refl refl + union→ : (X z u : HOD) → (X ∋ u) ∧ (u ∋ z) → Union X ∋ z + union→ X y u xx with trio< ( od→ord u ) ( osuc ( od→ord y )) + union→ X y u xx | tri< a ¬b ¬c with osuc-< a (c<→o< (proj2 xx)) + union→ X y u xx | tri< a ¬b ¬c | () + union→ X y u xx | tri≈ ¬a b ¬c = lemma b (c<→o< (proj1 xx )) where + lemma : {oX ou ooy : Ordinal {suc n}} → ou ≡ ooy → ou o< oX → ooy o< oX + lemma refl lt = lt + union→ X y u xx | tri> ¬a ¬b c = ordtrans {suc n} {osuc ( od→ord y )} {od→ord u} {od→ord X} c ( c<→o< (proj1 xx )) + union← : (X z : HOD) (X∋z : Union X ∋ z) → (X ∋ csuc z) ∧ (csuc z ∋ z ) + union← X z X∋z = record { proj1 = def-subst {suc n} {_} {_} {X} {od→ord (csuc z )} {!!} oiso (sym diso) ; proj2 = union-lemma-u X∋z } + ψiso : {ψ : HOD {suc n} → Set (suc n)} {x y : HOD {suc n}} → ψ x → x ≡ y → ψ y + ψiso {ψ} t refl = t + selection : {X : HOD } {ψ : (x : HOD ) → x ∈ X → Set (suc n)} {y : HOD} → ((d : X ∋ y ) → ψ y d ) ⇔ (Select X ψ ∋ y) + selection {ψ} {X} {y} = {!!} + replacement : {ψ : HOD → HOD} (X x : HOD) → Replace X ψ ∋ ψ x + replacement {ψ} X x = sup-c< ψ {x} + ∅-iso : {x : HOD} → ¬ (x == od∅) → ¬ ((ord→od (od→ord x)) == od∅) + ∅-iso {x} neq = subst (λ k → ¬ k) (=-iso {n} ) neq + minimul : (x : HOD {suc n} ) → ¬ (x == od∅ )→ HOD {suc n} + minimul x not = {!!} + regularity : (x : HOD) (not : ¬ (x == od∅)) → + (x ∋ minimul x not) ∧ (Select (minimul x not) (λ x₁ d → (minimul x not ∋ x₁) ∧ (x ∋ x₁)) == od∅) + proj1 (regularity x not ) = {!!} + proj2 (regularity x not ) = record { eq→ = reg ; eq← = {!!} } where + reg : {y : Ordinal} → def (Select (minimul x not) (λ x₂ d → (minimul x not ∋ x₂) ∧ (x ∋ x₂))) y → def od∅ y + reg {y} t = {!!} + extensionality : {A B : HOD {suc n}} → ((z : HOD) → (A ∋ z) ⇔ (B ∋ z)) → A == B + eq→ (extensionality {A} {B} eq ) {x} d = def-iso {suc n} {A} {B} (sym diso) (proj1 (eq (ord→od x))) d + eq← (extensionality {A} {B} eq ) {x} d = def-iso {suc n} {B} {A} (sym diso) (proj2 (eq (ord→od x))) d + xx-union : {x : HOD {suc n}} → (x , x) ≡ record { def = λ z → z o< osuc (od→ord x) } + xx-union {x} = cong ( λ k → Ord k ) (omxx (od→ord x)) + xxx-union : {x : HOD {suc n}} → (x , (x , x)) ≡ record { def = λ z → z o< osuc (osuc (od→ord x))} + xxx-union {x} = cong ( λ k → Ord k ) lemma where + lemma1 : {x : HOD {suc n}} → od→ord x o< od→ord (x , x) + lemma1 {x} = c<→o< ( proj1 (pair x x ) ) + lemma2 : {x : HOD {suc n}} → od→ord (x , x) ≡ osuc (od→ord x) + lemma2 = trans ( cong ( λ k → od→ord k ) xx-union ) {!!} + lemma : {x : HOD {suc n}} → omax (od→ord x) (od→ord (x , x)) ≡ osuc (osuc (od→ord x)) + lemma {x} = trans ( sym ( omax< (od→ord x) (od→ord (x , x)) lemma1 ) ) ( cong ( λ k → osuc k ) lemma2 ) + uxxx-union : {x : HOD {suc n}} → Union (x , (x , x)) ≡ record { def = λ z → osuc z o< osuc (osuc (od→ord x)) } + uxxx-union {x} = cong ( λ k → record { def = λ z → osuc z o< k ; otrans = {!!} } ) lemma where + lemma : od→ord (x , (x , x)) ≡ osuc (osuc (od→ord x)) + lemma = trans ( cong ( λ k → od→ord k ) xxx-union ) {!!} + uxxx-2 : {x : HOD {suc n}} → record { def = λ z → osuc z o< osuc (osuc (od→ord x)) } == record { def = λ z → z o< osuc (od→ord x) } + eq→ ( uxxx-2 {x} ) {m} lt = proj1 (osuc2 m (od→ord x)) lt + eq← ( uxxx-2 {x} ) {m} lt = proj2 (osuc2 m (od→ord x)) lt + uxxx-ord : {x : HOD {suc n}} → od→ord (Union (x , (x , x))) ≡ osuc (od→ord x) + uxxx-ord {x} = trans (cong (λ k → od→ord k ) uxxx-union) {!!} + infinite : HOD {suc n} + infinite = Ord omega + infinity∅ : Ord omega ∋ od∅ {suc n} + infinity∅ = {!!} + infinity : (x : HOD) → infinite ∋ x → infinite ∋ Union (x , (x , x )) + infinity x lt = {!!} where + lemma : (ox : Ordinal {suc n} ) → ox o< omega → osuc ox o< omega + lemma record { lv = Zero ; ord = (Φ .0) } (case1 (s≤s x)) = case1 (s≤s z≤n) + lemma record { lv = Zero ; ord = (OSuc .0 ord₁) } (case1 (s≤s x)) = case1 (s≤s z≤n) + lemma record { lv = (Suc lv₁) ; ord = (Φ .(Suc lv₁)) } (case1 (s≤s ())) + lemma record { lv = (Suc lv₁) ; ord = (OSuc .(Suc lv₁) ord₁) } (case1 (s≤s ())) + lemma record { lv = 1 ; ord = (Φ 1) } (case2 c2) with d<→lv c2 + lemma record { lv = (Suc Zero) ; ord = (Φ .1) } (case2 ()) | refl + -- ∀ X [ ∅ ∉ X → (∃ f : X → ⋃ X ) → ∀ A ∈ X ( f ( A ) ∈ A ) ] -- this form is no good since X is a transitive set + -- ∀ z [ ∀ x ( x ∈ z → ¬ ( x ≈ ∅ ) ) ∧ ∀ x ∀ y ( x , y ∈ z ∧ ¬ ( x ≈ y ) → x ∩ y ≈ ∅ ) → ∃ u ∀ x ( x ∈ z → ∃ t ( u ∩ x) ≈ { t }) ] + record Choice (z : HOD {suc n}) : Set (suc (suc n)) where + field + u : {x : HOD {suc n}} ( x∈z : x ∈ z ) → HOD {suc n} + t : {x : HOD {suc n}} ( x∈z : x ∈ z ) → (x : HOD {suc n} ) → HOD {suc n} + choice : { x : HOD {suc n} } → ( x∈z : x ∈ z ) → ( u x∈z ∩ x) == { t x∈z x } + -- choice : {x : HOD {suc n}} ( x ∈ z → ¬ ( x ≈ ∅ ) ) → + -- axiom-of-choice : { X : HOD } → ( ¬x∅ : ¬ ( X == od∅ ) ) → { A : HOD } → (A∈X : A ∈ X ) → choice ¬x∅ A∈X ∈ A + -- axiom-of-choice {X} nx {A} lt = ¬∅=→∅∈ {!!} +
--- a/ordinal-definable.agda Thu Jun 20 13:18:18 2019 +0900 +++ b/ordinal-definable.agda Tue Jun 25 05:50:22 2019 +0900 @@ -1,3 +1,5 @@ +{-# OPTIONS --allow-unsolved-metas #-} + open import Level module ordinal-definable where @@ -17,13 +19,21 @@ record OD {n : Level} : Set (suc n) where field def : (x : Ordinal {n} ) → Set n - otrans : {x y : Ordinal {n} } → def x → y o< x → def y open OD open import Data.Unit open Ordinal +-- Ordinal in OD ( and ZFSet ) +Ord : { n : Level } → ( a : Ordinal {n} ) → OD {n} +Ord {n} a = record { def = λ y → y o< a } + +-- od∅ : {n : Level} → OD {n} +-- od∅ {n} = record { def = λ _ → Lift n ⊥ } +od∅ : {n : Level} → OD {n} +od∅ {n} = Ord o∅ + record _==_ {n : Level} ( a b : OD {n} ) : Set n where field eq→ : ∀ { x : Ordinal {n} } → def a x → def b x @@ -43,30 +53,22 @@ eq-trans : {n : Level} { x y z : OD {n} } → x == y → y == z → x == z eq-trans x=y y=z = record { eq→ = λ t → eq→ y=z ( eq→ x=y t) ; eq← = λ t → eq← x=y ( eq← y=z t) } --- Ordinal in OD ( and ZFSet ) -Ord : { n : Level } → ( a : Ordinal {n} ) → OD {n} -Ord {n} a = record { def = λ y → y o< a ; otrans = lemma } where - lemma : {x y : Ordinal} → x o< a → y o< x → y o< a - lemma {x} {y} x<a y<x = ordtrans {n} {y} {x} {a} y<x x<a +ord→od : {n : Level} → Ordinal {n} → OD {n} +ord→od a = Ord a --- od∅ : {n : Level} → OD {n} --- od∅ {n} = record { def = λ _ → Lift n ⊥ } -od∅ : {n : Level} → OD {n} -od∅ {n} = Ord o∅ +o<→c< : {n : Level} {x y : Ordinal {n} } → x o< y → def (ord→od y) x +o<→c< {n} {x} {y} lt = lt postulate -- OD can be iso to a subset of Ordinal ( by means of Godel Set ) od→ord : {n : Level} → OD {n} → Ordinal {n} - ord→od : {n : Level} → Ordinal {n} → OD {n} c<→o< : {n : Level} {x y : OD {n} } → def y ( od→ord x ) → od→ord x o< od→ord y - -- next assumption causes ∀ x ∋ ∅ . It menas only an ordinal becomes a set - -- o<→c< : {n : Level} {x y : Ordinal {n} } → x o< y → def (ord→od y) x oiso : {n : Level} {x : OD {n}} → ord→od ( od→ord x ) ≡ x diso : {n : Level} {x : Ordinal {n}} → od→ord ( ord→od x ) ≡ x -- supermum as Replacement Axiom sup-o : {n : Level } → ( Ordinal {n} → Ordinal {n}) → Ordinal {n} sup-o< : {n : Level } → { ψ : Ordinal {n} → Ordinal {n}} → ∀ {x : Ordinal {n}} → ψ x o< sup-o ψ - -- contra-position of mimimulity of supermum required in Power Set Axiom + -- a property of supermum required in Power Set Axiom sup-x : {n : Level } → ( Ordinal {n} → Ordinal {n}) → Ordinal {n} sup-lb : {n : Level } → { ψ : Ordinal {n} → Ordinal {n}} → {z : Ordinal {n}} → z o< sup-o ψ → z o< osuc (ψ (sup-x ψ)) -- sup-lb : {n : Level } → ( ψ : Ordinal {n} → Ordinal {n}) → ( ∀ {x : Ordinal {n}} → ψx o< z ) → z o< osuc ( sup-o ψ ) @@ -77,9 +79,6 @@ _c<_ : { n : Level } → ( x a : OD {n} ) → Set n x c< a = a ∋ x -postulate - o<→c< : {n : Level} {x y : Ordinal {n} } → x o< y → Ord y ∋ Ord x - _c≤_ : {n : Level} → OD {n} → OD {n} → Set (suc n) a c≤ b = (a ≡ b) ∨ ( b ∋ a ) @@ -87,13 +86,15 @@ def-subst df refl refl = df sup-od : {n : Level } → ( OD {n} → OD {n}) → OD {n} -sup-od ψ = Ord ( sup-o ( λ x → od→ord (ψ (ord→od x ))) ) +sup-od ψ = ord→od ( sup-o ( λ x → od→ord (ψ (ord→od x ))) ) sup-c< : {n : Level } → ( ψ : OD {n} → OD {n}) → ∀ {x : OD {n}} → def ( sup-od ψ ) (od→ord ( ψ x )) -sup-c< {n} ψ {x} = def-subst {n} {_} {_} {Ord ( sup-o ( λ x → od→ord (ψ (ord→od x ))) )} {od→ord ( ψ x )} - lemma refl (cong ( λ k → od→ord (ψ k) ) oiso) where - lemma : od→ord (ψ (ord→od (od→ord x))) o< sup-o (λ x → od→ord (ψ (ord→od x))) - lemma = subst₂ (λ j k → j o< k ) refl diso (o<-subst sup-o< refl (sym diso) ) +sup-c< {n} ψ {x} = def-subst {n} {_} {_} {sup-od ψ} {od→ord ( ψ x )} + ( o<→c< sup-o< ) refl (cong ( λ k → od→ord (ψ k) ) oiso) + +∅1 : {n : Level} → ( x : OD {n} ) → ¬ ( x c< od∅ {n} ) +∅1 {n} x (case1 ()) +∅1 {n} x (case2 ()) ∅3 : {n : Level} → { x : Ordinal {n}} → ( ∀(y : Ordinal {n}) → ¬ (y o< x ) ) → x ≡ o∅ {n} ∅3 {n} {x} = TransFinite {n} c2 c3 x where @@ -114,7 +115,11 @@ transitive : {n : Level } { z y x : OD {suc n} } → z ∋ y → y ∋ x → z ∋ x transitive {n} {z} {y} {x} z∋y x∋y with ordtrans ( c<→o< {suc n} {x} {y} x∋y ) ( c<→o< {suc n} {y} {z} z∋y ) -... | t = otrans z z∋y (c<→o< {suc n} {x} {y} x∋y ) +... | t = lemma0 (lemma t) where + lemma : ( od→ord x ) o< ( od→ord z ) → def ( ord→od ( od→ord z )) ( od→ord x) + lemma xo<z = o<→c< xo<z + lemma0 : def ( ord→od ( od→ord z )) ( od→ord x) → def z (od→ord x) + lemma0 dz = def-subst {suc n} { ord→od ( od→ord z )} { od→ord x} dz (oiso) refl record Minimumo {n : Level } (x : Ordinal {n}) : Set (suc n) where field @@ -158,50 +163,100 @@ c≤-refl : {n : Level} → ( x : OD {n} ) → x c≤ x c≤-refl x = case1 refl +o<→o> : {n : Level} → { x y : OD {n} } → (x == y) → (od→ord x ) o< ( od→ord y) → ⊥ +o<→o> {n} {x} {y} record { eq→ = xy ; eq← = yx } (case1 lt) with + yx (def-subst {n} {ord→od (od→ord y)} {od→ord x} (o<→c< (case1 lt )) oiso refl ) +... | oyx with o<¬≡ refl (c<→o< {n} {x} oyx ) +... | () +o<→o> {n} {x} {y} record { eq→ = xy ; eq← = yx } (case2 lt) with + yx (def-subst {n} {ord→od (od→ord y)} {od→ord x} (o<→c< (case2 lt )) oiso refl ) +... | oyx with o<¬≡ refl (c<→o< {n} {x} oyx ) +... | () + +==→o≡ : {n : Level} → { x y : Ordinal {suc n} } → ord→od x == ord→od y → x ≡ y +==→o≡ {n} {x} {y} eq with trio< {n} x y +==→o≡ {n} {x} {y} eq | tri< a ¬b ¬c = ⊥-elim ( o<→o> eq (o<-subst a (sym ord-iso) (sym ord-iso ))) +==→o≡ {n} {x} {y} eq | tri≈ ¬a b ¬c = b +==→o≡ {n} {x} {y} eq | tri> ¬a ¬b c = ⊥-elim ( o<→o> (eq-sym eq) (o<-subst c (sym ord-iso) (sym ord-iso ))) + +≡-def : {n : Level} → { x : Ordinal {suc n} } → x ≡ od→ord (record { def = λ z → z o< x } ) +≡-def {n} {x} = ==→o≡ {n} (subst (λ k → ord→od x == k ) (sym oiso) lemma ) where + lemma : ord→od x == record { def = λ z → z o< x } + eq→ lemma {w} z = subst₂ (λ k j → k o< j ) diso refl (subst (λ k → (od→ord ( ord→od w)) o< k ) diso t ) where + t : (od→ord ( ord→od w)) o< (od→ord (ord→od x)) + t = c<→o< {suc n} {ord→od w} {ord→od x} (def-subst {suc n} {_} {_} {ord→od x} {_} z refl (sym diso)) + eq← lemma {w} z = def-subst {suc n} {_} {_} {ord→od x} {w} ( o<→c< {suc n} {_} {_} z ) refl refl + +od≡-def : {n : Level} → { x : Ordinal {suc n} } → ord→od x ≡ record { def = λ z → z o< x } +od≡-def {n} {x} = subst (λ k → ord→od x ≡ k ) oiso (cong ( λ k → ord→od k ) (≡-def {n} {x} )) + +==→o≡1 : {n : Level} → { x y : OD {suc n} } → x == y → od→ord x ≡ od→ord y +==→o≡1 eq = ==→o≡ (subst₂ (λ k j → k == j ) (sym oiso) (sym oiso) eq ) + +==-def-l : {n : Level } {x y : Ordinal {suc n} } { z : OD {suc n} }→ (ord→od x == ord→od y) → def z x → def z y +==-def-l {n} {x} {y} {z} eq z>x = subst ( λ k → def z k ) (==→o≡ eq) z>x + +==-def-r : {n : Level } {x y : OD {suc n} } { z : Ordinal {suc n} }→ (x == y) → def x z → def y z +==-def-r {n} {x} {y} {z} eq z>x = subst (λ k → def k z ) (subst₂ (λ j k → j ≡ k ) oiso oiso (cong (λ k → ord→od k) (==→o≡1 eq))) z>x + ∋→o< : {n : Level} → { a x : OD {suc n} } → a ∋ x → od→ord x o< od→ord a ∋→o< {n} {a} {x} lt = t where t : (od→ord x) o< (od→ord a) t = c<→o< {suc n} {x} {a} lt +o<∋→ : {n : Level} → { a x : OD {suc n} } → od→ord x o< od→ord a → a ∋ x +o<∋→ {n} {a} {x} lt = subst₂ (λ k j → def k j ) oiso refl t where + t : def (ord→od (od→ord a)) (od→ord x) + t = o<→c< {suc n} {od→ord x} {od→ord a} lt + o∅≡od∅ : {n : Level} → ord→od (o∅ {suc n}) ≡ od∅ {suc n} o∅≡od∅ {n} with trio< {n} (o∅ {suc n}) (od→ord (od∅ {suc n} )) o∅≡od∅ {n} | tri< a ¬b ¬c = ⊥-elim (lemma a) where lemma : o∅ {suc n } o< (od→ord (od∅ {suc n} )) → ⊥ - lemma lt with def-subst {!!} oiso refl - lemma lt | t = {!!} + lemma lt with def-subst (o<→c< lt) oiso refl + lemma lt | case1 () + lemma lt | case2 () o∅≡od∅ {n} | tri≈ ¬a b ¬c = trans (cong (λ k → ord→od k ) b ) oiso o∅≡od∅ {n} | tri> ¬a ¬b c = ⊥-elim (¬x<0 c) -ord-od∅ : {n : Level} → o∅ {suc n} ≡ od→ord (Ord (o∅ {suc n})) -ord-od∅ {n} with trio< {n} (o∅ {suc n}) (od→ord (Ord (o∅ {suc n}))) -ord-od∅ {n} | tri< a ¬b ¬c = ⊥-elim (lemma a) where - lemma : o∅ {suc n } o< (od→ord (Ord (o∅ {suc n}))) → ⊥ - lemma lt with o<→c< lt - lemma lt | t = o<¬≡ refl t -ord-od∅ {n} | tri≈ ¬a b ¬c = b -ord-od∅ {n} | tri> ¬a ¬b c = ⊥-elim (¬x<0 c) +o<→¬== : {n : Level} → { x y : OD {n} } → (od→ord x ) o< ( od→ord y) → ¬ (x == y ) +o<→¬== {n} {x} {y} lt eq = o<→o> eq lt o<→¬c> : {n : Level} → { x y : OD {n} } → (od→ord x ) o< ( od→ord y) → ¬ (y c< x ) o<→¬c> {n} {x} {y} olt clt = o<> olt (c<→o< clt ) where o≡→¬c< : {n : Level} → { x y : OD {n} } → (od→ord x ) ≡ ( od→ord y) → ¬ x c< y -o≡→¬c< {n} {x} {y} oeq lt = o<¬≡ (orefl oeq ) (c<→o< lt) +o≡→¬c< {n} {x} {y} oeq lt = o<¬≡ (orefl oeq ) (c<→o< lt) -∅0 : {n : Level} → record { def = λ x → Lift n ⊥ ; otrans = λ () } == od∅ {n} -eq→ ∅0 {w} (lift ()) -eq← ∅0 {w} (case1 ()) -eq← ∅0 {w} (case2 ()) +tri-c< : {n : Level} → Trichotomous _==_ (_c<_ {suc n}) +tri-c< {n} x y with trio< {n} (od→ord x) (od→ord y) +tri-c< {n} x y | tri< a ¬b ¬c = tri< (def-subst (o<→c< a) oiso refl) (o<→¬== a) ( o<→¬c> a ) +tri-c< {n} x y | tri≈ ¬a b ¬c = tri≈ (o≡→¬c< b) (ord→== b) (o≡→¬c< (sym b)) +tri-c< {n} x y | tri> ¬a ¬b c = tri> ( o<→¬c> c) (λ eq → o<→¬== c (eq-sym eq ) ) (def-subst (o<→c< c) oiso refl) + +c<> : {n : Level } { x y : OD {suc n}} → x c< y → y c< x → ⊥ +c<> {n} {x} {y} x<y y<x with tri-c< x y +c<> {n} {x} {y} x<y y<x | tri< a ¬b ¬c = ¬c y<x +c<> {n} {x} {y} x<y y<x | tri≈ ¬a b ¬c = o<→o> b ( c<→o< x<y ) +c<> {n} {x} {y} x<y y<x | tri> ¬a ¬b c = ¬a x<y ∅< : {n : Level} → { x y : OD {n} } → def x (od→ord y ) → ¬ ( x == od∅ {n} ) -∅< {n} {x} {y} d eq with eq→ (eq-trans eq (eq-sym ∅0) ) d -∅< {n} {x} {y} d eq | lift () +∅< {n} {x} {y} d eq with eq→ eq d +∅< {n} {x} {y} d eq | case1 () +∅< {n} {x} {y} d eq | case2 () --- ∅6 : {n : Level} → { x : OD {suc n} } → ¬ ( x ∋ x ) -- no Russel paradox --- ∅6 {n} {x} x∋x = c<> {n} {x} {x} x∋x x∋x +∅6 : {n : Level} → { x : OD {suc n} } → ¬ ( x ∋ x ) -- no Russel paradox +∅6 {n} {x} x∋x = c<> {n} {x} {x} x∋x x∋x def-iso : {n : Level} {A B : OD {n}} {x y : Ordinal {n}} → x ≡ y → (def A y → def B y) → def A x → def B x def-iso refl t = t +is-∋ : {n : Level} → ( x y : OD {suc n} ) → Dec ( x ∋ y ) +is-∋ {n} x y with tri-c< x y +is-∋ {n} x y | tri< a ¬b ¬c = no ¬c +is-∋ {n} x y | tri≈ ¬a b ¬c = no ¬c +is-∋ {n} x y | tri> ¬a ¬b c = yes c + is-o∅ : {n : Level} → ( x : Ordinal {suc n} ) → Dec ( x ≡ o∅ {suc n} ) is-o∅ {n} record { lv = Zero ; ord = (Φ .0) } = yes refl is-o∅ {n} record { lv = Zero ; ord = (OSuc .0 ord₁) } = no ( λ () ) @@ -209,6 +264,19 @@ open _∧_ +-- +-- This menas OD is Ordinal here +-- +¬∅=→∅∈ : {n : Level} → { x : OD {suc n} } → ¬ ( x == od∅ {suc n} ) → x ∋ od∅ {suc n} +¬∅=→∅∈ {n} {x} ne = def-subst (lemma (od→ord x) (subst (λ k → ¬ (k == od∅ {suc n} )) (sym oiso) ne )) oiso refl where + lemma : (ox : Ordinal {suc n}) → ¬ (ord→od ox == od∅ {suc n} ) → ord→od ox ∋ od∅ {suc n} + lemma ox ne with is-o∅ ox + lemma ox ne | yes refl with ne ( ord→== lemma1 ) where + lemma1 : od→ord (ord→od o∅) ≡ od→ord od∅ + lemma1 = cong ( λ k → od→ord k ) o∅≡od∅ + lemma o∅ ne | yes refl | () + lemma ox ne | no ¬p = subst ( λ k → def (ord→od ox) (od→ord k) ) o∅≡od∅ (o<→c< (subst (λ k → k o< ox ) (sym diso) (∅5 ¬p)) ) + -- open import Relation.Binary.HeterogeneousEquality as HE using (_≅_ ) -- postulate f-extensionality : { n : Level} → Relation.Binary.PropositionalEquality.Extensionality (suc n) (suc (suc n)) @@ -218,7 +286,7 @@ -- Power Set of X ( or constructible by λ y → def X (od→ord y ) ZFSubset : {n : Level} → (A x : OD {suc n} ) → OD {suc n} -ZFSubset A x = record { def = λ y → def A y ∧ def x y ; otrans = {!!} } +ZFSubset A x = record { def = λ y → def A y ∧ def x y } Def : {n : Level} → (A : OD {suc n}) → OD {suc n} Def {n} A = ord→od ( sup-o ( λ x → od→ord ( ZFSubset A (ord→od x )) ) ) @@ -228,13 +296,10 @@ L {n} record { lv = Zero ; ord = (Φ .0) } = od∅ L {n} record { lv = lx ; ord = (OSuc lv ox) } = Def ( L {n} ( record { lv = lx ; ord = ox } ) ) L {n} record { lv = (Suc lx) ; ord = (Φ (Suc lx)) } = -- Union ( L α ) - record { def = λ y → osuc y o< (od→ord (L {n} (record { lv = lx ; ord = Φ lx }) )) ; otrans = {!!} } + record { def = λ y → osuc y o< (od→ord (L {n} (record { lv = lx ; ord = Φ lx }) )) } -omega : { n : Level } → Ordinal {n} -omega = record { lv = Suc Zero ; ord = Φ 1 } - -OD→ZF : {n : Level} → ZF {suc (suc n)} {suc n} -OD→ZF {n} = record { +Ord→ZF : {n : Level} → ZF {suc (suc n)} {suc n} +Ord→ZF {n} = record { ZFSet = OD {suc n} ; _∋_ = _∋_ ; _≈_ = _==_ @@ -242,22 +307,19 @@ ; _,_ = _,_ ; Union = Union ; Power = Power - ; Select = Select + ; Select = {!!} ; Replace = Replace - ; infinite = Ord omega + ; infinite = ord→od ( record { lv = Suc Zero ; ord = Φ 1 } ) ; isZF = isZF } where Replace : OD {suc n} → (OD {suc n} → OD {suc n} ) → OD {suc n} Replace X ψ = sup-od ψ - Select : (X : OD {suc n} ) → ((x : OD {suc n} ) → X ∋ x → Set (suc n) ) → OD {suc n} - Select X ψ = record { def = λ x → ( (d : def X x ) → ψ (ord→od x) (subst (λ k → def X k ) (sym diso) d)) ; otrans = lemma } where - lemma : {x y : Ordinal} → ((d : def X x) → ψ (ord→od x) (subst (def X) (sym diso) d)) → - y o< x → (d : def X y) → ψ (ord→od y) (subst (def X) (sym diso) d) - lemma {x} {y} f y<x d = {!!} + Select : OD {suc n} → (OD {suc n} → Set (suc n) ) → OD {suc n} + Select X ψ = record { def = λ x → ( def X x ∧ ψ ( ord→od x )) } _,_ : OD {suc n} → OD {suc n} → OD {suc n} - x , y = Ord (omax (od→ord x) (od→ord y)) + x , y = record { def = λ z → z o< (omax (od→ord x) (od→ord y)) } Union : OD {suc n} → OD {suc n} - Union U = record { def = λ y → osuc y o< (od→ord U) ; otrans = {!!} } + Union U = record { def = λ y → osuc y o< (od→ord U) } -- power : ∀ X ∃ A ∀ t ( t ∈ A ↔ ( ∀ {x} → t ∋ x → X ∋ x ) Power : OD {suc n} → OD {suc n} Power A = Def A @@ -266,17 +328,14 @@ A ∈ B = B ∋ A _⊆_ : ( A B : ZFSet ) → ∀{ x : ZFSet } → Set (suc n) _⊆_ A B {x} = A ∋ x → B ∋ x - _∩_ : ( A B : ZFSet ) → ZFSet - A ∩ B = Select (A , B) ( λ x d → ( A ∋ x ) ∧ (B ∋ x) ) + -- _∩_ : ( A B : ZFSet ) → ZFSet + -- A ∩ B = Select (A , B) ( λ x → ( A ∋ x ) ∧ (B ∋ x) ) -- _∪_ : ( A B : ZFSet ) → ZFSet -- A ∪ B = Select (A , B) ( λ x → (A ∋ x) ∨ ( B ∋ x ) ) - {_} : ZFSet → ZFSet - { x } = ( x , x ) - infixr 200 _∈_ -- infixr 230 _∩_ _∪_ infixr 220 _⊆_ - isZF : IsZF (OD {suc n}) _∋_ _==_ od∅ _,_ Union Power Select Replace (Ord omega) + isZF : IsZF (OD {suc n}) _∋_ _==_ od∅ _,_ Union Power {!!} Replace (ord→od ( record { lv = Suc Zero ; ord = Φ 1} )) isZF = record { isEquivalence = record { refl = eq-refl ; sym = eq-sym; trans = eq-trans } ; pair = pair @@ -291,7 +350,7 @@ ; regularity = regularity ; infinity∅ = infinity∅ ; infinity = λ _ → infinity - ; selection = λ {ψ} {X} {y} → selection {ψ} {X} {y} + ; selection = λ {ψ} {X} {y} → {!!} ; replacement = replacement } where open _∧_ @@ -315,30 +374,31 @@ minsup : OD minsup = ZFSubset A ( ord→od ( sup-x (λ x → od→ord ( ZFSubset A (ord→od x))))) lemma-t : csuc minsup ∋ t - lemma-t = {!!} -- o<→c< (o<-subst (sup-lb (o<-subst (c<→o< P∋t) refl diso )) refl refl ) + lemma-t = o<→c< (o<-subst (sup-lb (o<-subst (c<→o< P∋t) refl diso )) refl refl ) lemma-s : ZFSubset A ( ord→od ( sup-x (λ x → od→ord ( ZFSubset A (ord→od x))))) ∋ x lemma-s with osuc-≡< ( o<-subst (c<→o< lemma-t ) refl diso ) - lemma-s | case1 eq = def-subst {!!} oiso refl - lemma-s | case2 lt = transitive {n} {minsup} {t} {x} (def-subst {!!} oiso refl ) t∋x + lemma-s | case1 eq = def-subst ( ==-def-r (o≡→== eq) (subst (λ k → def k (od→ord x)) (sym oiso) t∋x ) ) oiso refl + lemma-s | case2 lt = transitive {n} {minsup} {t} {x} (def-subst (o<→c< lt) oiso refl ) t∋x -- -- we have t ∋ x → A ∋ x means t is a subset of A, that is ZFSubset A t == t -- Power A is a sup of ZFSubset A t, so Power A ∋ t -- power← : (A t : OD) → ({x : OD} → (t ∋ x → A ∋ x)) → Power A ∋ t power← A t t→A = def-subst {suc n} {_} {_} {Power A} {od→ord t} - {!!} refl lemma1 where + ( o<→c< {suc n} {od→ord (ZFSubset A (ord→od (od→ord t)) )} {sup-o (λ x → od→ord (ZFSubset A (ord→od x)))} + lemma ) refl lemma1 where lemma-eq : ZFSubset A t == t eq→ lemma-eq {z} w = proj2 w eq← lemma-eq {z} w = record { proj2 = w ; proj1 = def-subst {suc n} {_} {_} {A} {z} ( t→A (def-subst {suc n} {_} {_} {t} {od→ord (ord→od z)} w refl (sym diso) )) refl diso } lemma1 : od→ord (ZFSubset A (ord→od (od→ord t))) ≡ od→ord t - lemma1 = subst (λ k → od→ord (ZFSubset A k) ≡ od→ord t ) (sym oiso) {!!} + lemma1 = subst (λ k → od→ord (ZFSubset A k) ≡ od→ord t ) (sym oiso) (==→o≡1 (lemma-eq)) lemma : od→ord (ZFSubset A (ord→od (od→ord t)) ) o< sup-o (λ x → od→ord (ZFSubset A (ord→od x))) lemma = sup-o< union-lemma-u : {X z : OD {suc n}} → (U>z : Union X ∋ z ) → csuc z ∋ z union-lemma-u {X} {z} U>z = lemma <-osuc where lemma : {oz ooz : Ordinal {suc n}} → oz o< ooz → def (ord→od ooz) oz - lemma {oz} {ooz} lt = def-subst {suc n} {ord→od ooz} {!!} refl refl + lemma {oz} {ooz} lt = def-subst {suc n} {ord→od ooz} (o<→c< lt) refl refl union→ : (X z u : OD) → (X ∋ u) ∧ (u ∋ z) → Union X ∋ z union→ X y u xx with trio< ( od→ord u ) ( osuc ( od→ord y )) union→ X y u xx | tri< a ¬b ¬c with osuc-< a (c<→o< (proj2 xx)) @@ -348,51 +408,68 @@ lemma refl lt = lt union→ X y u xx | tri> ¬a ¬b c = ordtrans {suc n} {osuc ( od→ord y )} {od→ord u} {od→ord X} c ( c<→o< (proj1 xx )) union← : (X z : OD) (X∋z : Union X ∋ z) → (X ∋ csuc z) ∧ (csuc z ∋ z ) - union← X z X∋z = record { proj1 = def-subst {suc n} {_} {_} {X} {od→ord (csuc z )} {!!} oiso (sym diso) ; proj2 = union-lemma-u X∋z } + union← X z X∋z = record { proj1 = def-subst {suc n} {_} {_} {X} {od→ord (csuc z )} (o<→c< X∋z) oiso (sym diso) ; proj2 = union-lemma-u X∋z } ψiso : {ψ : OD {suc n} → Set (suc n)} {x y : OD {suc n}} → ψ x → x ≡ y → ψ y ψiso {ψ} t refl = t - selection : {X : OD } {ψ : (x : OD ) → x ∈ X → Set (suc n)} {y : OD} → ((d : X ∋ y ) → ψ y d ) ⇔ (Select X ψ ∋ y) - selection {ψ} {X} {y} = {!!} + selection : {ψ : OD → Set (suc n)} {X y : OD} → ((X ∋ y) ∧ ψ y) ⇔ (Select X ψ ∋ y) + selection {ψ} {X} {y} = record { + proj1 = λ cond → record { proj1 = proj1 cond ; proj2 = ψiso {ψ} (proj2 cond) (sym oiso) } + ; proj2 = λ select → record { proj1 = proj1 select ; proj2 = ψiso {ψ} (proj2 select) oiso } + } replacement : {ψ : OD → OD} (X x : OD) → Replace X ψ ∋ ψ x replacement {ψ} X x = sup-c< ψ {x} ∅-iso : {x : OD} → ¬ (x == od∅) → ¬ ((ord→od (od→ord x)) == od∅) ∅-iso {x} neq = subst (λ k → ¬ k) (=-iso {n} ) neq minimul : (x : OD {suc n} ) → ¬ (x == od∅ )→ OD {suc n} - minimul x not = {!!} + minimul x not = od∅ regularity : (x : OD) (not : ¬ (x == od∅)) → - (x ∋ minimul x not) ∧ (Select (minimul x not) (λ x₁ d → (minimul x not ∋ x₁) ∧ (x ∋ x₁)) == od∅) - proj1 (regularity x not ) = {!!} - proj2 (regularity x not ) = record { eq→ = reg ; eq← = {!!} } where - reg : {y : Ordinal} → def (Select (minimul x not) (λ x₂ d → (minimul x not ∋ x₂) ∧ (x ∋ x₂))) y → def od∅ y - reg {y} t = {!!} + (x ∋ minimul x not) ∧ (Select (minimul x not) (λ x₁ → (minimul x not ∋ x₁) ∧ (x ∋ x₁)) == od∅) + proj1 (regularity x not ) = ¬∅=→∅∈ not + proj2 (regularity x not ) = record { eq→ = reg ; eq← = lemma } where + lemma : {ox : Ordinal} → def od∅ ox → def (Select (minimul x not) (λ y → (minimul x not ∋ y) ∧ (x ∋ y))) ox + lemma (case1 ()) + lemma (case2 ()) + reg : {y : Ordinal} → def (Select (minimul x not) (λ x₂ → (minimul x not ∋ x₂) ∧ (x ∋ x₂))) y → def od∅ y + reg {y} t with proj1 t + ... | x∈∅ = x∈∅ extensionality : {A B : OD {suc n}} → ((z : OD) → (A ∋ z) ⇔ (B ∋ z)) → A == B eq→ (extensionality {A} {B} eq ) {x} d = def-iso {suc n} {A} {B} (sym diso) (proj1 (eq (ord→od x))) d eq← (extensionality {A} {B} eq ) {x} d = def-iso {suc n} {B} {A} (sym diso) (proj2 (eq (ord→od x))) d xx-union : {x : OD {suc n}} → (x , x) ≡ record { def = λ z → z o< osuc (od→ord x) } - xx-union {x} = cong ( λ k → Ord k ) (omxx (od→ord x)) + xx-union {x} = cong ( λ k → record { def = λ z → z o< k } ) (omxx (od→ord x)) xxx-union : {x : OD {suc n}} → (x , (x , x)) ≡ record { def = λ z → z o< osuc (osuc (od→ord x))} - xxx-union {x} = cong ( λ k → Ord k ) lemma where + xxx-union {x} = cong ( λ k → record { def = λ z → z o< k } ) lemma where lemma1 : {x : OD {suc n}} → od→ord x o< od→ord (x , x) lemma1 {x} = c<→o< ( proj1 (pair x x ) ) lemma2 : {x : OD {suc n}} → od→ord (x , x) ≡ osuc (od→ord x) - lemma2 = trans ( cong ( λ k → od→ord k ) xx-union ) {!!} + lemma2 = trans ( cong ( λ k → od→ord k ) xx-union ) (sym ≡-def) lemma : {x : OD {suc n}} → omax (od→ord x) (od→ord (x , x)) ≡ osuc (osuc (od→ord x)) lemma {x} = trans ( sym ( omax< (od→ord x) (od→ord (x , x)) lemma1 ) ) ( cong ( λ k → osuc k ) lemma2 ) uxxx-union : {x : OD {suc n}} → Union (x , (x , x)) ≡ record { def = λ z → osuc z o< osuc (osuc (od→ord x)) } - uxxx-union {x} = cong ( λ k → record { def = λ z → osuc z o< k ; otrans = {!!} } ) lemma where + uxxx-union {x} = cong ( λ k → record { def = λ z → osuc z o< k } ) lemma where lemma : od→ord (x , (x , x)) ≡ osuc (osuc (od→ord x)) - lemma = trans ( cong ( λ k → od→ord k ) xxx-union ) {!!} + lemma = trans ( cong ( λ k → od→ord k ) xxx-union ) (sym ≡-def ) uxxx-2 : {x : OD {suc n}} → record { def = λ z → osuc z o< osuc (osuc (od→ord x)) } == record { def = λ z → z o< osuc (od→ord x) } eq→ ( uxxx-2 {x} ) {m} lt = proj1 (osuc2 m (od→ord x)) lt eq← ( uxxx-2 {x} ) {m} lt = proj2 (osuc2 m (od→ord x)) lt uxxx-ord : {x : OD {suc n}} → od→ord (Union (x , (x , x))) ≡ osuc (od→ord x) - uxxx-ord {x} = trans (cong (λ k → od→ord k ) uxxx-union) {!!} + uxxx-ord {x} = trans (cong (λ k → od→ord k ) uxxx-union) (==→o≡ (subst₂ (λ j k → j == k ) (sym oiso) (sym od≡-def ) uxxx-2 )) + omega = record { lv = Suc Zero ; ord = Φ 1 } infinite : OD {suc n} - infinite = Ord omega - infinity∅ : Ord omega ∋ od∅ {suc n} - infinity∅ = {!!} + infinite = ord→od ( omega ) + infinity∅ : ord→od ( omega ) ∋ od∅ {suc n} + infinity∅ = def-subst {suc n} {_} {o∅} {infinite} {od→ord od∅} + (o<→c< ( case1 (s≤s z≤n ))) refl (subst ( λ k → ( k ≡ od→ord od∅ )) diso (cong (λ k → od→ord k) o∅≡od∅ )) + infinite∋x : (x : OD) → infinite ∋ x → od→ord x o< omega + infinite∋x x lt = subst (λ k → od→ord x o< k ) diso t where + t : od→ord x o< od→ord (ord→od (omega)) + t = ∋→o< {n} {infinite} {x} lt + infinite∋uxxx : (x : OD) → osuc (od→ord x) o< omega → infinite ∋ Union (x , (x , x )) + infinite∋uxxx x lt = o<∋→ t where + t : od→ord (Union (x , (x , x))) o< od→ord (ord→od (omega)) + t = subst (λ k → od→ord (Union (x , (x , x))) o< k ) (sym diso ) ( subst ( λ k → k o< omega ) ( sym (uxxx-ord {x} ) ) lt ) infinity : (x : OD) → infinite ∋ x → infinite ∋ Union (x , (x , x )) - infinity x lt = {!!} where + infinity x lt = infinite∋uxxx x ( lemma (od→ord x) (infinite∋x x lt )) where lemma : (ox : Ordinal {suc n} ) → ox o< omega → osuc ox o< omega lemma record { lv = Zero ; ord = (Φ .0) } (case1 (s≤s x)) = case1 (s≤s z≤n) lemma record { lv = Zero ; ord = (OSuc .0 ord₁) } (case1 (s≤s x)) = case1 (s≤s z≤n) @@ -400,14 +477,4 @@ lemma record { lv = (Suc lv₁) ; ord = (OSuc .(Suc lv₁) ord₁) } (case1 (s≤s ())) lemma record { lv = 1 ; ord = (Φ 1) } (case2 c2) with d<→lv c2 lemma record { lv = (Suc Zero) ; ord = (Φ .1) } (case2 ()) | refl - -- ∀ X [ ∅ ∉ X → (∃ f : X → ⋃ X ) → ∀ A ∈ X ( f ( A ) ∈ A ) ] -- this form is no good since X is a transitive set - -- ∀ z [ ∀ x ( x ∈ z → ¬ ( x ≈ ∅ ) ) ∧ ∀ x ∀ y ( x , y ∈ z ∧ ¬ ( x ≈ y ) → x ∩ y ≈ ∅ ) → ∃ u ∀ x ( x ∈ z → ∃ t ( u ∩ x) ≈ { t }) ] - record Choice (z : OD {suc n}) : Set (suc (suc n)) where - field - u : {x : OD {suc n}} ( x∈z : x ∈ z ) → OD {suc n} - t : {x : OD {suc n}} ( x∈z : x ∈ z ) → (x : OD {suc n} ) → OD {suc n} - choice : { x : OD {suc n} } → ( x∈z : x ∈ z ) → ( u x∈z ∩ x) == { t x∈z x } - -- choice : {x : OD {suc n}} ( x ∈ z → ¬ ( x ≈ ∅ ) ) → - -- axiom-of-choice : { X : OD } → ( ¬x∅ : ¬ ( X == od∅ ) ) → { A : OD } → (A∈X : A ∈ X ) → choice ¬x∅ A∈X ∈ A - -- axiom-of-choice {X} nx {A} lt = ¬∅=→∅∈ {!!}