Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
6b855a2
start
vihdzp Dec 9, 2025
a530fad
more stuff
vihdzp Dec 9, 2025
1b69fc2
this seems sufficient
vihdzp Dec 9, 2025
9239676
Update Mathlib.lean
vihdzp Dec 9, 2025
39cc03e
only need this atm
vihdzp Dec 9, 2025
92cf621
ctue
vihdzp Dec 9, 2025
1a8cfb3
mb
vihdzp Dec 9, 2025
73b8420
there
vihdzp Dec 9, 2025
b8ac712
more
vihdzp Dec 9, 2025
7146db2
prove
vihdzp Dec 9, 2025
320f1c1
add zero case
vihdzp Dec 9, 2025
4dbb1b7
Update Cardinal.lean
vihdzp Dec 9, 2025
3bf3bce
Merge branch 'card' into hahnsize2
vihdzp Dec 9, 2025
feed359
fix
vihdzp Dec 9, 2025
3b70c32
Update Arithmetic.lean
vihdzp Dec 9, 2025
2495d85
private import
vihdzp Dec 9, 2025
cc1dd49
Update Cardinal.lean
vihdzp Dec 9, 2025
858cd1a
Update Cardinal.lean
vihdzp Dec 9, 2025
fe9b73f
Update Cardinal.lean
vihdzp Dec 9, 2025
8bda184
Revert "private import"
vihdzp Dec 9, 2025
478cdaf
Merge branch 'master' into hahnsize
vihdzp Dec 10, 2025
ef3d328
Merge branch 'hahnsize' into hahnsize2
vihdzp Dec 10, 2025
d2003df
Merge branch 'master' into hahnsize
vihdzp Dec 11, 2025
77d4517
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Dec 11, 2025
fbf79e0
Update Basic.lean
vihdzp Dec 11, 2025
b67fbfa
Update Cardinal.lean
vihdzp Dec 11, 2025
3514247
Update Cardinal.lean
vihdzp Dec 11, 2025
44816e6
Merge branch 'master' into hahnsize
vihdzp Dec 12, 2025
0ba2c3b
cardSupp
vihdzp Dec 15, 2025
4d0cd12
Update Cardinal.lean
vihdzp Dec 15, 2025
2222a63
Merge branch 'hahnsize' into hahnsize2
vihdzp Dec 15, 2025
29d0e89
fix merge
vihdzp Dec 15, 2025
8a0d28c
Merge branch 'master' into hahnsize2
vihdzp Dec 15, 2025
e2d98d1
fix names
vihdzp Dec 15, 2025
d00f514
revert chanes
vihdzp Dec 15, 2025
f2eef9c
fix
vihdzp Dec 15, 2025
fd9bc87
Update Summable.lean
vihdzp Dec 15, 2025
98ee14e
Update Mathlib/RingTheory/HahnSeries/Cardinal.lean
vihdzp Dec 22, 2025
7fabd61
Merge branch 'master' into hahnsize2
vihdzp Dec 22, 2025
f6b0c15
Refactor HahnSeries to use R⟦Γ⟧ type
vihdzp Dec 22, 2025
2ae5ac7
Update Multiplication.lean
vihdzp Dec 22, 2025
0f193eb
Apply suggestions from code review
vihdzp Dec 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions Mathlib/RingTheory/HahnSeries/Addition.lean
Original file line number Diff line number Diff line change
Expand Up @@ -267,16 +267,12 @@ theorem order_lt_order_of_eq_add_single {R} {Γ} [LinearOrder Γ] [Zero Γ] [Add
exact hyne rfl
refine lt_of_le_of_ne ?_ this
simp only [order, ne_zero_of_eq_add_single hxy hy, ↓reduceDIte, hy]
have : y.support ⊆ x.support := by
intro g hg
by_cases hgx : g = x.order
· refine (mem_support x g).mpr ?_
have : x.coeff x.order ≠ 0 := coeff_order_ne_zero <| ne_zero_of_eq_add_single hxy hy
rwa [← hgx] at this
· have : x.coeff g = (y + (single x.order) x.leadingCoeff).coeff g := by rw [← hxy]
rw [coeff_add, coeff_single_of_ne hgx, add_zero] at this
simpa [this] using hg
exact Set.IsWF.min_le_min_of_subset this
refine Set.IsWF.min_le_min_of_subset fun g hg ↦ ?_
obtain rfl | hgx := eq_or_ne g x.order
· simpa using coeff_order_eq_zero.not.2 <| ne_zero_of_eq_add_single hxy hy
· have : x.coeff g = (y + (single x.order) x.leadingCoeff).coeff g := by rw [← hxy]
rw [coeff_add, coeff_single_of_ne hgx, add_zero] at this
simpa [this] using hg

/-- `single` as an additive monoid/group homomorphism -/
@[simps!]
Expand Down
8 changes: 7 additions & 1 deletion Mathlib/RingTheory/HahnSeries/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -384,10 +384,16 @@ theorem order_eq_orderTop_of_ne_zero (hx : x ≠ 0) : order x = orderTop x := by

@[deprecated (since := "2025-08-19")] alias order_eq_orderTop_of_ne := order_eq_orderTop_of_ne_zero

theorem coeff_order_ne_zero {x : R⟦Γ⟧} (hx : x ≠ 0) : x.coeff x.order ≠ 0 := by
@[simp]
theorem coeff_order_eq_zero {x : R⟦Γ⟧} : x.coeff x.order = 0 ↔ x = 0 := by
refine ⟨not_imp_not.1 fun hx ↦ ?_, by simp +contextual⟩
rw [order_of_ne hx]
exact x.isWF_support.min_mem (support_nonempty_iff.2 hx)

@[deprecated coeff_order_eq_zero (since := "2025-12-09")]
theorem coeff_order_ne_zero {x : R⟦Γ⟧} (hx : x ≠ 0) : x.coeff x.order ≠ 0 :=
coeff_order_eq_zero.not.2 hx

theorem order_le_of_coeff_ne_zero {Γ} [Zero Γ] [LinearOrder Γ] {x : R⟦Γ⟧}
{g : Γ} (h : x.coeff g ≠ 0) : x.order ≤ g :=
le_trans (le_of_eq (order_of_ne (ne_zero_of_coeff_ne_zero h)))
Expand Down
69 changes: 65 additions & 4 deletions Mathlib/RingTheory/HahnSeries/Cardinal.lean
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ Authors: Violeta Hernández Palacios
-/
module

public import Mathlib.Algebra.Group.Pointwise.Set.Card
public import Mathlib.RingTheory.HahnSeries.Multiplication
public import Mathlib.RingTheory.HahnSeries.Summable
public import Mathlib.SetTheory.Cardinal.Arithmetic

import Mathlib.Algebra.Group.Pointwise.Set.Card

/-!
# Cardinality of Hahn series
Expand All @@ -16,7 +18,6 @@ for the cardinalities of different operations.

## Todo

- Bound the cardinality of the inverse.
- Build the subgroups, subrings, etc. of Hahn series with support less than a given infinite
cardinal.
-/
Expand All @@ -27,10 +28,13 @@ open Cardinal

namespace HahnSeries

variable {Γ R S : Type*} [PartialOrder Γ]
variable {Γ R S α : Type*}

/-! ### Cardinality function -/

section PartialOrder
variable [PartialOrder Γ]

section Zero
variable [Zero R]

Expand All @@ -56,6 +60,14 @@ theorem cardSupp_single_of_ne (a : Γ) {r : R} (h : r ≠ 0) : cardSupp (single
theorem cardSupp_single_le (a : Γ) (r : R) : cardSupp (single a r) ≤ 1 :=
(mk_le_mk_of_subset support_single_subset).trans_eq (mk_singleton a)

@[simp]
theorem cardSupp_one_le [Zero Γ] [One R] : cardSupp (1 : R⟦Γ⟧) ≤ 1 :=
cardSupp_single_le ..

@[simp]
theorem cardSupp_one [Zero Γ] [One R] [NeZero (1 : R)] : cardSupp (1 : R⟦Γ⟧) = 1 :=
cardSupp_single_of_ne _ one_ne_zero

theorem cardSupp_map_le [Zero S] (x : R⟦Γ⟧) (f : ZeroHom R S) : (x.map f).cardSupp ≤ x.cardSupp :=
cardSupp_mono <| support_map_subset ..

Expand Down Expand Up @@ -85,4 +97,53 @@ theorem cardSupp_mul_le [AddCommMonoid Γ] [IsOrderedCancelAddMonoid Γ] [NonUni
(x y : R⟦Γ⟧) : (x * y).cardSupp ≤ x.cardSupp * y.cardSupp :=
(mk_le_mk_of_subset (support_mul_subset ..)).trans mk_add_le

theorem cardSupp_single_mul_le [AddCommMonoid Γ] [IsOrderedCancelAddMonoid Γ]
[NonUnitalNonAssocSemiring R] (x : R⟦Γ⟧) (a : Γ) (r : R) :
(single a r * x).cardSupp ≤ x.cardSupp := by
simpa using (cardSupp_mul_le ..).trans (mul_le_mul_left (cardSupp_single_le ..) _)

theorem cardSupp_mul_single_le [AddCommMonoid Γ] [IsOrderedCancelAddMonoid Γ]
[NonUnitalNonAssocSemiring R] (x : R⟦Γ⟧) (a : Γ) (r : R) :
(x * single a r).cardSupp ≤ x.cardSupp := by
simpa using (cardSupp_mul_le ..).trans (mul_le_mul_right (cardSupp_single_le ..) _)

theorem cardSupp_pow_le [AddCommMonoid Γ] [IsOrderedCancelAddMonoid Γ] [Semiring R]
(x : R⟦Γ⟧) (n : ℕ) : (x ^ n).cardSupp ≤ x.cardSupp ^ n := by
induction n with
| zero => simp
| succ n IH =>
simpa [pow_succ] using (cardSupp_mul_le ..).trans <| mul_le_mul_left IH _

theorem cardSupp_hsum_le [AddCommMonoid R] (s : SummableFamily Γ R α) :
lift s.hsum.cardSupp ≤ sum fun a ↦ (s a).cardSupp :=
(lift_le.2 <| mk_le_mk_of_subset (SummableFamily.support_hsum_subset ..)).trans
mk_iUnion_le_sum_mk_lift

end PartialOrder

section LinearOrder
variable [LinearOrder Γ]

theorem cardSupp_hsum_powers_le [AddCommMonoid Γ] [IsOrderedCancelAddMonoid Γ] [CommRing R]
(x : R⟦Γ⟧) : (SummableFamily.powers x).hsum.cardSupp ≤ max ℵ₀ x.cardSupp := by
grw [← lift_uzero (cardSupp _), ← sum_pow_le_max_aleph0, cardSupp_hsum_le, sum_le_sum]
intro i
rw [SummableFamily.powers_toFun]
split_ifs
· exact cardSupp_pow_le ..
· cases i <;> simp

theorem cardSupp_inv_le [AddCommGroup Γ] [IsOrderedAddMonoid Γ] [Field R] (x : R⟦Γ⟧) :
x⁻¹.cardSupp ≤ max ℵ₀ x.cardSupp := by
obtain rfl | hx := eq_or_ne x 0; · simp
apply (cardSupp_single_mul_le ..).trans <| (cardSupp_hsum_powers_le ..).trans _
gcongr
refine (cardSupp_single_mul_le _ (-x.order) x.leadingCoeff⁻¹).trans' <| cardSupp_mono fun _ ↦ ?_
aesop (add simp [coeff_single_mul])

theorem cardSupp_div_le [AddCommGroup Γ] [IsOrderedAddMonoid Γ] [Field R] (x y : R⟦Γ⟧) :
(x / y).cardSupp ≤ x.cardSupp * max ℵ₀ y.cardSupp :=
(cardSupp_mul_le ..).trans <| mul_le_mul_right (cardSupp_inv_le y) _

end LinearOrder
end HahnSeries
10 changes: 10 additions & 0 deletions Mathlib/RingTheory/HahnSeries/Multiplication.lean
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,16 @@ theorem coeff_mul_single_add [NonUnitalNonAssocSemiring R] {r : R} {x : R⟦Γ
simp [hx]
· simp

theorem coeff_single_mul [NonUnitalNonAssocSemiring R] [PartialOrder Γ'] [AddCommGroup Γ']
[IsOrderedAddMonoid Γ'] {r : R} {x : R⟦Γ'⟧} {a b : Γ'} :
(single b r * x).coeff a = r * x.coeff (a - b) := by
simpa using coeff_single_mul_add (a := a - b) (b := b)

theorem coeff_mul_single [NonUnitalNonAssocSemiring R] [PartialOrder Γ'] [AddCommGroup Γ']
[IsOrderedAddMonoid Γ'] {r : R} {x : R⟦Γ'⟧} {a b : Γ'} :
(x * single b r).coeff a = x.coeff (a - b) * r := by
simpa using coeff_mul_single_add (a := a - b) (b := b)

@[simp]
theorem coeff_mul_single_zero [NonUnitalNonAssocSemiring R] {r : R} {x : R⟦Γ⟧} {a : Γ} :
(x * single 0 r).coeff a = x.coeff a * r := by rw [← add_zero a, coeff_mul_single_add, add_zero]
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/RingTheory/LaurentSeries.lean
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ theorem powerSeriesPart_eq_zero (x : R⸨X⸩) : x.powerSeriesPart = 0 ↔ x = 0
simp only [ne_eq]
intro h
rw [PowerSeries.ext_iff, not_forall]
refine ⟨0, ?_⟩
simp [coeff_order_ne_zero h]
use 0
simpa
· rintro rfl
simp

Expand Down