Skip to content

Commit afafe9f

Browse files
feat(MvPowerSeries.Order): order of multivariate power series (#14983)
Co-authored-by: mariainesdff <mariaines.dff@gmail.com>
1 parent 58cfc0e commit afafe9f

File tree

5 files changed

+548
-4
lines changed

5 files changed

+548
-4
lines changed

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4266,6 +4266,7 @@ import Mathlib.RingTheory.MvPowerSeries.Basic
42664266
import Mathlib.RingTheory.MvPowerSeries.Inverse
42674267
import Mathlib.RingTheory.MvPowerSeries.LexOrder
42684268
import Mathlib.RingTheory.MvPowerSeries.NoZeroDivisors
4269+
import Mathlib.RingTheory.MvPowerSeries.Order
42694270
import Mathlib.RingTheory.MvPowerSeries.Trunc
42704271
import Mathlib.RingTheory.Nakayama
42714272
import Mathlib.RingTheory.Nilpotent.Basic

Mathlib/Data/Finsupp/Weight.lean

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ Copyright (c) 2024 Antoine Chambert-Loir, María Inés de Frutos-Fernández. All
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Antoine Chambert-Loir, María Inés de Frutos-Fernández
55
-/
6+
import Mathlib.Algebra.Order.BigOperators.Group.Finset
67
import Mathlib.Algebra.Order.Module.Defs
8+
import Mathlib.Data.Finsupp.Antidiagonal
79
import Mathlib.LinearAlgebra.Finsupp
810

911
/-! # weights of Finsupp functions
@@ -34,6 +36,9 @@ for `OrderedAddCommMonoid M`, when `f s ≠ 0` and all `w i` are nonnegative.
3436
- `Finsupp.weight_eq_zero_iff_eq_zero` says that `f.weight w = 0` iff
3537
`f = 0` for `NonTorsion Weight w` and `CanonicallyOrderedAddCommMonoid M`.
3638
39+
- For `w : σ → ℕ` and `Finite σ`, `Finsupp.finite_of_nat_weight_le` proves that
40+
there are finitely many `f : σ →₀ ℕ` of bounded weight.
41+
3742
## Degree
3843
3944
- `Finsupp.degree`: the weight when all components of `w` are equal to `1 : ℕ`.
@@ -46,6 +51,10 @@ The present choice is to have it defined as a plain function.
4651
- `Finsupp.degree_eq_weight_one` says `f.degree = f.weight 1`.
4752
This is useful to access the additivity properties of `Finsupp.degree`
4853
54+
- For `Finite σ`, `Finsupp.finite_of_degree_le` proves that
55+
there are finitely many `f : σ →₀ ℕ` of bounded degree.
56+
57+
4958
5059
## TODO
5160
@@ -159,6 +168,25 @@ theorem weight_eq_zero_iff_eq_zero
159168
· intro h
160169
rw [h, map_zero]
161170

171+
theorem finite_of_nat_weight_le [Finite σ] (w : σ → ℕ) (hw : ∀ x, w x ≠ 0) (n : ℕ) :
172+
{d : σ →₀ ℕ | weight w d ≤ n}.Finite := by
173+
classical
174+
set fg := Finset.antidiagonal (Finsupp.equivFunOnFinite.symm (Function.const σ n)) with hfg
175+
suffices {d : σ →₀ ℕ | weight w d ≤ n} ⊆ ↑(fg.image fun uv => uv.fst) by
176+
exact Set.Finite.subset (Finset.finite_toSet _) this
177+
intro d hd
178+
rw [hfg]
179+
simp only [Finset.coe_image, Set.mem_image, Finset.mem_coe,
180+
Finset.mem_antidiagonal, Prod.exists, exists_and_right, exists_eq_right]
181+
use Finsupp.equivFunOnFinite.symm (Function.const σ n) - d
182+
ext x
183+
simp only [Finsupp.coe_add, Finsupp.coe_tsub, Pi.add_apply, Pi.sub_apply,
184+
Finsupp.equivFunOnFinite_symm_apply_toFun, Function.const_apply]
185+
rw [add_comm]
186+
apply Nat.sub_add_cancel
187+
apply le_trans (le_weight w (hw x) d)
188+
simpa only [Set.mem_setOf_eq] using hd
189+
162190
end CanonicallyOrderedAddCommMonoid
163191

164192
/-- The degree of a finsupp function. -/
@@ -190,4 +218,11 @@ theorem le_degree (s : σ) (f : σ →₀ ℕ) : f s ≤ degree f := by
190218
apply le_weight
191219
simp only [Pi.one_apply, ne_eq, one_ne_zero, not_false_eq_true]
192220

221+
theorem finite_of_degree_le [Finite σ] (n : ℕ) :
222+
{f : σ →₀ ℕ | degree f ≤ n}.Finite := by
223+
simp_rw [degree_eq_weight_one]
224+
refine finite_of_nat_weight_le (Function.const σ 1) ?_ n
225+
intro _
226+
simp only [Function.const_apply, ne_eq, one_ne_zero, not_false_eq_true]
227+
193228
end Finsupp

Mathlib/RingTheory/MvPowerSeries/Basic.lean

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,9 @@ def monomial (n : σ →₀ ℕ) : R →ₗ[R] MvPowerSeries σ R :=
134134
def coeff (n : σ →₀ ℕ) : MvPowerSeries σ R →ₗ[R] R :=
135135
LinearMap.proj n
136136

137+
theorem coeff_apply (f : MvPowerSeries σ R) (d : σ →₀ ℕ) : coeff R d f = f d :=
138+
rfl
139+
137140
variable {R}
138141

139142
/-- Two multivariate formal power series are equal if all their coefficients are equal. -/
@@ -181,6 +184,14 @@ theorem coeff_comp_monomial (n : σ →₀ ℕ) : (coeff R n).comp (monomial R n
181184
theorem coeff_zero (n : σ →₀ ℕ) : coeff R n (0 : MvPowerSeries σ R) = 0 :=
182185
rfl
183186

187+
theorem eq_zero_iff_forall_coeff_zero {f : MvPowerSeries σ R} :
188+
f = 0 ↔ (∀ d : σ →₀ ℕ, coeff R d f = 0) :=
189+
MvPowerSeries.ext_iff
190+
191+
theorem ne_zero_iff_exists_coeff_ne_zero (f : MvPowerSeries σ R) :
192+
f ≠ 0 ↔ (∃ d : σ →₀ ℕ, coeff R d f ≠ 0) := by
193+
simp only [MvPowerSeries.ext_iff, ne_eq, coeff_zero, not_forall]
194+
184195
variable (m n : σ →₀ ℕ) (φ ψ : MvPowerSeries σ R)
185196

186197
instance : One (MvPowerSeries σ R) :=

0 commit comments

Comments
 (0)