fact stringlengths 6 3.84k | type stringclasses 11
values | library stringclasses 32
values | imports listlengths 1 14 | filename stringlengths 20 95 | symbolic_name stringlengths 1 90 | docstring stringlengths 7 20k ⌀ |
|---|---|---|---|---|---|---|
@[simp]
toOrdinal_natCast (n : ℕ) : toOrdinal n = n := by
induction n with
| zero => rfl
| succ n hn =>
change (toOrdinal n) ♯ 1 = n + 1
rw [hn]; exact nadd_one n | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | toOrdinal_natCast | null |
nadd_eq_add (a b : Ordinal) : a ♯ b = toOrdinal (toNatOrdinal a + toNatOrdinal b) :=
rfl
@[simp] | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | nadd_eq_add | null |
toNatOrdinal_natCast (n : ℕ) : toNatOrdinal n = n := by
rw [← toOrdinal_natCast n]
rfl | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | toNatOrdinal_natCast | null |
lt_of_nadd_lt_nadd_left : ∀ {a b c}, a ♯ b < a ♯ c → b < c :=
@lt_of_add_lt_add_left NatOrdinal _ _ _ | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | lt_of_nadd_lt_nadd_left | null |
lt_of_nadd_lt_nadd_right : ∀ {a b c}, b ♯ a < c ♯ a → b < c :=
@lt_of_add_lt_add_right NatOrdinal _ _ _ | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | lt_of_nadd_lt_nadd_right | null |
le_of_nadd_le_nadd_left : ∀ {a b c}, a ♯ b ≤ a ♯ c → b ≤ c :=
@le_of_add_le_add_left NatOrdinal _ _ _ | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | le_of_nadd_le_nadd_left | null |
le_of_nadd_le_nadd_right : ∀ {a b c}, b ♯ a ≤ c ♯ a → b ≤ c :=
@le_of_add_le_add_right NatOrdinal _ _ _
@[simp] | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | le_of_nadd_le_nadd_right | null |
nadd_lt_nadd_iff_left : ∀ (a) {b c}, a ♯ b < a ♯ c ↔ b < c :=
@add_lt_add_iff_left NatOrdinal _ _ _ _
@[simp] | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | nadd_lt_nadd_iff_left | null |
nadd_lt_nadd_iff_right : ∀ (a) {b c}, b ♯ a < c ♯ a ↔ b < c :=
@add_lt_add_iff_right NatOrdinal _ _ _ _
@[simp] | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | nadd_lt_nadd_iff_right | null |
nadd_le_nadd_iff_left : ∀ (a) {b c}, a ♯ b ≤ a ♯ c ↔ b ≤ c :=
@add_le_add_iff_left NatOrdinal _ _ _ _
@[simp] | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | nadd_le_nadd_iff_left | null |
nadd_le_nadd_iff_right : ∀ (a) {b c}, b ♯ a ≤ c ♯ a ↔ b ≤ c :=
@_root_.add_le_add_iff_right NatOrdinal _ _ _ _ | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | nadd_le_nadd_iff_right | null |
nadd_le_nadd : ∀ {a b c d}, a ≤ b → c ≤ d → a ♯ c ≤ b ♯ d :=
@add_le_add NatOrdinal _ _ _ _ | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | nadd_le_nadd | null |
nadd_lt_nadd : ∀ {a b c d}, a < b → c < d → a ♯ c < b ♯ d :=
@add_lt_add NatOrdinal _ _ _ _ | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | nadd_lt_nadd | null |
nadd_lt_nadd_of_lt_of_le : ∀ {a b c d}, a < b → c ≤ d → a ♯ c < b ♯ d :=
@add_lt_add_of_lt_of_le NatOrdinal _ _ _ _ | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | nadd_lt_nadd_of_lt_of_le | null |
nadd_lt_nadd_of_le_of_lt : ∀ {a b c d}, a ≤ b → c < d → a ♯ c < b ♯ d :=
@add_lt_add_of_le_of_lt NatOrdinal _ _ _ _ | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | nadd_lt_nadd_of_le_of_lt | null |
nadd_left_cancel : ∀ {a b c}, a ♯ b = a ♯ c → b = c :=
@_root_.add_left_cancel NatOrdinal _ _ | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | nadd_left_cancel | null |
nadd_right_cancel : ∀ {a b c}, a ♯ b = c ♯ b → a = c :=
@_root_.add_right_cancel NatOrdinal _ _
@[simp] | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | nadd_right_cancel | null |
nadd_left_cancel_iff : ∀ {a b c}, a ♯ b = a ♯ c ↔ b = c :=
@add_left_cancel_iff NatOrdinal _ _
@[simp] | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | nadd_left_cancel_iff | null |
nadd_right_cancel_iff : ∀ {a b c}, b ♯ a = c ♯ a ↔ b = c :=
@add_right_cancel_iff NatOrdinal _ _ | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | nadd_right_cancel_iff | null |
le_nadd_self {a b} : a ≤ b ♯ a := by simpa using nadd_le_nadd_right (Ordinal.zero_le b) a | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | le_nadd_self | null |
le_nadd_left {a b c} (h : a ≤ c) : a ≤ b ♯ c :=
le_nadd_self.trans (nadd_le_nadd_left h b) | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | le_nadd_left | null |
le_self_nadd {a b} : a ≤ a ♯ b := by simpa using nadd_le_nadd_left (Ordinal.zero_le b) a | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | le_self_nadd | null |
le_nadd_right {a b c} (h : a ≤ b) : a ≤ b ♯ c :=
le_self_nadd.trans (nadd_le_nadd_right h c) | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | le_nadd_right | null |
nadd_left_comm : ∀ a b c, a ♯ (b ♯ c) = b ♯ (a ♯ c) :=
@add_left_comm NatOrdinal _ | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | nadd_left_comm | null |
nadd_right_comm : ∀ a b c, a ♯ b ♯ c = a ♯ c ♯ b :=
@add_right_comm NatOrdinal _
/-! ### Natural multiplication -/
variable {a b c d : Ordinal.{u}}
@[deprecated "avoid using the definition of `nmul` directly" (since := "2024-11-19")] | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | nadd_right_comm | null |
nmul_def (a b : Ordinal) :
a ⨳ b = sInf {c | ∀ a' < a, ∀ b' < b, a' ⨳ b ♯ a ⨳ b' < c ♯ a' ⨳ b'} := by
rw [nmul] | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | nmul_def | null |
private nmul_nonempty (a b : Ordinal.{u}) :
{c : Ordinal.{u} | ∀ a' < a, ∀ b' < b, a' ⨳ b ♯ a ⨳ b' < c ♯ a' ⨳ b'}.Nonempty := by
obtain ⟨c, hc⟩ : BddAbove ((fun x ↦ x.1 ⨳ b ♯ a ⨳ x.2) '' Set.Iio a ×ˢ Set.Iio b) :=
bddAbove_of_small _
exact ⟨_, fun x hx y hy ↦
(lt_succ_of_le <| hc <| Set.mem_image_of_mem _ <| Set.mk_mem_prod hx hy).trans_le le_self_nadd⟩ | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | nmul_nonempty | The set in the definition of `nmul` is nonempty. |
nmul_nadd_lt {a' b' : Ordinal} (ha : a' < a) (hb : b' < b) :
a' ⨳ b ♯ a ⨳ b' < a ⨳ b ♯ a' ⨳ b' := by
conv_rhs => rw [nmul]
exact csInf_mem (nmul_nonempty a b) a' ha b' hb | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | nmul_nadd_lt | null |
nmul_nadd_le {a' b' : Ordinal} (ha : a' ≤ a) (hb : b' ≤ b) :
a' ⨳ b ♯ a ⨳ b' ≤ a ⨳ b ♯ a' ⨳ b' := by
rcases lt_or_eq_of_le ha with (ha | rfl)
· rcases lt_or_eq_of_le hb with (hb | rfl)
· exact (nmul_nadd_lt ha hb).le
· rw [nadd_comm]
· exact le_rfl | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | nmul_nadd_le | null |
lt_nmul_iff : c < a ⨳ b ↔ ∃ a' < a, ∃ b' < b, c ♯ a' ⨳ b' ≤ a' ⨳ b ♯ a ⨳ b' := by
refine ⟨fun h => ?_, ?_⟩
· rw [nmul] at h
simpa using notMem_of_lt_csInf h ⟨0, fun _ _ => bot_le⟩
· rintro ⟨a', ha, b', hb, h⟩
have := h.trans_lt (nmul_nadd_lt ha hb)
rwa [nadd_lt_nadd_iff_right] at this | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | lt_nmul_iff | null |
nmul_le_iff : a ⨳ b ≤ c ↔ ∀ a' < a, ∀ b' < b, a' ⨳ b ♯ a ⨳ b' < c ♯ a' ⨳ b' := by
rw [← not_iff_not]; simp [lt_nmul_iff] | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | nmul_le_iff | null |
nmul_comm (a b) : a ⨳ b = b ⨳ a := by
rw [nmul, nmul]
congr; ext x; constructor <;> intro H c hc d hd
· rw [nadd_comm, ← nmul_comm, ← nmul_comm a, ← nmul_comm d]
exact H _ hd _ hc
· rw [nadd_comm, nmul_comm, nmul_comm c, nmul_comm c]
exact H _ hd _ hc
termination_by (a, b)
@[simp] | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | nmul_comm | null |
nmul_zero (a) : a ⨳ 0 = 0 := by
rw [← Ordinal.le_zero, nmul_le_iff]
exact fun _ _ a ha => (Ordinal.not_lt_zero a ha).elim
@[simp] | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | nmul_zero | null |
zero_nmul (a) : 0 ⨳ a = 0 := by rw [nmul_comm, nmul_zero]
@[simp] | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | zero_nmul | null |
nmul_one (a : Ordinal) : a ⨳ 1 = a := by
rw [nmul]
convert csInf_Ici
ext b
refine ⟨fun H ↦ le_of_forall_lt (a := a) fun c hc ↦ ?_, fun ha c hc ↦ ?_⟩
· simpa [nmul_one c] using H c hc
· simpa [nmul_one c] using hc.trans_le ha
termination_by a
@[simp] | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | nmul_one | null |
one_nmul (a) : 1 ⨳ a = a := by rw [nmul_comm, nmul_one] | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | one_nmul | null |
nmul_lt_nmul_of_pos_left (h₁ : a < b) (h₂ : 0 < c) : c ⨳ a < c ⨳ b :=
lt_nmul_iff.2 ⟨0, h₂, a, h₁, by simp⟩ | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | nmul_lt_nmul_of_pos_left | null |
nmul_lt_nmul_of_pos_right (h₁ : a < b) (h₂ : 0 < c) : a ⨳ c < b ⨳ c :=
lt_nmul_iff.2 ⟨a, h₁, 0, h₂, by simp⟩ | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | nmul_lt_nmul_of_pos_right | null |
nmul_le_nmul_left (h : a ≤ b) (c) : c ⨳ a ≤ c ⨳ b := by
rcases lt_or_eq_of_le h with (h₁ | rfl) <;> rcases (eq_zero_or_pos c).symm with (h₂ | rfl)
· exact (nmul_lt_nmul_of_pos_left h₁ h₂).le
all_goals simp | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | nmul_le_nmul_left | null |
nmul_le_nmul_right (h : a ≤ b) (c) : a ⨳ c ≤ b ⨳ c := by
rw [nmul_comm, nmul_comm b]
exact nmul_le_nmul_left h c | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | nmul_le_nmul_right | null |
nmul_nadd (a b c : Ordinal) : a ⨳ (b ♯ c) = a ⨳ b ♯ a ⨳ c := by
refine le_antisymm (nmul_le_iff.2 fun a' ha d hd => ?_)
(nadd_le_iff.2 ⟨fun d hd => ?_, fun d hd => ?_⟩)
· rw [nmul_nadd]
rcases lt_nadd_iff.1 hd with (⟨b', hb, hd⟩ | ⟨c', hc, hd⟩)
· have := nadd_lt_nadd_of_lt_of_le (nmul_nadd_lt ha hb) (nmul_nadd_le ha.le hd)
rw [nmul_nadd, nmul_nadd] at this
simp only [nadd_assoc] at this
rwa [nadd_left_comm, nadd_left_comm _ (a ⨳ b'), nadd_left_comm (a ⨳ b),
nadd_lt_nadd_iff_left, nadd_left_comm (a' ⨳ b), nadd_left_comm (a ⨳ b),
nadd_lt_nadd_iff_left, ← nadd_assoc, ← nadd_assoc] at this
· have := nadd_lt_nadd_of_le_of_lt (nmul_nadd_le ha.le hd) (nmul_nadd_lt ha hc)
rw [nmul_nadd, nmul_nadd] at this
simp only [nadd_assoc] at this
rwa [nadd_left_comm, nadd_comm (a ⨳ c), nadd_left_comm (a' ⨳ d), nadd_left_comm (a ⨳ c'),
nadd_left_comm (a ⨳ b), nadd_lt_nadd_iff_left, nadd_comm (a' ⨳ c), nadd_left_comm (a ⨳ d),
nadd_left_comm (a' ⨳ b), nadd_left_comm (a ⨳ b), nadd_lt_nadd_iff_left, nadd_comm (a ⨳ d),
nadd_comm (a' ⨳ d), ← nadd_assoc, ← nadd_assoc] at this
· rcases lt_nmul_iff.1 hd with ⟨a', ha, b', hb, hd⟩
have := nadd_lt_nadd_of_le_of_lt hd (nmul_nadd_lt ha (nadd_lt_nadd_right hb c))
rw [nmul_nadd, nmul_nadd, nmul_nadd a'] at this
simp only [nadd_assoc] at this
rwa [nadd_left_comm (a' ⨳ b'), nadd_left_comm, nadd_lt_nadd_iff_left, nadd_left_comm,
nadd_left_comm _ (a' ⨳ b'), nadd_left_comm (a ⨳ b'), nadd_lt_nadd_iff_left,
nadd_left_comm (a' ⨳ c), nadd_left_comm, nadd_lt_nadd_iff_left, nadd_left_comm,
nadd_comm _ (a' ⨳ c), nadd_lt_nadd_iff_left] at this
· rcases lt_nmul_iff.1 hd with ⟨a', ha, c', hc, hd⟩
have := nadd_lt_nadd_of_lt_of_le (nmul_nadd_lt ha (nadd_lt_nadd_left hc b)) hd
rw [nmul_nadd, nmul_nadd, nmul_nadd a'] at this
simp only [nadd_assoc] at this
rwa [nadd_left_comm _ (a' ⨳ b), nadd_lt_nadd_iff_left, nadd_left_comm (a' ⨳ c'),
nadd_left_comm _ (a' ⨳ c), nadd_lt_nadd_iff_left, nadd_left_comm, nadd_comm (a' ⨳ c'),
nadd_left_comm _ (a ⨳ c'), nadd_lt_nadd_iff_left, nadd_comm _ (a' ⨳ c'),
nadd_comm _ (a' ⨳ c'), nadd_left_comm, nadd_lt_nadd_iff_left] at this
termination_by (a, b, c) | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | nmul_nadd | null |
nadd_nmul (a b c) : (a ♯ b) ⨳ c = a ⨳ c ♯ b ⨳ c := by
rw [nmul_comm, nmul_nadd, nmul_comm, nmul_comm c] | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | nadd_nmul | null |
nmul_nadd_lt₃ {a' b' c' : Ordinal} (ha : a' < a) (hb : b' < b) (hc : c' < c) :
a' ⨳ b ⨳ c ♯ a ⨳ b' ⨳ c ♯ a ⨳ b ⨳ c' ♯ a' ⨳ b' ⨳ c' <
a ⨳ b ⨳ c ♯ a' ⨳ b' ⨳ c ♯ a' ⨳ b ⨳ c' ♯ a ⨳ b' ⨳ c' := by
simpa only [nadd_nmul, ← nadd_assoc] using nmul_nadd_lt (nmul_nadd_lt ha hb) hc | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | nmul_nadd_lt₃ | null |
nmul_nadd_le₃ {a' b' c' : Ordinal} (ha : a' ≤ a) (hb : b' ≤ b) (hc : c' ≤ c) :
a' ⨳ b ⨳ c ♯ a ⨳ b' ⨳ c ♯ a ⨳ b ⨳ c' ♯ a' ⨳ b' ⨳ c' ≤
a ⨳ b ⨳ c ♯ a' ⨳ b' ⨳ c ♯ a' ⨳ b ⨳ c' ♯ a ⨳ b' ⨳ c' := by
simpa only [nadd_nmul, ← nadd_assoc] using nmul_nadd_le (nmul_nadd_le ha hb) hc | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | nmul_nadd_le₃ | null |
private nmul_nadd_lt₃' {a' b' c' : Ordinal} (ha : a' < a) (hb : b' < b) (hc : c' < c) :
a' ⨳ (b ⨳ c) ♯ a ⨳ (b' ⨳ c) ♯ a ⨳ (b ⨳ c') ♯ a' ⨳ (b' ⨳ c') <
a ⨳ (b ⨳ c) ♯ a' ⨳ (b' ⨳ c) ♯ a' ⨳ (b ⨳ c') ♯ a ⨳ (b' ⨳ c') := by
simp only [nmul_comm _ (_ ⨳ _)]
convert nmul_nadd_lt₃ hb hc ha using 1 <;>
(simp only [nadd_eq_add, NatOrdinal.toOrdinal_toNatOrdinal]; abel_nf)
@[deprecated nmul_nadd_le₃ (since := "2024-11-19")] | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | nmul_nadd_lt₃' | null |
nmul_nadd_le₃' {a' b' c' : Ordinal} (ha : a' ≤ a) (hb : b' ≤ b) (hc : c' ≤ c) :
a' ⨳ (b ⨳ c) ♯ a ⨳ (b' ⨳ c) ♯ a ⨳ (b ⨳ c') ♯ a' ⨳ (b' ⨳ c') ≤
a ⨳ (b ⨳ c) ♯ a' ⨳ (b' ⨳ c) ♯ a' ⨳ (b ⨳ c') ♯ a ⨳ (b' ⨳ c') := by
simp only [nmul_comm _ (_ ⨳ _)]
convert nmul_nadd_le₃ hb hc ha using 1 <;>
(simp only [nadd_eq_add, NatOrdinal.toOrdinal_toNatOrdinal]; abel_nf) | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | nmul_nadd_le₃' | null |
lt_nmul_iff₃ : d < a ⨳ b ⨳ c ↔ ∃ a' < a, ∃ b' < b, ∃ c' < c,
d ♯ a' ⨳ b' ⨳ c ♯ a' ⨳ b ⨳ c' ♯ a ⨳ b' ⨳ c' ≤
a' ⨳ b ⨳ c ♯ a ⨳ b' ⨳ c ♯ a ⨳ b ⨳ c' ♯ a' ⨳ b' ⨳ c' := by
refine ⟨fun h ↦ ?_, fun ⟨a', ha, b', hb, c', hc, h⟩ ↦ ?_⟩
· rcases lt_nmul_iff.1 h with ⟨e, he, c', hc, H₁⟩
rcases lt_nmul_iff.1 he with ⟨a', ha, b', hb, H₂⟩
refine ⟨a', ha, b', hb, c', hc, ?_⟩
have := nadd_le_nadd H₁ (nmul_nadd_le H₂ hc.le)
simp only [nadd_nmul, nadd_assoc] at this
rw [nadd_left_comm, nadd_left_comm d, nadd_left_comm, nadd_le_nadd_iff_left,
nadd_left_comm (a ⨳ b' ⨳ c), nadd_left_comm (a' ⨳ b ⨳ c), nadd_left_comm (a ⨳ b ⨳ c'),
nadd_le_nadd_iff_left, nadd_left_comm (a ⨳ b ⨳ c'), nadd_left_comm (a ⨳ b ⨳ c')] at this
simpa only [nadd_assoc]
· have := h.trans_lt (nmul_nadd_lt₃ ha hb hc)
repeat rw [nadd_lt_nadd_iff_right] at this
assumption | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | lt_nmul_iff₃ | null |
nmul_le_iff₃ : a ⨳ b ⨳ c ≤ d ↔ ∀ a' < a, ∀ b' < b, ∀ c' < c,
a' ⨳ b ⨳ c ♯ a ⨳ b' ⨳ c ♯ a ⨳ b ⨳ c' ♯ a' ⨳ b' ⨳ c' <
d ♯ a' ⨳ b' ⨳ c ♯ a' ⨳ b ⨳ c' ♯ a ⨳ b' ⨳ c' := by
simpa using lt_nmul_iff₃.not | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | nmul_le_iff₃ | null |
private nmul_le_iff₃' : a ⨳ (b ⨳ c) ≤ d ↔ ∀ a' < a, ∀ b' < b, ∀ c' < c,
a' ⨳ (b ⨳ c) ♯ a ⨳ (b' ⨳ c) ♯ a ⨳ (b ⨳ c') ♯ a' ⨳ (b' ⨳ c') <
d ♯ a' ⨳ (b' ⨳ c) ♯ a' ⨳ (b ⨳ c') ♯ a ⨳ (b' ⨳ c') := by
simp only [nmul_comm _ (_ ⨳ _), nmul_le_iff₃, nadd_eq_add, toOrdinal_toNatOrdinal]
constructor <;> intro h a' ha b' hb c' hc
· convert h b' hb c' hc a' ha using 1 <;> abel_nf
· convert h c' hc a' ha b' hb using 1 <;> abel_nf
@[deprecated lt_nmul_iff₃ (since := "2024-11-19")] | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | nmul_le_iff₃' | null |
lt_nmul_iff₃' : d < a ⨳ (b ⨳ c) ↔ ∃ a' < a, ∃ b' < b, ∃ c' < c,
d ♯ a' ⨳ (b' ⨳ c) ♯ a' ⨳ (b ⨳ c') ♯ a ⨳ (b' ⨳ c') ≤
a' ⨳ (b ⨳ c) ♯ a ⨳ (b' ⨳ c) ♯ a ⨳ (b ⨳ c') ♯ a' ⨳ (b' ⨳ c') := by
simpa using nmul_le_iff₃'.not | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | lt_nmul_iff₃' | null |
nmul_assoc (a b c : Ordinal) : a ⨳ b ⨳ c = a ⨳ (b ⨳ c) := by
apply le_antisymm
· rw [nmul_le_iff₃]
intro a' ha b' hb c' hc
repeat rw [nmul_assoc]
exact nmul_nadd_lt₃' ha hb hc
· rw [nmul_le_iff₃']
intro a' ha b' hb c' hc
repeat rw [← nmul_assoc]
exact nmul_nadd_lt₃ ha hb hc
termination_by (a, b, c) | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | nmul_assoc | null |
lt_mul_iff {a b c : NatOrdinal} :
c < a * b ↔ ∃ a' < a, ∃ b' < b, c + a' * b' ≤ a' * b + a * b' :=
Ordinal.lt_nmul_iff | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | lt_mul_iff | null |
mul_le_iff {a b c : NatOrdinal} :
a * b ≤ c ↔ ∀ a' < a, ∀ b' < b, a' * b + a * b' < c + a' * b' :=
Ordinal.nmul_le_iff | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | mul_le_iff | null |
mul_add_lt {a b a' b' : NatOrdinal} (ha : a' < a) (hb : b' < b) :
a' * b + a * b' < a * b + a' * b' :=
Ordinal.nmul_nadd_lt ha hb | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | mul_add_lt | null |
nmul_nadd_le {a b a' b' : NatOrdinal} (ha : a' ≤ a) (hb : b' ≤ b) :
a' * b + a * b' ≤ a * b + a' * b' :=
Ordinal.nmul_nadd_le ha hb | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | nmul_nadd_le | null |
nmul_eq_mul (a b) : a ⨳ b = toOrdinal (toNatOrdinal a * toNatOrdinal b) :=
rfl | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | nmul_eq_mul | null |
nmul_nadd_one : ∀ a b, a ⨳ (b ♯ 1) = a ⨳ b ♯ a :=
@mul_add_one NatOrdinal _ _ _ | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | nmul_nadd_one | null |
nadd_one_nmul : ∀ a b, (a ♯ 1) ⨳ b = a ⨳ b ♯ b :=
@add_one_mul NatOrdinal _ _ _ | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | nadd_one_nmul | null |
nmul_succ (a b) : a ⨳ succ b = a ⨳ b ♯ a := by rw [← nadd_one, nmul_nadd_one] | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | nmul_succ | null |
succ_nmul (a b) : succ a ⨳ b = a ⨳ b ♯ b := by rw [← nadd_one, nadd_one_nmul] | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | succ_nmul | null |
nmul_add_one : ∀ a b, a ⨳ (b + 1) = a ⨳ b ♯ a :=
nmul_succ | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | nmul_add_one | null |
add_one_nmul : ∀ a b, (a + 1) ⨳ b = a ⨳ b ♯ b :=
succ_nmul | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | add_one_nmul | null |
mul_le_nmul (a b : Ordinal.{u}) : a * b ≤ a ⨳ b := by
refine b.limitRecOn ?_ ?_ ?_
· simp
· intro c h
rw [mul_succ, nmul_succ]
exact (add_le_nadd _ a).trans (nadd_le_nadd_right h a)
· intro c hc H
rcases eq_zero_or_pos a with (rfl | ha)
· simp
· rw [(isNormal_mul_right ha).apply_of_isSuccLimit hc, Ordinal.iSup_le_iff]
rintro ⟨i, hi⟩
exact (H i hi).trans (nmul_le_nmul_left hi.le a) | theorem | SetTheory | [
"Mathlib.SetTheory.Ordinal.Family",
"Mathlib.Tactic.Abel",
"Mathlib.Tactic.Linter.DeprecatedModule"
] | Mathlib/SetTheory/Ordinal/NaturalOps.lean | mul_le_nmul | null |
ONote : Type
| zero : ONote
| oadd : ONote → ℕ+ → ONote → ONote
deriving DecidableEq
compile_inductive% ONote | inductive | SetTheory | [
"Mathlib.Algebra.Ring.Divisibility.Basic",
"Mathlib.Data.Ordering.Lemmas",
"Mathlib.Data.PNat.Basic",
"Mathlib.SetTheory.Ordinal.Principal",
"Mathlib.Tactic.NormNum"
] | Mathlib/SetTheory/Ordinal/Notation.lean | ONote | 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`. |
omega : ONote :=
oadd 1 1 0 | def | SetTheory | [
"Mathlib.Algebra.Ring.Divisibility.Basic",
"Mathlib.Data.Ordering.Lemmas",
"Mathlib.Data.PNat.Basic",
"Mathlib.SetTheory.Ordinal.Principal",
"Mathlib.Tactic.NormNum"
] | Mathlib/SetTheory/Ordinal/Notation.lean | omega | Notation for 0 -/
instance : Zero ONote :=
⟨zero⟩
@[simp]
theorem zero_def : zero = 0 :=
rfl
instance : Inhabited ONote :=
⟨0⟩
/-- Notation for 1 -/
instance : One ONote :=
⟨oadd 0 1 0⟩
/-- Notation for ω |
noncomputable repr : ONote → Ordinal.{0}
| 0 => 0
| oadd e n a => ω ^ repr e * n + repr a
@[simp] theorem repr_zero : repr 0 = 0 := rfl
attribute [simp] repr.eq_1 repr.eq_2 | def | SetTheory | [
"Mathlib.Algebra.Ring.Divisibility.Basic",
"Mathlib.Data.Ordering.Lemmas",
"Mathlib.Data.PNat.Basic",
"Mathlib.SetTheory.Ordinal.Principal",
"Mathlib.Tactic.NormNum"
] | Mathlib/SetTheory/Ordinal/Notation.lean | repr | The ordinal denoted by a notation |
private toString_aux (e : ONote) (n : ℕ) (s : String) : String :=
if e = 0 then toString n
else (if e = 1 then "ω" else "ω^(" ++ s ++ ")") ++ if n = 1 then "" else "*" ++ toString n | def | SetTheory | [
"Mathlib.Algebra.Ring.Divisibility.Basic",
"Mathlib.Data.Ordering.Lemmas",
"Mathlib.Data.PNat.Basic",
"Mathlib.SetTheory.Ordinal.Principal",
"Mathlib.Tactic.NormNum"
] | Mathlib/SetTheory/Ordinal/Notation.lean | toString_aux | Print `ω^s*n`, omitting `s` if `e = 0` or `e = 1`, and omitting `n` if `n = 1` |
toString : ONote → String
| zero => "0"
| oadd e n 0 => toString_aux e n (toString e)
| oadd e n a => toString_aux e n (toString e) ++ " + " ++ toString a
open Lean in | def | SetTheory | [
"Mathlib.Algebra.Ring.Divisibility.Basic",
"Mathlib.Data.Ordering.Lemmas",
"Mathlib.Data.PNat.Basic",
"Mathlib.SetTheory.Ordinal.Principal",
"Mathlib.Tactic.NormNum"
] | Mathlib/SetTheory/Ordinal/Notation.lean | toString | Print an ordinal notation |
repr' (prec : ℕ) : ONote → Format
| zero => "0"
| oadd e n a =>
Repr.addAppParen
("oadd " ++ (repr' max_prec e) ++ " " ++ Nat.repr (n : ℕ) ++ " " ++ (repr' max_prec a))
prec | def | SetTheory | [
"Mathlib.Algebra.Ring.Divisibility.Basic",
"Mathlib.Data.Ordering.Lemmas",
"Mathlib.Data.PNat.Basic",
"Mathlib.SetTheory.Ordinal.Principal",
"Mathlib.Tactic.NormNum"
] | Mathlib/SetTheory/Ordinal/Notation.lean | repr' | Print an ordinal notation |
lt_def {x y : ONote} : x < y ↔ repr x < repr y :=
Iff.rfl | theorem | SetTheory | [
"Mathlib.Algebra.Ring.Divisibility.Basic",
"Mathlib.Data.Ordering.Lemmas",
"Mathlib.Data.PNat.Basic",
"Mathlib.SetTheory.Ordinal.Principal",
"Mathlib.Tactic.NormNum"
] | Mathlib/SetTheory/Ordinal/Notation.lean | lt_def | null |
le_def {x y : ONote} : x ≤ y ↔ repr x ≤ repr y :=
Iff.rfl | theorem | SetTheory | [
"Mathlib.Algebra.Ring.Divisibility.Basic",
"Mathlib.Data.Ordering.Lemmas",
"Mathlib.Data.PNat.Basic",
"Mathlib.SetTheory.Ordinal.Principal",
"Mathlib.Tactic.NormNum"
] | Mathlib/SetTheory/Ordinal/Notation.lean | le_def | null |
@[coe] ofNat : ℕ → ONote
| 0 => 0
| Nat.succ n => oadd 0 n.succPNat 0
@[simp] theorem ofNat_zero : ofNat 0 = 0 :=
rfl
@[simp] theorem ofNat_succ (n) : ofNat (Nat.succ n) = oadd 0 n.succPNat 0 :=
rfl | def | SetTheory | [
"Mathlib.Algebra.Ring.Divisibility.Basic",
"Mathlib.Data.Ordering.Lemmas",
"Mathlib.Data.PNat.Basic",
"Mathlib.SetTheory.Ordinal.Principal",
"Mathlib.Tactic.NormNum"
] | Mathlib/SetTheory/Ordinal/Notation.lean | ofNat | Convert a `Nat` into an ordinal |
@[simp 1200] ofNat_one : ofNat 1 = 1 := rfl
@[simp] theorem repr_ofNat (n : ℕ) : repr (ofNat n) = n := by cases n <;> simp
@[simp] theorem repr_one : repr 1 = (1 : ℕ) := repr_ofNat 1 | theorem | SetTheory | [
"Mathlib.Algebra.Ring.Divisibility.Basic",
"Mathlib.Data.Ordering.Lemmas",
"Mathlib.Data.PNat.Basic",
"Mathlib.SetTheory.Ordinal.Principal",
"Mathlib.Tactic.NormNum"
] | Mathlib/SetTheory/Ordinal/Notation.lean | ofNat_one | null |
omega0_le_oadd (e n a) : ω ^ repr e ≤ repr (oadd e n a) := by
refine le_trans ?_ (le_add_right _ _)
simpa using (mul_le_mul_iff_right₀ <| opow_pos (repr e) omega0_pos).2 (Nat.cast_le.2 n.2) | theorem | SetTheory | [
"Mathlib.Algebra.Ring.Divisibility.Basic",
"Mathlib.Data.Ordering.Lemmas",
"Mathlib.Data.PNat.Basic",
"Mathlib.SetTheory.Ordinal.Principal",
"Mathlib.Tactic.NormNum"
] | Mathlib/SetTheory/Ordinal/Notation.lean | omega0_le_oadd | null |
oadd_pos (e n a) : 0 < oadd e n a :=
@lt_of_lt_of_le _ _ _ (ω ^ repr e) _ (opow_pos (repr e) omega0_pos) (omega0_le_oadd e n a) | theorem | SetTheory | [
"Mathlib.Algebra.Ring.Divisibility.Basic",
"Mathlib.Data.Ordering.Lemmas",
"Mathlib.Data.PNat.Basic",
"Mathlib.SetTheory.Ordinal.Principal",
"Mathlib.Tactic.NormNum"
] | Mathlib/SetTheory/Ordinal/Notation.lean | oadd_pos | null |
cmp : ONote → ONote → Ordering
| 0, 0 => Ordering.eq
| _, 0 => Ordering.gt
| 0, _ => Ordering.lt
| _o₁@(oadd e₁ n₁ a₁), _o₂@(oadd e₂ n₂ a₂) =>
(cmp e₁ e₂).then <| (_root_.cmp (n₁ : ℕ) n₂).then (cmp a₁ a₂) | def | SetTheory | [
"Mathlib.Algebra.Ring.Divisibility.Basic",
"Mathlib.Data.Ordering.Lemmas",
"Mathlib.Data.PNat.Basic",
"Mathlib.SetTheory.Ordinal.Principal",
"Mathlib.Tactic.NormNum"
] | Mathlib/SetTheory/Ordinal/Notation.lean | cmp | 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₂`. |
eq_of_cmp_eq : ∀ {o₁ o₂}, cmp o₁ o₂ = Ordering.eq → o₁ = o₂
| 0, 0, _ => rfl
| oadd e n a, 0, h => by injection h
| 0, oadd e n a, h => by injection h
| oadd e₁ n₁ a₁, oadd e₂ n₂ a₂, h => by
revert h; simp only [cmp]
cases h₁ : cmp e₁ e₂ <;> intro h <;> try cases h
obtain rfl := eq_of_cmp_eq h₁
revert h; cases h₂ : _root_.cmp (n₁ : ℕ) n₂ <;> intro h <;> try cases h
obtain rfl := eq_of_cmp_eq h
rw [_root_.cmp, cmpUsing_eq_eq, not_lt, not_lt, ← le_antisymm_iff] at h₂
obtain rfl := Subtype.eq h₂
simp | theorem | SetTheory | [
"Mathlib.Algebra.Ring.Divisibility.Basic",
"Mathlib.Data.Ordering.Lemmas",
"Mathlib.Data.PNat.Basic",
"Mathlib.SetTheory.Ordinal.Principal",
"Mathlib.Tactic.NormNum"
] | Mathlib/SetTheory/Ordinal/Notation.lean | eq_of_cmp_eq | null |
protected zero_lt_one : (0 : ONote) < 1 := by
simp only [lt_def, repr_zero, repr_one, Nat.cast_one, zero_lt_one] | theorem | SetTheory | [
"Mathlib.Algebra.Ring.Divisibility.Basic",
"Mathlib.Data.Ordering.Lemmas",
"Mathlib.Data.PNat.Basic",
"Mathlib.SetTheory.Ordinal.Principal",
"Mathlib.Tactic.NormNum"
] | Mathlib/SetTheory/Ordinal/Notation.lean | zero_lt_one | null |
NFBelow : ONote → Ordinal.{0} → Prop
| zero {b} : NFBelow 0 b
| oadd' {e n a eb b} : NFBelow e eb → NFBelow a (repr e) → repr e < b → NFBelow (oadd e n a) b | inductive | SetTheory | [
"Mathlib.Algebra.Ring.Divisibility.Basic",
"Mathlib.Data.Ordering.Lemmas",
"Mathlib.Data.PNat.Basic",
"Mathlib.SetTheory.Ordinal.Principal",
"Mathlib.Tactic.NormNum"
] | Mathlib/SetTheory/Ordinal/Notation.lean | NFBelow | `NFBelow o b` says that `o` is a normal form ordinal notation satisfying `repr o < ω ^ b`. |
NF (o : ONote) : Prop where
out : Exists (NFBelow o) | class | SetTheory | [
"Mathlib.Algebra.Ring.Divisibility.Basic",
"Mathlib.Data.Ordering.Lemmas",
"Mathlib.Data.PNat.Basic",
"Mathlib.SetTheory.Ordinal.Principal",
"Mathlib.Tactic.NormNum"
] | Mathlib/SetTheory/Ordinal/Notation.lean | NF | 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. |
NF.zero : NF 0 :=
⟨⟨0, NFBelow.zero⟩⟩ | instance | SetTheory | [
"Mathlib.Algebra.Ring.Divisibility.Basic",
"Mathlib.Data.Ordering.Lemmas",
"Mathlib.Data.PNat.Basic",
"Mathlib.SetTheory.Ordinal.Principal",
"Mathlib.Tactic.NormNum"
] | Mathlib/SetTheory/Ordinal/Notation.lean | NF.zero | null |
NFBelow.oadd {e n a b} : NF e → NFBelow a (repr e) → repr e < b → NFBelow (oadd e n a) b
| ⟨⟨_, h⟩⟩ => NFBelow.oadd' h | theorem | SetTheory | [
"Mathlib.Algebra.Ring.Divisibility.Basic",
"Mathlib.Data.Ordering.Lemmas",
"Mathlib.Data.PNat.Basic",
"Mathlib.SetTheory.Ordinal.Principal",
"Mathlib.Tactic.NormNum"
] | Mathlib/SetTheory/Ordinal/Notation.lean | NFBelow.oadd | null |
NFBelow.fst {e n a b} (h : NFBelow (ONote.oadd e n a) b) : NF e := by
obtain - | ⟨h₁, h₂, h₃⟩ := h; exact ⟨⟨_, h₁⟩⟩ | theorem | SetTheory | [
"Mathlib.Algebra.Ring.Divisibility.Basic",
"Mathlib.Data.Ordering.Lemmas",
"Mathlib.Data.PNat.Basic",
"Mathlib.SetTheory.Ordinal.Principal",
"Mathlib.Tactic.NormNum"
] | Mathlib/SetTheory/Ordinal/Notation.lean | NFBelow.fst | null |
NF.fst {e n a} : NF (oadd e n a) → NF e
| ⟨⟨_, h⟩⟩ => h.fst | theorem | SetTheory | [
"Mathlib.Algebra.Ring.Divisibility.Basic",
"Mathlib.Data.Ordering.Lemmas",
"Mathlib.Data.PNat.Basic",
"Mathlib.SetTheory.Ordinal.Principal",
"Mathlib.Tactic.NormNum"
] | Mathlib/SetTheory/Ordinal/Notation.lean | NF.fst | null |
NFBelow.snd {e n a b} (h : NFBelow (ONote.oadd e n a) b) : NFBelow a (repr e) := by
obtain - | ⟨h₁, h₂, h₃⟩ := h; exact h₂ | theorem | SetTheory | [
"Mathlib.Algebra.Ring.Divisibility.Basic",
"Mathlib.Data.Ordering.Lemmas",
"Mathlib.Data.PNat.Basic",
"Mathlib.SetTheory.Ordinal.Principal",
"Mathlib.Tactic.NormNum"
] | Mathlib/SetTheory/Ordinal/Notation.lean | NFBelow.snd | null |
NF.snd' {e n a} : NF (oadd e n a) → NFBelow a (repr e)
| ⟨⟨_, h⟩⟩ => h.snd | theorem | SetTheory | [
"Mathlib.Algebra.Ring.Divisibility.Basic",
"Mathlib.Data.Ordering.Lemmas",
"Mathlib.Data.PNat.Basic",
"Mathlib.SetTheory.Ordinal.Principal",
"Mathlib.Tactic.NormNum"
] | Mathlib/SetTheory/Ordinal/Notation.lean | NF.snd' | null |
NF.snd {e n a} (h : NF (oadd e n a)) : NF a :=
⟨⟨_, h.snd'⟩⟩ | theorem | SetTheory | [
"Mathlib.Algebra.Ring.Divisibility.Basic",
"Mathlib.Data.Ordering.Lemmas",
"Mathlib.Data.PNat.Basic",
"Mathlib.SetTheory.Ordinal.Principal",
"Mathlib.Tactic.NormNum"
] | Mathlib/SetTheory/Ordinal/Notation.lean | NF.snd | null |
NF.oadd {e a} (h₁ : NF e) (n) (h₂ : NFBelow a (repr e)) : NF (oadd e n a) :=
⟨⟨_, NFBelow.oadd h₁ h₂ (lt_succ _)⟩⟩ | theorem | SetTheory | [
"Mathlib.Algebra.Ring.Divisibility.Basic",
"Mathlib.Data.Ordering.Lemmas",
"Mathlib.Data.PNat.Basic",
"Mathlib.SetTheory.Ordinal.Principal",
"Mathlib.Tactic.NormNum"
] | Mathlib/SetTheory/Ordinal/Notation.lean | NF.oadd | null |
NF.oadd_zero (e n) [h : NF e] : NF (ONote.oadd e n 0) :=
h.oadd _ NFBelow.zero | instance | SetTheory | [
"Mathlib.Algebra.Ring.Divisibility.Basic",
"Mathlib.Data.Ordering.Lemmas",
"Mathlib.Data.PNat.Basic",
"Mathlib.SetTheory.Ordinal.Principal",
"Mathlib.Tactic.NormNum"
] | Mathlib/SetTheory/Ordinal/Notation.lean | NF.oadd_zero | null |
NFBelow.lt {e n a b} (h : NFBelow (ONote.oadd e n a) b) : repr e < b := by
obtain - | ⟨h₁, h₂, h₃⟩ := h; exact h₃ | theorem | SetTheory | [
"Mathlib.Algebra.Ring.Divisibility.Basic",
"Mathlib.Data.Ordering.Lemmas",
"Mathlib.Data.PNat.Basic",
"Mathlib.SetTheory.Ordinal.Principal",
"Mathlib.Tactic.NormNum"
] | Mathlib/SetTheory/Ordinal/Notation.lean | NFBelow.lt | null |
NFBelow_zero : ∀ {o}, NFBelow o 0 ↔ o = 0
| 0 => ⟨fun _ => rfl, fun _ => NFBelow.zero⟩
| oadd _ _ _ =>
⟨fun h => (not_le_of_gt h.lt).elim (Ordinal.zero_le _), fun e => e.symm ▸ NFBelow.zero⟩ | theorem | SetTheory | [
"Mathlib.Algebra.Ring.Divisibility.Basic",
"Mathlib.Data.Ordering.Lemmas",
"Mathlib.Data.PNat.Basic",
"Mathlib.SetTheory.Ordinal.Principal",
"Mathlib.Tactic.NormNum"
] | Mathlib/SetTheory/Ordinal/Notation.lean | NFBelow_zero | null |
NF.zero_of_zero {e n a} (h : NF (ONote.oadd e n a)) (e0 : e = 0) : a = 0 := by
simpa [e0, NFBelow_zero] using h.snd' | theorem | SetTheory | [
"Mathlib.Algebra.Ring.Divisibility.Basic",
"Mathlib.Data.Ordering.Lemmas",
"Mathlib.Data.PNat.Basic",
"Mathlib.SetTheory.Ordinal.Principal",
"Mathlib.Tactic.NormNum"
] | Mathlib/SetTheory/Ordinal/Notation.lean | NF.zero_of_zero | null |
NFBelow.repr_lt {o b} (h : NFBelow o b) : repr o < ω ^ b := by
induction h with
| zero => exact opow_pos _ omega0_pos
| oadd' _ _ h₃ _ IH =>
rw [repr]
apply ((add_lt_add_iff_left _).2 IH).trans_le
rw [← mul_succ]
apply (mul_le_mul_left' (succ_le_of_lt (nat_lt_omega0 _)) _).trans
rw [← opow_succ]
exact opow_le_opow_right omega0_pos (succ_le_of_lt h₃) | theorem | SetTheory | [
"Mathlib.Algebra.Ring.Divisibility.Basic",
"Mathlib.Data.Ordering.Lemmas",
"Mathlib.Data.PNat.Basic",
"Mathlib.SetTheory.Ordinal.Principal",
"Mathlib.Tactic.NormNum"
] | Mathlib/SetTheory/Ordinal/Notation.lean | NFBelow.repr_lt | null |
NFBelow.mono {o b₁ b₂} (bb : b₁ ≤ b₂) (h : NFBelow o b₁) : NFBelow o b₂ := by
induction h with
| zero => exact zero
| oadd' h₁ h₂ h₃ _ _ => constructor; exacts [h₁, h₂, lt_of_lt_of_le h₃ bb] | theorem | SetTheory | [
"Mathlib.Algebra.Ring.Divisibility.Basic",
"Mathlib.Data.Ordering.Lemmas",
"Mathlib.Data.PNat.Basic",
"Mathlib.SetTheory.Ordinal.Principal",
"Mathlib.Tactic.NormNum"
] | Mathlib/SetTheory/Ordinal/Notation.lean | NFBelow.mono | null |
NF.below_of_lt {e n a b} (H : repr e < b) :
NF (ONote.oadd e n a) → NFBelow (ONote.oadd e n a) b
| ⟨⟨b', h⟩⟩ => by (obtain - | ⟨h₁, h₂, h₃⟩ := h; exact NFBelow.oadd' h₁ h₂ H) | theorem | SetTheory | [
"Mathlib.Algebra.Ring.Divisibility.Basic",
"Mathlib.Data.Ordering.Lemmas",
"Mathlib.Data.PNat.Basic",
"Mathlib.SetTheory.Ordinal.Principal",
"Mathlib.Tactic.NormNum"
] | Mathlib/SetTheory/Ordinal/Notation.lean | NF.below_of_lt | null |
NF.below_of_lt' : ∀ {o b}, repr o < ω ^ b → NF o → NFBelow o b
| 0, _, _, _ => NFBelow.zero
| ONote.oadd _ _ _, _, H, h =>
h.below_of_lt <|
(opow_lt_opow_iff_right one_lt_omega0).1 <| lt_of_le_of_lt (omega0_le_oadd _ _ _) H | theorem | SetTheory | [
"Mathlib.Algebra.Ring.Divisibility.Basic",
"Mathlib.Data.Ordering.Lemmas",
"Mathlib.Data.PNat.Basic",
"Mathlib.SetTheory.Ordinal.Principal",
"Mathlib.Tactic.NormNum"
] | Mathlib/SetTheory/Ordinal/Notation.lean | NF.below_of_lt' | null |
nfBelow_ofNat : ∀ n, NFBelow (ofNat n) 1
| 0 => NFBelow.zero
| Nat.succ _ => NFBelow.oadd NF.zero NFBelow.zero zero_lt_one | theorem | SetTheory | [
"Mathlib.Algebra.Ring.Divisibility.Basic",
"Mathlib.Data.Ordering.Lemmas",
"Mathlib.Data.PNat.Basic",
"Mathlib.SetTheory.Ordinal.Principal",
"Mathlib.Tactic.NormNum"
] | Mathlib/SetTheory/Ordinal/Notation.lean | nfBelow_ofNat | null |
nf_ofNat (n) : NF (ofNat n) :=
⟨⟨_, nfBelow_ofNat n⟩⟩ | instance | SetTheory | [
"Mathlib.Algebra.Ring.Divisibility.Basic",
"Mathlib.Data.Ordering.Lemmas",
"Mathlib.Data.PNat.Basic",
"Mathlib.SetTheory.Ordinal.Principal",
"Mathlib.Tactic.NormNum"
] | Mathlib/SetTheory/Ordinal/Notation.lean | nf_ofNat | null |
nf_one : NF 1 := by rw [← ofNat_one]; infer_instance | instance | SetTheory | [
"Mathlib.Algebra.Ring.Divisibility.Basic",
"Mathlib.Data.Ordering.Lemmas",
"Mathlib.Data.PNat.Basic",
"Mathlib.SetTheory.Ordinal.Principal",
"Mathlib.Tactic.NormNum"
] | Mathlib/SetTheory/Ordinal/Notation.lean | nf_one | null |
oadd_lt_oadd_1 {e₁ n₁ o₁ e₂ n₂ o₂} (h₁ : NF (oadd e₁ n₁ o₁)) (h : e₁ < e₂) :
oadd e₁ n₁ o₁ < oadd e₂ n₂ o₂ :=
@lt_of_lt_of_le _ _ (repr (oadd e₁ n₁ o₁)) _ _
(NF.below_of_lt h h₁).repr_lt (omega0_le_oadd e₂ n₂ o₂) | theorem | SetTheory | [
"Mathlib.Algebra.Ring.Divisibility.Basic",
"Mathlib.Data.Ordering.Lemmas",
"Mathlib.Data.PNat.Basic",
"Mathlib.SetTheory.Ordinal.Principal",
"Mathlib.Tactic.NormNum"
] | Mathlib/SetTheory/Ordinal/Notation.lean | oadd_lt_oadd_1 | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.