Skip to content

Commit 9c71e18

Browse files
vihdzppre-commit-ci-lite[bot]
authored andcommitted
feat: cardinality of Hahn series inverse (leanprover-community#32643)
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
1 parent 307e9f2 commit 9c71e18

File tree

5 files changed

+90
-17
lines changed

5 files changed

+90
-17
lines changed

Mathlib/RingTheory/HahnSeries/Addition.lean

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -267,16 +267,12 @@ theorem order_lt_order_of_eq_add_single {R} {Γ} [LinearOrder Γ] [Zero Γ] [Add
267267
exact hyne rfl
268268
refine lt_of_le_of_ne ?_ this
269269
simp only [order, ne_zero_of_eq_add_single hxy hy, ↓reduceDIte, hy]
270-
have : y.support ⊆ x.support := by
271-
intro g hg
272-
by_cases hgx : g = x.order
273-
· refine (mem_support x g).mpr ?_
274-
have : x.coeff x.order ≠ 0 := coeff_order_ne_zero <| ne_zero_of_eq_add_single hxy hy
275-
rwa [← hgx] at this
276-
· have : x.coeff g = (y + (single x.order) x.leadingCoeff).coeff g := by rw [← hxy]
277-
rw [coeff_add, coeff_single_of_ne hgx, add_zero] at this
278-
simpa [this] using hg
279-
exact Set.IsWF.min_le_min_of_subset this
270+
refine Set.IsWF.min_le_min_of_subset fun g hg ↦ ?_
271+
obtain rfl | hgx := eq_or_ne g x.order
272+
· simpa using coeff_order_eq_zero.not.2 <| ne_zero_of_eq_add_single hxy hy
273+
· have : x.coeff g = (y + (single x.order) x.leadingCoeff).coeff g := by rw [← hxy]
274+
rw [coeff_add, coeff_single_of_ne hgx, add_zero] at this
275+
simpa [this] using hg
280276

281277
/-- `single` as an additive monoid/group homomorphism -/
282278
@[simps!]

Mathlib/RingTheory/HahnSeries/Basic.lean

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,10 +384,16 @@ theorem order_eq_orderTop_of_ne_zero (hx : x ≠ 0) : order x = orderTop x := by
384384

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

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

393+
@[deprecated coeff_order_eq_zero (since := "2025-12-09")]
394+
theorem coeff_order_ne_zero {x : R⟦Γ⟧} (hx : x ≠ 0) : x.coeff x.order ≠ 0 :=
395+
coeff_order_eq_zero.not.2 hx
396+
391397
theorem order_le_of_coeff_ne_zero {Γ} [Zero Γ] [LinearOrder Γ] {x : R⟦Γ⟧}
392398
{g : Γ} (h : x.coeff g ≠ 0) : x.order ≤ g :=
393399
le_trans (le_of_eq (order_of_ne (ne_zero_of_coeff_ne_zero h)))

Mathlib/RingTheory/HahnSeries/Cardinal.lean

Lines changed: 65 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ Authors: Violeta Hernández Palacios
55
-/
66
module
77

8-
public import Mathlib.Algebra.Group.Pointwise.Set.Card
9-
public import Mathlib.RingTheory.HahnSeries.Multiplication
8+
public import Mathlib.RingTheory.HahnSeries.Summable
9+
public import Mathlib.SetTheory.Cardinal.Arithmetic
10+
11+
import Mathlib.Algebra.Group.Pointwise.Set.Card
1012

1113
/-!
1214
# Cardinality of Hahn series
@@ -16,7 +18,6 @@ for the cardinalities of different operations.
1618
1719
## Todo
1820
19-
- Bound the cardinality of the inverse.
2021
- Build the subgroups, subrings, etc. of Hahn series with support less than a given infinite
2122
cardinal.
2223
-/
@@ -27,10 +28,13 @@ open Cardinal
2728

2829
namespace HahnSeries
2930

30-
variable {Γ R S : Type*} [PartialOrder Γ]
31+
variable {Γ R S α : Type*}
3132

3233
/-! ### Cardinality function -/
3334

35+
section PartialOrder
36+
variable [PartialOrder Γ]
37+
3438
section Zero
3539
variable [Zero R]
3640

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

63+
@[simp]
64+
theorem cardSupp_one_le [Zero Γ] [One R] : cardSupp (1 : R⟦Γ⟧) ≤ 1 :=
65+
cardSupp_single_le ..
66+
67+
@[simp]
68+
theorem cardSupp_one [Zero Γ] [One R] [NeZero (1 : R)] : cardSupp (1 : R⟦Γ⟧) = 1 :=
69+
cardSupp_single_of_ne _ one_ne_zero
70+
5971
theorem cardSupp_map_le [Zero S] (x : R⟦Γ⟧) (f : ZeroHom R S) : (x.map f).cardSupp ≤ x.cardSupp :=
6072
cardSupp_mono <| support_map_subset ..
6173

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

100+
theorem cardSupp_single_mul_le [AddCommMonoid Γ] [IsOrderedCancelAddMonoid Γ]
101+
[NonUnitalNonAssocSemiring R] (x : R⟦Γ⟧) (a : Γ) (r : R) :
102+
(single a r * x).cardSupp ≤ x.cardSupp := by
103+
simpa using (cardSupp_mul_le ..).trans (mul_le_mul_left (cardSupp_single_le ..) _)
104+
105+
theorem cardSupp_mul_single_le [AddCommMonoid Γ] [IsOrderedCancelAddMonoid Γ]
106+
[NonUnitalNonAssocSemiring R] (x : R⟦Γ⟧) (a : Γ) (r : R) :
107+
(x * single a r).cardSupp ≤ x.cardSupp := by
108+
simpa using (cardSupp_mul_le ..).trans (mul_le_mul_right (cardSupp_single_le ..) _)
109+
110+
theorem cardSupp_pow_le [AddCommMonoid Γ] [IsOrderedCancelAddMonoid Γ] [Semiring R]
111+
(x : R⟦Γ⟧) (n : ℕ) : (x ^ n).cardSupp ≤ x.cardSupp ^ n := by
112+
induction n with
113+
| zero => simp
114+
| succ n IH =>
115+
simpa [pow_succ] using (cardSupp_mul_le ..).trans <| mul_le_mul_left IH _
116+
117+
theorem cardSupp_hsum_le [AddCommMonoid R] (s : SummableFamily Γ R α) :
118+
lift s.hsum.cardSupp ≤ sum fun a ↦ (s a).cardSupp :=
119+
(lift_le.2 <| mk_le_mk_of_subset (SummableFamily.support_hsum_subset ..)).trans
120+
mk_iUnion_le_sum_mk_lift
121+
122+
end PartialOrder
123+
124+
section LinearOrder
125+
variable [LinearOrder Γ]
126+
127+
theorem cardSupp_hsum_powers_le [AddCommMonoid Γ] [IsOrderedCancelAddMonoid Γ] [CommRing R]
128+
(x : R⟦Γ⟧) : (SummableFamily.powers x).hsum.cardSupp ≤ max ℵ₀ x.cardSupp := by
129+
grw [← lift_uzero (cardSupp _), ← sum_pow_le_max_aleph0, cardSupp_hsum_le, sum_le_sum]
130+
intro i
131+
rw [SummableFamily.powers_toFun]
132+
split_ifs
133+
· exact cardSupp_pow_le ..
134+
· cases i <;> simp
135+
136+
theorem cardSupp_inv_le [AddCommGroup Γ] [IsOrderedAddMonoid Γ] [Field R] (x : R⟦Γ⟧) :
137+
x⁻¹.cardSupp ≤ max ℵ₀ x.cardSupp := by
138+
obtain rfl | hx := eq_or_ne x 0; · simp
139+
apply (cardSupp_single_mul_le ..).trans <| (cardSupp_hsum_powers_le ..).trans _
140+
gcongr
141+
refine (cardSupp_single_mul_le _ (-x.order) x.leadingCoeff⁻¹).trans' <| cardSupp_mono fun _ ↦ ?_
142+
aesop (add simp [coeff_single_mul])
143+
144+
theorem cardSupp_div_le [AddCommGroup Γ] [IsOrderedAddMonoid Γ] [Field R] (x y : R⟦Γ⟧) :
145+
(x / y).cardSupp ≤ x.cardSupp * max ℵ₀ y.cardSupp :=
146+
(cardSupp_mul_le ..).trans <| mul_le_mul_right (cardSupp_inv_le y) _
147+
148+
end LinearOrder
88149
end HahnSeries

Mathlib/RingTheory/HahnSeries/Multiplication.lean

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,16 @@ theorem coeff_mul_single_add [NonUnitalNonAssocSemiring R] {r : R} {x : R⟦Γ
473473
simp [hx]
474474
· simp
475475

476+
theorem coeff_single_mul [NonUnitalNonAssocSemiring R] [PartialOrder Γ'] [AddCommGroup Γ']
477+
[IsOrderedAddMonoid Γ'] {r : R} {x : R⟦Γ'⟧} {a b : Γ'} :
478+
(single b r * x).coeff a = r * x.coeff (a - b) := by
479+
simpa using coeff_single_mul_add (a := a - b) (b := b)
480+
481+
theorem coeff_mul_single [NonUnitalNonAssocSemiring R] [PartialOrder Γ'] [AddCommGroup Γ']
482+
[IsOrderedAddMonoid Γ'] {r : R} {x : R⟦Γ'⟧} {a b : Γ'} :
483+
(x * single b r).coeff a = x.coeff (a - b) * r := by
484+
simpa using coeff_mul_single_add (a := a - b) (b := b)
485+
476486
@[simp]
477487
theorem coeff_mul_single_zero [NonUnitalNonAssocSemiring R] {r : R} {x : R⟦Γ⟧} {a : Γ} :
478488
(x * single 0 r).coeff a = x.coeff a * r := by rw [← add_zero a, coeff_mul_single_add, add_zero]

Mathlib/RingTheory/LaurentSeries.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,8 @@ theorem powerSeriesPart_eq_zero (x : R⸨X⸩) : x.powerSeriesPart = 0 ↔ x = 0
226226
simp only [ne_eq]
227227
intro h
228228
rw [PowerSeries.ext_iff, not_forall]
229-
refine ⟨0, ?_⟩
230-
simp [coeff_order_ne_zero h]
229+
use 0
230+
simpa
231231
· rintro rfl
232232
simp
233233

0 commit comments

Comments
 (0)