Skip to content

Commit 10a055a

Browse files
committed
feat(SetTheory/Ordinal/Commute): characterize when ordinal addition commutes (#36664)
1 parent 6770747 commit 10a055a

3 files changed

Lines changed: 51 additions & 0 deletions

File tree

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6924,6 +6924,7 @@ public import Mathlib.SetTheory.Lists
69246924
public import Mathlib.SetTheory.Ordinal.Arithmetic
69256925
public import Mathlib.SetTheory.Ordinal.Basic
69266926
public import Mathlib.SetTheory.Ordinal.CantorNormalForm
6927+
public import Mathlib.SetTheory.Ordinal.Commute
69276928
public import Mathlib.SetTheory.Ordinal.Enum
69286929
public import Mathlib.SetTheory.Ordinal.Exponential
69296930
public import Mathlib.SetTheory.Ordinal.Family
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/-
2+
Copyright (c) 2026 Snir Broshi. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Snir Broshi
5+
-/
6+
module
7+
8+
public import Mathlib.SetTheory.Ordinal.Arithmetic
9+
10+
/-!
11+
# Ordinal arithmetic commutativity
12+
13+
Results on the commutativity of ordinal arithmetic operations.
14+
15+
## References
16+
17+
* [Wacław Sierpiński, *Cardinal and Ordinal Numbers*][sierpinski1958]
18+
-/
19+
20+
public section
21+
22+
namespace Ordinal
23+
24+
theorem addCommute_iff_eq_mul_natCast {o₁ o₂ : Ordinal} :
25+
AddCommute o₁ o₂ ↔ ∃ (o : Ordinal) (n₁ n₂ : ℕ), o * n₁ = o₁ ∧ o * n₂ = o₂ := by
26+
refine ⟨fun hcomm ↦ ?_, ?_⟩
27+
· induction h : o₁ + o₂ using WellFoundedLT.induction generalizing o₁ o₂ with | ind o ih
28+
subst h
29+
wlog hle : o₁ ≤ o₂
30+
· grind [hcomm.symm]
31+
rcases eq_or_ne o₁ 0 with (rfl | h₁)
32+
· exact ⟨o₂, 0, 1, by simp, by simp⟩
33+
let o₃ := o₂ - o₁
34+
have hsub : o₁ + o₃ = o₂ := Ordinal.add_sub_cancel_of_le hle
35+
have hcomm' : AddCommute o₁ o₃ := add_left_cancel (a := o₁) <| by grind
36+
have hlt : o₁ + o₃ < o₁ + o₂ := by simpa [hsub, hcomm.eq] using h₁.pos
37+
rcases ih _ hlt hcomm' rfl with ⟨o, n₁, n₃, hn₁, hn₃⟩
38+
use o, n₁, n₁ + n₃, hn₁
39+
rw [Nat.cast_add, mul_add, hn₁, hn₃, hsub]
40+
· rintro ⟨o, n₁, n₂, rfl, rfl⟩
41+
rw [addCommute_iff_eq, ← mul_add, ← mul_add, ← Nat.cast_add, add_comm, Nat.cast_add]
42+
43+
end Ordinal

docs/references.bib

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5217,6 +5217,13 @@ @Book{ sga-4-tome-1
52175217
zbl = {0234.00007}
52185218
}
52195219

5220+
@Book{ sierpinski1958,
5221+
author = {Wacław Sierpiński},
5222+
title = {Cardinal and Ordinal Numbers},
5223+
publisher = {Państwowe Wydawnictwo Naukowe},
5224+
year = {1958}
5225+
}
5226+
52205227
@Book{ silverman2009,
52215228
author = {Silverman, Joseph},
52225229
publisher = {Springer New York, NY},

0 commit comments

Comments
 (0)