open import Level module ordinal-definable 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 OD {n : Level} : Set (suc n) where field def : (x : Ordinal {n} ) → Set n open OD open import Data.Unit postulate od→ord : {n : Level} → OD {n} → Ordinal {n} ord→od : {n : Level} → Ordinal {n} → OD {n} _∋_ : { n : Level } → ( a x : OD {n} ) → Set n _∋_ {n} a x = def a ( od→ord x ) _c<_ : { n : Level } → ( a x : OD {n} ) → Set n x c< a = a ∋ x -- _=='_ : {n : Level} → Set (suc n) -- Rel (OD {n}) (suc n) -- _=='_ {n} = ( a b : OD {n} ) → ( ∀ { x : OD {n} } → a ∋ x → b ∋ x ) ∧ ( ∀ { x : OD {n} } → a ∋ x → b ∋ x ) 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 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) } _c≤_ : {n : Level} → OD {n} → OD {n} → Set (suc n) a c≤ b = (a ≡ b) ∨ ( b ∋ a ) od∅ : {n : Level} → OD {n} od∅ {n} = record { def = λ _ → Lift n ⊥ } postulate c<→o< : {n : Level} {x y : OD {n} } → x c< y → od→ord x o< od→ord y o<→c< : {n : Level} {x y : Ordinal {n} } → x o< y → ord→od x c< ord→od 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 sup-od : {n : Level } → ( OD {n} → OD {n}) → OD {n} sup-c< : {n : Level } → ( ψ : OD {n} → OD {n}) → ∀ {x : OD {n}} → ψ x c< sup-od ψ ∅-base-def : {n : Level} → def ( ord→od (o∅ {n}) ) ≡ def (od∅ {n}) ∅1 : {n : Level} → ( x : OD {n} ) → ¬ ( x c< od∅ {n} ) ∅1 {n} x (lift ()) ∅3 : {n : Level} → { x : Ordinal {n}} → ( ∀(y : Ordinal {n}) → ¬ (y o< x ) ) → x ≡ o∅ {n} ∅3 {n} {x} = TransFinite {n} c1 c2 c3 x where c0 : Nat → Ordinal {n} → Set n c0 lx x = (∀(y : Ordinal {n}) → ¬ (y o< x)) → x ≡ o∅ {n} c1 : ∀ (lx : Nat ) → c0 lx (record { lv = Suc lx ; ord = ℵ lx } ) c1 lx not with not ( record { lv = lx ; ord = Φ lx } ) ... | t with t (case1 ≤-refl ) c1 lx not | t | () 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 ¬a ¬b c = ¬b refl ∅8 : {n : Level} → ( x : Ordinal {n} ) → ¬ x o< o∅ {n} ∅8 {n} x (case1 ()) ∅8 {n} x (case2 ()) -- ∅10 : {n : Level} → (x : OD {n} ) → ¬ ( ( y : OD {n} ) → Lift (suc n) ( x ∋ y)) → x ≡ od∅ -- ∅10 {n} x not = ? open Ordinal -- ∋-subst : {n : Level} {X Y x y : OD {suc n} } → X ≡ x → Y ≡ y → X ∋ Y → x ∋ y -- ∋-subst refl refl x = x -- ∅77 : {n : Level} → (x : OD {suc n} ) → ¬ ( ord→od (o∅ {suc n}) ∋ x ) -- ∅77 {n} x lt = {!!} where ∅7' : {n : Level} → ord→od (o∅ {n}) ≡ od∅ {n} ∅7' {n} = cong ( λ k → record { def = k }) ( ∅-base-def ) where ∅7 : {n : Level} → ( x : OD {n} ) → od→ord x ≡ o∅ {n} → x == od∅ {n} ∅7 {n} x eq = record { eq→ = e1 ; eq← = e2 } where e0 : {y : Ordinal {n}} → y o< o∅ {n} → def od∅ y e0 {y} (case1 ()) e0 {y} (case2 ()) e1 : {y : Ordinal {n}} → def x y → def od∅ y e1 {y} y