-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[Merged by Bors] - feat: cardinality of Hahn series #32640
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 8 commits
6b855a2
a530fad
1b69fc2
9239676
39cc03e
1a8cfb3
2495d85
8bda184
478cdaf
d2003df
77d4517
fbf79e0
b67fbfa
3514247
44816e6
0ba2c3b
4d0cd12
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| /- | ||
| Copyright (c) 2025 Violeta Hernández Palacios. All rights reserved. | ||
| Released under Apache 2.0 license as described in the file LICENSE. | ||
| Authors: Violeta Hernández Palacios | ||
| -/ | ||
| module | ||
|
|
||
| public import Mathlib.Algebra.Group.Pointwise.Set.Card | ||
| public import Mathlib.RingTheory.HahnSeries.Multiplication | ||
|
|
||
| /-! | ||
| # Cardinality of Hahn series | ||
|
|
||
| We define `HahnSeries.card` as the cardinality of the support of a Hahn series, and find bounds for | ||
| the cardinalities of different operations. | ||
|
|
||
| ## Todo | ||
|
|
||
| - Bound the cardinality of the inverse. | ||
| - Build the subgroups, subrings, etc. of Hahn series with less than a given infinite cardinal. | ||
| -/ | ||
|
|
||
| @[expose] public section | ||
|
|
||
| open Cardinal | ||
|
|
||
| namespace HahnSeries | ||
|
|
||
| variable {Γ R S : Type*} [PartialOrder Γ] | ||
|
|
||
| /-! ### Cardinality function -/ | ||
|
|
||
| section Zero | ||
| variable [Zero R] | ||
|
|
||
| /-- The cardinality of the support of a Hahn series. -/ | ||
| def card (x : HahnSeries Γ R) : Cardinal := | ||
| #x.support | ||
|
|
||
| theorem card_congr [Zero S] {x : HahnSeries Γ R} {y : HahnSeries Γ S} (h : x.support = y.support) : | ||
| x.card = y.card := by | ||
| simp_rw [card, h] | ||
|
|
||
| theorem card_mono [Zero S] {x : HahnSeries Γ R} {y : HahnSeries Γ S} (h : x.support ⊆ y.support) : | ||
| x.card ≤ y.card := | ||
| mk_le_mk_of_subset h | ||
|
|
||
| @[simp] | ||
| theorem card_zero : card (0 : HahnSeries Γ R) = 0 := by | ||
| simp [card] | ||
|
|
||
| theorem card_single_of_ne (a : Γ) {r : R} (h : r ≠ 0) : card (single a r) = 1 := by | ||
| rw [card, support_single_of_ne h, mk_singleton] | ||
|
|
||
| theorem card_single_le (a : Γ) (r : R) : card (single a r) ≤ 1 := | ||
| (mk_le_mk_of_subset support_single_subset).trans_eq (mk_singleton a) | ||
|
|
||
| theorem card_map_le [Zero S] (x : HahnSeries Γ R) (f : ZeroHom R S) : (x.map f).card ≤ x.card := | ||
| card_mono <| support_map_subset .. | ||
|
|
||
| theorem card_truncLT_le [DecidableLT Γ] (x : HahnSeries Γ R) (c : Γ) : | ||
| (truncLT c x).card ≤ x.card := | ||
| card_mono <| support_truncLT_subset .. | ||
|
|
||
| theorem card_smul_le (s : S) (x : HahnSeries Γ R) [SMulZeroClass S R] : (s • x).card ≤ x.card := | ||
| card_mono <| support_smul_subset .. | ||
|
|
||
| end Zero | ||
|
|
||
| theorem card_neg_le [NegZeroClass R] (x : HahnSeries Γ R) : (-x).card ≤ x.card := | ||
| card_mono <| support_neg_subset .. | ||
|
|
||
| theorem card_add_le [AddMonoid R] (x y : HahnSeries Γ R) : (x + y).card ≤ x.card + y.card := | ||
| (mk_le_mk_of_subset (support_add_subset ..)).trans (mk_union_le ..) | ||
|
|
||
| @[simp] | ||
| theorem card_neg [AddGroup R] (x : HahnSeries Γ R) : (-x).card = x.card := | ||
| card_congr support_neg | ||
|
|
||
| theorem card_sub_le [AddGroup R] (x y : HahnSeries Γ R) : (x - y).card ≤ x.card + y.card := | ||
| (mk_le_mk_of_subset (support_sub_subset ..)).trans (mk_union_le ..) | ||
|
|
||
| theorem card_mul_le [AddCommMonoid Γ] [IsOrderedCancelAddMonoid Γ] [NonUnitalNonAssocSemiring R] | ||
| (x y : HahnSeries Γ R) : (x * y).card ≤ x.card * y.card := | ||
| (mk_le_mk_of_subset (support_mul_subset ..)).trans mk_add_le | ||
|
|
||
| end HahnSeries | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -492,11 +492,14 @@ theorem single_zero_mul_eq_smul [Semiring R] {r : R} {x : HahnSeries Γ R} : | |
| ext | ||
| exact coeff_single_zero_mul | ||
|
|
||
| theorem support_mul_subset_add_support [NonUnitalNonAssocSemiring R] {x y : HahnSeries Γ R} : | ||
| theorem support_mul_subset [NonUnitalNonAssocSemiring R] {x y : HahnSeries Γ R} : | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As the previous name was not wrong, I don't know if it is worth the churn to rename and deprecate
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The idea here was to make the names of all these lemmas consistent. |
||
| support (x * y) ⊆ support x + support y := by | ||
| rw [← of_symm_smul_of_eq_mul, ← vadd_eq_add] | ||
| exact HahnModule.support_smul_subset_vadd_support | ||
|
|
||
| @[deprecated (since := "2025-12-09")] | ||
| alias support_mul_subset_add_support := support_mul_subset | ||
|
|
||
| instance [NonUnitalNonAssocSemiring R] : NonUnitalNonAssocSemiring (HahnSeries Γ R) := | ||
| { inferInstanceAs (AddCommMonoid (HahnSeries Γ R)), | ||
| inferInstanceAs (Distrib (HahnSeries Γ R)) with | ||
|
|
@@ -530,7 +533,7 @@ theorem orderTop_mul_of_nonzero {x y : HahnSeries Γ R} (h : x.leadingCoeff * y. | |
| refine le_antisymm (order_le_of_coeff_ne_zero this) ?_ | ||
| rw [HahnSeries.order_of_ne hx, HahnSeries.order_of_ne hy, HahnSeries.order_of_ne hxy, | ||
| ← Set.IsWF.min_add] | ||
| exact Set.IsWF.min_le_min_of_subset support_mul_subset_add_support | ||
| exact Set.IsWF.min_le_min_of_subset support_mul_subset | ||
|
|
||
| theorem orderTop_add_le_mul {x y : HahnSeries Γ R} : | ||
| x.orderTop + y.orderTop ≤ (x * y).orderTop := by | ||
|
|
@@ -547,7 +550,7 @@ theorem order_mul_of_nonzero {x y : HahnSeries Γ R} | |
| (Eq.mpr (congrArg (fun _a ↦ _a ≠ 0) (coeff_mul_order_add_order x y)) h)) ?_ | ||
| rw [order_of_ne <| leadingCoeff_ne_zero.mp hx, order_of_ne <| leadingCoeff_ne_zero.mp hy, | ||
| order_of_ne <| ne_zero_of_coeff_ne_zero hxy, ← Set.IsWF.min_add] | ||
| exact Set.IsWF.min_le_min_of_subset support_mul_subset_add_support | ||
| exact Set.IsWF.min_le_min_of_subset support_mul_subset | ||
|
|
||
| theorem leadingCoeff_mul_of_nonzero {x y : HahnSeries Γ R} | ||
| (h : x.leadingCoeff * y.leadingCoeff ≠ 0) : | ||
|
|
@@ -571,8 +574,8 @@ variable [AddCommMonoid Γ] [PartialOrder Γ] [IsOrderedCancelAddMonoid Γ] | |
| private theorem mul_assoc' [NonUnitalSemiring R] (x y z : HahnSeries Γ R) : | ||
| x * y * z = x * (y * z) := by | ||
| ext b | ||
| rw [coeff_mul_left' (x.isPWO_support.add y.isPWO_support) support_mul_subset_add_support, | ||
| coeff_mul_right' (y.isPWO_support.add z.isPWO_support) support_mul_subset_add_support] | ||
| rw [coeff_mul_left' (x.isPWO_support.add y.isPWO_support) support_mul_subset, | ||
| coeff_mul_right' (y.isPWO_support.add z.isPWO_support) support_mul_subset] | ||
| simp only [coeff_mul, sum_mul, mul_sum, sum_sigma'] | ||
| apply Finset.sum_nbij' (fun ⟨⟨_i, j⟩, ⟨k, l⟩⟩ ↦ ⟨(k, l + j), (l, j)⟩) | ||
| (fun ⟨⟨i, _j⟩, ⟨k, l⟩⟩ ↦ ⟨(i + k, l), (i, k)⟩) <;> | ||
|
|
@@ -718,7 +721,7 @@ private theorem mul_smul' [Semiring R] [Module R V] (x y : HahnSeries Γ R) | |
| (z : HahnModule Γ' R V) : (x * y) • z = x • (y • z) := by | ||
| ext b | ||
| rw [coeff_smul_left (x.isPWO_support.add y.isPWO_support) | ||
| HahnSeries.support_mul_subset_add_support, coeff_smul_right | ||
| HahnSeries.support_mul_subset, coeff_smul_right | ||
| (y.isPWO_support.vadd ((of R).symm z).isPWO_support) support_smul_subset_vadd_support] | ||
| simp only [HahnSeries.coeff_mul, coeff_smul, sum_smul, smul_sum, sum_sigma'] | ||
| apply Finset.sum_nbij' (fun ⟨⟨_i, j⟩, ⟨k, l⟩⟩ ↦ ⟨(k, l +ᵥ j), (l, j)⟩) | ||
|
|
@@ -793,7 +796,7 @@ theorem order_mul {Γ} [AddCommMonoid Γ] [LinearOrder Γ] [IsOrderedCancelAddMo | |
| rw [coeff_mul_order_add_order x y] | ||
| exact mul_ne_zero (leadingCoeff_ne_zero.mpr hx) (leadingCoeff_ne_zero.mpr hy) | ||
| · rw [order_of_ne hx, order_of_ne hy, order_of_ne (mul_ne_zero hx hy), ← Set.IsWF.min_add] | ||
| exact Set.IsWF.min_le_min_of_subset support_mul_subset_add_support | ||
| exact Set.IsWF.min_le_min_of_subset support_mul_subset | ||
|
|
||
| @[simp] | ||
| theorem order_pow {Γ} [AddCommMonoid Γ] [LinearOrder Γ] [IsOrderedCancelAddMonoid Γ] | ||
|
|
@@ -921,7 +924,7 @@ theorem embDomain_mul [NonUnitalNonAssocSemiring R] (f : Γ ↪o Γ') | |
| exact ⟨i, j, h1, rfl⟩ | ||
| · rw [embDomain_notin_range hg, eq_comm] | ||
| contrapose! hg | ||
| obtain ⟨_, hi, _, hj, rfl⟩ := support_mul_subset_add_support ((mem_support _ _).2 hg) | ||
| obtain ⟨_, hi, _, hj, rfl⟩ := support_mul_subset ((mem_support _ _).2 hg) | ||
| obtain ⟨i, _, rfl⟩ := support_embDomain_subset hi | ||
| obtain ⟨j, _, rfl⟩ := support_embDomain_subset hj | ||
| exact ⟨i + j, hf i j⟩ | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.