Mercurial > hg > Members > kono > Proof > ZF-in-agda
changeset 180:11490a3170d4
new ordinal-definable
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 20 Jul 2019 14:05:32 +0900 |
parents | aa89d1b8ce96 |
children | 7012158bf2d9 |
files | HOD.agda ordinal-definable.agda ordinal.agda |
diffstat | 3 files changed, 96 insertions(+), 202 deletions(-) [+] |
line wrap: on
line diff
--- a/HOD.agda Sat Jul 20 08:21:54 2019 +0900 +++ b/HOD.agda Sat Jul 20 14:05:32 2019 +0900 @@ -502,23 +502,20 @@ ≡⟨⟩ ly ∎ - lemma2 : { lx : Nat } → lx < Suc lx - lemma2 {Zero} = s≤s z≤n - lemma2 {Suc lx} = s≤s (lemma2 {lx}) lemma : (z : OD) → ord→od record { lv = ly ; ord = oy } ∋ z → ψ z lemma z lt with c<→o< {suc n} {z} {ord→od (record { lv = ly ; ord = oy })} lt lemma z lt | case1 lz<ly with <-cmp lx ly lemma z lt | case1 lz<ly | tri< a ¬b ¬c = ⊥-elim ( lemma0 y<sox a) -- can't happen - lemma z lt | case1 lz<ly | tri≈ ¬a refl ¬c = -- (1) + lemma z lt | case1 lz<ly | tri≈ ¬a refl ¬c = -- ly(1) subst (λ k → ψ k ) oiso (ε-induction-ord lx (Φ lx) {_} {ord (od→ord z)} (case1 (subst (λ k → lv (od→ord z) < k ) lemma1 lz<ly ) )) - lemma z lt | case1 lz<ly | tri> ¬a ¬b c = -- z(a) + lemma z lt | case1 lz<ly | tri> ¬a ¬b c = -- lz(a) subst (λ k → ψ k ) oiso (ε-induction-ord lx (Φ lx) {_} {ord (od→ord z)} (case1 (<-trans lz<ly (subst (λ k → k < lx ) (sym lemma1) c)))) lemma z lt | case2 lz=ly with <-cmp lx ly lemma z lt | case2 lz=ly | tri< a ¬b ¬c = ⊥-elim ( lemma0 y<sox a) -- can't happen - lemma z lt | case2 lz=ly | tri> ¬a ¬b c with d<→lv lz=ly -- z(b) + lemma z lt | case2 lz=ly | tri> ¬a ¬b c with d<→lv lz=ly -- lz(b) ... | eq = subst (λ k → ψ k ) oiso (ε-induction-ord lx (Φ lx) {_} {ord (od→ord z)} (case1 (subst (λ k → k < lx ) (trans (sym lemma1)(sym eq) ) c ))) - lemma z lt | case2 lz=ly | tri≈ ¬a lx=ly ¬c with d<→lv lz=ly -- z(c) + lemma z lt | case2 lz=ly | tri≈ ¬a lx=ly ¬c with d<→lv lz=ly -- lz(c) ... | eq = lemma6 {ly} {Φ lx} {oy} lx=ly (sym (subst (λ k → lv (od→ord z) ≡ k) lemma1 eq)) where lemma5 : (ox : OrdinalD lx) → (lv (od→ord z) < lx) ∨ (ord (od→ord z) d< ox) → ψ z lemma5 ox lt = subst (λ k → ψ k ) oiso (ε-induction-ord lx ox lt )
--- a/ordinal-definable.agda Sat Jul 20 08:21:54 2019 +0900 +++ b/ordinal-definable.agda Sat Jul 20 14:05:32 2019 +0900 @@ -5,6 +5,7 @@ open import zf open import ordinal +open import HOD open import Data.Nat renaming ( zero to Zero ; suc to Suc ; ℕ to Nat ; _⊔_ to _n⊔_ ) open import Relation.Binary.PropositionalEquality @@ -16,102 +17,19 @@ -- Ordinal Definable Set -record OD {n : Level} : Set (suc n) where - field - def : (x : Ordinal {n} ) → Set n - 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 - eq← : ∀ { x : Ordinal {n} } → def b x → def a x +open _==_ -id : {n : Level} {A : Set n} → A → A -id x = x - -eq-refl : {n : Level} { x : OD {n} } → x == x -eq-refl {n} {x} = record { eq→ = id ; eq← = id } - -open _==_ - -eq-sym : {n : Level} { x y : OD {n} } → x == y → y == x -eq-sym eq = record { eq→ = eq← eq ; eq← = eq→ eq } - -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) } - -ord→od : {n : Level} → Ordinal {n} → OD {n} -ord→od a = Ord a - -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} - c<→o< : {n : Level} {x y : OD {n} } → def y ( od→ord x ) → od→ord x o< od→ord y - 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 ψ -- 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 ψ ) - -_∋_ : { n : Level } → ( a x : OD {n} ) → Set n -_∋_ {n} a x = def a ( od→ord x ) - -_c<_ : { n : Level } → ( x a : OD {n} ) → Set n -x c< a = a ∋ x - -_c≤_ : {n : Level} → OD {n} → OD {n} → Set (suc n) -a c≤ b = (a ≡ b) ∨ ( b ∋ a ) - -def-subst : {n : Level } {Z : OD {n}} {X : Ordinal {n} }{z : OD {n}} {x : Ordinal {n} }→ def Z X → Z ≡ z → X ≡ x → def z x -def-subst df refl refl = df - -sup-od : {n : Level } → ( OD {n} → OD {n}) → OD {n} -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} {_} {_} {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 - 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 | () + o<→c< : {n : Level} {x y : Ordinal {n} } → x o< y → def (ord→od y) x 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 ) @@ -121,43 +39,6 @@ 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 -∅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 : OD {n} } → { y : Ordinal {n} } → od→ord x ≡ y → od→ord x ≡ y -orefl refl = refl - -==-iso : {n : Level} → { x y : OD {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 : OD {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 : OD {suc n} } → (x == y) ≡ (ord→od (od→ord x) == y) -=-iso {_} {_} {y} = cong ( λ k → k == y ) (sym oiso) - -ord→== : {n : Level} → { x y : OD {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 : 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 ) @@ -168,14 +49,14 @@ ... | 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 ))) +==→o≡o : {n : Level} → { x y : Ordinal {suc n} } → ord→od x == ord→od y → x ≡ y +==→o≡o {n} {x} {y} eq with trio< {n} x y +==→o≡o {n} {x} {y} eq | tri< a ¬b ¬c = ⊥-elim ( o<→o> eq (o<-subst a (sym ord-iso) (sym ord-iso ))) +==→o≡o {n} {x} {y} eq | tri≈ ¬a b ¬c = b +==→o≡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 +≡-def {n} {x} = ==→o≡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)) @@ -186,43 +67,22 @@ 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 ) +==→o≡1 eq = ==→o≡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-l {n} {x} {y} {z} eq z>x = subst ( λ k → def z k ) (==→o≡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 (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) - 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) - 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 ) @@ -235,16 +95,6 @@ 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 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 - -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 @@ -252,10 +102,6 @@ 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 ( λ () ) -is-o∅ {n} record { lv = (Suc lv₁) ; ord = ord } = no (λ()) open _∧_ @@ -278,24 +124,6 @@ csuc : {n : Level} → OD {suc n} → OD {suc n} csuc x = Ord ( osuc ( od→ord x )) -in-codomain : {n : Level} → (X : OD {suc n} ) → ( ψ : OD {suc n} → OD {suc n} ) → OD {suc n} -in-codomain {n} X ψ = record { def = λ x → ¬ ( (y : Ordinal {suc n}) → ¬ ( def X y ∧ ( x ≡ od→ord (ψ (Ord y ))))) } - --- 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 } - -Def : {n : Level} → (A : OD {suc n}) → OD {suc n} -Def {n} A = Ord ( sup-o ( λ x → od→ord ( ZFSubset A (ord→od x )) ) ) - --- Constructible Set on α -L : {n : Level} → (α : Ordinal {suc n}) → OD {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 }) )) } - Ord→ZF : {n : Level} → ZF {suc (suc n)} {suc n} Ord→ZF {n} = record { ZFSet = OD {suc n} @@ -373,9 +201,9 @@ 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 with osuc-≡< ( o<-subst (c<→o< {!!} ) refl diso ) 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 -- @@ -384,8 +212,7 @@ -- 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} - ( 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 + {!!} refl lemma1 where lemma-eq : ZFSubset A t == t eq→ lemma-eq {z} w = proj2 w eq← lemma-eq {z} w = record { proj2 = w ; @@ -396,7 +223,7 @@ 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 + union-lemma-u {X} {z} U>z = {!!} where -- 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} (o<→c< lt) refl refl union→ : (X z u : OD) → (X ∋ u) ∧ (u ∋ z) → Union X ∋ z @@ -409,7 +236,7 @@ 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) → ¬ ( (u : OD ) → ¬ ((X ∋ u) ∧ (u ∋ z ))) -- (X ∋ csuc z) ∧ (csuc z ∋ z ) union← X z X∋z not = not (csuc 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 } + record { proj1 = def-subst {suc n} {_} {_} {X} {od→ord (csuc z )} (o<→c< X∋z) oiso (sym {!!}) ; 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 @@ -424,7 +251,7 @@ lemma : def (in-codomain X ψ) (od→ord (ψ x)) lemma not = ⊥-elim ( not ( od→ord x ) (record { proj1 = lt ; proj2 = cong (λ k → od→ord (ψ k)) (sym oiso)} ) ) replacement→ : {ψ : OD → OD} (X x : OD) → (lt : Replace X ψ ∋ x) → ¬ ( (y : OD) → ¬ (x == ψ y)) - replacement→ {ψ} X x lt = contra-position lemma (lemma2 (proj2 lt)) where + replacement→ {ψ} X x lt = contra-position lemma (lemma2 {!!}) where lemma2 : ¬ ((y : Ordinal) → ¬ def X y ∧ ((od→ord x) ≡ od→ord (ψ (Ord y)))) → ¬ ((y : Ordinal) → ¬ def X y ∧ (ord→od (od→ord x) == ψ (Ord y))) lemma2 not not2 = not ( λ y d → not2 y (record { proj1 = proj1 d ; proj2 = lemma3 (proj2 d)})) where @@ -433,17 +260,17 @@ lemma : ( (y : OD) → ¬ (x == ψ y)) → ( (y : Ordinal) → ¬ def X y ∧ (ord→od (od→ord x) == ψ (Ord y)) ) lemma not y not2 = not (Ord y) (subst (λ k → k == ψ (Ord y)) oiso ( proj2 not2 )) - minimul : (x : OD {suc n} ) → ¬ (x == od∅ )→ OD {suc n} - minimul x not = od∅ + minimul-o : (x : OD {suc n} ) → ¬ (x == od∅ )→ OD {suc n} + minimul-o x not = od∅ regularity : (x : OD) (not : ¬ (x == od∅)) → (x ∋ minimul x not) ∧ (Select (minimul x not) (λ x₁ → (minimul x not ∋ x₁) ∧ (x ∋ x₁)) == od∅) - proj1 (regularity x not ) = ¬∅=→∅∈ not + proj1 (regularity x 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 = ⊥-elim ( ¬x<0 (proj1 (proj2 t )) ) + reg {y} t = ⊥-elim ( ¬x<0 {!!} ) 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 @@ -467,7 +294,7 @@ 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) (==→o≡ (subst₂ (λ j k → j == k ) (sym oiso) (sym od≡-def ) uxxx-2 )) + uxxx-ord {x} = trans (cong (λ k → od→ord k ) uxxx-union) (==→o≡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→od ( omega ) @@ -492,3 +319,67 @@ lemma record { lv = 1 ; ord = (Φ 1) } (case2 c2) with d<→lv c2 lemma record { lv = (Suc Zero) ; ord = (Φ .1) } (case2 ()) | refl + -- Axiom of choice ( is equivalent to the existence of minimul in our case ) + -- ∀ X [ ∅ ∉ X → (∃ f : X → ⋃ X ) → ∀ A ∈ X ( f ( A ) ∈ A ) ] + choice-func : (X : OD {suc n} ) → {x : OD } → ¬ ( x == od∅ ) → ( X ∋ x ) → OD + choice-func X {x} not X∋x = od∅ {suc n} + choice : (X : OD {suc n} ) → {A : OD } → ( X∋A : X ∋ A ) → (not : ¬ ( A == od∅ )) → A ∋ choice-func X not X∋A + choice X {A} X∋A not = ¬∅=→∅∈ not + + -- another form of regularity + -- + ε-induction : {n m : Level} { ψ : OD {suc n} → Set m} + → ( {x : OD {suc n} } → ({ y : OD {suc n} } → x ∋ y → ψ y ) → ψ x ) + → (x : OD {suc n} ) → ψ x + ε-induction {n} {m} {ψ} ind x = subst (λ k → ψ k ) oiso (ε-induction-ord (lv (osuc (od→ord x))) (ord (osuc (od→ord x))) <-osuc) where + ε-induction-ord : (lx : Nat) ( ox : OrdinalD {suc n} lx ) {ly : Nat} {oy : OrdinalD {suc n} ly } + → (ly < lx) ∨ (oy d< ox ) → ψ (ord→od (record { lv = ly ; ord = oy } ) ) + ε-induction-ord Zero (Φ 0) (case1 ()) + ε-induction-ord Zero (Φ 0) (case2 ()) + ε-induction-ord lx (OSuc lx ox) {ly} {oy} y<x = + ind {ord→od (record { lv = ly ; ord = oy })} ( λ {y} lt → subst (λ k → ψ k ) oiso (ε-induction-ord lx ox (lemma y lt ))) where + lemma : (y : OD) → ord→od record { lv = ly ; ord = oy } ∋ y → od→ord y o< record { lv = lx ; ord = ox } + lemma y lt with osuc-≡< y<x + lemma y lt | case1 refl = o<-subst (c<→o< lt) refl diso + lemma y lt | case2 lt1 = ordtrans (o<-subst (c<→o< lt) refl diso) lt1 + ε-induction-ord (Suc lx) (Φ (Suc lx)) {ly} {oy} (case1 y<sox ) = + ind {ord→od (record { lv = ly ; ord = oy })} ( λ {y} lt → lemma y lt ) where + -- + -- if lv of z if less than x Ok + -- else lv z = lv x. We can create OSuc of z which is larger than z and less than x in lemma + -- + -- lx Suc lx (1) lz(a) <lx by case1 + -- ly(1) ly(2) (2) lz(b) <lx by case1 + -- lz(a) lz(b) lz(c) lz(c) <lx by case2 ( ly==lz==lx) + -- + lemma0 : { lx ly : Nat } → ly < Suc lx → lx < ly → ⊥ + lemma0 {Suc lx} {Suc ly} (s≤s lt1) (s≤s lt2) = lemma0 lt1 lt2 + lemma1 : {n : Level } {ly : Nat} {oy : OrdinalD {suc n} ly} → lv (od→ord (ord→od (record { lv = ly ; ord = oy }))) ≡ ly + lemma1 {n} {ly} {oy} = let open ≡-Reasoning in begin + lv (od→ord (ord→od (record { lv = ly ; ord = oy }))) + ≡⟨ cong ( λ k → lv k ) diso ⟩ + lv (record { lv = ly ; ord = oy }) + ≡⟨⟩ + ly + ∎ + lemma : (z : OD) → ord→od record { lv = ly ; ord = oy } ∋ z → ψ z + lemma z lt with c<→o< {suc n} {z} {ord→od (record { lv = ly ; ord = oy })} lt + lemma z lt | case1 lz<ly with <-cmp lx ly + lemma z lt | case1 lz<ly | tri< a ¬b ¬c = ⊥-elim ( lemma0 y<sox a) -- can-t happen + lemma z lt | case1 lz<ly | tri≈ ¬a refl ¬c = -- ly(1) + subst (λ k → ψ k ) oiso (ε-induction-ord lx (Φ lx) {_} {ord (od→ord z)} (case1 (subst (λ k → lv (od→ord z) < k ) lemma1 lz<ly ) )) + lemma z lt | case1 lz<ly | tri> ¬a ¬b c = -- lz(a) + subst (λ k → ψ k ) oiso (ε-induction-ord lx (Φ lx) {_} {ord (od→ord z)} (case1 (<-trans lz<ly (subst (λ k → k < lx ) (sym lemma1) c)))) + lemma z lt | case2 lz=ly with <-cmp lx ly + lemma z lt | case2 lz=ly | tri< a ¬b ¬c = ⊥-elim ( lemma0 y<sox a) -- can-t happen + lemma z lt | case2 lz=ly | tri> ¬a ¬b c with d<→lv lz=ly -- lz(b) + ... | eq = subst (λ k → ψ k ) oiso + (ε-induction-ord lx (Φ lx) {_} {ord (od→ord z)} (case1 (subst (λ k → k < lx ) (trans (sym lemma1)(sym eq) ) c ))) + lemma z lt | case2 lz=ly | tri≈ ¬a lx=ly ¬c with d<→lv lz=ly -- lz(c) + ... | eq = lemma6 {ly} {Φ lx} {oy} lx=ly (sym (subst (λ k → lv (od→ord z) ≡ k) lemma1 eq)) where + lemma5 : (ox : OrdinalD lx) → (lv (od→ord z) < lx) ∨ (ord (od→ord z) d< ox) → ψ z + lemma5 ox lt = subst (λ k → ψ k ) oiso (ε-induction-ord lx ox lt ) + lemma6 : { ly : Nat } { ox : OrdinalD {suc n} lx } { oy : OrdinalD {suc n} ly } → + lx ≡ ly → ly ≡ lv (od→ord z) → ψ z + lemma6 {ly} {ox} {oy} refl refl = lemma5 (OSuc lx (ord (od→ord z)) ) (case2 s<refl) +
--- a/ordinal.agda Sat Jul 20 08:21:54 2019 +0900 +++ b/ordinal.agda Sat Jul 20 14:05:32 2019 +0900 @@ -224,6 +224,12 @@ lemma1 (case1 x) = ¬a x lemma1 (case2 x) = ≡→¬d< x +xo<ab : {n : Level} {oa ob : Ordinal {suc n}} → ( {ox : Ordinal {suc n}} → ox o< oa → ox o< ob ) → oa o< osuc ob +xo<ab {n} {oa} {ob} a→b with trio< oa ob +xo<ab {n} {oa} {ob} a→b | tri< a ¬b ¬c = ordtrans a <-osuc +xo<ab {n} {oa} {ob} a→b | tri≈ ¬a refl ¬c = <-osuc +xo<ab {n} {oa} {ob} a→b | tri> ¬a ¬b c = ⊥-elim ( o<¬≡ refl (a→b c ) ) + maxα : {n : Level} → Ordinal {suc n} → Ordinal → Ordinal maxα x y with trio< x y maxα x y | tri< a ¬b ¬c = y