@@ -3,7 +3,9 @@ Copyright (c) 2024 Antoine Chambert-Loir, María Inés de Frutos-Fernández. All
3
3
Released under Apache 2.0 license as described in the file LICENSE.
4
4
Authors: Antoine Chambert-Loir, María Inés de Frutos-Fernández
5
5
-/
6
+ import Mathlib.Algebra.Order.BigOperators.Group.Finset
6
7
import Mathlib.Algebra.Order.Module.Defs
8
+ import Mathlib.Data.Finsupp.Antidiagonal
7
9
import Mathlib.LinearAlgebra.Finsupp
8
10
9
11
/-! # weights of Finsupp functions
@@ -34,6 +36,9 @@ for `OrderedAddCommMonoid M`, when `f s ≠ 0` and all `w i` are nonnegative.
34
36
- `Finsupp.weight_eq_zero_iff_eq_zero` says that `f.weight w = 0` iff
35
37
`f = 0` for `NonTorsion Weight w` and `CanonicallyOrderedAddCommMonoid M`.
36
38
39
+ - For `w : σ → ℕ` and `Finite σ`, `Finsupp.finite_of_nat_weight_le` proves that
40
+ there are finitely many `f : σ →₀ ℕ` of bounded weight.
41
+
37
42
## Degree
38
43
39
44
- `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.
46
51
- `Finsupp.degree_eq_weight_one` says `f.degree = f.weight 1`.
47
52
This is useful to access the additivity properties of `Finsupp.degree`
48
53
54
+ - For `Finite σ`, `Finsupp.finite_of_degree_le` proves that
55
+ there are finitely many `f : σ →₀ ℕ` of bounded degree.
56
+
57
+
49
58
50
59
## TODO
51
60
@@ -159,6 +168,25 @@ theorem weight_eq_zero_iff_eq_zero
159
168
· intro h
160
169
rw [h, map_zero]
161
170
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
+
162
190
end CanonicallyOrderedAddCommMonoid
163
191
164
192
/-- The degree of a finsupp function. -/
@@ -190,4 +218,11 @@ theorem le_degree (s : σ) (f : σ →₀ ℕ) : f s ≤ degree f := by
190
218
apply le_weight
191
219
simp only [Pi.one_apply, ne_eq, one_ne_zero, not_false_eq_true]
192
220
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
+
193
228
end Finsupp
0 commit comments