Mercurial > hg > Members > kono > Proof > ZF-in-agda
changeset 1475:6752e2ff4dc6
ordinal (countable Ordinal) done
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 28 Jun 2024 17:41:43 +0900 |
parents | 893954e484a4 |
children | 32001d93755b |
files | src/ODUtil.agda src/Ordinals.agda src/cardinal.agda src/ordinal.agda src/zorn.agda |
diffstat | 5 files changed, 258 insertions(+), 256 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ODUtil.agda Sun Jun 23 09:32:40 2024 +0900 +++ b/src/ODUtil.agda Fri Jun 28 17:41:43 2024 +0900 @@ -60,6 +60,8 @@ p01 : {z : HOD} → (x ∩ y) ∋ z → A ∋ z p01 {z} xyz = power→ A x ax (proj1 xyz ) +odef-not : {S : HOD} {x : Ordinal } → ¬ ( odef S x ) → odef S x → ⊥ +odef-not neg sx = ⊥-elim ( neg sx ) cseq : HOD → HOD cseq x = record { od = record { def = λ y → odef x (osuc y) } ; odmax = osuc (odmax x) ; <odmax = lemma } where
--- a/src/Ordinals.agda Sun Jun 23 09:32:40 2024 +0900 +++ b/src/Ordinals.agda Fri Jun 28 17:41:43 2024 +0900 @@ -26,7 +26,7 @@ <-osuc : { x : ord } → x o< osuc x osuc-≡< : { a x : ord } → x o< osuc a → (x ≡ a ) ∨ (x o< a) Oprev-p : ( x : ord ) → Dec ( Oprev ord osuc x ) - o<-irr : { x y : ord } → { lt lt1 : x o< y } → lt ≡ lt1 + -- o<-irr : { x y : ord } → { lt lt1 : x o< y } → lt ≡ lt1 TransFinite : { ψ : ord → Set (suc n) } → ( (x : ord) → ( (y : ord ) → y o< x → ψ y ) → ψ x ) → ∀ (x : ord) → ψ x
--- a/src/cardinal.agda Sun Jun 23 09:32:40 2024 +0900 +++ b/src/cardinal.agda Fri Jun 28 17:41:43 2024 +0900 @@ -443,26 +443,27 @@ f1 = record { i→ = λ x → & (* x , * x) ; iB = c00 ; inject = c02 }where c02 : (x y : Ordinal) (ltx : odef (* (& S)) x) (lty : odef (* (& S)) y) → & (* x , * x) ≡ & (* y , * y) → x ≡ y - c02 x y ltx lty eq = ? where -- subst₂ (λ j k → j ≡ k ) &iso &iso (cong (&) (xx=zy→x=y c03 )) where + c02 x y ltx lty eq = subst₂ (λ j k → j ≡ k ) &iso &iso (==→o≡ (xx=zy→x=y c03 )) where c03 : (* x , * x) =h= (* y , * y) c03 = ord→== eq c00 : (x : Ordinal) (lt : odef (* (& S)) x) → odef (* (& (Power S))) (& (* x , * x)) - c00 x lt = ? where -- subst₂ (λ j k → odef j (& k) ) (sym *iso) refl (λ y z → c01 y (subst (λ k → odef k y ) *iso z )) where + c00 x lt = eq← *iso (λ y lt → c01 y (eq→ *iso lt) ) where c01 : (y : Ordinal ) → odef (* x , * x ) y → odef S y - c01 y (case1 eq) = ? --- subst₂ (λ j k → odef j k ) *iso (trans (sym &iso) (sym eq) ) lt - c01 y (case2 eq) = ? -- subst₂ (λ j k → odef j k ) *iso (trans (sym &iso) (sym eq) ) lt + c01 y (case1 eq) = eq→ *iso (subst (λ k → odef (* (& S)) k ) (trans (sym &iso) (sym eq) ) lt) + c01 y (case2 eq) = eq→ *iso (subst (λ k → odef (* (& S)) k ) (trans (sym &iso) (sym eq) ) lt) f2 : Injection (& (Power S)) (& S) f2 = f -- postulate -- yes we have a proof but it is very slow b : HODBijection (Power S) S - b = ? -- subst₂ (λ j k → HODBijection j k) ? ? ( Bernstein f2 f1) -- this makes check very slow + b = proj1 (==-bi (proj2 (==-bi ( Bernstein f2 f1) ) *iso ) ) *iso + -- -- subst₂ (λ j k → HODBijection j k) ? ? ( Bernstein f2 f1) -- this makes check very slow -- but postulate makes check weak eg. irrerevance of ∋ -- we have at least one element since Power S contains od∅ -- p0 : odef (Power S) o∅ - p0 z xz = ? -- ⊥-elim (¬x<0 (subst (λ k → odef k z) o∅≡od∅ xz) ) + p0 = Power∋∅ {S} s : Ordinal s = fun→ b o∅ p0 @@ -483,21 +484,43 @@ ; odmax = & S ; <odmax = odef∧< } diag3 : odef (Power S) (& Diag) - diag3 z xz = ? -- with subst (λ k → odef k z) *iso xz - -- ... | ⟪ sx , eq ⟫ = sx + diag3 z xz with eq→ *iso xz + ... | ⟪ sx , eq ⟫ = sx not-isD : (x : Ordinal) → (sn : odef S x) → not ( is-S (* (fun← b x sn )) x ) ≡ is-S Diag x not-isD x sn with p∨¬p (odef (* (fun← b x sn )) x) | p∨¬p (odef Diag x) | (is-S (* (fun← b x sn ))) x in eq1 - ... | case1 lt | case1 ⟪ sx , eq ⟫ | _ = ? -- ⊥-elim (¬t=f false (trans (sym eq1) (eq sn )) ) - ... | case1 lt | case2 lt1 | _ = ? - ... | case2 lt | case1 lt1 | _ = ? -- refl - ... | case2 lt | case2 neg | _ = ? --⊥-elim ( neg ⟪ sn , (λ sx → trans (cong diag ( HE.≅-to-≡ ( ∋-irr {S} sx sn ))) eq1 ) ⟫ ) + ... | case1 lt | case1 ⟪ sx , eq ⟫ | true = ⊥-elim ( ¬-bool {diag sx} ni00 ni01) where + ni00 : diag sx ≡ false + ni00 = eq sx + ni01 : diag sx ≡ true + ni01 with p∨¬p (odef (* (fun← b x sx)) x) + ... | case1 eq1 = refl + ... | case2 ne = ⊥-elim (ne (subst (λ k → odef (* k) x) ni02 lt) ) where + ni02 : fun← b x sn ≡ fun← b x sx + ni02 = fcong← b _ _ sn sx refl + ... | case1 lt | case2 lt1 | p1 = subst (λ k → not k ≡ false ) eq1 refl + ... | case2 lt | case1 lt1 | p1 = subst (λ k → not k ≡ true ) eq1 refl + ... | case2 lt | case2 neg | false = ⊥-elim (neg ⟪ sn , (λ sx → ni00 sx ) ⟫) where + ni00 : (sx : odef S x ) → diag sx ≡ false + ni00 sx with p∨¬p (odef (* (fun← b x sx)) x) + ... | case1 dx = ⊥-elim ( lt (subst (λ k → odef (* k) x) ni02 dx) ) where + ni03 : odef (* (fun← b x sx)) x + ni03 = dx + ni02 : fun← b x sx ≡ fun← b x sn + ni02 = sym (fcong← b _ _ sn sx refl) + ... | case2 ndx = refl + is-S-congS : (S S1 : HOD ) → (x : Ordinal) → S =h= S1 → is-S S x ≡ is-S S1 x + is-S-congS S S1 x eq with p∨¬p (odef S x) | p∨¬p (odef S1 x) + ... | case1 sx | case1 sx1 = refl + ... | case2 sx | case2 sx1 = refl + ... | case1 sx | case2 sx1 = ⊥-elim ( sx1 (eq→ eq sx) ) + ... | case2 sx | case1 sx1 = ⊥-elim ( sx (eq← eq sx1) ) diagn1 : (n : Ordinal ) → odef S n → ¬ (fun→ b (& Diag) diag3 ≡ n) diagn1 n sn dn = ¬t=f (is-S Diag n) (begin not (is-S Diag n) - ≡⟨ cong (λ k → not (is-S k n)) (sym ? ) ⟩ + ≡⟨ cong (λ k → not k) (is-S-congS Diag (* (& Diag)) _ (==-sym *iso) ) ⟩ not (is-S (* (& Diag)) n) ≡⟨ cong (λ k → not (is-S (* k) n)) (sym (fiso← b (& Diag) diag3 )) ⟩ not ( is-S (* (fun← b (fun→ b (& Diag) diag3) (funB b (& Diag) diag3 ))) n ) @@ -512,21 +535,36 @@ diag4 = diagn1 (fun→ b (& Diag) diag3) (funB b (& Diag) diag3) refl c<¬= : { u s : HOD } → u c< s → ¬ ( u =c= s ) -c<¬= {u} {s} c<u ceq = c<u record { i→ = λ x → fun← ceq x (subst (λ k → odef k x) ? ?) - ; iB = λ x lt → subst₂ (λ j k → odef j k) (sym ?) refl (funA ceq x (subst (λ k → odef k x) ? lt)) - ; inject = c04 } where - c04 : (x y : Ordinal) (ltx : odef (* (& (s))) x) (lty : odef (* (& (s))) y) - → fun← ceq x (subst (λ k → odef k x) ? ltx) ≡ fun← ceq y (subst (λ k → odef k y) ? lty) → x ≡ y - c04 x y ltx lty eq = begin - x ≡⟨ sym ( fiso→ ceq x c05 ) ⟩ - fun→ ceq ( fun← ceq x c05 ) (funA ceq x c05) ≡⟨ fun←cong (hodbij-sym ceq) eq ⟩ - fun→ ceq ( fun← ceq y c06 ) (funA ceq y c06) ≡⟨ fiso→ ceq y c06 ⟩ - y ∎ where - open ≡-Reasoning - c05 : odef (s) x - c05 = subst (λ k → odef k x) ? ltx - c06 : odef (s) y - c06 = subst (λ k → odef k y) ? lty +c<¬= {u} {s} c<u ceq = c<u record { i→ = λ x → cf x + ; iB = c00 + ; inject = c01 } where + cf : (x : Ordinal ) → Ordinal + cf x with p∨¬p (odef s x) + ... | case1 sx = fun← ceq x sx + ... | case2 nsx = o∅ + c00 : (x : Ordinal) → odef (* (& s)) x → odef (* (& u)) (cf x) + c00 x sx with p∨¬p (odef s x) + ... | case1 sx = eq← *iso (funA ceq x sx ) + ... | case2 nsx = ⊥-elim (nsx (eq→ *iso sx)) + c01 : (x y : Ordinal) → odef (* (& s)) x → odef (* (& s)) y → cf x ≡ cf y → x ≡ y + c01 x y ssx ssy cfeq with p∨¬p (odef s x) | p∨¬p (odef s y) + ... | case2 nsx | case1 sy = ⊥-elim (nsx (eq→ *iso ssx)) + ... | case1 sx | case2 nsy = ⊥-elim (nsy (eq→ *iso ssy)) + ... | case2 nsx | case2 nsy = ⊥-elim (nsx (eq→ *iso ssx)) + ... | case1 sx | case1 sy = begin + x ≡⟨ sym ( fiso→ ceq x c05 ) ⟩ + fun→ ceq ( fun← ceq x c05 ) (funA ceq x c05) ≡⟨ fcong→ ceq _ _ (funA ceq _ c05 ) (funA ceq _ c06 ) ( begin + fun← ceq x c05 ≡⟨ fcong← ceq x x c05 sx refl ⟩ + fun← ceq x sx ≡⟨ cfeq ⟩ + fun← ceq y sy ≡⟨ fcong← ceq y y sy c06 refl ⟩ + fun← ceq y c06 ∎ ) ⟩ + fun→ ceq ( fun← ceq y c06 ) (funA ceq y c06) ≡⟨ fiso→ ceq y c06 ⟩ + y ∎ where + open ≡-Reasoning + c05 : odef s x + c05 = eq→ *iso ssx + c06 : odef s y + c06 = eq→ *iso ssy Cantor2 : (u : HOD) → ¬ ( u =c= Power u ) Cantor2 u = c<¬= (Cantor1 u )
--- a/src/ordinal.agda Sun Jun 23 09:32:40 2024 +0900 +++ b/src/ordinal.agda Fri Jun 28 17:41:43 2024 +0900 @@ -1,9 +1,11 @@ -open import Level +{-# OPTIONS --cubical-compatible --safe #-} + +open import Level renaming ( zero to Zero ; suc to Suc ; _⊔_ to _n⊔_ ) module ordinal where open import logic open import nat -open import Data.Nat renaming ( zero to Zero ; suc to Suc ; _⊔_ to _n⊔_ ) +open import Data.Nat open import Data.Empty open import Relation.Binary.PropositionalEquality open import Relation.Binary.Definitions @@ -16,281 +18,241 @@ -- Countable Ordinals -- -data OrdinalD {n : Level} : (lv : ℕ) → Set n where - Φ : (lv : ℕ) → OrdinalD lv - OSuc : (lv : ℕ) → OrdinalD {n} lv → OrdinalD lv - -record Ordinal {n : Level} : Set n where - constructor ordinal +record Ordinal : Set where + constructor ordinal field lv : ℕ - ord : OrdinalD {n} lv - -data _d<_ {n : Level} : {lx ly : ℕ} → OrdinalD {n} lx → OrdinalD {n} ly → Set n where - Φ< : {lx : ℕ} → {x : OrdinalD {n} lx} → Φ lx d< OSuc lx x - s< : {lx : ℕ} → {x y : OrdinalD {n} lx} → x d< y → OSuc lx x d< OSuc lx y + ord : ℕ open Ordinal - -_o<_ : {n : Level} ( x y : Ordinal ) → Set n -_o<_ x y = (lv x < lv y ) ∨ ( ord x d< ord y ) +open _∧_ -s<refl : {n : Level } {lx : ℕ } { x : OrdinalD {n} lx } → x d< OSuc lx x -s<refl {n} {lv} {Φ lv} = Φ< -s<refl {n} {lv} {OSuc lv x} = s< s<refl +o∅ : Ordinal +o∅ = record { lv = zero ; ord = zero } -trio<> : {n : Level} → {lx : ℕ} {x : OrdinalD {n} lx } { y : OrdinalD lx } → y d< x → x d< y → ⊥ -trio<> {n} {lx} {.(OSuc lx _)} {.(OSuc lx _)} (s< s) (s< t) = trio<> s t -trio<> {n} {lx} {.(OSuc lx _)} {.(Φ lx)} Φ< () +osuc : ( x : Ordinal ) → Ordinal +osuc record { lv = lx ; ord = ox } = record { lv = lx ; ord = suc ox } -d<→lv : {n : Level} {x y : Ordinal {n}} → ord x d< ord y → lv x ≡ lv y -d<→lv Φ< = refl -d<→lv (s< lt) = refl - -o∅ : {n : Level} → Ordinal {n} -o∅ = record { lv = Zero ; ord = Φ Zero } - --- open import Relation.Binary.HeterogeneousEquality using (_≅_;refl) +_o<_ : Ordinal → Ordinal → Set +_o<_ x y = (lv x < lv y) ∨ ((lv x ≡ lv y) ∧ (ord x < ord y)) --- ordinal-cong : {n : Level} {x y : Ordinal {n}} → --- lv x ≡ lv y → ord x ≅ ord y → x ≡ y --- ordinal-cong refl refl = refl - -≡→¬d< : {n : Level} → {lv : ℕ} → {x : OrdinalD {n} lv } → x d< x → ⊥ -≡→¬d< {n} {lx} {OSuc lx y} (s< t) = ≡→¬d< t - -trio<≡ : {n : Level} → {lx : ℕ} {x : OrdinalD {n} lx } { y : OrdinalD lx } → x ≡ y → x d< y → ⊥ -trio<≡ refl = ≡→¬d< +<-osuc : { x : Ordinal } → x o< osuc x +<-osuc {x} = case2 ⟪ refl , a<sa ⟫ -trio>≡ : {n : Level} → {lx : ℕ} {x : OrdinalD {n} lx } { y : OrdinalD lx } → x ≡ y → y d< x → ⊥ -trio>≡ refl = ≡→¬d< +o<¬≡ : { ox oy : Ordinal } → ox ≡ oy → ox o< oy → ⊥ +o<¬≡ {ox} {.ox} refl (case1 lt) = ⊥-elim ( nat-<≡ lt ) +o<¬≡ {ox} {.ox} refl (case2 x) = ⊥-elim ( nat-<≡ (proj2 x) ) -triOrdd : {n : Level} → {lx : ℕ} → Trichotomous _≡_ ( _d<_ {n} {lx} {lx} ) -triOrdd {_} {lv} (Φ lv) (Φ lv) = tri≈ ≡→¬d< refl ≡→¬d< -triOrdd {_} {lv} (Φ lv) (OSuc lv y) = tri< Φ< (λ ()) ( λ lt → trio<> lt Φ< ) -triOrdd {_} {lv} (OSuc lv x) (Φ lv) = tri> (λ lt → trio<> lt Φ<) (λ ()) Φ< -triOrdd {_} {lv} (OSuc lv x) (OSuc lv y) with triOrdd x y -triOrdd {_} {lv} (OSuc lv x) (OSuc lv y) | tri< a ¬b ¬c = tri< (s< a) (λ tx=ty → trio<≡ tx=ty (s< a) ) ( λ lt → trio<> lt (s< a) ) -triOrdd {_} {lv} (OSuc lv x) (OSuc lv x) | tri≈ ¬a refl ¬c = tri≈ ≡→¬d< refl ≡→¬d< -triOrdd {_} {lv} (OSuc lv x) (OSuc lv y) | tri> ¬a ¬b c = tri> ( λ lt → trio<> lt (s< c) ) (λ tx=ty → trio>≡ tx=ty (s< c) ) (s< c) +¬x<0 : { x : Ordinal } → ¬ ( x o< o∅ ) +¬x<0 {x} (case1 ()) +¬x<0 {x} (case2 ()) -osuc : {n : Level} ( x : Ordinal {n} ) → Ordinal {n} -osuc record { lv = lx ; ord = ox } = record { lv = lx ; ord = OSuc lx ox } - -<-osuc : {n : Level} { x : Ordinal {n} } → x o< osuc x -<-osuc {n} {record { lv = lx ; ord = Φ .lx }} = case2 Φ< -<-osuc {n} {record { lv = lx ; ord = OSuc .lx ox }} = case2 ( s< s<refl ) - -o<¬≡ : {n : Level } { ox oy : Ordinal {suc n}} → ox ≡ oy → ox o< oy → ⊥ -o<¬≡ {_} {ox} {ox} refl (case1 lt) = =→¬< lt -o<¬≡ {_} {ox} {ox} refl (case2 (s< lt)) = trio<≡ refl lt - -¬x<0 : {n : Level} → { x : Ordinal {suc n} } → ¬ ( x o< o∅ {suc n} ) -¬x<0 {n} {x} (case1 ()) -¬x<0 {n} {x} (case2 ()) - -o<> : {n : Level} → {x y : Ordinal {n} } → y o< x → x o< y → ⊥ -o<> {n} {x} {y} (case1 x₁) (case1 x₂) = nat-<> x₁ x₂ -o<> {n} {x} {y} (case1 x₁) (case2 x₂) = nat-≡< (sym (d<→lv x₂)) x₁ -o<> {n} {x} {y} (case2 x₁) (case1 x₂) = nat-≡< (sym (d<→lv x₁)) x₂ -o<> {n} {record { lv = lv₁ ; ord = .(OSuc lv₁ _) }} {record { lv = .lv₁ ; ord = .(Φ lv₁) }} (case2 Φ<) (case2 ()) -o<> {n} {record { lv = lv₁ ; ord = .(OSuc lv₁ _) }} {record { lv = .lv₁ ; ord = .(OSuc lv₁ _) }} (case2 (s< y<x)) (case2 (s< x<y)) = - o<> (case2 y<x) (case2 x<y) +trio< : Trichotomous _≡_ _o<_ +trio< a b with <-cmp (lv a) (lv b) +... | tri< a₁ ¬b ¬c = tri< (case1 a₁) (λ eq → ¬b (cong lv eq) ) tr00 where + tr00 : ¬ (suc (lv b) ≤ lv a) ∨ ((lv b ≡ lv a) ∧ (suc (ord b) ≤ ord a)) + tr00 (case1 x) = ¬c x + tr00 (case2 x) = ¬b (sym (proj1 x)) +... | tri> ¬a ¬b c = tri> tr00 (λ eq → ¬b (cong lv eq) ) (case1 c) where + tr00 : ¬ (suc (lv a) ≤ lv b) ∨ ((lv a ≡ lv b) ∧ (suc (ord a) ≤ ord b)) + tr00 (case1 x) = ¬a x + tr00 (case2 x) = ¬b ((proj1 x)) +... | tri≈ ¬a refl ¬c with <-cmp (ord a) (ord b) +... | tri< a₁ ¬b ¬c₁ = tri< (case2 ⟪ refl , a₁ ⟫) (λ eq → ¬b (cong ord eq) ) tr00 where + tr00 : ¬ (suc (lv b) ≤ lv b) ∨ ((lv b ≡ lv b) ∧ (suc (ord b) ≤ (ord a) )) + tr00 (case1 x) = ⊥-elim ( ¬a≤a {lv b} x ) + tr00 (case2 ⟪ eq , lt ⟫) = nat-<> lt a₁ +... | tri≈ ¬a₁ refl ¬c₁ = tri≈ tr00 refl tr01 where + tr00 : ¬ (suc (lv b) ≤ lv b) ∨ ((lv b ≡ lv b) ∧ (suc (ord b) ≤ ord b)) + tr00 (case1 x) = ¬a x + tr00 (case2 x) = ¬a₁ (proj2 x) + tr01 : ¬ (suc (lv b) ≤ lv b) ∨ ((lv b ≡ lv b) ∧ (suc (ord b) ≤ ord b)) + tr01 (case1 x) = ¬c x + tr01 (case2 x) = ¬c₁ (proj2 x) +... | tri> ¬a₁ ¬b c = tri> tr00 (λ eq → ¬b (cong ord eq) ) (case2 ⟪ refl , c ⟫ ) where + tr00 : ¬ (suc (lv a) ≤ lv b) ∨ ((lv a ≡ lv b) ∧ (suc (ord a) ≤ ord b)) + tr00 (case1 x) = ¬c x + tr00 (case2 x) = ¬a₁ (proj2 x) -orddtrans : {n : Level} {lx : ℕ} {x y z : OrdinalD {n} lx } → x d< y → y d< z → x d< z -orddtrans {_} {lx} {.(Φ lx)} {.(OSuc lx _)} {.(OSuc lx _)} Φ< (s< y<z) = Φ< -orddtrans {_} {lx} {.(OSuc lx _)} {.(OSuc lx _)} {.(OSuc lx _)} (s< x<y) (s< y<z) = s< ( orddtrans x<y y<z ) +ordtrans : {x y z : Ordinal } → x o< y → y o< z → x o< z +ordtrans {x} {y} {z} (case1 x₁) (case1 x₂) = case1 (<-trans x₁ x₂) +ordtrans {x} {y} {z} (case1 x₁) (case2 x₂) = case1 ( subst (λ k → lv x < k ) (proj1 x₂) x₁ ) +ordtrans {x} {y} {z} (case2 x₁) (case1 x₂) = case1 ( subst (λ k → k < lv z ) (sym (proj1 x₁)) x₂ ) +ordtrans {x} {y} {z} (case2 x₁) (case2 x₂) = case2 ⟪ trans (proj1 x₁) (proj1 x₂) , <-trans (proj2 x₁) (proj2 x₂) ⟫ -osuc-≡< : {n : Level} { a x : Ordinal {n} } → x o< osuc a → (x ≡ a ) ∨ (x o< a) -osuc-≡< {n} {a} {x} (case1 lt) = case2 (case1 lt) -osuc-≡< {n} {record { lv = lv₁ ; ord = Φ .lv₁ }} {record { lv = .lv₁ ; ord = .(Φ lv₁) }} (case2 Φ<) = case1 refl -osuc-≡< {n} {record { lv = lv₁ ; ord = OSuc .lv₁ ord₁ }} {record { lv = .lv₁ ; ord = .(Φ lv₁) }} (case2 Φ<) = case2 (case2 Φ<) -osuc-≡< {n} {record { lv = lv₁ ; ord = Φ .lv₁ }} {record { lv = .lv₁ ; ord = .(OSuc lv₁ _) }} (case2 (s< ())) -osuc-≡< {n} {record { lv = la ; ord = OSuc la oa }} {record { lv = la ; ord = (OSuc la ox) }} (case2 (s< lt)) with - osuc-≡< {n} {record { lv = la ; ord = oa }} {record { lv = la ; ord = ox }} (case2 lt ) -... | case1 refl = case1 refl -... | case2 (case2 x) = case2 (case2( s< x) ) -... | case2 (case1 x) = ⊥-elim (¬a≤a x) +o<> : {x y : Ordinal } → y o< x → x o< y → ⊥ +o<> {x} {y} y<x x<y with trio< x y +... | tri< a ¬b ¬c = ⊥-elim ( ¬c y<x ) +... | tri≈ ¬a b ¬c = ⊥-elim ( ¬c y<x ) +... | tri> ¬a ¬b c = ⊥-elim ( ¬a x<y ) -osuc-< : {n : Level} { x y : Ordinal {n} } → y o< osuc x → x o< y → ⊥ -osuc-< {n} {x} {y} y<ox x<y with osuc-≡< y<ox -osuc-< {n} {x} {x} y<ox (case1 x₁) | case1 refl = ⊥-elim (¬a≤a x₁) -osuc-< {n} {x} {x} (case1 x₂) (case2 x₁) | case1 refl = ⊥-elim (¬a≤a x₂) -osuc-< {n} {x} {x} (case2 x₂) (case2 x₁) | case1 refl = ≡→¬d< x₁ -osuc-< {n} {x} {y} y<ox (case1 x₂) | case2 (case1 x₁) = nat-<> x₂ x₁ -osuc-< {n} {x} {y} y<ox (case1 x₂) | case2 (case2 x₁) = nat-≡< (sym (d<→lv x₁)) x₂ -osuc-< {n} {x} {y} y<ox (case2 x<y) | case2 y<x = o<> (case2 x<y) y<x +osuc-≡< : { a x : Ordinal } → x o< osuc a → (x ≡ a ) ∨ (x o< a) +osuc-≡< {a} {x} (case1 x₁) = case2 (case1 x₁) +osuc-≡< {a} {x} (case2 ⟪ eq , lt ⟫) with <-cmp (ord x) (ord a) +... | tri< a₁ ¬b ¬c = case2 (case2 ⟪ eq , a₁ ⟫) +osuc-≡< {a} {ordinal .(lv a) .(ord a)} (case2 ⟪ refl , lt ⟫) | tri≈ ¬a refl ¬c = case1 refl +... | tri> ¬a ¬b c = ⊥-elim ( nat-≤> c lt ) -ordtrans : {n : Level} {x y z : Ordinal {n} } → x o< y → y o< z → x o< z -ordtrans {n} {x} {y} {z} (case1 x₁) (case1 x₂) = case1 ( <-trans x₁ x₂ ) -ordtrans {n} {x} {y} {z} (case1 x₁) (case2 x₂) with d<→lv x₂ -... | refl = case1 x₁ -ordtrans {n} {x} {y} {z} (case2 x₁) (case1 x₂) with d<→lv x₁ -... | refl = case1 x₂ -ordtrans {n} {x} {y} {z} (case2 x₁) (case2 x₂) with d<→lv x₁ | d<→lv x₂ -... | refl | refl = case2 ( orddtrans x₁ x₂ ) +-- we don't use this +OrdIrr : {x y : Ordinal } (lt lt1 : x o< y) → lt ≡ lt1 +OrdIrr {x} {y} (case1 x₁) (case1 x₂) = cong case1 (<-irrelevant _ _) +OrdIrr {x} {y} (case1 x₁) (case2 x₂) = ⊥-elim ( nat-≡< (proj1 x₂) x₁ ) +OrdIrr {x} {y} (case2 x₁) (case1 x₂) = ⊥-elim ( nat-≡< (proj1 x₁) x₂ ) +OrdIrr {x} {y} (case2 x₁) (case2 x₂) with (≡-irrelevant (proj1 x₁) (proj1 x₂)) | (<-irrelevant (proj2 x₁) (proj2 x₂)) +... | refl | refl = refl -trio< : {n : Level } → Trichotomous {suc n} _≡_ _o<_ -trio< a b with <-cmp (lv a) (lv b) -trio< a b | tri< a₁ ¬b ¬c = tri< (case1 a₁) (λ refl → ¬b (cong ( λ x → lv x ) refl ) ) lemma1 where - lemma1 : ¬ (Suc (lv b) ≤ lv a) ∨ (ord b d< ord a) - lemma1 (case1 x) = ¬c x - lemma1 (case2 x) = ⊥-elim (nat-≡< (sym ( d<→lv x )) a₁ ) -trio< a b | tri> ¬a ¬b c = tri> lemma1 (λ refl → ¬b (cong ( λ x → lv x ) refl ) ) (case1 c) where - lemma1 : ¬ (Suc (lv a) ≤ lv b) ∨ (ord a d< ord b) - lemma1 (case1 x) = ¬a x - lemma1 (case2 x) = ⊥-elim (nat-≡< (sym ( d<→lv x )) c ) -trio< a b | tri≈ ¬a refl ¬c with triOrdd ( ord a ) ( ord b ) -trio< record { lv = .(lv b) ; ord = x } b | tri≈ ¬a refl ¬c | tri< a ¬b ¬c₁ = tri< (case2 a) (λ refl → ¬b (lemma1 refl )) lemma2 where - lemma1 : (record { lv = _ ; ord = x }) ≡ b → x ≡ ord b - lemma1 refl = refl - lemma2 : ¬ (Suc (lv b) ≤ lv b) ∨ (ord b d< x) - lemma2 (case1 x) = ¬a x - lemma2 (case2 x) = trio<> x a -trio< record { lv = .(lv b) ; ord = x } b | tri≈ ¬a refl ¬c | tri> ¬a₁ ¬b c = tri> lemma2 (λ refl → ¬b (lemma1 refl )) (case2 c) where - lemma1 : (record { lv = _ ; ord = x }) ≡ b → x ≡ ord b - lemma1 refl = refl - lemma2 : ¬ (Suc (lv b) ≤ lv b) ∨ (x d< ord b) - lemma2 (case1 x) = ¬a x - lemma2 (case2 x) = trio<> x c -trio< record { lv = .(lv b) ; ord = x } b | tri≈ ¬a refl ¬c | tri≈ ¬a₁ refl ¬c₁ = tri≈ lemma1 refl lemma1 where - lemma1 : ¬ (Suc (lv b) ≤ lv b) ∨ (ord b d< ord b) - lemma1 (case1 x) = ¬a x - lemma1 (case2 x) = ≡→¬d< x - - -open _∧_ - -TransFinite : {n m : Level} → { ψ : Ordinal {suc n} → Set m } - → ( ∀ (lx : ℕ ) → ( (x : Ordinal {suc n} ) → x o< ordinal lx (Φ lx) → ψ x ) → ψ ( record { lv = lx ; ord = Φ lx } ) ) - → ( ∀ (lx : ℕ ) → (x : OrdinalD lx ) → ( (y : Ordinal {suc n} ) → y o< ordinal lx (OSuc lx x) → ψ y ) → ψ ( record { lv = lx ; ord = OSuc lx x } ) ) +TransFinite : {m : Level} → { ψ : Ordinal → Set m } + → ( (x : Ordinal) → ( (y : Ordinal ) → y o< x → ψ y ) → ψ x ) → ∀ (x : Ordinal) → ψ x -TransFinite {n} {m} {ψ} caseΦ caseOSuc x = proj1 (TransFinite1 (lv x) (ord x) ) where - TransFinite1 : (lx : ℕ) (ox : OrdinalD lx ) → ψ (ordinal lx ox) ∧ ( ( (x : Ordinal {suc n} ) → x o< ordinal lx ox → ψ x ) ) - TransFinite1 Zero (Φ 0) = ⟪ caseΦ Zero lemma , lemma1 ⟫ where - lemma : (x : Ordinal) → x o< ordinal Zero (Φ Zero) → ψ x +TransFinite {m} {ψ} ind x = proj1 (TransFinite1 (lv x) (ord x) ) where + caseΦ : (lx : ℕ) → ((x₁ : Ordinal) → x₁ o< ordinal lx zero → ψ x₁) → + ψ (record { lv = lx ; ord = zero }) + caseΦ lx prev = ind (ordinal lx zero ) prev + caseOSuc : (lx : ℕ) (x₁ : ℕ) → ((y : Ordinal) → y o< ordinal lx (suc x₁) → ψ y) → + ψ (record { lv = lx ; ord = suc x₁ }) + caseOSuc lx ox prev = ind (ordinal lx (suc ox)) prev + TransFinite1 : (lx : ℕ) (ox : ℕ ) → ψ (ordinal lx ox) ∧ ( ( (x : Ordinal ) → x o< ordinal lx ox → ψ x ) ) + TransFinite1 zero zero = ⟪ caseΦ zero lemma , lemma1 ⟫ where + lemma : (x : Ordinal) → x o< ordinal zero zero → ψ x lemma x (case1 ()) lemma x (case2 ()) - lemma1 : (x : Ordinal) → x o< ordinal Zero (Φ Zero) → ψ x + lemma1 : (x : Ordinal) → x o< ordinal zero zero → ψ x lemma1 x (case1 ()) lemma1 x (case2 ()) - TransFinite1 (Suc lx) (Φ (Suc lx)) = ⟪ caseΦ (Suc lx) (λ x → lemma (lv x) (ord x)) , (λ x → lemma (lv x) (ord x)) ⟫ where - lemma0 : (ly : ℕ) (oy : OrdinalD ly ) → ordinal ly oy o< ordinal lx (Φ lx) → ψ (ordinal ly oy) - lemma0 ly oy lt = proj2 ( TransFinite1 lx (Φ lx) ) (ordinal ly oy) lt - lemma : (ly : ℕ) (oy : OrdinalD ly ) → ordinal ly oy o< ordinal (Suc lx) (Φ (Suc lx)) → ψ (ordinal ly oy) - lemma lx1 ox1 (case1 lt) with <-∨ lt - lemma lx (Φ lx) (case1 lt) | case1 refl = proj1 ( TransFinite1 lx (Φ lx) ) - lemma lx (Φ lx) (case1 lt) | case2 lt1 = lemma0 lx (Φ lx) (case1 lt1) - lemma lx (OSuc lx ox1) (case1 lt) | case1 refl = caseOSuc lx ox1 lemma2 where - lemma2 : (y : Ordinal) → (Suc (lv y) ≤ lx) ∨ (ord y d< OSuc lx ox1) → ψ y + TransFinite1 (suc lx) zero = ⟪ caseΦ (suc lx) (λ x → lemma (lv x) (ord x)) , (λ x → lemma (lv x) (ord x)) ⟫ where + lemma0 : (ly : ℕ) (oy : ℕ ) → ordinal ly oy o< ordinal lx zero → ψ (ordinal ly oy) + lemma0 ly oy lt = proj2 ( TransFinite1 lx zero ) (ordinal ly oy) lt + lemma : (ly : ℕ) (oy : ℕ ) → ordinal ly oy o< ordinal (suc lx) zero → ψ (ordinal ly oy) + lemma lx1 ox1 (case1 lt) with <-∨ lt + lemma lx zero (case1 lt) | case1 refl = proj1 ( TransFinite1 lx zero ) + lemma lx zero (case1 lt) | case2 lt1 = lemma0 lx zero (case1 lt1) + lemma lx (suc ox1) (case1 lt) | case1 refl = caseOSuc lx ox1 lemma2 where + lemma2 : (y : Ordinal) → (suc (lv y) ≤ lx) ∨ ((lv y ≡ lx) ∧ (suc (ord y) ≤ suc ox1)) → ψ y lemma2 y lt1 with osuc-≡< lt1 - lemma2 y lt1 | case1 refl = lemma lx ox1 (case1 a<sa) - lemma2 y lt1 | case2 t = proj2 (TransFinite1 lx ox1) y t - lemma lx1 (OSuc lx1 ox1) (case1 lt) | case2 lt1 = caseOSuc lx1 ox1 lemma2 where - lemma2 : (y : Ordinal) → (Suc (lv y) ≤ lx1) ∨ (ord y d< OSuc lx1 ox1) → ψ y + ... | case1 refl = lemma lx ox1 (case1 a<sa) + ... | case2 lt2 = proj2 (TransFinite1 lx ox1) y lt2 + lemma lx1 (suc ox1) (case1 lt) | case2 lt1 = caseOSuc lx1 ox1 lemma2 where + lemma2 : (y : Ordinal) → (suc (lv y) ≤ lx1) ∨ ((lv y ≡ lx1) ∧ (suc (ord y) ≤ suc ox1)) → ψ y lemma2 y lt2 with osuc-≡< lt2 - lemma2 y lt2 | case1 refl = lemma lx1 ox1 (ordtrans lt2 (case1 lt)) - lemma2 y lt2 | case2 (case1 lt3) = proj2 (TransFinite1 lx (Φ lx)) y (case1 (<-trans lt3 lt1 )) - lemma2 y lt2 | case2 (case2 lt3) with d<→lv lt3 - ... | refl = proj2 (TransFinite1 lx (Φ lx)) y (case1 lt1) - TransFinite1 lx (OSuc lx ox) = ⟪ caseOSuc lx ox lemma , lemma ⟫ where - lemma : (y : Ordinal) → y o< ordinal lx (OSuc lx ox) → ψ y + ... | case1 refl = lemma lx1 ox1 (ordtrans lt2 (case1 lt)) + ... | case2 (case1 lt3) = proj2 (TransFinite1 lx zero) y (case1 (<-trans lt3 lt1 )) + ... | case2 (case2 lt3) = proj2 (TransFinite1 lx zero) y (case1 lemma3) where + lemma3 : lv y < lx + lemma3 = begin + suc (lv y) ≡⟨ cong suc (proj1 lt3) ⟩ + suc lx1 ≤⟨ lt1 ⟩ + lx ∎ where open ≤-Reasoning + TransFinite1 lx (suc ox) = ⟪ caseOSuc lx ox lemma , lemma ⟫ where + lemma : (y : Ordinal) → y o< ordinal lx (suc ox) → ψ y lemma y lt with osuc-≡< lt - lemma y lt | case1 refl = proj1 ( TransFinite1 lx ox ) + lemma y lt | case1 refl = proj1 ( TransFinite1 lx ox ) lemma y lt | case2 lt1 = proj2 ( TransFinite1 lx ox ) y lt1 -OrdIrr : {n : Level } {x y : Ordinal {suc n} } {lt lt1 : x o< y} → lt ≡ lt1 -OrdIrr {n} {ordinal lv₁ ord₁} {ordinal lv₂ ord₂} {case1 x} {case1 x₁} = cong case1 (NP.<-irrelevant _ _ ) -OrdIrr {n} {ordinal lv₁ ord₁} {ordinal lv₂ ord₂} {case1 x} {case2 x₁} = ⊥-elim ( nat-≡< ( d<→lv x₁ ) x ) -OrdIrr {n} {ordinal lv₁ ord₁} {ordinal lv₂ ord₂} {case2 x} {case1 x₁} = ⊥-elim ( nat-≡< ( d<→lv x ) x₁ ) -OrdIrr {n} {ordinal lv₁ .(Φ lv₁)} {ordinal .lv₁ .(OSuc lv₁ _)} {case2 Φ<} {case2 Φ<} = refl -OrdIrr {n} {ordinal lv₁ (OSuc lv₁ a)} {ordinal .lv₁ (OSuc lv₁ b)} {case2 (s< x)} {case2 (s< x₁)} = cong (λ k → case2 (s< k)) (lemma1 _ _ x x₁) where - lemma1 : {lx : ℕ} (a b : OrdinalD {suc n} lx) → (x y : a d< b ) → x ≡ y - lemma1 {lx} .(Φ lx) .(OSuc lx _) Φ< Φ< = refl - lemma1 {lx} (OSuc lx a) (OSuc lx b) (s< x) (s< y) = cong s< (lemma1 {lx} a b x y ) + +open import Induction.WellFounded + +-- The accessibility predicate: x is accessible if everything which is +-- smaller than x is also accessible (inductively). +-- +-- data Acc {A : Set a} (_<_ : Rel A ℓ) (x : A) : Set (a ⊔ ℓ) where +-- acc : (rs : (y : A ) → y < x → Acc _<_ x) → Acc _<_ x + + +ordWF : WellFounded _o<_ +ordWF x = TransFinite {Zero} {λ y → Acc _o<_ y} (λ x ind → acc (λ x rs → ind x rs ) ) x -TransFinite3 : {n m : Level} { ψ : Ordinal {suc n} → Set m } - → ( (x : Ordinal {suc n}) → ( (y : Ordinal {suc n} ) → y o< x → ψ y ) → ψ x ) - → ∀ (x : Ordinal {suc n} ) → ψ x -TransFinite3 {n} {m} {ψ} ind x = TransFinite {n} {m} {ψ} caseΦ caseOSuc x where - caseΦ : (lx : ℕ) → ((x₁ : Ordinal {suc n}) → x₁ o< ordinal lx (Φ lx) → ψ x₁) → - ψ (record { lv = lx ; ord = Φ lx }) - caseΦ lx prev = ind (ordinal lx (Φ lx) ) prev - caseOSuc : (lx : ℕ) (x₁ : OrdinalD lx) → ((y : Ordinal) → y o< ordinal lx (OSuc lx x₁) → ψ y) → - ψ (record { lv = lx ; ord = OSuc lx x₁ }) - caseOSuc lx ox prev = ind (ordinal lx (OSuc lx ox)) prev +TransFiniteWF : {m : Level} + → ( (x : Ordinal) → ( (y : Ordinal ) → y o< x → Acc _o<_ y ) → Acc _o<_ x ) + → ∀ (x : Ordinal) → Acc _o<_ x +TransFiniteWF {m} ind x = proj1 (TransFinite1 (lv x) (ord x) ) where + caseΦ : (lx : ℕ) → ((x₁ : Ordinal) → x₁ o< ordinal lx zero → Acc _o<_ x₁) → + Acc _o<_ (record { lv = lx ; ord = zero }) + caseΦ lx prev = ind (ordinal lx zero ) prev + caseOSuc : (lx : ℕ) (x₁ : ℕ) → ((y : Ordinal) → y o< ordinal lx (suc x₁) → Acc _o<_ y) → + Acc _o<_ (record { lv = lx ; ord = suc x₁ }) + caseOSuc lx ox prev = ind (ordinal lx (suc ox)) prev + TransFinite1 : (lx : ℕ) (ox : ℕ ) → Acc _o<_ (ordinal lx ox) ∧ ( ( (x : Ordinal ) → x o< ordinal lx ox → Acc _o<_ x ) ) + TransFinite1 zero zero = ⟪ caseΦ zero lemma , lemma1 ⟫ where + lemma : (x : Ordinal) → x o< ordinal zero zero → Acc _o<_ x + lemma x (case1 ()) + lemma x (case2 ()) + lemma1 : (x : Ordinal) → x o< ordinal zero zero → Acc _o<_ x + lemma1 x (case1 ()) + lemma1 x (case2 ()) + TransFinite1 (suc lx) zero = ⟪ caseΦ (suc lx) (λ x → lemma (lv x) (ord x)) , (λ x → lemma (lv x) (ord x)) ⟫ where + lemma0 : (ly : ℕ) (oy : ℕ ) → ordinal ly oy o< ordinal lx zero → Acc _o<_ (ordinal ly oy) + lemma0 ly oy lt = proj2 ( TransFinite1 lx zero ) (ordinal ly oy) lt + lemma : (ly : ℕ) (oy : ℕ ) → ordinal ly oy o< ordinal (suc lx) zero → Acc _o<_ (ordinal ly oy) + lemma lx1 ox1 (case1 lt) with <-∨ lt + lemma lx zero (case1 lt) | case1 refl = proj1 ( TransFinite1 lx zero ) + lemma lx zero (case1 lt) | case2 lt1 = lemma0 lx zero (case1 lt1) + lemma lx (suc ox1) (case1 lt) | case1 refl = caseOSuc lx ox1 lemma2 where + lemma2 : (y : Ordinal) → (suc (lv y) ≤ lx) ∨ ((lv y ≡ lx) ∧ (suc (ord y) ≤ suc ox1)) → Acc _o<_ y + lemma2 y lt1 with osuc-≡< lt1 + ... | case1 refl = lemma lx ox1 (case1 a<sa) + ... | case2 lt2 = proj2 (TransFinite1 lx ox1) y lt2 + lemma lx1 (suc ox1) (case1 lt) | case2 lt1 = caseOSuc lx1 ox1 lemma2 where + lemma2 : (y : Ordinal) → (suc (lv y) ≤ lx1) ∨ ((lv y ≡ lx1) ∧ (suc (ord y) ≤ suc ox1)) → Acc _o<_ y + lemma2 y lt2 with osuc-≡< lt2 + ... | case1 refl = lemma lx1 ox1 (ordtrans lt2 (case1 lt)) + ... | case2 (case1 lt3) = proj2 (TransFinite1 lx zero) y (case1 (<-trans lt3 lt1 )) + ... | case2 (case2 lt3) = proj2 (TransFinite1 lx zero) y (case1 lemma3) where + lemma3 : lv y < lx + lemma3 = begin + suc (lv y) ≡⟨ cong suc (proj1 lt3) ⟩ + suc lx1 ≤⟨ lt1 ⟩ + lx ∎ where open ≤-Reasoning + TransFinite1 lx (suc ox) = ⟪ caseOSuc lx ox lemma , lemma ⟫ where + lemma : (y : Ordinal) → y o< ordinal lx (suc ox) → Acc _o<_ y + lemma y lt with osuc-≡< lt + lemma y lt | case1 refl = proj1 ( TransFinite1 lx ox ) + lemma y lt | case2 lt1 = proj2 ( TransFinite1 lx ox ) y lt1 --- TP : {n m l : Level} → {Q : Ordinal {suc n} → Set m} {P : { x y : Ordinal {suc n} } → Q x → Q y → Set l} --- → ( ind : (x : Ordinal {suc n}) → ( (y : Ordinal {suc n} ) → y o< x → Q y ) → Q x ) --- → ( (x : Ordinal {suc n} ) → ( prev : (y : Ordinal {suc n} ) → y o< x → Q y ) → {y : Ordinal {suc n}} → (y<x : y o< x) → P (prev y y<x) (ind x prev) ) --- → {x z : Ordinal {suc n} } → (z≤x : z o< osuc x ) → P (TransFinite3 {n} {m} { λ x → Q x } {!!} x ) {!!} -- P (TransFinite {?} ind z) (TransFinite {?} ind x ) --- TP = ? - +open import Ordinals -open import Ordinals - -C-Ordinal : {n : Level} → Ordinals {suc n} -C-Ordinal {n} = record { - Ordinal = Ordinal {suc n} +C-Ordinal : Ordinals {Zero} +C-Ordinal = record { + Ordinal = Ordinal ; o∅ = o∅ ; osuc = osuc ; _o<_ = _o<_ ; isOrdinal = record { ordtrans = ordtrans ; trio< = trio< - ; ¬x<0 = ¬x<0 + ; ¬x<0 = ¬x<0 ; <-osuc = <-osuc ; osuc-≡< = osuc-≡< ; TransFinite = TransFinite2 - ; o<-irr = OrdIrr - ; Oprev-p = Oprev-p + ; Oprev-p = Oprev-p } -- -- isNext = record { - -- x<nx = x<nx + -- x<nx = x<nx -- ; osuc<nx = λ {x} {y} → osuc<nx {x} {y} - -- -- ; ¬nx<nx = ¬nx<nx + -- -- ; ¬nx<nx = ¬nx<nx -- } } where - next : Ordinal {suc n} → Ordinal {suc n} - next (ordinal lv ord) = ordinal (Suc lv) (Φ (Suc lv)) + next : Ordinal → Ordinal + next (ordinal lv ord) = ordinal (suc lv) zero x<nx : { y : Ordinal } → (y o< next y ) x<nx = case1 a<sa - osuc<nx : { x y : Ordinal } → x o< next y → osuc x o< next y - osuc<nx (case1 lt) = case1 lt - ¬nx<nx : {x y : Ordinal} → y o< x → x o< next y → ¬ ((z : Ordinal) → ¬ (x ≡ osuc z)) - ¬nx<nx {x} {y} = lemma2 x where - lemma2 : (x : Ordinal) → y o< x → x o< next y → ¬ ((z : Ordinal) → ¬ x ≡ osuc z) - lemma2 (ordinal Zero (Φ 0)) (case2 ()) (case1 (s≤s z≤n)) not - lemma2 (ordinal Zero (OSuc 0 dx)) (case2 Φ<) (case1 (s≤s z≤n)) not = not _ refl - lemma2 (ordinal Zero (OSuc 0 dx)) (case2 (s< x)) (case1 (s≤s z≤n)) not = not _ refl - lemma2 (ordinal (Suc lx) (OSuc (Suc lx) ox)) y<x (case1 (s≤s (s≤s lt))) not = not _ refl - lemma2 (ordinal (Suc lx) (Φ (Suc lx))) (case1 x) (case1 (s≤s (s≤s lt))) not = lemma3 x lt where - lemma3 : {n l : ℕ} → (Suc (Suc n) ≤ Suc l) → l ≤ n → ⊥ - lemma3 (s≤s sn≤l) (s≤s l≤n) = lemma3 sn≤l l≤n + osuc<nx : { x y : Ordinal } → x o< next y → osuc x o< next y + osuc<nx {x} {Y} (case1 lv<) = case1 lv< open Oprev - Oprev-p : (x : Ordinal) → Dec ( Oprev (Ordinal {suc n}) osuc x ) - Oprev-p (ordinal lv (Φ lv)) = no (λ not → lemma (oprev not) (oprev=x not) ) where - lemma : (x : Ordinal) → osuc x ≡ (ordinal lv (Φ lv)) → ⊥ - lemma x () - Oprev-p (ordinal lv (OSuc lv ox)) = yes record { oprev = ordinal lv ox ; oprev=x = refl } - ord1 : Set (suc n) - ord1 = Ordinal {suc n} - TransFinite2 : { ψ : ord1 → Set (suc (suc n)) } + Oprev-p : (x : Ordinal) → Dec ( Oprev (Ordinal ) osuc x ) + Oprev-p (ordinal lv₁ zero) = no (λ ()) + Oprev-p (ordinal lv₁ (suc ord₁)) = yes (record { oprev = ordinal lv₁ ord₁ ; oprev=x = refl }) + ord1 : Set + ord1 = Ordinal + TransFinite2 : {m : Level } { ψ : ord1 → Set m } → ( (x : ord1) → ( (y : ord1 ) → y o< x → ψ y ) → ψ x ) → ∀ (x : ord1) → ψ x - TransFinite2 {ψ} ind x = TransFinite {n} {suc (suc n)} {ψ} caseΦ caseOSuc x where - caseΦ : (lx : ℕ) → ((x₁ : Ordinal) → x₁ o< ordinal lx (Φ lx) → ψ x₁) → - ψ (record { lv = lx ; ord = Φ lx }) - caseΦ lx prev = ind (ordinal lx (Φ lx) ) prev - caseOSuc : (lx : ℕ) (x₁ : OrdinalD lx) → ((y : Ordinal) → y o< ordinal lx (OSuc lx x₁) → ψ y) → - ψ (record { lv = lx ; ord = OSuc lx x₁ }) - caseOSuc lx ox prev = ind (ordinal lx (OSuc lx ox)) prev + TransFinite2 {ψ} ind x = TransFinite ind x --- H-Ordinal : {n : Level} → Ordinals {suc n} → Ordinals {suc n} → Ordinals {suc n} +-- H-Ordinal : {n : Level} → Ordinals {suc n} → Ordinals {suc n} → Ordinals {suc n} -- H-Ordinal {n} O1 O2 = record { --- Ordinal = Ordinals.Ordinal O1 ∧ Ordinals.Ordinal O2 +-- Ordinal = Ordinals.Ordinal O1 ∧ Ordinals.Ordinal O2 -- } -- We may have an oridinal as proper subset of an ordinal -- then the internal ordinal become a set in the outer ordinal
--- a/src/zorn.agda Sun Jun 23 09:32:40 2024 +0900 +++ b/src/zorn.agda Fri Jun 28 17:41:43 2024 +0900 @@ -1156,8 +1156,8 @@ zeq {xa} {xb} {z} xa<x xb<x xa≤xb z≤xa = supf-unique A f mf< ay xa≤xb (pzc xa<x) (pzc xb<x) z≤xa - iceq : {ix iy : Ordinal } → ix ≡ iy → {i<x : ix o< x } {i<y : iy o< x } → supfz i<x ≡ supfz i<y - iceq refl = cong supfz o<-irr + -- iceq : {ix iy : Ordinal } → ix ≡ iy → {i<x : ix o< x } {i<y : iy o< x } → supfz i<x ≡ supfz i<y + -- iceq refl = cong supfz o<-irr IChain-i : {z : Ordinal } → IChain ay supfz z → Ordinal IChain-i (ic-init fc) = o∅