The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V31. Set theory

Mathlib.SetTheory.Ordinal.Notation

212 declarations. Mathlib docs · Source

Ordinal notation

Constructive ordinal arithmetic for ordinals below ε₀.

We define a type ONote, with constructors 0 : ONote and ONote.oadd e n a representing ω ^ e * n + a. We say that o is in Cantor normal form - ONote.NF o - if either o = 0 or o = ω ^ e * n + a with a < ω ^ e and a in Cantor normal form.

The type NONote is the type of ordinals below ε₀ in Cantor normal form. Various operations (addition, subtraction, multiplication, exponentiation) are defined on ONote and NONote.

abbrev ONote.brecOn.go E1 #

{motive : ONote → Sort u} → (t : ONote) → ((t : ONote) → ONote.below t → motive t) → motive t ×' ONote.below t

theorem ONote.cmp.match_1.congr_eq_1 E1 #

∀ (motive : ONote → ONote → Sort u_1) (x x_1 : ONote) (h_1 : Unit → motive ONote.zero ONote.zero)
  (h_2 : (x : ONote) → motive x ONote.zero) (h_3 : (x : ONote) → motive ONote.zero x)
  (h_4 :
    (_o₁ e₁ : ONote) →
      (n₁ : ℕ+) →
        (a₁ : ONote) →
          _o₁ = e₁.oadd n₁ a₁ →
            (_o₂ e₂ : ONote) → (n₂ : ℕ+) → (a₂ : ONote) → _o₂ = e₂.oadd n₂ a₂ → motive (e₁.oadd n₁ a₁) (e₂.oadd n₂ a₂)),
  x = ONote.zero →
    x_1 = ONote.zero →
      (match x, x_1 with
        | ONote.zero, ONote.zero => h_1 ()
        | x, ONote.zero => h_2 x
        | ONote.zero, x => h_3 x
        | _o₁@h:(e₁.oadd n₁ a₁), _o₂@h_5:(e₂.oadd n₂ a₂) => h_4 _o₁ e₁ n₁ a₁ h _o₂ e₂ n₂ a₂ h_5) ≍
        h_1 ()

theorem ONote.fundamentalSequence.match_1.congr_eq_3 E1 #

∀ (motive : Option ONote ⊕ (ℕ → ONote) → ℕ → Sort u_1) (x : Option ONote ⊕ (ℕ → ONote)) (x_1 : ℕ)
  (h_1 : Unit → motive (Sum.inl none) 0) (h_2 : (m : ℕ) → motive (Sum.inl none) m.succ)
  (h_3 : (a' : ONote) → motive (Sum.inl (some a')) 0) (h_4 : (a' : ONote) → (m : ℕ) → motive (Sum.inl (some a')) m.succ)
  (h_5 : (f : ℕ → ONote) → motive (Sum.inr f) 0) (h_6 : (f : ℕ → ONote) → (m : ℕ) → motive (Sum.inr f) m.succ)
  (a' : ONote),
  x = Sum.inl (some a') →
    x_1 = 0 →
      (match x, x_1 with
        | Sum.inl none, 0 => h_1 ()
        | Sum.inl none, m.succ => h_2 m
        | Sum.inl (some a'), 0 => h_3 a'
        | Sum.inl (some a'), m.succ => h_4 a' m
        | Sum.inr f, 0 => h_5 f
        | Sum.inr f, m.succ => h_6 f m) ≍
        h_3 a'

theorem ONote.fundamentalSequence.match_1.congr_eq_1 E1 #

∀ (motive : Option ONote ⊕ (ℕ → ONote) → ℕ → Sort u_1) (x : Option ONote ⊕ (ℕ → ONote)) (x_1 : ℕ)
  (h_1 : Unit → motive (Sum.inl none) 0) (h_2 : (m : ℕ) → motive (Sum.inl none) m.succ)
  (h_3 : (a' : ONote) → motive (Sum.inl (some a')) 0) (h_4 : (a' : ONote) → (m : ℕ) → motive (Sum.inl (some a')) m.succ)
  (h_5 : (f : ℕ → ONote) → motive (Sum.inr f) 0) (h_6 : (f : ℕ → ONote) → (m : ℕ) → motive (Sum.inr f) m.succ),
  x = Sum.inl none →
    x_1 = 0 →
      (match x, x_1 with
        | Sum.inl none, 0 => h_1 ()
        | Sum.inl none, m.succ => h_2 m
        | Sum.inl (some a'), 0 => h_3 a'
        | Sum.inl (some a'), m.succ => h_4 a' m
        | Sum.inr f, 0 => h_5 f
        | Sum.inr f, m.succ => h_6 f m) ≍
        h_1 ()

theorem ONote.repr.match_1.congr_eq_2 E1 #

∀ (motive : ONote → Sort u_1) (x : ONote) (h_1 : Unit → motive ONote.zero)
  (h_2 : (e : ONote) → (n : ℕ+) → (a : ONote) → motive (e.oadd n a)) (e : ONote) (n : ℕ+) (a : ONote),
  x = e.oadd n a →
    (match x with
      | ONote.zero => h_1 ()
      | e.oadd n a => h_2 e n a) ≍
      h_2 e n a

def ONote.ctorIdx E1 #

ONote → ℕ

theorem ONote.ofNat.match_1.congr_eq_1 E1 #

∀ (motive : ℕ → Sort u_1) (x : ℕ) (h_1 : Unit → motive 0) (h_2 : (n : ℕ) → motive n.succ),
  x = 0 →
    (match x with
      | 0 => h_1 ()
      | n.succ => h_2 n) ≍
      h_1 ()

theorem ONote.fundamentalSequence.match_1.congr_eq_4 E1 #

∀ (motive : Option ONote ⊕ (ℕ → ONote) → ℕ → Sort u_1) (x : Option ONote ⊕ (ℕ → ONote)) (x_1 : ℕ)
  (h_1 : Unit → motive (Sum.inl none) 0) (h_2 : (m : ℕ) → motive (Sum.inl none) m.succ)
  (h_3 : (a' : ONote) → motive (Sum.inl (some a')) 0) (h_4 : (a' : ONote) → (m : ℕ) → motive (Sum.inl (some a')) m.succ)
  (h_5 : (f : ℕ → ONote) → motive (Sum.inr f) 0) (h_6 : (f : ℕ → ONote) → (m : ℕ) → motive (Sum.inr f) m.succ)
  (a' : ONote) (m : ℕ),
  x = Sum.inl (some a') →
    x_1 = m.succ →
      (match x, x_1 with
        | Sum.inl none, 0 => h_1 ()
        | Sum.inl none, m.succ => h_2 m
        | Sum.inl (some a'), 0 => h_3 a'
        | Sum.inl (some a'), m.succ => h_4 a' m
        | Sum.inr f, 0 => h_5 f
        | Sum.inr f, m.succ => h_6 f m) ≍
        h_4 a' m

theorem ONote.fundamentalSequence.match_1.congr_eq_2 E1 #

∀ (motive : Option ONote ⊕ (ℕ → ONote) → ℕ → Sort u_1) (x : Option ONote ⊕ (ℕ → ONote)) (x_1 : ℕ)
  (h_1 : Unit → motive (Sum.inl none) 0) (h_2 : (m : ℕ) → motive (Sum.inl none) m.succ)
  (h_3 : (a' : ONote) → motive (Sum.inl (some a')) 0) (h_4 : (a' : ONote) → (m : ℕ) → motive (Sum.inl (some a')) m.succ)
  (h_5 : (f : ℕ → ONote) → motive (Sum.inr f) 0) (h_6 : (f : ℕ → ONote) → (m : ℕ) → motive (Sum.inr f) m.succ) (m : ℕ),
  x = Sum.inl none →
    x_1 = m.succ →
      (match x, x_1 with
        | Sum.inl none, 0 => h_1 ()
        | Sum.inl none, m.succ => h_2 m
        | Sum.inl (some a'), 0 => h_3 a'
        | Sum.inl (some a'), m.succ => h_4 a' m
        | Sum.inr f, 0 => h_5 f
        | Sum.inr f, m.succ => h_6 f m) ≍
        h_2 m

theorem ONote.cmp.match_1.congr_eq_2 E1 #

∀ (motive : ONote → ONote → Sort u_1) (x x_1 : ONote) (h_1 : Unit → motive ONote.zero ONote.zero)
  (h_2 : (x : ONote) → motive x ONote.zero) (h_3 : (x : ONote) → motive ONote.zero x)
  (h_4 :
    (_o₁ e₁ : ONote) →
      (n₁ : ℕ+) →
        (a₁ : ONote) →
          _o₁ = e₁.oadd n₁ a₁ →
            (_o₂ e₂ : ONote) → (n₂ : ℕ+) → (a₂ : ONote) → _o₂ = e₂.oadd n₂ a₂ → motive (e₁.oadd n₁ a₁) (e₂.oadd n₂ a₂))
  (x_2 : ONote),
  x = x_2 →
    x_1 = ONote.zero →
      (x_2 = ONote.zero → False) →
        (match x, x_1 with
          | ONote.zero, ONote.zero => h_1 ()
          | x, ONote.zero => h_2 x
          | ONote.zero, x => h_3 x
          | _o₁@h:(e₁.oadd n₁ a₁), _o₂@h_5:(e₂.oadd n₂ a₂) => h_4 _o₁ e₁ n₁ a₁ h _o₂ e₂ n₂ a₂ h_5) ≍
          h_2 x_2

theorem ONote.opowAux2.match_3.congr_eq_4 E1 #

∀ (motive : ONote × ℕ → Sort u_1) (o₁ : ONote × ℕ) (h_1 : Unit → motive (ONote.zero, 0))
  (h_2 : Unit → motive (ONote.zero, 1)) (h_3 : (m : ℕ) → motive (ONote.zero, m.succ))
  (h_4 : (a a0 : ONote) → (a_1 : ℕ+) → (a_2 : ONote) → a = a0.oadd a_1 a_2 → (m : ℕ) → motive (a0.oadd a_1 a_2, m))
  (a0 : ONote) (a : ℕ+) (a_1 : ONote) (m : ℕ),
  o₁ = (a0.oadd a a_1, m) →
    (match o₁ with
      | (ONote.zero, 0) => h_1 ()
      | (ONote.zero, 1) => h_2 ()
      | (ONote.zero, m.succ) => h_3 m
      | (a@h:(a0.oadd a_2 a_3), m) => h_4 a a0 a_2 a_3 h m) ≍
      h_4 (a0.oadd a a_1) a0 a a_1 ⋯ m

theorem ONote.opowAux2.match_3.congr_eq_2 E1 #

∀ (motive : ONote × ℕ → Sort u_1) (o₁ : ONote × ℕ) (h_1 : Unit → motive (ONote.zero, 0))
  (h_2 : Unit → motive (ONote.zero, 1)) (h_3 : (m : ℕ) → motive (ONote.zero, m.succ))
  (h_4 : (a a0 : ONote) → (a_1 : ℕ+) → (a_2 : ONote) → a = a0.oadd a_1 a_2 → (m : ℕ) → motive (a0.oadd a_1 a_2, m)),
  o₁ = (ONote.zero, 1) →
    (match o₁ with
      | (ONote.zero, 0) => h_1 ()
      | (ONote.zero, 1) => h_2 ()
      | (ONote.zero, m.succ) => h_3 m
      | (a@h:(a0.oadd a_1 a_2), m) => h_4 a a0 a_1 a_2 h m) ≍
      h_2 ()

ctor ONote.NFBelow.below.oadd' E0 #

∀ {motive : (a : ONote) → (a_1 : Ordinal.{0}) → a.NFBelow a_1 → Prop} {e : ONote} {n : ℕ+} {a : ONote}
  {eb b : Ordinal.{0}} (a_1 : e.NFBelow eb) (a_2 : a.NFBelow e.repr) (a_3 : e.repr < b),
  ONote.NFBelow.below a_1 → motive e eb a_1 → ONote.NFBelow.below a_2 → motive a e.repr a_2 → ONote.NFBelow.below ⋯

theorem ONote.opowAux.match_1.congr_eq_1 E1 #

∀ (motive : ℕ → ℕ → Sort u_1) (x x_1 : ℕ) (h_1 : (x : ℕ) → motive x 0) (h_2 : (m : ℕ) → motive 0 m.succ)
  (h_3 : (k m : ℕ) → motive k.succ m) (x_2 : ℕ),
  x = x_2 →
    x_1 = 0 →
      (match x, x_1 with
        | x, 0 => h_1 x
        | 0, m.succ => h_2 m
        | k.succ, m => h_3 k m) ≍
        h_1 x_2

theorem ONote.opowAux2.match_1.congr_eq_1 E1 #

∀ (motive : ONote × ℕ → Sort u_1) (x : ONote × ℕ) (h_1 : (b : ONote) → motive (b, 0))
  (h_2 : (b : ONote) → (k : ℕ) → motive (b, k.succ)) (b : ONote),
  x = (b, 0) →
    (match x with
      | (b, 0) => h_1 b
      | (b, k.succ) => h_2 b k) ≍
      h_1 b

theorem ONote.fastGrowing.match_1.congr_eq_3 E1 #

∀ (o : ONote) (motive : (x : Option ONote ⊕ (ℕ → ONote)) → o.FundamentalSequenceProp x → Sort u_1)
  (x : Option ONote ⊕ (ℕ → ONote)) (x_1 : o.FundamentalSequenceProp x)
  (h_1 : (x : o.FundamentalSequenceProp (Sum.inl none)) → motive (Sum.inl none) x)
  (h_2 : (a : ONote) → (h : o.FundamentalSequenceProp (Sum.inl (some a))) → motive (Sum.inl (some a)) h)
  (h_3 : (f : ℕ → ONote) → (h : o.FundamentalSequenceProp (Sum.inr f)) → motive (Sum.inr f) h) (f : ℕ → ONote)
  (h : o.FundamentalSequenceProp (Sum.inr f)),
  x = Sum.inr f →
    x_1 ≍ h →
      (match x, x_1 with
        | Sum.inl none, x => h_1 x
        | Sum.inl (some a), h => h_2 a h
        | Sum.inr f, h => h_3 f h) ≍
        h_3 f h

theorem ONote.addAux.match_1.congr_eq_3 E1 #

∀ (motive : Ordering → Sort u_1) (x : Ordering) (h_1 : Unit → motive Ordering.lt) (h_2 : Unit → motive Ordering.eq)
  (h_3 : Unit → motive Ordering.gt),
  x = Ordering.gt →
    (match x with
      | Ordering.lt => h_1 ()
      | Ordering.eq => h_2 ()
      | Ordering.gt => h_3 ()) ≍
      h_3 ()

theorem ONote.add.match_1.congr_eq_2 E1 #

∀ (motive : ONote → ONote → Sort u_1) (x x_1 : ONote) (h_1 : (o : ONote) → motive ONote.zero o)
  (h_2 : (e : ONote) → (n : ℕ+) → (a o : ONote) → motive (e.oadd n a) o) (e : ONote) (n : ℕ+) (a o : ONote),
  x = e.oadd n a →
    x_1 = o →
      (match x, x_1 with
        | ONote.zero, o => h_1 o
        | e.oadd n a, o => h_2 e n a o) ≍
        h_2 e n a o

theorem ONote.sub.match_3.congr_eq_3 E1 #

∀ (motive : ONote → ONote → Sort u_1) (x x_1 : ONote) (h_1 : (x : ONote) → motive ONote.zero x)
  (h_2 : (o : ONote) → motive o ONote.zero)
  (h_3 :
    (o₁ e₁ : ONote) →
      (n₁ : ℕ+) →
        (a₁ : ONote) →
          o₁ = e₁.oadd n₁ a₁ → (e₂ : ONote) → (n₂ : ℕ+) → (a₂ : ONote) → motive (e₁.oadd n₁ a₁) (e₂.oadd n₂ a₂))
  (e₁ : ONote) (n₁ : ℕ+) (a₁ e₂ : ONote) (n₂ : ℕ+) (a₂ : ONote),
  x = e₁.oadd n₁ a₁ →
    x_1 = e₂.oadd n₂ a₂ →
      (match x, x_1 with
        | ONote.zero, x => h_1 x
        | o, ONote.zero => h_2 o
        | o₁@h:(e₁.oadd n₁ a₁), e₂.oadd n₂ a₂ => h_3 o₁ e₁ n₁ a₁ h e₂ n₂ a₂) ≍
        h_3 (e₁.oadd n₁ a₁) e₁ n₁ a₁ ⋯ e₂ n₂ a₂

theorem ONote.add.match_1.congr_eq_1 E1 #

∀ (motive : ONote → ONote → Sort u_1) (x x_1 : ONote) (h_1 : (o : ONote) → motive ONote.zero o)
  (h_2 : (e : ONote) → (n : ℕ+) → (a o : ONote) → motive (e.oadd n a) o) (o : ONote),
  x = ONote.zero →
    x_1 = o →
      (match x, x_1 with
        | ONote.zero, o => h_1 o
        | e.oadd n a, o => h_2 e n a o) ≍
        h_1 o

theorem ONote.FundamentalSequenceProp.match_1.congr_eq_3 E1 #

∀ (motive : Option ONote ⊕ (ℕ → ONote) → Sort u_1) (x : Option ONote ⊕ (ℕ → ONote)) (h_1 : Unit → motive (Sum.inl none))
  (h_2 : (a : ONote) → motive (Sum.inl (some a))) (h_3 : (f : ℕ → ONote) → motive (Sum.inr f)) (f : ℕ → ONote),
  x = Sum.inr f →
    (match x with
      | Sum.inl none => h_1 ()
      | Sum.inl (some a) => h_2 a
      | Sum.inr f => h_3 f) ≍
      h_3 f

theorem ONote.cmp.match_1.congr_eq_3 E1 #

∀ (motive : ONote → ONote → Sort u_1) (x x_1 : ONote) (h_1 : Unit → motive ONote.zero ONote.zero)
  (h_2 : (x : ONote) → motive x ONote.zero) (h_3 : (x : ONote) → motive ONote.zero x)
  (h_4 :
    (_o₁ e₁ : ONote) →
      (n₁ : ℕ+) →
        (a₁ : ONote) →
          _o₁ = e₁.oadd n₁ a₁ →
            (_o₂ e₂ : ONote) → (n₂ : ℕ+) → (a₂ : ONote) → _o₂ = e₂.oadd n₂ a₂ → motive (e₁.oadd n₁ a₁) (e₂.oadd n₂ a₂))
  (x_2 : ONote),
  x = ONote.zero →
    x_1 = x_2 →
      (x_2 = ONote.zero → False) →
        (match x, x_1 with
          | ONote.zero, ONote.zero => h_1 ()
          | x, ONote.zero => h_2 x
          | ONote.zero, x => h_3 x
          | _o₁@h:(e₁.oadd n₁ a₁), _o₂@h_5:(e₂.oadd n₂ a₂) => h_4 _o₁ e₁ n₁ a₁ h _o₂ e₂ n₂ a₂ h_5) ≍
          h_3 x_2

theorem ONote.split'.match_1.congr_eq_1 E1 #

∀ (motive : ONote × ℕ → Sort u_1) (x : ONote × ℕ) (h_1 : (a' : ONote) → (m : ℕ) → motive (a', m)) (a' : ONote) (m : ℕ),
  x = (a', m) →
    (match x with
      | (a', m) => h_1 a' m) ≍
      h_1 a' m

theorem ONote.cmp.match_1.congr_eq_4 E1 #

∀ (motive : ONote → ONote → Sort u_1) (x x_1 : ONote) (h_1 : Unit → motive ONote.zero ONote.zero)
  (h_2 : (x : ONote) → motive x ONote.zero) (h_3 : (x : ONote) → motive ONote.zero x)
  (h_4 :
    (_o₁ e₁ : ONote) →
      (n₁ : ℕ+) →
        (a₁ : ONote) →
          _o₁ = e₁.oadd n₁ a₁ →
            (_o₂ e₂ : ONote) → (n₂ : ℕ+) → (a₂ : ONote) → _o₂ = e₂.oadd n₂ a₂ → motive (e₁.oadd n₁ a₁) (e₂.oadd n₂ a₂))
  (e₁ : ONote) (n₁ : ℕ+) (a₁ e₂ : ONote) (n₂ : ℕ+) (a₂ : ONote),
  x = e₁.oadd n₁ a₁ →
    x_1 = e₂.oadd n₂ a₂ →
      (match x, x_1 with
        | ONote.zero, ONote.zero => h_1 ()
        | x, ONote.zero => h_2 x
        | ONote.zero, x => h_3 x
        | _o₁@h:(e₁.oadd n₁ a₁), _o₂@h_5:(e₂.oadd n₂ a₂) => h_4 _o₁ e₁ n₁ a₁ h _o₂ e₂ n₂ a₂ h_5) ≍
        h_4 (e₁.oadd n₁ a₁) e₁ n₁ a₁ ⋯ (e₂.oadd n₂ a₂) e₂ n₂ a₂ ⋯

theorem ONote.sub.match_1.congr_eq_2 E1 #

∀ (motive : Ordering → Sort u_1) (x : Ordering) (h_1 : Unit → motive Ordering.lt) (h_2 : Unit → motive Ordering.gt)
  (h_3 : Unit → motive Ordering.eq),
  x = Ordering.gt →
    (match x with
      | Ordering.lt => h_1 ()
      | Ordering.gt => h_2 ()
      | Ordering.eq => h_3 ()) ≍
      h_2 ()

theorem ONote.sub.match_1.congr_eq_3 E1 #

∀ (motive : Ordering → Sort u_1) (x : Ordering) (h_1 : Unit → motive Ordering.lt) (h_2 : Unit → motive Ordering.gt)
  (h_3 : Unit → motive Ordering.eq),
  x = Ordering.eq →
    (match x with
      | Ordering.lt => h_1 ()
      | Ordering.gt => h_2 ()
      | Ordering.eq => h_3 ()) ≍
      h_3 ()

theorem ONote.FundamentalSequenceProp.match_1.congr_eq_1 E1 #

∀ (motive : Option ONote ⊕ (ℕ → ONote) → Sort u_1) (x : Option ONote ⊕ (ℕ → ONote)) (h_1 : Unit → motive (Sum.inl none))
  (h_2 : (a : ONote) → motive (Sum.inl (some a))) (h_3 : (f : ℕ → ONote) → motive (Sum.inr f)),
  x = Sum.inl none →
    (match x with
      | Sum.inl none => h_1 ()
      | Sum.inl (some a) => h_2 a
      | Sum.inr f => h_3 f) ≍
      h_1 ()

theorem ONote.addAux.match_1.congr_eq_1 E1 #

∀ (motive : Ordering → Sort u_1) (x : Ordering) (h_1 : Unit → motive Ordering.lt) (h_2 : Unit → motive Ordering.eq)
  (h_3 : Unit → motive Ordering.gt),
  x = Ordering.lt →
    (match x with
      | Ordering.lt => h_1 ()
      | Ordering.eq => h_2 ()
      | Ordering.gt => h_3 ()) ≍
      h_1 ()

theorem ONote.sub.match_3.congr_eq_2 E1 #

∀ (motive : ONote → ONote → Sort u_1) (x x_1 : ONote) (h_1 : (x : ONote) → motive ONote.zero x)
  (h_2 : (o : ONote) → motive o ONote.zero)
  (h_3 :
    (o₁ e₁ : ONote) →
      (n₁ : ℕ+) →
        (a₁ : ONote) →
          o₁ = e₁.oadd n₁ a₁ → (e₂ : ONote) → (n₂ : ℕ+) → (a₂ : ONote) → motive (e₁.oadd n₁ a₁) (e₂.oadd n₂ a₂))
  (o : ONote),
  x = o →
    x_1 = ONote.zero →
      (o = ONote.zero → False) →
        (match x, x_1 with
          | ONote.zero, x => h_1 x
          | o, ONote.zero => h_2 o
          | o₁@h:(e₁.oadd n₁ a₁), e₂.oadd n₂ a₂ => h_3 o₁ e₁ n₁ a₁ h e₂ n₂ a₂) ≍
          h_2 o

theorem ONote.sub.match_1.congr_eq_1 E1 #

∀ (motive : Ordering → Sort u_1) (x : Ordering) (h_1 : Unit → motive Ordering.lt) (h_2 : Unit → motive Ordering.gt)
  (h_3 : Unit → motive Ordering.eq),
  x = Ordering.lt →
    (match x with
      | Ordering.lt => h_1 ()
      | Ordering.gt => h_2 ()
      | Ordering.eq => h_3 ()) ≍
      h_1 ()

theorem ONote.fastGrowing.match_1.congr_eq_1 E1 #

∀ (o : ONote) (motive : (x : Option ONote ⊕ (ℕ → ONote)) → o.FundamentalSequenceProp x → Sort u_1)
  (x : Option ONote ⊕ (ℕ → ONote)) (x_1 : o.FundamentalSequenceProp x)
  (h_1 : (x : o.FundamentalSequenceProp (Sum.inl none)) → motive (Sum.inl none) x)
  (h_2 : (a : ONote) → (h : o.FundamentalSequenceProp (Sum.inl (some a))) → motive (Sum.inl (some a)) h)
  (h_3 : (f : ℕ → ONote) → (h : o.FundamentalSequenceProp (Sum.inr f)) → motive (Sum.inr f) h)
  (x_2 : o.FundamentalSequenceProp (Sum.inl none)),
  x = Sum.inl none →
    x_1 ≍ x_2 →
      (match x, x_1 with
        | Sum.inl none, x => h_1 x
        | Sum.inl (some a), h => h_2 a h
        | Sum.inr f, h => h_3 f h) ≍
        h_1 x_2

theorem ONote.oadd.injEq E0 #

∀ (a : ONote) (a_1 : ℕ+) (a_2 a_3 : ONote) (a_4 : ℕ+) (a_5 : ONote),
  (a.oadd a_1 a_2 = a_3.oadd a_4 a_5) = (a = a_3 ∧ a_1 = a_4 ∧ a_2 = a_5)

theorem ONote.opowAux2.match_1.congr_eq_2 E1 #

∀ (motive : ONote × ℕ → Sort u_1) (x : ONote × ℕ) (h_1 : (b : ONote) → motive (b, 0))
  (h_2 : (b : ONote) → (k : ℕ) → motive (b, k.succ)) (b : ONote) (k : ℕ),
  x = (b, k.succ) →
    (match x with
      | (b, 0) => h_1 b
      | (b, k.succ) => h_2 b k) ≍
      h_2 b k

abbrev ONote.ctorElimType E1 #

{motive : ONote → Sort u} → ℕ → Sort (max 1 u)

theorem ONote.brecOn.eq E1 #

∀ {motive : ONote → Sort u} (t : ONote) (F_1 : (t : ONote) → ONote.below t → motive t),
  ONote.brecOn t F_1 = F_1 t (ONote.brecOn.go t F_1).2

theorem ONote.fastGrowing.match_1.congr_eq_2 E1 #

∀ (o : ONote) (motive : (x : Option ONote ⊕ (ℕ → ONote)) → o.FundamentalSequenceProp x → Sort u_1)
  (x : Option ONote ⊕ (ℕ → ONote)) (x_1 : o.FundamentalSequenceProp x)
  (h_1 : (x : o.FundamentalSequenceProp (Sum.inl none)) → motive (Sum.inl none) x)
  (h_2 : (a : ONote) → (h : o.FundamentalSequenceProp (Sum.inl (some a))) → motive (Sum.inl (some a)) h)
  (h_3 : (f : ℕ → ONote) → (h : o.FundamentalSequenceProp (Sum.inr f)) → motive (Sum.inr f) h) (a : ONote)
  (h : o.FundamentalSequenceProp (Sum.inl (some a))),
  x = Sum.inl (some a) →
    x_1 ≍ h →
      (match x, x_1 with
        | Sum.inl none, x => h_1 x
        | Sum.inl (some a), h => h_2 a h
        | Sum.inr f, h => h_3 f h) ≍
        h_2 a h

theorem ONote.opowAux2.match_3.congr_eq_3 E1 #

∀ (motive : ONote × ℕ → Sort u_1) (o₁ : ONote × ℕ) (h_1 : Unit → motive (ONote.zero, 0))
  (h_2 : Unit → motive (ONote.zero, 1)) (h_3 : (m : ℕ) → motive (ONote.zero, m.succ))
  (h_4 : (a a0 : ONote) → (a_1 : ℕ+) → (a_2 : ONote) → a = a0.oadd a_1 a_2 → (m : ℕ) → motive (a0.oadd a_1 a_2, m))
  (m : ℕ),
  o₁ = (ONote.zero, m.succ) →
    (m = 0 → False) →
      (match o₁ with
        | (ONote.zero, 0) => h_1 ()
        | (ONote.zero, 1) => h_2 ()
        | (ONote.zero, m.succ) => h_3 m
        | (a@h:(a0.oadd a_1 a_2), m) => h_4 a a0 a_1 a_2 h m) ≍
        h_3 m

theorem ONote.addAux.match_3.congr_eq_2 E1 #

∀ (motive : ONote → Sort u_1) (o : ONote) (h_1 : Unit → motive ONote.zero)
  (h_2 : (o' e' : ONote) → (n' : ℕ+) → (a' : ONote) → o' = e'.oadd n' a' → motive (e'.oadd n' a')) (e' : ONote)
  (n' : ℕ+) (a' : ONote),
  o = e'.oadd n' a' →
    (match o with
      | ONote.zero => h_1 ()
      | o'@h:(e'.oadd n' a') => h_2 o' e' n' a' h) ≍
      h_2 (e'.oadd n' a') e' n' a' ⋯

theorem ONote.sub.match_3.congr_eq_1 E1 #

∀ (motive : ONote → ONote → Sort u_1) (x x_1 : ONote) (h_1 : (x : ONote) → motive ONote.zero x)
  (h_2 : (o : ONote) → motive o ONote.zero)
  (h_3 :
    (o₁ e₁ : ONote) →
      (n₁ : ℕ+) →
        (a₁ : ONote) →
          o₁ = e₁.oadd n₁ a₁ → (e₂ : ONote) → (n₂ : ℕ+) → (a₂ : ONote) → motive (e₁.oadd n₁ a₁) (e₂.oadd n₂ a₂))
  (x_2 : ONote),
  x = ONote.zero →
    x_1 = x_2 →
      (match x, x_1 with
        | ONote.zero, x => h_1 x
        | o, ONote.zero => h_2 o
        | o₁@h:(e₁.oadd n₁ a₁), e₂.oadd n₂ a₂ => h_3 o₁ e₁ n₁ a₁ h e₂ n₂ a₂) ≍
        h_1 x_2

theorem ONote.oadd.inj E1 #

∀ {a : ONote} {a_1 : ℕ+} {a_2 a_3 : ONote} {a_4 : ℕ+} {a_5 : ONote},
  a.oadd a_1 a_2 = a_3.oadd a_4 a_5 → a = a_3 ∧ a_1 = a_4 ∧ a_2 = a_5

theorem ONote.opowAux2.match_3.congr_eq_1 E1 #

∀ (motive : ONote × ℕ → Sort u_1) (o₁ : ONote × ℕ) (h_1 : Unit → motive (ONote.zero, 0))
  (h_2 : Unit → motive (ONote.zero, 1)) (h_3 : (m : ℕ) → motive (ONote.zero, m.succ))
  (h_4 : (a a0 : ONote) → (a_1 : ℕ+) → (a_2 : ONote) → a = a0.oadd a_1 a_2 → (m : ℕ) → motive (a0.oadd a_1 a_2, m)),
  o₁ = (ONote.zero, 0) →
    (match o₁ with
      | (ONote.zero, 0) => h_1 ()
      | (ONote.zero, 1) => h_2 ()
      | (ONote.zero, m.succ) => h_3 m
      | (a@h:(a0.oadd a_1 a_2), m) => h_4 a a0 a_1 a_2 h m) ≍
      h_1 ()

theorem ONote.addAux.match_3.congr_eq_1 E1 #

∀ (motive : ONote → Sort u_1) (o : ONote) (h_1 : Unit → motive ONote.zero)
  (h_2 : (o' e' : ONote) → (n' : ℕ+) → (a' : ONote) → o' = e'.oadd n' a' → motive (e'.oadd n' a')),
  o = ONote.zero →
    (match o with
      | ONote.zero => h_1 ()
      | o'@h:(e'.oadd n' a') => h_2 o' e' n' a' h) ≍
      h_1 ()

theorem ONote.fundamentalSequence.match_3.congr_eq_2 E1 #

∀ (motive : Option ONote ⊕ (ℕ → ONote) → Sort u_1) (x : Option ONote ⊕ (ℕ → ONote))
  (h_1 : (f : ℕ → ONote) → motive (Sum.inr f)) (h_2 : (b' : ONote) → motive (Sum.inl (some b')))
  (h_3 : Unit → motive (Sum.inl none)) (b' : ONote),
  x = Sum.inl (some b') →
    (match x with
      | Sum.inr f => h_1 f
      | Sum.inl (some b') => h_2 b'
      | Sum.inl none => h_3 ()) ≍
      h_2 b'

theorem ONote.addAux.match_1.congr_eq_2 E1 #

∀ (motive : Ordering → Sort u_1) (x : Ordering) (h_1 : Unit → motive Ordering.lt) (h_2 : Unit → motive Ordering.eq)
  (h_3 : Unit → motive Ordering.gt),
  x = Ordering.eq →
    (match x with
      | Ordering.lt => h_1 ()
      | Ordering.eq => h_2 ()
      | Ordering.gt => h_3 ()) ≍
      h_2 ()

theorem ONote.ofNat.match_1.congr_eq_2 E1 #

∀ (motive : ℕ → Sort u_1) (x : ℕ) (h_1 : Unit → motive 0) (h_2 : (n : ℕ) → motive n.succ) (n : ℕ),
  x = n.succ →
    (match x with
      | 0 => h_1 ()
      | n.succ => h_2 n) ≍
      h_2 n

theorem ONote.fundamentalSequence.match_1.congr_eq_5 E1 #

∀ (motive : Option ONote ⊕ (ℕ → ONote) → ℕ → Sort u_1) (x : Option ONote ⊕ (ℕ → ONote)) (x_1 : ℕ)
  (h_1 : Unit → motive (Sum.inl none) 0) (h_2 : (m : ℕ) → motive (Sum.inl none) m.succ)
  (h_3 : (a' : ONote) → motive (Sum.inl (some a')) 0) (h_4 : (a' : ONote) → (m : ℕ) → motive (Sum.inl (some a')) m.succ)
  (h_5 : (f : ℕ → ONote) → motive (Sum.inr f) 0) (h_6 : (f : ℕ → ONote) → (m : ℕ) → motive (Sum.inr f) m.succ)
  (f : ℕ → ONote),
  x = Sum.inr f →
    x_1 = 0 →
      (match x, x_1 with
        | Sum.inl none, 0 => h_1 ()
        | Sum.inl none, m.succ => h_2 m
        | Sum.inl (some a'), 0 => h_3 a'
        | Sum.inl (some a'), m.succ => h_4 a' m
        | Sum.inr f, 0 => h_5 f
        | Sum.inr f, m.succ => h_6 f m) ≍
        h_5 f

theorem ONote.opowAux.match_1.congr_eq_3 E1 #

∀ (motive : ℕ → ℕ → Sort u_1) (x x_1 : ℕ) (h_1 : (x : ℕ) → motive x 0) (h_2 : (m : ℕ) → motive 0 m.succ)
  (h_3 : (k m : ℕ) → motive k.succ m) (k m : ℕ),
  x = k.succ →
    x_1 = m →
      (m = 0 → False) →
        (match x, x_1 with
          | x, 0 => h_1 x
          | 0, m.succ => h_2 m
          | k.succ, m => h_3 k m) ≍
          h_3 k m

theorem ONote.fundamentalSequence.match_3.congr_eq_3 E1 #

∀ (motive : Option ONote ⊕ (ℕ → ONote) → Sort u_1) (x : Option ONote ⊕ (ℕ → ONote))
  (h_1 : (f : ℕ → ONote) → motive (Sum.inr f)) (h_2 : (b' : ONote) → motive (Sum.inl (some b')))
  (h_3 : Unit → motive (Sum.inl none)),
  x = Sum.inl none →
    (match x with
      | Sum.inr f => h_1 f
      | Sum.inl (some b') => h_2 b'
      | Sum.inl none => h_3 ()) ≍
      h_3 ()

theorem ONote.fundamentalSequence.match_3.congr_eq_1 E1 #

∀ (motive : Option ONote ⊕ (ℕ → ONote) → Sort u_1) (x : Option ONote ⊕ (ℕ → ONote))
  (h_1 : (f : ℕ → ONote) → motive (Sum.inr f)) (h_2 : (b' : ONote) → motive (Sum.inl (some b')))
  (h_3 : Unit → motive (Sum.inl none)) (f : ℕ → ONote),
  x = Sum.inr f →
    (match x with
      | Sum.inr f => h_1 f
      | Sum.inl (some b') => h_2 b'
      | Sum.inl none => h_3 ()) ≍
      h_1 f

ctor ONote.NFBelow.below.zero E0 #

∀ {motive : (a : ONote) → (a_1 : Ordinal.{0}) → a.NFBelow a_1 → Prop} {b : Ordinal.{0}}, ONote.NFBelow.below ⋯

theorem ONote.FundamentalSequenceProp.match_1.congr_eq_2 E1 #

∀ (motive : Option ONote ⊕ (ℕ → ONote) → Sort u_1) (x : Option ONote ⊕ (ℕ → ONote)) (h_1 : Unit → motive (Sum.inl none))
  (h_2 : (a : ONote) → motive (Sum.inl (some a))) (h_3 : (f : ℕ → ONote) → motive (Sum.inr f)) (a : ONote),
  x = Sum.inl (some a) →
    (match x with
      | Sum.inl none => h_1 ()
      | Sum.inl (some a) => h_2 a
      | Sum.inr f => h_3 f) ≍
      h_2 a

theorem ONote.fundamentalSequence.match_1.congr_eq_6 E1 #

∀ (motive : Option ONote ⊕ (ℕ → ONote) → ℕ → Sort u_1) (x : Option ONote ⊕ (ℕ → ONote)) (x_1 : ℕ)
  (h_1 : Unit → motive (Sum.inl none) 0) (h_2 : (m : ℕ) → motive (Sum.inl none) m.succ)
  (h_3 : (a' : ONote) → motive (Sum.inl (some a')) 0) (h_4 : (a' : ONote) → (m : ℕ) → motive (Sum.inl (some a')) m.succ)
  (h_5 : (f : ℕ → ONote) → motive (Sum.inr f) 0) (h_6 : (f : ℕ → ONote) → (m : ℕ) → motive (Sum.inr f) m.succ)
  (f : ℕ → ONote) (m : ℕ),
  x = Sum.inr f →
    x_1 = m.succ →
      (match x, x_1 with
        | Sum.inl none, 0 => h_1 ()
        | Sum.inl none, m.succ => h_2 m
        | Sum.inl (some a'), 0 => h_3 a'
        | Sum.inl (some a'), m.succ => h_4 a' m
        | Sum.inr f, 0 => h_5 f
        | Sum.inr f, m.succ => h_6 f m) ≍
        h_6 f m

theorem ONote.repr.match_1.congr_eq_1 E1 #

∀ (motive : ONote → Sort u_1) (x : ONote) (h_1 : Unit → motive ONote.zero)
  (h_2 : (e : ONote) → (n : ℕ+) → (a : ONote) → motive (e.oadd n a)),
  x = ONote.zero →
    (match x with
      | ONote.zero => h_1 ()
      | e.oadd n a => h_2 e n a) ≍
      h_1 ()

theorem ONote.opowAux.match_1.congr_eq_2 E1 #

∀ (motive : ℕ → ℕ → Sort u_1) (x x_1 : ℕ) (h_1 : (x : ℕ) → motive x 0) (h_2 : (m : ℕ) → motive 0 m.succ)
  (h_3 : (k m : ℕ) → motive k.succ m) (m : ℕ),
  x = 0 →
    x_1 = m.succ →
      (match x, x_1 with
        | x, 0 => h_1 x
        | 0, m.succ => h_2 m
        | k.succ, m => h_3 k m) ≍
        h_2 m

inductive ONote E1 #

Type

Recursive definition of an ordinal notation. zero denotes the ordinal 0, and oadd e n a is intended to refer to ω ^ e * n + a. For this to be a valid Cantor normal form, we must have the exponents decrease to the right, but we can't state this condition until we've defined repr, so we make it a separate definition NF.

ctor ONote.zero E0 #

ONote

ctor ONote.oadd E0 #

ONote → ℕ+ → ONote → ONote

def instDecidableEqONote.decEq E1 #

(x x_1 : ONote) → Decidable (x = x_1)

instance instDecidableEqONote E0 #

DecidableEq ONote

instance ONote.instZero E0 #

Zero ONote

Notation for 0

theorem ONote.zero_def E0 #

ONote.zero = 0

instance ONote.instInhabited E0 #

Inhabited ONote

instance ONote.instOne E0 #

One ONote

Notation for 1

def ONote.omega E1 #

ONote

Notation for ω

def ONote.repr E1 #

ONote → Ordinal.{0}

The ordinal denoted by a notation

theorem ONote.repr_zero E0 #

ONote.repr 0 = 0

def ONote.toString E1 #

ONote → String

Print an ordinal notation

def ONote.repr' E1 #

ℕ → ONote → Std.Format

Print an ordinal notation

instance ONote.instToString E0 #

ToString ONote

instance ONote.instRepr E0 #

Repr ONote

instance ONote.instPreorder E0 #

Preorder ONote

theorem ONote.lt_def E0 #

∀ {x y : ONote}, x < y ↔ x.repr < y.repr

theorem ONote.le_def E0 #

∀ {x y : ONote}, x ≤ y ↔ x.repr ≤ y.repr

theorem ONote.repr_le_repr E1 #

∀ {x y : ONote}, x ≤ y → x.repr ≤ y.repr

Alias of the forward direction of ONote.le_def.

theorem ONote.repr_lt_repr E1 #

∀ {x y : ONote}, x < y → x.repr < y.repr

Alias of the forward direction of ONote.lt_def.

instance ONote.instWellFoundedRelation E0 #

WellFoundedRelation ONote

def ONote.ofNat E1 #

ℕ → ONote

Convert a Nat into an ordinal

theorem ONote.ofNat_zero E0 #

↑0 = 0

theorem ONote.ofNat_succ E0 #

∀ (n : ℕ), ↑n.succ = ONote.oadd 0 n.succPNat 0

instance ONote.nat E0 #

(n : ℕ) → OfNat ONote n

theorem ONote.ofNat_one E0 #

↑1 = 1

theorem ONote.repr_ofNat E0 #

∀ (n : ℕ), (↑n).repr = ↑n

theorem ONote.repr_one E0 #

ONote.repr 1 = ↑1

theorem ONote.omega0_le_oadd E1 #

∀ (e : ONote) (n : ℕ+) (a : ONote), Ordinal.omega0 ^ e.repr ≤ (e.oadd n a).repr

theorem ONote.oadd_pos E1 #

∀ (e : ONote) (n : ℕ+) (a : ONote), 0 < e.oadd n a

def ONote.cmp E1 #

ONote → ONote → Ordering

Comparison of ordinal notations:

ω ^ e₁ * n₁ + a₁ is less than ω ^ e₂ * n₂ + a₂ when either e₁ < e₂, or e₁ = e₂ and n₁ < n₂, or e₁ = e₂, n₁ = n₂, and a₁ < a₂.

theorem ONote.zero_lt_one E1 #

0 < 1

inductive ONote.NFBelow E1 #

ONote → Ordinal.{0} → Prop

NFBelow o b says that o is a normal form ordinal notation satisfying repr o < ω ^ b.

ctor ONote.NFBelow.zero E0 #

∀ {b : Ordinal.{0}}, ONote.NFBelow 0 b

ctor ONote.NFBelow.oadd' E0 #

∀ {e : ONote} {n : ℕ+} {a : ONote} {eb b : Ordinal.{0}},
  e.NFBelow eb → a.NFBelow e.repr → e.repr < b → (e.oadd n a).NFBelow b

class ONote.NF E1 #

ONote → Prop

A normal form ordinal notation has the form

ω ^ a₁ * n₁ + ω ^ a₂ * n₂ + ⋯ + ω ^ aₖ * nₖ

where a₁ > a₂ > ⋯ > aₖ and all the aᵢ are also in normal form.

We will essentially only be interested in normal form ordinal notations, but to avoid complicating the algorithms, we define everything over general ordinal notations and only prove correctness with normal form as an invariant.

ctor ONote.NF.mk E0 #

∀ {o : ONote}, Exists o.NFBelow → o.NF

theorem ONote.NF.out E1 #

∀ {o : ONote} [self : o.NF], Exists o.NFBelow

instance ONote.NF.zero E0 #

ONote.NF 0

theorem ONote.NFBelow.oadd E1 #

∀ {e : ONote} {n : ℕ+} {a : ONote} {b : Ordinal.{0}}, e.NF → a.NFBelow e.repr → e.repr < b → (e.oadd n a).NFBelow b

theorem ONote.NFBelow.fst E1 #

∀ {e : ONote} {n : ℕ+} {a : ONote} {b : Ordinal.{0}}, (e.oadd n a).NFBelow b → e.NF

theorem ONote.NF.fst E1 #

∀ {e : ONote} {n : ℕ+} {a : ONote}, (e.oadd n a).NF → e.NF

theorem ONote.NFBelow.snd E1 #

∀ {e : ONote} {n : ℕ+} {a : ONote} {b : Ordinal.{0}}, (e.oadd n a).NFBelow b → a.NFBelow e.repr

theorem ONote.NF.snd' E1 #

∀ {e : ONote} {n : ℕ+} {a : ONote}, (e.oadd n a).NF → a.NFBelow e.repr

theorem ONote.NF.snd E1 #

∀ {e : ONote} {n : ℕ+} {a : ONote}, (e.oadd n a).NF → a.NF

theorem ONote.NF.oadd E1 #

∀ {e a : ONote}, e.NF → ∀ (n : ℕ+), a.NFBelow e.repr → (e.oadd n a).NF

instance ONote.NF.oadd_zero E0 #

∀ (e : ONote) (n : ℕ+) [h : e.NF], (e.oadd n 0).NF

theorem ONote.NFBelow.lt E1 #

∀ {e : ONote} {n : ℕ+} {a : ONote} {b : Ordinal.{0}}, (e.oadd n a).NFBelow b → e.repr < b

theorem ONote.NFBelow_zero E1 #

∀ {o : ONote}, o.NFBelow 0 ↔ o = 0

theorem ONote.NF.zero_of_zero E1 #

∀ {e : ONote} {n : ℕ+} {a : ONote}, (e.oadd n a).NF → e = 0 → a = 0

theorem ONote.NFBelow.repr_lt E1 #

∀ {o : ONote} {b : Ordinal.{0}}, o.NFBelow b → o.repr < Ordinal.omega0 ^ b

theorem ONote.NFBelow.mono E1 #

∀ {o : ONote} {b₁ b₂ : Ordinal.{0}}, b₁ ≤ b₂ → o.NFBelow b₁ → o.NFBelow b₂

theorem ONote.NF.below_of_lt E1 #

∀ {e : ONote} {n : ℕ+} {a : ONote} {b : Ordinal.{0}}, e.repr < b → (e.oadd n a).NF → (e.oadd n a).NFBelow b

theorem ONote.NF.below_of_lt' E1 #

∀ {o : ONote} {b : Ordinal.{0}}, o.repr < Ordinal.omega0 ^ b → o.NF → o.NFBelow b

theorem ONote.nfBelow_ofNat E1 #

∀ (n : ℕ), (↑n).NFBelow 1

instance ONote.nf_ofNat E0 #

∀ (n : ℕ), (↑n).NF

instance ONote.nf_one E0 #

ONote.NF 1

theorem ONote.oadd_lt_oadd_1 E1 #

∀ {e₁ : ONote} {n₁ : ℕ+} {o₁ e₂ : ONote} {n₂ : ℕ+} {o₂ : ONote},
  (e₁.oadd n₁ o₁).NF → e₁ < e₂ → e₁.oadd n₁ o₁ < e₂.oadd n₂ o₂

theorem ONote.oadd_lt_oadd_2 E1 #

∀ {e o₁ o₂ : ONote} {n₁ n₂ : ℕ+}, (e.oadd n₁ o₁).NF → ↑n₁ < ↑n₂ → e.oadd n₁ o₁ < e.oadd n₂ o₂

theorem ONote.oadd_lt_oadd_3 E1 #

∀ {e : ONote} {n : ℕ+} {a₁ a₂ : ONote}, a₁ < a₂ → e.oadd n a₁ < e.oadd n a₂

theorem ONote.cmp_compares E1 #

∀ (a b : ONote) [a.NF] [b.NF], (a.cmp b).Compares a b

theorem ONote.repr_inj E1 #

∀ {a b : ONote} [a.NF] [b.NF], a.repr = b.repr ↔ a = b

theorem ONote.NF.of_dvd_omega0_opow E1 #

∀ {b : Ordinal.{0}} {e : ONote} {n : ℕ+} {a : ONote},
  (e.oadd n a).NF → Ordinal.omega0 ^ b ∣ (e.oadd n a).repr → b ≤ e.repr ∧ Ordinal.omega0 ^ b ∣ a.repr

theorem ONote.NF.of_dvd_omega0 E1 #

∀ {e : ONote} {n : ℕ+} {a : ONote},
  (e.oadd n a).NF → Ordinal.omega0 ∣ (e.oadd n a).repr → e.repr ≠ 0 ∧ Ordinal.omega0 ∣ a.repr

def ONote.TopBelow E1 #

ONote → ONote → Prop

TopBelow b o asserts that the largest exponent in o, if it exists, is less than b. This is an auxiliary definition for decidability of NF.

instance ONote.decidableTopBelow E0 #

DecidableRel ONote.TopBelow

theorem ONote.nfBelow_iff_topBelow E1 #

∀ {b : ONote} [b.NF] {o : ONote}, o.NFBelow b.repr ↔ o.NF ∧ b.TopBelow o

instance ONote.decidableNF E0 #

DecidablePred ONote.NF

def ONote.addAux E0 #

ONote → ℕ+ → ONote → ONote

Auxiliary definition for add

def ONote.add E1 #

ONote → ONote → ONote

Addition of ordinal notations (correct only for normal input)

instance ONote.instAdd E0 #

Add ONote

theorem ONote.zero_add E0 #

∀ (o : ONote), 0 + o = o

theorem ONote.oadd_add E1 #

∀ (e : ONote) (n : ℕ+) (a o : ONote), e.oadd n a + o = e.addAux n (a + o)

def ONote.sub E1 #

ONote → ONote → ONote

Subtraction of ordinal notations (correct only for normal input)

instance ONote.instSub E0 #

Sub ONote

theorem ONote.add_nfBelow E1 #

∀ {b : Ordinal.{0}} {o₁ o₂ : ONote}, o₁.NFBelow b → o₂.NFBelow b → (o₁ + o₂).NFBelow b

instance ONote.add_nf E0 #

∀ (o₁ o₂ : ONote) [o₁.NF] [o₂.NF], (o₁ + o₂).NF

theorem ONote.repr_add E0 #

∀ (o₁ o₂ : ONote) [o₁.NF] [o₂.NF], (o₁ + o₂).repr = o₁.repr + o₂.repr

theorem ONote.sub_nfBelow E1 #

∀ {o₁ o₂ : ONote} {b : Ordinal.{0}}, o₁.NFBelow b → o₂.NF → (o₁ - o₂).NFBelow b

instance ONote.sub_nf E0 #

∀ (o₁ o₂ : ONote) [o₁.NF] [o₂.NF], (o₁ - o₂).NF

theorem ONote.repr_sub E0 #

∀ (o₁ o₂ : ONote) [o₁.NF] [o₂.NF], (o₁ - o₂).repr = o₁.repr - o₂.repr

def ONote.mul E1 #

ONote → ONote → ONote

Multiplication of ordinal notations (correct only for normal input)

instance ONote.instMul E0 #

Mul ONote

instance ONote.instMulZeroClass E0 #

MulZeroClass ONote

theorem ONote.oadd_mul E1 #

∀ (e₁ : ONote) (n₁ : ℕ+) (a₁ e₂ : ONote) (n₂ : ℕ+) (a₂ : ONote),
  e₁.oadd n₁ a₁ * e₂.oadd n₂ a₂ = if e₂ = 0 then e₁.oadd (n₁ * n₂) a₁ else (e₁ + e₂).oadd n₂ (e₁.oadd n₁ a₁ * a₂)

theorem ONote.oadd_mul_nfBelow E1 #

∀ {e₁ : ONote} {n₁ : ℕ+} {a₁ : ONote} {b₁ : Ordinal.{0}},
  (e₁.oadd n₁ a₁).NFBelow b₁ →
    ∀ {o₂ : ONote} {b₂ : Ordinal.{0}}, o₂.NFBelow b₂ → (e₁.oadd n₁ a₁ * o₂).NFBelow (e₁.repr + b₂)

instance ONote.mul_nf E0 #

∀ (o₁ o₂ : ONote) [o₁.NF] [o₂.NF], (o₁ * o₂).NF

theorem ONote.repr_mul E0 #

∀ (o₁ o₂ : ONote) [o₁.NF] [o₂.NF], (o₁ * o₂).repr = o₁.repr * o₂.repr

def ONote.split' E1 #

ONote → ONote × ℕ

Calculate division and remainder of o mod ω:

split' o = (a, n) means o = ω * a + n.

def ONote.split E1 #

ONote → ONote × ℕ

Calculate division and remainder of o mod ω:

split o = (a, n) means o = a + n, where ω ∣ a.

def ONote.scale E1 #

ONote → ONote → ONote

scale x o is the ordinal notation for ω ^ x * o.

def ONote.mulNat E1 #

ONote → ℕ → ONote

mulNat o n is the ordinal notation for o * n.

def ONote.opowAux E0 #

ONote → ONote → ONote → ℕ → ℕ → ONote

Auxiliary definition to compute the ordinal notation for the ordinal exponentiation in opow

def ONote.opowAux2 E1 #

ONote → ONote × ℕ → ONote

Auxiliary definition to compute the ordinal notation for the ordinal exponentiation in opow

def ONote.opow E1 #

ONote → ONote → ONote

opow o₁ o₂ calculates the ordinal notation for the ordinal exponential o₁ ^ o₂.

instance ONote.instPow E0 #

Pow ONote ONote

theorem ONote.opow_def E0 #

∀ (o₁ o₂ : ONote), o₁ ^ o₂ = o₂.opowAux2 o₁.split

theorem ONote.split_eq_scale_split' E1 #

∀ {o o' : ONote} {m : ℕ} [o.NF], o.split' = (o', m) → o.split = (ONote.scale 1 o', m)

theorem ONote.nf_repr_split' E1 #

∀ {o o' : ONote} {m : ℕ} [o.NF], o.split' = (o', m) → o'.NF ∧ o.repr = Ordinal.omega0 * o'.repr + ↑m

theorem ONote.scale_eq_mul E1 #

∀ (x : ONote) [x.NF] (o : ONote) [o.NF], x.scale o = x.oadd 1 0 * o

instance ONote.nf_scale E0 #

∀ (x : ONote) [x.NF] (o : ONote) [o.NF], (x.scale o).NF

theorem ONote.repr_scale E0 #

∀ (x : ONote) [x.NF] (o : ONote) [o.NF], (x.scale o).repr = Ordinal.omega0 ^ x.repr * o.repr

theorem ONote.nf_repr_split E1 #

∀ {o o' : ONote} {m : ℕ} [o.NF], o.split = (o', m) → o'.NF ∧ o.repr = o'.repr + ↑m

theorem ONote.split_dvd E1 #

∀ {o o' : ONote} {m : ℕ} [o.NF], o.split = (o', m) → Ordinal.omega0 ∣ o'.repr

theorem ONote.split_add_lt E1 #

∀ {o e : ONote} {n : ℕ+} {a : ONote} {m : ℕ} [o.NF], o.split = (e.oadd n a, m) → a.repr + ↑m < Ordinal.omega0 ^ e.repr

theorem ONote.mulNat_eq_mul E0 #

∀ (n : ℕ) (o : ONote), o.mulNat n = o * ↑n

instance ONote.nf_mulNat E0 #

∀ (o : ONote) [o.NF] (n : ℕ), (o.mulNat n).NF

instance ONote.nf_opowAux E0 #

∀ (e a0 a : ONote) [e.NF] [a0.NF] [a.NF] (k m : ℕ), (e.opowAux a0 a k m).NF

instance ONote.nf_opow E0 #

∀ (o₁ o₂ : ONote) [o₁.NF] [o₂.NF], (o₁ ^ o₂).NF

theorem ONote.scale_opowAux E0 #

∀ (e a0 a : ONote) [e.NF] [a0.NF] [a.NF] (k m : ℕ),
  (e.opowAux a0 a k m).repr = Ordinal.omega0 ^ e.repr * (ONote.opowAux 0 a0 a k m).repr

theorem ONote.repr_opow_aux₁ E1 #

∀ {e a : ONote} [Ne : e.NF] [Na : a.NF] {a' : Ordinal.{0}},
  e.repr ≠ 0 →
    a' < Ordinal.omega0 ^ e.repr →
      a.repr = a' →
        ∀ (n : ℕ+), (Ordinal.omega0 ^ e.repr * ↑↑n + a') ^ Ordinal.omega0 = (Ordinal.omega0 ^ e.repr) ^ Ordinal.omega0

theorem ONote.repr_opow_aux₂ E1 #

∀ {a0 a' : ONote} [N0 : a0.NF] [Na' : a'.NF] (m : ℕ),
  Ordinal.omega0 ∣ a'.repr →
    a0.repr ≠ 0 →
      a'.repr + ↑m < Ordinal.omega0 ^ a0.repr →
        ∀ (n : ℕ+) (k : ℕ),
          have R := (ONote.opowAux 0 a0 (a0.oadd n a' * ↑m) k m).repr;
          (k ≠ 0 → R < (Ordinal.omega0 ^ a0.repr) ^ Order.succ ↑k) ∧
            (Ordinal.omega0 ^ a0.repr) ^ ↑k * (Ordinal.omega0 ^ a0.repr * ↑↑n + a'.repr) + R =
              (Ordinal.omega0 ^ a0.repr * ↑↑n + a'.repr + ↑m) ^ Order.succ ↑k

theorem ONote.repr_opow E1 #

∀ (o₁ o₂ : ONote) [o₁.NF] [o₂.NF], (o₁ ^ o₂).repr = o₁.repr ^ o₂.repr

def ONote.fundamentalSequence E1 #

ONote → Option ONote ⊕ (ℕ → ONote)

Given an ordinal, returns:

  • inl none for 0
  • inl (some a) for a + 1
  • inr f for a limit ordinal a, where f i is a sequence converging to a

def ONote.FundamentalSequenceProp E1 #

ONote → Option ONote ⊕ (ℕ → ONote) → Prop

The property satisfied by fundamentalSequence o:

  • inl none means o = 0
  • inl (some a) means o = succ a
  • inr f means o is a limit ordinal and f is a strictly increasing sequence which converges to o

theorem ONote.fundamentalSequenceProp_inl_none E1 #

∀ (o : ONote), o.FundamentalSequenceProp (Sum.inl none) ↔ o = 0

theorem ONote.fundamentalSequenceProp_inl_some E1 #

∀ (o a : ONote), o.FundamentalSequenceProp (Sum.inl (some a)) ↔ o.repr = Order.succ a.repr ∧ (o.NF → a.NF)

theorem ONote.fundamentalSequenceProp_inr E1 #

∀ (o : ONote) (f : ℕ → ONote),
  o.FundamentalSequenceProp (Sum.inr f) ↔
    Order.IsSuccLimit o.repr ∧
      (∀ (i : ℕ), f i < f (i + 1) ∧ f i < o ∧ (o.NF → (f i).NF)) ∧ ∀ a < o.repr, ∃ i, a < (f i).repr

theorem ONote.fundamentalSequence_has_prop E1 #

∀ (o : ONote), o.FundamentalSequenceProp o.fundamentalSequence

def ONote.fastGrowing E1 #

ONote → ℕ → ℕ

The fast growing hierarchy for ordinal notations < ε₀. This is a sequence of functions ℕ → ℕ indexed by ordinals, with the definition:

  • f_0(n) = n + 1
  • f_(α + 1)(n) = f_α^[n](n)
  • f_α(n) = f_(α[n])(n) where α is a limit ordinal and α[i] is the fundamental sequence converging to α

theorem ONote.fastGrowing_def E0 #

∀ {o : ONote} {x : Option ONote ⊕ (ℕ → ONote)} (e : o.fundamentalSequence = x),
  o.fastGrowing =
    match (motive := (x : Option ONote ⊕ (ℕ → ONote)) → o.FundamentalSequenceProp x → ℕ → ℕ) x, ⋯ with
    | Sum.inl none, x => Nat.succ
    | Sum.inl (some a), x => fun i ↦ a.fastGrowing^[i] i
    | Sum.inr f, x => fun i ↦ (f i).fastGrowing i

theorem ONote.fastGrowing_zero' E1 #

∀ (o : ONote), o.fundamentalSequence = Sum.inl none → o.fastGrowing = Nat.succ

theorem ONote.fastGrowing_succ E1 #

∀ (o : ONote) {a : ONote}, o.fundamentalSequence = Sum.inl (some a) → o.fastGrowing = fun i ↦ a.fastGrowing^[i] i

theorem ONote.fastGrowing_limit E1 #

∀ (o : ONote) {f : ℕ → ONote}, o.fundamentalSequence = Sum.inr f → o.fastGrowing = fun i ↦ (f i).fastGrowing i

theorem ONote.fastGrowing_zero E0 #

ONote.fastGrowing 0 = Nat.succ

theorem ONote.fastGrowing_one E0 #

ONote.fastGrowing 1 = fun n ↦ 2 * n

theorem ONote.fastGrowing_two E0 #

ONote.fastGrowing 2 = fun n ↦ 2 ^ n * n

def ONote.fastGrowingε₀ E1 #

ℕ → ℕ

We can extend the fast growing hierarchy one more step to ε₀ itself, using ω ^ (ω ^ (⋯ ^ ω)) as the fundamental sequence converging to ε₀ (which is not an ONote). Extending the fast growing hierarchy beyond this requires a definition of fundamental sequence for larger ordinals.

theorem ONote.fastGrowingε₀_zero E1 #

ONote.fastGrowingε₀ 0 = 1

theorem ONote.fastGrowingε₀_one E1 #

ONote.fastGrowingε₀ 1 = 2

theorem ONote.fastGrowingε₀_two E1 #

ONote.fastGrowingε₀ 2 = 2048

def NONote E1 #

Type

The type of normal ordinal notations.

It would have been nicer to define this right in the inductive type, but NF o requires repr which requires ONote, so all these things would have to be defined at once, which messes up the VM representation.

instance instDecidableEqNONote E0 #

DecidableEq NONote

instance NONote.NF E0 #

∀ (o : NONote), (↑o).NF

def NONote.mk E1 #

(o : ONote) → [h : o.NF] → NONote

Construct a NONote from an ordinal notation (and infer normality)

def NONote.repr E1 #

NONote → Ordinal.{0}

The ordinal represented by an ordinal notation.

This function is noncomputable because ordinal arithmetic is noncomputable. In computational applications NONote can be used exclusively without reference to Ordinal, but this function allows for correctness results to be stated.

instance NONote.instToString E0 #

ToString NONote

instance NONote.instRepr E0 #

Repr NONote

instance NONote.instPreorder E0 #

Preorder NONote

instance NONote.instZero E0 #

Zero NONote

instance NONote.instInhabited E0 #

Inhabited NONote

instance NONote.lt_wf E0 #

WellFoundedLT NONote

instance NONote.instWellFoundedRelation E0 #

WellFoundedRelation NONote

def NONote.ofNat E1 #

ℕ → NONote

Convert a natural number to an ordinal notation

def NONote.cmp E1 #

NONote → NONote → Ordering

Compare ordinal notations

theorem NONote.cmp_compares E1 #

∀ (a b : NONote), (a.cmp b).Compares a b

instance NONote.instLinearOrder E0 #

LinearOrder NONote

def NONote.oadd E1 #

(e : NONote) → ℕ+ → (a : NONote) → a.below e → NONote

The oadd pseudo-constructor for NONote

def NONote.recOn E1 #

{C : NONote → Sort u_1} →
  (o : NONote) → C 0 → ((e : NONote) → (n : ℕ+) → (a : NONote) → (h : a.below e) → C e → C a → C (e.oadd n a h)) → C o

This is a recursor-like theorem for NONote suggesting an inductive definition, which can't actually be defined this way due to conflicting dependencies.

instance NONote.instAdd E0 #

Add NONote

Addition of ordinal notations

theorem NONote.repr_add E1 #

∀ (a b : NONote), (a + b).repr = a.repr + b.repr

instance NONote.instSub E0 #

Sub NONote

Subtraction of ordinal notations

theorem NONote.repr_sub E1 #

∀ (a b : NONote), (a - b).repr = a.repr - b.repr

instance NONote.instMul E0 #

Mul NONote

Multiplication of ordinal notations

theorem NONote.repr_mul E1 #

∀ (a b : NONote), (a * b).repr = a.repr * b.repr

def NONote.opow E1 #

NONote → NONote → NONote

Exponentiation of ordinal notations

theorem NONote.repr_opow E1 #

∀ (a b : NONote), (a.opow b).repr = a.repr ^ b.repr