Skip to content

Commit

Permalink
chore(SetTheory/Ordinal/Arithmetic): prove n + ω = ω earlier (#19803)
Browse files Browse the repository at this point in the history
We use this to simplify the previous proof for `one_add_omega0`.
  • Loading branch information
vihdzp committed Dec 11, 2024
1 parent 43404d7 commit 013d296
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 50 deletions.
73 changes: 36 additions & 37 deletions Mathlib/SetTheory/Ordinal/Arithmetic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -612,27 +612,6 @@ theorem isLimit_sub {a b} (ha : IsLimit a) (h : b < a) : IsLimit (a - b) := by
@[deprecated isLimit_sub (since := "2024-10-11")]
alias sub_isLimit := isLimit_sub

theorem one_add_omega0 : 1 + ω = ω := by
refine le_antisymm ?_ (le_add_left _ _)
rw [omega0, ← lift_one.{0}, ← lift_add, lift_le, ← type_unit, ← type_sum_lex]
refine ⟨RelEmbedding.collapse (RelEmbedding.ofMonotone ?_ ?_)⟩
· apply Sum.rec
· exact fun _ => 0
· exact Nat.succ
· intro a b
cases a <;> cases b <;> intro H <;> cases' H with _ _ H _ _ H <;>
[exact H.elim; exact Nat.succ_pos _; exact Nat.succ_lt_succ H]

@[deprecated "No deprecation message was provided." (since := "2024-09-30")]
alias one_add_omega := one_add_omega0

@[simp]
theorem one_add_of_omega0_le {o} (h : ω ≤ o) : 1 + o = o := by
rw [← Ordinal.add_sub_cancel_of_le h, ← add_assoc, one_add_omega0]

@[deprecated "No deprecation message was provided." (since := "2024-09-30")]
alias one_add_of_omega_le := one_add_of_omega0_le

/-! ### Multiplication of ordinals -/


Expand Down Expand Up @@ -2329,24 +2308,8 @@ theorem lift_ofNat (n : ℕ) [n.AtLeastTwo] :
lift.{u, v} (no_index (OfNat.ofNat n)) = OfNat.ofNat n :=
lift_natCast n

end Ordinal

/-! ### Properties of ω -/


namespace Cardinal

open Ordinal

@[simp]
theorem add_one_of_aleph0_le {c} (h : ℵ₀ ≤ c) : c + 1 = c := by
rw [add_comm, ← card_ord c, ← card_one, ← card_add, one_add_of_omega0_le]
rwa [← ord_aleph0, ord_le_ord]

end Cardinal

namespace Ordinal

theorem lt_add_of_limit {a b c : Ordinal.{u}} (h : IsLimit c) :
a < b + c ↔ ∃ c' < c, a < b + c' := by
-- Porting note: `bex_def` is required.
Expand Down Expand Up @@ -2421,6 +2384,37 @@ theorem omega0_le_of_isLimit {o} (h : IsLimit o) : ω ≤ o :=
@[deprecated "No deprecation message was provided." (since := "2024-09-30")]
alias omega_le_of_isLimit := omega0_le_of_isLimit

theorem natCast_add_omega0 (n : ℕ) : n + ω = ω := by
refine le_antisymm (le_of_forall_lt fun a ha ↦ ?_) (le_add_left _ _)
obtain ⟨b, hb', hb⟩ := (lt_add_iff omega0_ne_zero).1 ha
obtain ⟨m, rfl⟩ := lt_omega0.1 hb'
apply hb.trans_lt
exact_mod_cast nat_lt_omega0 (n + m)

theorem one_add_omega0 : 1 + ω = ω :=
mod_cast natCast_add_omega0 1

@[deprecated "No deprecation message was provided." (since := "2024-09-30")]
alias one_add_omega := one_add_omega0

theorem add_omega0 {a : Ordinal} (h : a < ω) : a + ω = ω := by
obtain ⟨n, rfl⟩ := lt_omega0.1 h
exact natCast_add_omega0 n

@[deprecated (since := "2024-09-30")]
alias add_omega := add_omega0

@[simp]
theorem natCast_add_of_omega0_le {o} (h : ω ≤ o) (n : ℕ) : n + o = o := by
rw [← Ordinal.add_sub_cancel_of_le h, ← add_assoc, natCast_add_omega0]

@[simp]
theorem one_add_of_omega0_le {o} (h : ω ≤ o) : 1 + o = o :=
mod_cast natCast_add_of_omega0_le h 1

@[deprecated "No deprecation message was provided." (since := "2024-09-30")]
alias one_add_of_omega_le := one_add_of_omega0_le

theorem isLimit_iff_omega0_dvd {a : Ordinal} : IsLimit a ↔ a ≠ 0 ∧ ω ∣ a := by
refine ⟨fun l => ⟨l.ne_zero, ⟨a / ω, le_antisymm ?_ (mul_div_le _ _)⟩⟩, fun h => ?_⟩
· refine (limit_le l).2 fun x hx => le_of_lt ?_
Expand Down Expand Up @@ -2501,6 +2495,11 @@ namespace Cardinal

open Ordinal

@[simp]
theorem add_one_of_aleph0_le {c} (h : ℵ₀ ≤ c) : c + 1 = c := by
rw [add_comm, ← card_ord c, ← card_one, ← card_add, one_add_of_omega0_le]
rwa [← ord_aleph0, ord_le_ord]

theorem isLimit_ord {c} (co : ℵ₀ ≤ c) : (ord c).IsLimit := by
rw [isLimit_iff, isSuccPrelimit_iff_succ_lt]
refine ⟨fun h => aleph0_ne_zero ?_, fun a => lt_imp_lt_of_le_imp_le fun h => ?_⟩
Expand Down
13 changes: 0 additions & 13 deletions Mathlib/SetTheory/Ordinal/Principal.lean
Original file line number Diff line number Diff line change
Expand Up @@ -195,19 +195,6 @@ theorem principal_add_iff_add_lt_ne_self : Principal (· + ·) a ↔ ∀ b < a,
rcases exists_lt_add_of_not_principal_add ha with ⟨b, hb, c, hc, rfl⟩
exact (H b hb c hc).irrefl⟩

theorem add_omega0 (h : a < ω) : a + ω = ω := by
rcases lt_omega0.1 h with ⟨n, rfl⟩
clear h; induction' n with n IH
· rw [Nat.cast_zero, zero_add]
· rwa [Nat.cast_succ, add_assoc, one_add_of_omega0_le (le_refl _)]

@[deprecated (since := "2024-09-30")]
alias add_omega := add_omega0

@[simp]
theorem natCast_add_omega0 (n : ℕ) : n + ω = ω :=
add_omega0 (nat_lt_omega0 n)

theorem principal_add_omega0 : Principal (· + ·) ω :=
principal_add_iff_add_left_eq_self.2 fun _ => add_omega0

Expand Down

0 comments on commit 013d296

Please sign in to comment.