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] toNimber_symm_eq : toNimber.symm = Nimber.toOrdinal := rfl @[simp]
theorem
SetTheory
[ "Mathlib.Data.Nat.Bitwise", "Mathlib.SetTheory.Ordinal.Family", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Basic.lean
toNimber_symm_eq
null
toNimber_toOrdinal (a : Ordinal) : Nimber.toOrdinal (∗a) = a := rfl @[simp]
theorem
SetTheory
[ "Mathlib.Data.Nat.Bitwise", "Mathlib.SetTheory.Ordinal.Family", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Basic.lean
toNimber_toOrdinal
null
toNimber_zero : ∗0 = 0 := rfl @[simp]
theorem
SetTheory
[ "Mathlib.Data.Nat.Bitwise", "Mathlib.SetTheory.Ordinal.Family", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Basic.lean
toNimber_zero
null
toNimber_one : ∗1 = 1 := rfl @[simp]
theorem
SetTheory
[ "Mathlib.Data.Nat.Bitwise", "Mathlib.SetTheory.Ordinal.Family", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Basic.lean
toNimber_one
null
toNimber_eq_zero {a} : ∗a = 0 ↔ a = 0 := Iff.rfl @[simp]
theorem
SetTheory
[ "Mathlib.Data.Nat.Bitwise", "Mathlib.SetTheory.Ordinal.Family", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Basic.lean
toNimber_eq_zero
null
toNimber_eq_one {a} : ∗a = 1 ↔ a = 1 := Iff.rfl @[simp]
theorem
SetTheory
[ "Mathlib.Data.Nat.Bitwise", "Mathlib.SetTheory.Ordinal.Family", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Basic.lean
toNimber_eq_one
null
toNimber_max (a b : Ordinal) : ∗(max a b) = max (∗a) (∗b) := rfl @[simp]
theorem
SetTheory
[ "Mathlib.Data.Nat.Bitwise", "Mathlib.SetTheory.Ordinal.Family", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Basic.lean
toNimber_max
null
toNimber_min (a b : Ordinal) : ∗(min a b) = min (∗a) (∗b) := rfl
theorem
SetTheory
[ "Mathlib.Data.Nat.Bitwise", "Mathlib.SetTheory.Ordinal.Family", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Basic.lean
toNimber_min
null
private add_nonempty (a b : Nimber.{u}) : {x | (∃ a' < a, a' + b = x) ∨ ∃ b' < b, a + b' = x}ᶜ.Nonempty := nonempty_of_not_bddAbove <| not_bddAbove_compl_of_small ((· + b) '' Set.Iio a ∪ (a + ·) '' Set.Iio b)
theorem
SetTheory
[ "Mathlib.Data.Nat.Bitwise", "Mathlib.SetTheory.Ordinal.Family", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Basic.lean
add_nonempty
Nimber addition is recursively defined so that `a + b` is the smallest nimber not equal to `a' + b` or `a + b'` for `a' < a` and `b' < b`. -/ -- We write the binders like this so that the termination checker works. protected def add (a b : Nimber.{u}) : Nimber.{u} := sInf {x | (∃ a', ∃ (_ : a' < a), Nimber.add a' b = x) ∨ ∃ b', ∃ (_ : b' < b), Nimber.add a b' = x}ᶜ termination_by (a, b) instance : Add Nimber := ⟨Nimber.add⟩ theorem add_def (a b : Nimber) : a + b = sInf {x | (∃ a' < a, a' + b = x) ∨ ∃ b' < b, a + b' = x}ᶜ := by change Nimber.add a b = _ rw [Nimber.add] simp_rw [exists_prop] rfl /-- The set in the definition of `Nimber.add` is nonempty.
exists_of_lt_add (h : c < a + b) : (∃ a' < a, a' + b = c) ∨ ∃ b' < b, a + b' = c := by rw [add_def] at h have := notMem_of_lt_csInf' h rwa [Set.mem_compl_iff, not_not] at this
theorem
SetTheory
[ "Mathlib.Data.Nat.Bitwise", "Mathlib.SetTheory.Ordinal.Family", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Basic.lean
exists_of_lt_add
null
add_le_of_forall_ne (h₁ : ∀ a' < a, a' + b ≠ c) (h₂ : ∀ b' < b, a + b' ≠ c) : a + b ≤ c := by by_contra! h have := exists_of_lt_add h tauto
theorem
SetTheory
[ "Mathlib.Data.Nat.Bitwise", "Mathlib.SetTheory.Ordinal.Family", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Basic.lean
add_le_of_forall_ne
null
private add_ne_of_lt (a b : Nimber) : (∀ a' < a, a' + b ≠ a + b) ∧ ∀ b' < b, a + b' ≠ a + b := by have H := csInf_mem (add_nonempty a b) rw [← add_def] at H simpa using H
theorem
SetTheory
[ "Mathlib.Data.Nat.Bitwise", "Mathlib.SetTheory.Ordinal.Family", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Basic.lean
add_ne_of_lt
null
protected add_comm (a b : Nimber) : a + b = b + a := by rw [add_def, add_def] simp_rw [or_comm] congr! 7 <;> (rw [and_congr_right_iff]; intro; rw [Nimber.add_comm]) termination_by (a, b)
theorem
SetTheory
[ "Mathlib.Data.Nat.Bitwise", "Mathlib.SetTheory.Ordinal.Family", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Basic.lean
add_comm
null
add_eq_zero {a b : Nimber} : a + b = 0 ↔ a = b := by constructor <;> intro hab · obtain h | rfl | h := lt_trichotomy a b · have ha : a + a = 0 := add_eq_zero.2 rfl rwa [← ha, add_right_inj, eq_comm] at hab · rfl · have hb : b + b = 0 := add_eq_zero.2 rfl rwa [← hb, add_left_inj] at hab · rw [← Nimber.le_zero] apply add_le_of_forall_ne <;> simp_rw [ne_eq] <;> intro x hx · rw [add_eq_zero, ← hab] exact hx.ne · rw [add_eq_zero, hab] exact hx.ne' termination_by (a, b)
theorem
SetTheory
[ "Mathlib.Data.Nat.Bitwise", "Mathlib.SetTheory.Ordinal.Family", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Basic.lean
add_eq_zero
null
add_ne_zero_iff : a + b ≠ 0 ↔ a ≠ b := add_eq_zero.not @[simp]
theorem
SetTheory
[ "Mathlib.Data.Nat.Bitwise", "Mathlib.SetTheory.Ordinal.Family", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Basic.lean
add_ne_zero_iff
null
add_self (a : Nimber) : a + a = 0 := add_eq_zero.2 rfl
theorem
SetTheory
[ "Mathlib.Data.Nat.Bitwise", "Mathlib.SetTheory.Ordinal.Family", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Basic.lean
add_self
null
protected add_assoc (a b c : Nimber) : a + b + c = a + (b + c) := by apply le_antisymm <;> apply add_le_of_forall_ne <;> intro x hx <;> try obtain ⟨y, hy, rfl⟩ | ⟨y, hy, rfl⟩ := exists_of_lt_add hx on_goal 1 => rw [Nimber.add_assoc y, add_ne_add_left] on_goal 2 => rw [Nimber.add_assoc _ y, add_ne_add_right, add_ne_add_left] on_goal 3 => rw [Nimber.add_assoc _ _ x, add_ne_add_right, add_ne_add_right] on_goal 4 => rw [← Nimber.add_assoc x, add_ne_add_left, add_ne_add_left] on_goal 5 => rw [← Nimber.add_assoc _ y, add_ne_add_left, add_ne_add_right] on_goal 6 => rw [← Nimber.add_assoc _ _ y, add_ne_add_right] all_goals apply ne_of_lt; assumption termination_by (a, b, c)
theorem
SetTheory
[ "Mathlib.Data.Nat.Bitwise", "Mathlib.SetTheory.Ordinal.Family", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Basic.lean
add_assoc
null
protected add_zero (a : Nimber) : a + 0 = a := by apply le_antisymm · apply add_le_of_forall_ne · intro a' ha rw [Nimber.add_zero] exact ha.ne · intro _ h exact (Nimber.not_lt_zero _ h).elim · by_contra! h replace h := h -- needed to remind `termination_by` have := Nimber.add_zero (a + 0) rw [add_left_inj] at this exact this.not_lt h termination_by a
theorem
SetTheory
[ "Mathlib.Data.Nat.Bitwise", "Mathlib.SetTheory.Ordinal.Family", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Basic.lean
add_zero
null
protected zero_add (a : Nimber) : 0 + a = a := by rw [Nimber.add_comm, Nimber.add_zero]
theorem
SetTheory
[ "Mathlib.Data.Nat.Bitwise", "Mathlib.SetTheory.Ordinal.Family", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Basic.lean
zero_add
null
@[simp] protected neg_eq (a : Nimber) : -a = a := rfl
theorem
SetTheory
[ "Mathlib.Data.Nat.Bitwise", "Mathlib.SetTheory.Ordinal.Family", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Basic.lean
neg_eq
null
@[simp] add_cancel_right (a b : Nimber) : a + b + b = a := by rw [add_assoc, add_self, add_zero] @[simp]
theorem
SetTheory
[ "Mathlib.Data.Nat.Bitwise", "Mathlib.SetTheory.Ordinal.Family", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Basic.lean
add_cancel_right
null
add_cancel_left (a b : Nimber) : a + (a + b) = b := by rw [← add_assoc, add_self, zero_add]
theorem
SetTheory
[ "Mathlib.Data.Nat.Bitwise", "Mathlib.SetTheory.Ordinal.Family", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Basic.lean
add_cancel_left
null
add_trichotomy {a b c : Nimber} (h : a + b + c ≠ 0) : b + c < a ∨ c + a < b ∨ a + b < c := by rw [← Nimber.pos_iff_ne_zero] at h obtain ⟨x, hx, hx'⟩ | ⟨x, hx, hx'⟩ := exists_of_lt_add h <;> rw [add_eq_zero] at hx' · obtain ⟨x, hx, hx'⟩ | ⟨x, hx, hx'⟩ := exists_of_lt_add (hx' ▸ hx) · rw [← hx', add_comm, add_cancel_right] exact Or.inl hx · rw [← hx', add_comm a, add_cancel_right] exact Or.inr <| Or.inl hx · rw [← hx'] at hx exact Or.inr <| Or.inr hx
theorem
SetTheory
[ "Mathlib.Data.Nat.Bitwise", "Mathlib.SetTheory.Ordinal.Family", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Basic.lean
add_trichotomy
null
lt_add_cases {a b c : Nimber} (h : a < b + c) : a + c < b ∨ a + b < c := by obtain ha | hb | hc := add_trichotomy <| add_assoc a b c ▸ add_ne_zero_iff.2 h.ne exacts [(h.asymm ha).elim, Or.inl <| add_comm c a ▸ hb, Or.inr hc]
theorem
SetTheory
[ "Mathlib.Data.Nat.Bitwise", "Mathlib.SetTheory.Ordinal.Family", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Basic.lean
lt_add_cases
null
add_nat (a b : ℕ) : ∗a + ∗b = ∗(a ^^^ b) := by apply le_antisymm · apply add_le_of_forall_ne all_goals intro c hc obtain ⟨c, rfl⟩ := eq_nat_of_le_nat hc.le rw [OrderIso.lt_iff_lt] at hc replace hc := Nat.cast_lt.1 hc rw [add_nat] simpa using hc.ne · apply le_of_not_gt intro hc obtain ⟨c, hc'⟩ := eq_nat_of_le_nat hc.le rw [hc', OrderIso.lt_iff_lt, Nat.cast_lt] at hc obtain h | h := Nat.lt_xor_cases hc · apply h.ne simpa [Nat.xor_comm, Nat.xor_cancel_left, ← hc'] using add_nat (c ^^^ b) b · apply h.ne simpa [Nat.xor_comm, Nat.xor_cancel_left, ← hc'] using add_nat a (c ^^^ a)
theorem
SetTheory
[ "Mathlib.Data.Nat.Bitwise", "Mathlib.SetTheory.Ordinal.Family", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Basic.lean
add_nat
Nimber addition of naturals corresponds to the bitwise XOR operation.
private two_zsmul (x : Nimber) : (2 : ℤ) • x = 0 := by rw [_root_.two_zsmul] exact add_self x
theorem
SetTheory
[ "Mathlib.Algebra.CharP.Two", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Abel", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Field.lean
two_zsmul
null
private add_eq_iff_eq_add : a + b = c ↔ a = c + b := sub_eq_iff_eq_add
theorem
SetTheory
[ "Mathlib.Algebra.CharP.Two", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Abel", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Field.lean
add_eq_iff_eq_add
null
private mul_nonempty (a b : Nimber.{u}) : {x | ∃ a' < a, ∃ b' < b, a' * b + a * b' + a' * b' = x}ᶜ.Nonempty := by convert nonempty_of_not_bddAbove <| not_bddAbove_compl_of_small ((fun x ↦ x.1 * b + a * x.2 + x.1 * x.2) '' Set.Iio a ×ˢ Set.Iio b) ext simp_rw [Set.mem_setOf_eq, Set.mem_image, Set.mem_prod, Set.mem_Iio, Prod.exists] tauto
theorem
SetTheory
[ "Mathlib.Algebra.CharP.Two", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Abel", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Field.lean
mul_nonempty
Nimber multiplication is recursively defined so that `a * b` is the smallest nimber not equal to `a' * b + a * b' + a' * b'` for `a' < a` and `b' < b`. -/ -- We write the binders like this so that the termination checker works. protected def mul (a b : Nimber.{u}) : Nimber.{u} := sInf {x | ∃ a', ∃ (_ : a' < a), ∃ b', ∃ (_ : b' < b), Nimber.mul a' b + Nimber.mul a b' + Nimber.mul a' b' = x}ᶜ termination_by (a, b) instance : Mul Nimber := ⟨Nimber.mul⟩ theorem mul_def (a b : Nimber) : a * b = sInf {x | ∃ a' < a, ∃ b' < b, a' * b + a * b' + a' * b' = x}ᶜ := by change Nimber.mul a b = _ rw [Nimber.mul] simp_rw [exists_prop] rfl /-- The set in the definition of `Nimber.mul` is nonempty.
exists_of_lt_mul (h : c < a * b) : ∃ a' < a, ∃ b' < b, a' * b + a * b' + a' * b' = c := by rw [mul_def] at h have := notMem_of_lt_csInf' h rwa [Set.notMem_compl_iff] at this
theorem
SetTheory
[ "Mathlib.Algebra.CharP.Two", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Abel", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Field.lean
exists_of_lt_mul
null
mul_le_of_forall_ne (h : ∀ a' < a, ∀ b' < b, a' * b + a * b' + a' * b' ≠ c) : a * b ≤ c := by by_contra! h' have := exists_of_lt_mul h' tauto
theorem
SetTheory
[ "Mathlib.Algebra.CharP.Two", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Abel", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Field.lean
mul_le_of_forall_ne
null
private mul_ne_of_lt : ∀ a' < a, ∀ b' < b, a' * b + a * b' + a' * b' ≠ a * b := by have H := csInf_mem (mul_nonempty a b) rw [← mul_def] at H simpa using H
theorem
SetTheory
[ "Mathlib.Algebra.CharP.Two", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Abel", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Field.lean
mul_ne_of_lt
null
protected mul_comm (a b : Nimber) : a * b = b * a := by apply le_antisymm <;> refine mul_le_of_forall_ne fun x hx y hy ↦ ?_ on_goal 1 => rw [add_comm (x * _), Nimber.mul_comm a, Nimber.mul_comm x, Nimber.mul_comm x] on_goal 2 => rw [add_comm (x * _), ← Nimber.mul_comm y, ← Nimber.mul_comm a, ← Nimber.mul_comm y] all_goals exact mul_ne_of_lt y hy x hx termination_by (a, b)
theorem
SetTheory
[ "Mathlib.Algebra.CharP.Two", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Abel", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Field.lean
mul_comm
null
protected mul_add (a b c : Nimber) : a * (b + c) = a * b + a * c := by apply le_antisymm · refine mul_le_of_forall_ne fun a' ha x hx ↦ ?_ obtain (⟨b', h, rfl⟩ | ⟨c', h, rfl⟩) := exists_of_lt_add hx <;> rw [Nimber.mul_add a', Nimber.mul_add a, Nimber.mul_add a'] on_goal 1 => rw [← add_ne_add_left (a * c)] on_goal 2 => rw [← add_ne_add_left (a * b)] all_goals abel_nf simp only [two_zsmul, zero_add] rw [← add_assoc] exact mul_ne_of_lt _ ha _ h · apply add_le_of_forall_ne <;> (intro x' hx'; obtain ⟨x, hx, y, hy, rfl⟩ := exists_of_lt_mul hx') · obtain h | h | h := lt_trichotomy (y + c) (b + c) · have H := mul_ne_of_lt _ hx _ h rw [Nimber.mul_add x, Nimber.mul_add a, Nimber.mul_add x] at H abel_nf at H ⊢ simpa only [two_zsmul, zero_add] using H · exact (hy.ne <| add_left_injective _ h).elim · obtain ⟨z, hz, hz'⟩ | ⟨c', hc, hc'⟩ := exists_of_lt_add h · exact ((hz.trans hy).ne <| add_left_injective _ hz').elim · have := add_eq_iff_eq_add.1 hc' have H := mul_ne_of_lt _ hx _ hc rw [← hc', Nimber.mul_add a y c', ← add_ne_add_left (a * y), ← add_ne_add_left (a * c), ← add_ne_add_left (a * c'), ← add_eq_iff_eq_add.2 hc', Nimber.mul_add x, Nimber.mul_add x] abel_nf at H ⊢ simpa only [two_zsmul, add_zero, zero_add] using H · obtain h | h | h := lt_trichotomy (b + y) (b + c) · have H := mul_ne_of_lt _ hx _ h rw [Nimber.mul_add x, Nimber.mul_add a, Nimber.mul_add x] at H abel_nf at H ⊢ simpa only [two_zsmul, zero_add] using H · exact (hy.ne <| add_right_injective _ h).elim · obtain ⟨b', hb, hb'⟩ | ⟨z, hz, hz'⟩ := exists_of_lt_add h · have H := mul_ne_of_lt _ hx _ hb have hb'' := add_eq_iff_eq_add.2 (add_comm b c ▸ hb') rw [← hb', Nimber.mul_add a b', ← add_ne_add_left (a * y), ← add_ne_add_left (a * b), ← add_ne_add_left (a * b'), ← hb'', Nimber.mul_add x, Nimber.mul_add x] abel_nf at H ⊢ simpa only [two_zsmul, add_zero, zero_add] using H · exact ((hz.trans hy).ne <| add_right_injective _ hz').elim termination_by (a, b, c)
theorem
SetTheory
[ "Mathlib.Algebra.CharP.Two", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Abel", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Field.lean
mul_add
null
protected add_mul (a b c : Nimber) : (a + b) * c = a * c + b * c := by rw [Nimber.mul_comm, Nimber.mul_add, Nimber.mul_comm, Nimber.mul_comm b]
theorem
SetTheory
[ "Mathlib.Algebra.CharP.Two", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Abel", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Field.lean
add_mul
null
private add_ne_zero_of_lt {a b : Nimber} (h : b < a) : a + b ≠ 0 := by rw [add_ne_zero_iff] exact h.ne'
theorem
SetTheory
[ "Mathlib.Algebra.CharP.Two", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Abel", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Field.lean
add_ne_zero_of_lt
null
protected mul_assoc (a b c : Nimber) : a * b * c = a * (b * c) := by apply le_antisymm <;> refine mul_le_of_forall_ne fun x hx y hy ↦ ?_ · obtain ⟨a', ha, b', hb, rfl⟩ := exists_of_lt_mul hx have H : (a + a') * ((b + b') * (c + y)) ≠ 0 := by apply mul_ne_zero _ (mul_ne_zero _ _) <;> apply add_ne_zero_of_lt assumption' simp only [Nimber.add_mul, Nimber.mul_add] at H ⊢ iterate 7 rw [Nimber.mul_assoc] rw [← add_ne_add_left (a * (b * c))] abel_nf at H ⊢ simpa only [two_zsmul, zero_add] using H · obtain ⟨b', hb, c', hc, rfl⟩ := exists_of_lt_mul hy have H : (a + x) * (b + b') * (c + c') ≠ 0 := by apply mul_ne_zero (mul_ne_zero _ _) <;> apply add_ne_zero_of_lt assumption' simp only [Nimber.add_mul, Nimber.mul_add] at H ⊢ iterate 7 rw [← Nimber.mul_assoc] rw [← add_ne_add_left (a * b * c)] abel_nf at H ⊢ simpa only [two_zsmul, zero_add] using H termination_by (a, b, c)
theorem
SetTheory
[ "Mathlib.Algebra.CharP.Two", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Abel", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Field.lean
mul_assoc
null
protected one_mul (a : Nimber) : 1 * a = a := by apply le_antisymm · refine mul_le_of_forall_ne fun x hx y hy ↦ ?_ rw [Nimber.lt_one_iff_zero] at hx rw [hx, Nimber.one_mul, zero_mul, zero_mul, add_zero, zero_add] exact hy.ne · by_contra! h replace h := h -- needed to remind `termination_by` exact (mul_left_cancel₀ one_ne_zero <| Nimber.one_mul _).not_lt h termination_by a
theorem
SetTheory
[ "Mathlib.Algebra.CharP.Two", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Abel", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Field.lean
one_mul
null
protected mul_one (a : Nimber) : a * 1 = a := by rw [Nimber.mul_comm, Nimber.one_mul]
theorem
SetTheory
[ "Mathlib.Algebra.CharP.Two", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Abel", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Field.lean
mul_one
null
invAux (a : Nimber) : Nimber := sInf (invSet a)ᶜ termination_by (a, 1)
def
SetTheory
[ "Mathlib.Algebra.CharP.Two", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Abel", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Field.lean
invAux
The nimber inverse `a⁻¹` is mutually recursively defined as the smallest nimber not in the set `s = invSet a`, which itself is defined as the smallest set with `0 ∈ s` and `(1 + (a + a') * b) / a' ∈ s` for `0 < a' < a` and `b ∈ s`. This preliminary definition "accidentally" satisfies `invAux 0 = 1`, which the real inverse corrects. The lemma `inv_eq_invAux` can be used to transfer between the two.
invSet (a : Nimber) : Set Nimber := ⋂₀ {s | 0 ∈ s ∧ ∀ a' < a, a' ≠ 0 → ∀ b ∈ s, invAux a' * (1 + (a + a') * b) ∈ s} termination_by (a, 0)
def
SetTheory
[ "Mathlib.Algebra.CharP.Two", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Abel", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Field.lean
invSet
The set in the definition of `invAux a`.
zero_mem_invSet (a : Nimber) : 0 ∈ invSet a := by rw [invSet] exact Set.mem_sInter.2 fun _ hs => hs.1
theorem
SetTheory
[ "Mathlib.Algebra.CharP.Two", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Abel", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Field.lean
zero_mem_invSet
null
cons_mem_invSet {a' : Nimber} (ha₀ : a' ≠ 0) (ha : a' < a) (hb : b ∈ invSet a) : invAux a' * (1 + (a + a') * b) ∈ invSet a := by rw [invSet] at hb ⊢ exact Set.mem_sInter.2 fun _ hs => hs.2 _ ha ha₀ _ (Set.mem_sInter.1 hb _ hs)
theorem
SetTheory
[ "Mathlib.Algebra.CharP.Two", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Abel", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Field.lean
cons_mem_invSet
"cons" is our operation `(1 + (a + a') * b) / a'` in the definition of the inverse.
@[elab_as_elim] invSet_recOn {p : Nimber → Prop} (a : Nimber) (h0 : p 0) (hi : ∀ a' < a, a' ≠ 0 → ∀ b, p b → p (invAux a' * (1 + (a + a') * b))) (x : Nimber) (hx : x ∈ invSet a) : p x := by revert x rw [invSet] exact Set.sInter_subset_of_mem ⟨h0, hi⟩
theorem
SetTheory
[ "Mathlib.Algebra.CharP.Two", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Abel", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Field.lean
invSet_recOn
A recursion principle for `invSet`.
private List.toNimber {a : Nimber} : List a.toOrdinal.toType → Nimber | [] => 0 | x :: l => let a' := ∗((Ordinal.enumIsoToType a.toOrdinal).symm x) invAux a' * (1 + (a + a') * toNimber l)
def
SetTheory
[ "Mathlib.Algebra.CharP.Two", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Abel", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Field.lean
List.toNimber
An enumeration of elements in `invSet` by a type in the same universe.
private invSet_nonempty (a : Nimber) : (invSet a)ᶜ.Nonempty := have := instSmallElemInvSet a -- why is this needed? nonempty_of_not_bddAbove (Ordinal.not_bddAbove_compl_of_small _)
theorem
SetTheory
[ "Mathlib.Algebra.CharP.Two", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Abel", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Field.lean
invSet_nonempty
The complement of `invSet a` is nonempty.
invAux_ne_zero (a : Nimber) : invAux a ≠ 0 := by rw [invAux] exact fun h ↦ h ▸ csInf_mem (invSet_nonempty a) <| zero_mem_invSet a
theorem
SetTheory
[ "Mathlib.Algebra.CharP.Two", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Abel", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Field.lean
invAux_ne_zero
null
mem_invSet_of_lt_invAux (h : b < invAux a) : b ∈ invSet a := by rw [invAux] at h have := notMem_of_lt_csInf h ⟨_, bot_mem_lowerBounds _⟩ rwa [Set.notMem_compl_iff] at this
theorem
SetTheory
[ "Mathlib.Algebra.CharP.Two", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Abel", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Field.lean
mem_invSet_of_lt_invAux
null
invAux_notMem_invSet (a : Nimber) : invAux a ∉ invSet a := by rw [invAux] exact csInf_mem (invSet_nonempty a) @[deprecated (since := "2025-05-23")] alias invAux_not_mem_invSet := invAux_notMem_invSet
theorem
SetTheory
[ "Mathlib.Algebra.CharP.Two", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Abel", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Field.lean
invAux_notMem_invSet
null
invAux_mem_invSet_of_lt (ha : a ≠ 0) (hb : a < b) : invAux a ∈ invSet b := by have H := cons_mem_invSet ha hb (zero_mem_invSet b) rwa [mul_zero, add_zero, mul_one] at H
theorem
SetTheory
[ "Mathlib.Algebra.CharP.Two", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Abel", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Field.lean
invAux_mem_invSet_of_lt
null
private mul_inv_cancel_aux (a : Nimber) : (∀ b ∈ invSet a, a * b ≠ 1) ∧ (a ≠ 0 → a * invAux a = 1) := by have H₁ : ∀ b ∈ invSet a, a * b ≠ 1 := by refine fun b hb ↦ invSet_recOn a ?_ ?_ b hb · rw [mul_zero] exact zero_ne_one · intro a' ha ha' b hb rw [ne_eq, mul_comm, ← mul_right_inj' ha', ← mul_assoc, ← mul_assoc, (mul_inv_cancel_aux a').2 ha', one_mul, mul_one, add_mul, one_mul, ← add_left_inj a', add_self, mul_assoc, mul_comm b, add_assoc, add_comm _ a', ← add_assoc, ← mul_one_add, ← ne_eq, mul_ne_zero_iff, add_ne_zero_iff, add_ne_zero_iff] exact ⟨ha.ne', hb.symm⟩ refine ⟨H₁, fun ha₀ => le_antisymm ?_ ?_⟩ · apply mul_le_of_forall_ne fun a' ha b hb H ↦ ?_ replace hb := mem_invSet_of_lt_invAux hb rw [add_assoc, ← add_mul, ← CharTwo.eq_add_iff_add_eq] at H obtain rfl | ha' := eq_or_ne a' 0 · rw [zero_mul, add_zero, ← add_eq_iff_eq_add, zero_add] at H exact H₁ _ hb H · rw [← mul_right_inj' (invAux_ne_zero a'), ← mul_assoc, mul_comm _ a', (mul_inv_cancel_aux a').2 ha', one_mul] at H exact invAux_notMem_invSet a (H ▸ cons_mem_invSet ha' ha hb) · rw [one_le_iff_ne_zero, mul_ne_zero_iff] exact ⟨ha₀, invAux_ne_zero a⟩ termination_by a
theorem
SetTheory
[ "Mathlib.Algebra.CharP.Two", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Abel", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Field.lean
mul_inv_cancel_aux
We set up a simultaneous induction to prove that `invAux a` is the inverse of `a`, and no element in its defining set `invSet a` is.
mul_invAux_cancel (h : a ≠ 0) : a * invAux a = 1 := (mul_inv_cancel_aux a).2 h
theorem
SetTheory
[ "Mathlib.Algebra.CharP.Two", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Abel", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Field.lean
mul_invAux_cancel
null
inv_eq_invAux (ha : a ≠ 0) : a⁻¹ = invAux a := dif_neg ha
theorem
SetTheory
[ "Mathlib.Algebra.CharP.Two", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Abel", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Nimber/Field.lean
inv_eq_invAux
null
@[simp] lift_add (a b : Ordinal.{v}) : lift.{u} (a + b) = lift.{u} a + lift.{u} b := Quotient.inductionOn₂ a b fun ⟨_α, _r, _⟩ ⟨_β, _s, _⟩ => Quotient.sound ⟨(RelIso.preimage Equiv.ulift _).trans (RelIso.sumLexCongr (RelIso.preimage Equiv.ulift _) (RelIso.preimage Equiv.ulift _)).symm⟩ @[simp]
theorem
SetTheory
[ "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.SuccPred.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic" ]
Mathlib/SetTheory/Ordinal/Arithmetic.lean
lift_add
null
lift_succ (a : Ordinal.{v}) : lift.{u} (succ a) = succ (lift.{u} a) := by rw [← add_one_eq_succ, lift_add, lift_one] rfl
theorem
SetTheory
[ "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.SuccPred.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic" ]
Mathlib/SetTheory/Ordinal/Arithmetic.lean
lift_succ
null
instAddLeftReflectLE : AddLeftReflectLE Ordinal.{u} where elim c a b := by refine inductionOn₃ a b c fun α r _ β s _ γ t _ ⟨f⟩ ↦ ?_ have H₁ a : f (Sum.inl a) = Sum.inl a := by simpa using ((InitialSeg.leAdd t r).trans f).eq (InitialSeg.leAdd t s) a have H₂ a : ∃ b, f (Sum.inr a) = Sum.inr b := by generalize hx : f (Sum.inr a) = x obtain x | x := x · rw [← H₁, f.inj] at hx contradiction · exact ⟨x, rfl⟩ choose g hg using H₂ refine (RelEmbedding.ofMonotone g fun _ _ h ↦ ?_).ordinal_type_le rwa [← @Sum.lex_inr_inr _ t _ s, ← hg, ← hg, f.map_rel_iff, Sum.lex_inr_inr]
instance
SetTheory
[ "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.SuccPred.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic" ]
Mathlib/SetTheory/Ordinal/Arithmetic.lean
instAddLeftReflectLE
null
private add_lt_add_iff_left' (a) {b c : Ordinal} : a + b < a + c ↔ b < c := by rw [← not_le, ← not_le, add_le_add_iff_left]
theorem
SetTheory
[ "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.SuccPred.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic" ]
Mathlib/SetTheory/Ordinal/Arithmetic.lean
add_lt_add_iff_left'
null
instAddLeftStrictMono : AddLeftStrictMono Ordinal.{u} := ⟨fun a _b _c ↦ (add_lt_add_iff_left' a).2⟩
instance
SetTheory
[ "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.SuccPred.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic" ]
Mathlib/SetTheory/Ordinal/Arithmetic.lean
instAddLeftStrictMono
null
instAddLeftReflectLT : AddLeftReflectLT Ordinal.{u} := ⟨fun a _b _c ↦ (add_lt_add_iff_left' a).1⟩
instance
SetTheory
[ "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.SuccPred.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic" ]
Mathlib/SetTheory/Ordinal/Arithmetic.lean
instAddLeftReflectLT
null
instAddRightReflectLT : AddRightReflectLT Ordinal.{u} := ⟨fun _a _b _c ↦ lt_imp_lt_of_le_imp_le fun h => add_le_add_right h _⟩
instance
SetTheory
[ "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.SuccPred.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic" ]
Mathlib/SetTheory/Ordinal/Arithmetic.lean
instAddRightReflectLT
null
add_le_add_iff_right {a b : Ordinal} : ∀ n : ℕ, a + n ≤ b + n ↔ a ≤ b | 0 => by simp | n + 1 => by simp only [natCast_succ, add_succ, add_succ, succ_le_succ_iff, add_le_add_iff_right]
theorem
SetTheory
[ "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.SuccPred.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic" ]
Mathlib/SetTheory/Ordinal/Arithmetic.lean
add_le_add_iff_right
null
add_right_cancel {a b : Ordinal} (n : ℕ) : a + n = b + n ↔ a = b := by simp only [le_antisymm_iff, add_le_add_iff_right]
theorem
SetTheory
[ "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.SuccPred.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic" ]
Mathlib/SetTheory/Ordinal/Arithmetic.lean
add_right_cancel
null
add_eq_zero_iff {a b : Ordinal} : a + b = 0 ↔ a = 0 ∧ b = 0 := inductionOn₂ a b fun α r _ β s _ => by simp_rw [← type_sum_lex, type_eq_zero_iff_isEmpty] exact isEmpty_sum
theorem
SetTheory
[ "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.SuccPred.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic" ]
Mathlib/SetTheory/Ordinal/Arithmetic.lean
add_eq_zero_iff
null
left_eq_zero_of_add_eq_zero {a b : Ordinal} (h : a + b = 0) : a = 0 := (add_eq_zero_iff.1 h).1
theorem
SetTheory
[ "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.SuccPred.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic" ]
Mathlib/SetTheory/Ordinal/Arithmetic.lean
left_eq_zero_of_add_eq_zero
null
right_eq_zero_of_add_eq_zero {a b : Ordinal} (h : a + b = 0) : b = 0 := (add_eq_zero_iff.1 h).2 /-! ### Limit ordinals -/
theorem
SetTheory
[ "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.SuccPred.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic" ]
Mathlib/SetTheory/Ordinal/Arithmetic.lean
right_eq_zero_of_add_eq_zero
null
isSuccLimit_iff {o : Ordinal} : IsSuccLimit o ↔ o ≠ 0 ∧ IsSuccPrelimit o := by simp [IsSuccLimit] @[deprecated (since := "2025-07-09")] alias isLimit_iff := isSuccLimit_iff @[deprecated (since := "2025-07-09")] alias IsLimit.isSuccPrelimit := IsSuccLimit.isSuccPrelimit @[deprecated (since := "2025-07-09")] alias IsLimit.succ_lt := IsSuccLimit.succ_lt @[simp]
theorem
SetTheory
[ "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.SuccPred.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic" ]
Mathlib/SetTheory/Ordinal/Arithmetic.lean
isSuccLimit_iff
null
isSuccPrelimit_zero : IsSuccPrelimit (0 : Ordinal) := isSuccPrelimit_bot @[simp]
theorem
SetTheory
[ "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.SuccPred.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic" ]
Mathlib/SetTheory/Ordinal/Arithmetic.lean
isSuccPrelimit_zero
null
not_isSuccLimit_zero : ¬ IsSuccLimit (0 : Ordinal) := not_isSuccLimit_bot @[deprecated (since := "2025-07-09")] alias not_zero_isLimit := not_isSuccLimit_zero @[deprecated (since := "2025-07-09")] alias not_succ_isLimit := not_isSuccLimit_succ @[deprecated (since := "2025-07-09")] alias succ_lt_of_isLimit := IsSuccLimit.succ_lt_iff @[deprecated (since := "2025-07-09")] alias le_succ_of_isLimit := IsSuccLimit.le_succ_iff @[deprecated (since := "2025-07-09")] alias limit_le := IsSuccLimit.le_iff_forall_le @[deprecated (since := "2025-07-09")] alias lt_limit := IsSuccLimit.lt_iff_exists_lt @[simp]
theorem
SetTheory
[ "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.SuccPred.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic" ]
Mathlib/SetTheory/Ordinal/Arithmetic.lean
not_isSuccLimit_zero
null
isSuccPrelimit_lift {o : Ordinal} : IsSuccPrelimit (lift.{u, v} o) ↔ IsSuccPrelimit o := liftInitialSeg.isSuccPrelimit_apply_iff @[simp]
theorem
SetTheory
[ "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.SuccPred.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic" ]
Mathlib/SetTheory/Ordinal/Arithmetic.lean
isSuccPrelimit_lift
null
isSuccLimit_lift {o : Ordinal} : IsSuccLimit (lift.{u, v} o) ↔ IsSuccLimit o := liftInitialSeg.isSuccLimit_apply_iff @[deprecated (since := "2025-07-09")] alias lift_isLimit := isSuccLimit_lift
theorem
SetTheory
[ "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.SuccPred.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic" ]
Mathlib/SetTheory/Ordinal/Arithmetic.lean
isSuccLimit_lift
null
natCast_lt_of_isSuccLimit {o : Ordinal} (h : IsSuccLimit o) (n : ℕ) : n < o := by simpa using h.add_natCast_lt h.bot_lt n @[deprecated (since := "2025-07-09")] alias IsLimit.nat_lt := natCast_lt_of_isSuccLimit
theorem
SetTheory
[ "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.SuccPred.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic" ]
Mathlib/SetTheory/Ordinal/Arithmetic.lean
natCast_lt_of_isSuccLimit
null
one_lt_of_isSuccLimit {o : Ordinal} (h : IsSuccLimit o) : 1 < o := mod_cast natCast_lt_of_isSuccLimit h 1 @[deprecated (since := "2025-07-09")] alias IsLimit.one_lt := one_lt_of_isSuccLimit
theorem
SetTheory
[ "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.SuccPred.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic" ]
Mathlib/SetTheory/Ordinal/Arithmetic.lean
one_lt_of_isSuccLimit
null
zero_or_succ_or_isSuccLimit (o : Ordinal) : o = 0 ∨ o ∈ range succ ∨ IsSuccLimit o := by simpa using isMin_or_mem_range_succ_or_isSuccLimit o @[deprecated (since := "2025-07-09")] alias IsLimit.sSup_Iio := IsSuccLimit.sSup_Iio @[deprecated (since := "2025-07-09")] alias IsLimit.iSup_Iio := IsSuccLimit.iSup_Iio
theorem
SetTheory
[ "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.SuccPred.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic" ]
Mathlib/SetTheory/Ordinal/Arithmetic.lean
zero_or_succ_or_isSuccLimit
null
@[elab_as_elim] limitRecOn {motive : Ordinal → Sort*} (o : Ordinal) (zero : motive 0) (succ : ∀ o, motive o → motive (succ o)) (limit : ∀ o, IsSuccLimit o → (∀ o' < o, motive o') → motive o) : motive o := SuccOrder.limitRecOn o (fun _a ha ↦ ha.eq_bot ▸ zero) (fun a _ ↦ succ a) limit @[simp]
def
SetTheory
[ "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.SuccPred.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic" ]
Mathlib/SetTheory/Ordinal/Arithmetic.lean
limitRecOn
Main induction principle of ordinals: if one can prove a property by induction at successor ordinals and at limit ordinals, then it holds for all ordinals.
limitRecOn_zero {motive} (H₁ H₂ H₃) : @limitRecOn motive 0 H₁ H₂ H₃ = H₁ := SuccOrder.limitRecOn_isMin _ _ _ isMin_bot @[simp]
theorem
SetTheory
[ "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.SuccPred.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic" ]
Mathlib/SetTheory/Ordinal/Arithmetic.lean
limitRecOn_zero
null
limitRecOn_succ {motive} (o H₁ H₂ H₃) : @limitRecOn motive (succ o) H₁ H₂ H₃ = H₂ o (@limitRecOn motive o H₁ H₂ H₃) := SuccOrder.limitRecOn_succ .. @[simp]
theorem
SetTheory
[ "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.SuccPred.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic" ]
Mathlib/SetTheory/Ordinal/Arithmetic.lean
limitRecOn_succ
null
limitRecOn_limit {motive} (o H₁ H₂ H₃ h) : @limitRecOn motive o H₁ H₂ H₃ = H₃ o h fun x _h => @limitRecOn motive x H₁ H₂ H₃ := SuccOrder.limitRecOn_of_isSuccLimit ..
theorem
SetTheory
[ "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.SuccPred.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic" ]
Mathlib/SetTheory/Ordinal/Arithmetic.lean
limitRecOn_limit
null
@[elab_as_elim] boundedLimitRecOn {l : Ordinal} (lLim : IsSuccLimit l) {motive : Iio l → Sort*} (o : Iio l) (zero : motive ⟨0, lLim.bot_lt⟩) (succ : (o : Iio l) → motive o → motive ⟨succ o, lLim.succ_lt o.2⟩) (limit : (o : Iio l) → IsSuccLimit o.1 → (Π o' < o, motive o') → motive o) : motive o := limitRecOn (motive := fun p ↦ (h : p < l) → motive ⟨p, h⟩) o.1 (fun _ ↦ zero) (fun o ih h ↦ succ ⟨o, _⟩ <| ih <| (lt_succ o).trans h) (fun _o ho ih _ ↦ limit _ ho fun _o' h ↦ ih _ h _) o.2 @[simp]
def
SetTheory
[ "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.SuccPred.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic" ]
Mathlib/SetTheory/Ordinal/Arithmetic.lean
boundedLimitRecOn
Bounded recursion on ordinals. Similar to `limitRecOn`, with the assumption `o < l` added to all cases. The final term's domain is the ordinals below `l`.
boundedLimitRec_zero {l} (lLim : IsSuccLimit l) {motive} (H₁ H₂ H₃) : @boundedLimitRecOn l lLim motive ⟨0, lLim.bot_lt⟩ H₁ H₂ H₃ = H₁ := by rw [boundedLimitRecOn, limitRecOn_zero] @[simp]
theorem
SetTheory
[ "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.SuccPred.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic" ]
Mathlib/SetTheory/Ordinal/Arithmetic.lean
boundedLimitRec_zero
null
boundedLimitRec_succ {l} (lLim : IsSuccLimit l) {motive} (o H₁ H₂ H₃) : @boundedLimitRecOn l lLim motive ⟨succ o.1, lLim.succ_lt o.2⟩ H₁ H₂ H₃ = H₂ o (@boundedLimitRecOn l lLim motive o H₁ H₂ H₃) := by rw [boundedLimitRecOn, limitRecOn_succ] rfl
theorem
SetTheory
[ "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.SuccPred.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic" ]
Mathlib/SetTheory/Ordinal/Arithmetic.lean
boundedLimitRec_succ
null
boundedLimitRec_limit {l} (lLim : IsSuccLimit l) {motive} (o H₁ H₂ H₃ oLim) : @boundedLimitRecOn l lLim motive o H₁ H₂ H₃ = H₃ o oLim (fun x _ ↦ @boundedLimitRecOn l lLim motive x H₁ H₂ H₃) := by rw [boundedLimitRecOn, limitRecOn_limit] rfl
theorem
SetTheory
[ "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.SuccPred.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic" ]
Mathlib/SetTheory/Ordinal/Arithmetic.lean
boundedLimitRec_limit
null
orderTopToTypeSucc (o : Ordinal) : OrderTop (succ o).toType := @OrderTop.mk _ _ (Top.mk _) le_enum_succ
instance
SetTheory
[ "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.SuccPred.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic" ]
Mathlib/SetTheory/Ordinal/Arithmetic.lean
orderTopToTypeSucc
null
enum_succ_eq_top {o : Ordinal} : enum (α := (succ o).toType) (· < ·) ⟨o, type_toType _ ▸ lt_succ o⟩ = ⊤ := rfl
theorem
SetTheory
[ "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.SuccPred.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic" ]
Mathlib/SetTheory/Ordinal/Arithmetic.lean
enum_succ_eq_top
null
has_succ_of_type_succ_lt {α} {r : α → α → Prop} [wo : IsWellOrder α r] (h : ∀ a < type r, succ a < type r) (x : α) : ∃ y, r x y := by use enum r ⟨succ (typein r x), h _ (typein_lt_type r x)⟩ convert enum_lt_enum.mpr _ · rw [enum_typein] · rw [Subtype.mk_lt_mk, lt_succ_iff]
theorem
SetTheory
[ "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.SuccPred.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic" ]
Mathlib/SetTheory/Ordinal/Arithmetic.lean
has_succ_of_type_succ_lt
null
toType_noMax_of_succ_lt {o : Ordinal} (ho : ∀ a < o, succ a < o) : NoMaxOrder o.toType := ⟨has_succ_of_type_succ_lt (type_toType _ ▸ ho)⟩
theorem
SetTheory
[ "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.SuccPred.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic" ]
Mathlib/SetTheory/Ordinal/Arithmetic.lean
toType_noMax_of_succ_lt
null
bounded_singleton {r : α → α → Prop} [IsWellOrder α r] (hr : IsSuccLimit (type r)) (x) : Bounded r {x} := by refine ⟨enum r ⟨succ (typein r x), hr.succ_lt (typein_lt_type r x)⟩, ?_⟩ intro b hb rw [mem_singleton_iff.1 hb] nth_rw 1 [← enum_typein r x] rw [@enum_lt_enum _ r, Subtype.mk_lt_mk] apply lt_succ @[simp]
theorem
SetTheory
[ "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.SuccPred.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic" ]
Mathlib/SetTheory/Ordinal/Arithmetic.lean
bounded_singleton
null
typein_ordinal (o : Ordinal.{u}) : @typein Ordinal (· < ·) _ o = Ordinal.lift.{u + 1} o := by refine Quotient.inductionOn o ?_ rintro ⟨α, r, wo⟩; apply Quotient.sound constructor; refine ((RelIso.preimage Equiv.ulift r).trans (enum r).symm).symm
theorem
SetTheory
[ "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.SuccPred.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic" ]
Mathlib/SetTheory/Ordinal/Arithmetic.lean
typein_ordinal
null
mk_Iio_ordinal (o : Ordinal.{u}) : #(Iio o) = Cardinal.lift.{u + 1} o.card := by rw [lift_card, ← typein_ordinal] rfl /-! ### The predecessor of an ordinal -/
theorem
SetTheory
[ "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.SuccPred.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic" ]
Mathlib/SetTheory/Ordinal/Arithmetic.lean
mk_Iio_ordinal
null
pred (o : Ordinal) : Ordinal := isSuccPrelimitRecOn o (fun a _ ↦ a) (fun a _ ↦ a) @[simp]
def
SetTheory
[ "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.SuccPred.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic" ]
Mathlib/SetTheory/Ordinal/Arithmetic.lean
pred
The ordinal predecessor of `o` is `o'` if `o = succ o'`, and `o` otherwise.
pred_succ (o) : pred (succ o) = o := isSuccPrelimitRecOn_succ ..
theorem
SetTheory
[ "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.SuccPred.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic" ]
Mathlib/SetTheory/Ordinal/Arithmetic.lean
pred_succ
null
pred_eq_of_isSuccPrelimit {o} : IsSuccPrelimit o → pred o = o := isSuccPrelimitRecOn_of_isSuccPrelimit _ _ alias _root_.Order.IsSuccPrelimit.ordinalPred_eq := pred_eq_of_isSuccPrelimit
theorem
SetTheory
[ "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.SuccPred.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic" ]
Mathlib/SetTheory/Ordinal/Arithmetic.lean
pred_eq_of_isSuccPrelimit
null
_root_.Order.IsSuccLimit.ordinalPred_eq {o} (ho : IsSuccLimit o) : pred o = o := ho.isSuccPrelimit.ordinalPred_eq @[simp]
theorem
SetTheory
[ "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.SuccPred.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic" ]
Mathlib/SetTheory/Ordinal/Arithmetic.lean
_root_.Order.IsSuccLimit.ordinalPred_eq
null
pred_zero : pred 0 = 0 := isSuccPrelimit_zero.ordinalPred_eq @[simp]
theorem
SetTheory
[ "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.SuccPred.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic" ]
Mathlib/SetTheory/Ordinal/Arithmetic.lean
pred_zero
null
pred_le_iff_le_succ {a b} : pred a ≤ b ↔ a ≤ succ b := by obtain ⟨a, rfl⟩ | ha := mem_range_succ_or_isSuccPrelimit a · simp · rw [ha.ordinalPred_eq, ha.le_succ_iff] @[simp]
theorem
SetTheory
[ "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.SuccPred.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic" ]
Mathlib/SetTheory/Ordinal/Arithmetic.lean
pred_le_iff_le_succ
null
lt_pred_iff_succ_lt {a b} : a < pred b ↔ succ a < b := le_iff_le_iff_lt_iff_lt.1 pred_le_iff_le_succ
theorem
SetTheory
[ "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.SuccPred.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic" ]
Mathlib/SetTheory/Ordinal/Arithmetic.lean
lt_pred_iff_succ_lt
null
pred_le_self (o) : pred o ≤ o := by simpa using le_succ o
theorem
SetTheory
[ "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.SuccPred.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic" ]
Mathlib/SetTheory/Ordinal/Arithmetic.lean
pred_le_self
null
pred_succ_gi : GaloisInsertion pred succ := GaloisConnection.toGaloisInsertion @pred_le_iff_le_succ (by simp)
def
SetTheory
[ "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.SuccPred.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic" ]
Mathlib/SetTheory/Ordinal/Arithmetic.lean
pred_succ_gi
`Ordinal.pred` and `Order.succ` form a Galois insertion.
pred_surjective : Function.Surjective pred := pred_succ_gi.l_surjective
theorem
SetTheory
[ "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.SuccPred.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic" ]
Mathlib/SetTheory/Ordinal/Arithmetic.lean
pred_surjective
null
self_le_succ_pred (o) : o ≤ succ (pred o) := pred_succ_gi.gc.le_u_l o
theorem
SetTheory
[ "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.SuccPred.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic" ]
Mathlib/SetTheory/Ordinal/Arithmetic.lean
self_le_succ_pred
null
pred_eq_iff_isSuccPrelimit {o} : pred o = o ↔ IsSuccPrelimit o := by obtain ⟨a, rfl⟩ | ho := mem_range_succ_or_isSuccPrelimit o · simpa using (lt_succ a).ne · simp_rw [ho.ordinalPred_eq, ho]
theorem
SetTheory
[ "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.SuccPred.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic" ]
Mathlib/SetTheory/Ordinal/Arithmetic.lean
pred_eq_iff_isSuccPrelimit
null
pred_lt_iff_not_isSuccPrelimit {o} : pred o < o ↔ ¬ IsSuccPrelimit o := by rw [(pred_le_self o).lt_iff_ne] exact pred_eq_iff_isSuccPrelimit.not
theorem
SetTheory
[ "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.SuccPred.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic" ]
Mathlib/SetTheory/Ordinal/Arithmetic.lean
pred_lt_iff_not_isSuccPrelimit
null