The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V03. Sets, finite structures and big operators

Mathlib.Data.Finsupp.Weight

38 declarations. Mathlib docs · Source

weights of Finsupp functions

The theory of multivariate polynomials and power series is built on the type σ →₀ ℕ which gives the exponents of the monomials. Many aspects of the theory (degree, order, graded ring structure) require classifying these exponents according to their total sum ∑ i, f i, or variants, and this file provides some API for that.

Weight

We fix a type σ, a semiring R, an R-module M, as well as a function w : σ → M. (The important case is R = ℕ.)

  • Finsupp.weight of a finitely supported function f : σ →₀ R with respect to w: it is the sum ∑ (f i) • (w i). It is an AddMonoidHom map defined using Finsupp.linearCombination.

  • Finsupp.le_weight says that f s ≤ f.weight w when M = ℕ

  • Finsupp.le_weight_of_ne_zero says that w s ≤ f.weight w for IsOrderedAddMonoid M, when f s ≠ 0 and all w i are nonnegative.

  • Finsupp.le_weight_of_ne_zero' is the same statement for CanonicallyOrderedAdd M.

  • NonTorsionWeight: all values w s are nontorsion in M.

  • Finsupp.weight_eq_zero_iff_eq_zero says that f.weight w = 0 iff f = 0 for NonTorsionWeight w and CanonicallyOrderedAddCommMonoid M.

  • For w : σ → ℕ and Finite σ, Finsupp.finite_of_nat_weight_le proves that there are finitely many f : σ →₀ ℕ of bounded weight.

Degree

  • Finsupp.degree f is the sum of all f s, for s ∈ f.support. The present choice is to have it defined as a plain function.

  • Finsupp.degree_eq_zero_iff says that f.degree = 0 iff f = 0.

  • Finsupp.le_degree says that f s ≤ f.degree.

  • Finsupp.degree_eq_weight_one says f.degree = f.weight 1 when R is a semiring. This is useful to access the additivity properties of Finsupp.degree

  • For Finite σ, Finsupp.finite_of_degree_le proves that there are finitely many f : σ →₀ ℕ of bounded degree.

TODO

  • Maybe Finsupp.weight w and Finsupp.degree should have similar types, both AddMonoidHom or both functions.

def Finsupp.weight E1 #

{σ : Type u_1} →
  {M : Type u_2} →
    {R : Type u_3} → [inst : Semiring R] → (σ → M) → [inst_1 : AddCommMonoid M] → [Module R M] → (σ →₀ R) →+ M

The weight of the finitely supported function f : σ →₀ R with respect to w : σ → M is the sum ∑ i, f i • w i.

theorem Finsupp.weight_apply E0 #

∀ {σ : Type u_1} {M : Type u_2} {R : Type u_3} [inst : Semiring R] (w : σ → M) [inst_1 : AddCommMonoid M]
  [inst_2 : Module R M] (f : σ →₀ R), (Finsupp.weight w) f = f.sum fun i c ↦ c • w i

theorem Finsupp.weight_single_index E1 #

∀ {σ : Type u_1} {M : Type u_2} {R : Type u_3} [inst : Semiring R] [inst_1 : AddCommMonoid M] [inst_2 : Module R M]
  [inst_3 : DecidableEq σ] (s : σ) (c : M) (f : σ →₀ R), (Finsupp.weight (Pi.single s c)) f = f s • c

theorem Finsupp.weight_single_one_apply E0 #

∀ {σ : Type u_1} {R : Type u_3} [inst : Semiring R] [inst_1 : DecidableEq σ] (s : σ) (f : σ →₀ R),
  (Finsupp.weight (Pi.single s 1)) f = f s

theorem Finsupp.weight_single E1 #

∀ {σ : Type u_1} {M : Type u_2} {R : Type u_3} [inst : Semiring R] (w : σ → M) [inst_1 : AddCommMonoid M]
  [inst_2 : Module R M] (s : σ) (r : R), ((Finsupp.weight w) fun₀ | s => r) = r • w s

theorem Finsupp.weight_eq_sum E1 #

∀ {σ : Type u_1} {M : Type u_2} {R : Type u_3} [inst : Semiring R] (w : σ → M) [inst_1 : AddCommMonoid M]
  [inst_2 : Module R M] [inst_3 : Fintype σ] (f : σ →₀ R), (Finsupp.weight w) f = ∑ i, f i • w i

class Finsupp.NonTorsionWeight E1 #

{σ : Type u_1} →
  {M : Type u_2} → (R : Type u_3) → [inst : Semiring R] → [inst_1 : AddCommMonoid M] → [Module R M] → (σ → M) → Prop

A weight function is nontorsion if its values are not torsion.

ctor Finsupp.NonTorsionWeight.mk E0 #

∀ {σ : Type u_1} {M : Type u_2} {R : Type u_3} [inst : Semiring R] [inst_1 : AddCommMonoid M] [inst_2 : Module R M]
  {w : σ → M}, (∀ {r : R} {s : σ}, r • w s = 0 → r = 0) → Finsupp.NonTorsionWeight R w

theorem Finsupp.nonTorsionWeight_of E1 #

∀ {σ : Type u_1} {M : Type u_2} (R : Type u_3) [inst : Semiring R] (w : σ → M) [inst_1 : AddCommMonoid M]
  [inst_2 : Module R M] [IsDomain R] [Module.IsTorsionFree R M], (∀ (i : σ), w i ≠ 0) → Finsupp.NonTorsionWeight R w

Without zero divisors, nonzero weight is a NonTorsionWeight

theorem Finsupp.NonTorsionWeight.ne_zero E1 #

∀ {σ : Type u_1} {M : Type u_2} (R : Type u_3) [inst : Semiring R] (w : σ → M) [inst_1 : AddCommMonoid M]
  [inst_2 : Module R M] [Nontrivial R] [Finsupp.NonTorsionWeight R w] (s : σ), w s ≠ 0

theorem Finsupp.weight_sub_single_add E1 #

∀ {σ : Type u_1} {M : Type u_2} {w : σ → M} [inst : AddCommMonoid M] {f : σ →₀ ℕ} {i : σ},
  f i ≠ 0 → (Finsupp.weight w) (f - fun₀ | i => 1) + w i = (Finsupp.weight w) f

theorem Finsupp.le_weight E1 #

∀ {σ : Type u_1} (w : σ → ℕ) {s : σ}, w s ≠ 0 → ∀ (f : σ →₀ ℕ), f s ≤ (Finsupp.weight w) f

theorem Finsupp.le_weight_of_ne_zero E1 #

∀ {σ : Type u_1} {M : Type u_2} [inst : AddCommMonoid M] [inst_1 : PartialOrder M] [IsOrderedAddMonoid M] {w : σ → M},
  (∀ (s : σ), 0 ≤ w s) → ∀ {s : σ} {f : σ →₀ ℕ}, f s ≠ 0 → w s ≤ (Finsupp.weight w) f

theorem Finsupp.le_weight_of_ne_zero' E1 #

∀ {σ : Type u_1} {M : Type u_4} [inst : AddCommMonoid M] [inst_1 : PartialOrder M] [IsOrderedAddMonoid M]
  [CanonicallyOrderedAdd M] (w : σ → M) {s : σ} {f : σ →₀ ℕ}, f s ≠ 0 → w s ≤ (Finsupp.weight w) f

theorem Finsupp.weight_eq_zero_iff_eq_zero E1 #

∀ {σ : Type u_1} {M : Type u_4} [inst : AddCommMonoid M] [inst_1 : PartialOrder M] [IsOrderedAddMonoid M]
  [CanonicallyOrderedAdd M] (w : σ → M) [Finsupp.NonTorsionWeight ℕ w] {f : σ →₀ ℕ}, (Finsupp.weight w) f = 0 ↔ f = 0

If M is a CanonicallyOrderedAddCommMonoid, then weight f is zero iff f = 0.

theorem Finsupp.finite_of_nat_weight_le E1 #

∀ {σ : Type u_1} [Finite σ] (w : σ → ℕ), (∀ (x : σ), w x ≠ 0) → ∀ (n : ℕ), {d | (Finsupp.weight w) d ≤ n}.Finite

theorem Finsupp.finite_of_nat_weight_lt E1 #

∀ {σ : Type u_1} [Finite σ] (w : σ → ℕ), (∀ (x : σ), w x ≠ 0) → ∀ (n : ℕ), {d | (Finsupp.weight w) d < n}.Finite

theorem Finsupp.finite_of_nat_weight_eq E0 #

∀ {σ : Type u_1} [Finite σ] (w : σ → ℕ), (∀ (x : σ), w x ≠ 0) → ∀ (n : ℕ), {d | (Finsupp.weight w) d = n}.Finite

def Finsupp.degree E1 #

{σ : Type u_1} → {R : Type u_4} → [inst : AddCommMonoid R] → (σ →₀ R) →+ R

The degree of a finsupp function.

theorem Finsupp.degree_apply E0 #

∀ {σ : Type u_1} {R : Type u_4} [inst : AddCommMonoid R] (d : σ →₀ R), Finsupp.degree d = ∑ i ∈ d.support, d i

theorem Finsupp.degree_eq_sum E1 #

∀ {σ : Type u_1} {R : Type u_4} [inst : AddCommMonoid R] [inst_1 : Fintype σ] (f : σ →₀ R), Finsupp.degree f = ∑ i, f i

theorem Finsupp.degree_single E0 #

∀ {σ : Type u_1} {R : Type u_4} [inst : AddCommMonoid R] (a : σ) (r : R), (Finsupp.degree fun₀ | a => r) = r

theorem Finsupp.degree_eq_zero_iff E0 #

∀ {σ : Type u_1} {R : Type u_5} [inst : AddCommMonoid R] [inst_1 : PartialOrder R] [CanonicallyOrderedAdd R]
  (d : σ →₀ R), Finsupp.degree d = 0 ↔ d = 0

theorem Finsupp.le_degree E1 #

∀ {σ : Type u_1} {R : Type u_5} [inst : AddCommMonoid R] [inst_1 : PartialOrder R] [CanonicallyOrderedAdd R] (s : σ)
  (f : σ →₀ R), f s ≤ Finsupp.degree f

theorem Finsupp.degree_eq_weight_one E1 #

∀ {σ : Type u_1} {R : Type u_5} [inst : Semiring R], Finsupp.degree = Finsupp.weight fun x ↦ 1

theorem Finsupp.finite_of_degree_le E1 #

∀ {σ : Type u_1} [Finite σ] (n : ℕ), {f | Finsupp.degree f ≤ n}.Finite

theorem Finsupp.finite_of_degree_lt E1 #

∀ {σ : Type u_1} [Finite σ] (n : ℕ), {f | Finsupp.degree f < n}.Finite

theorem Finsupp.finite_of_degree_eq E0 #

∀ {σ : Type u_1} [Finite σ] (n : ℕ), {f | Finsupp.degree f = n}.Finite

theorem Finsupp.range_single_one E1 #

∀ {σ : Type u_1}, (Set.range fun a ↦ fun₀ | a => 1) = {d | Finsupp.degree d = 1}

theorem Finsupp.degree_mapDomain E0 #

∀ {σ : Type u_1} {M : Type u_2} {τ : Type u_5} (f : σ → τ) [inst : AddCommMonoid M] (x : σ →₀ M),
  Finsupp.degree (Finsupp.mapDomain f x) = Finsupp.degree x

theorem Finsupp.degree_comapDomain_le_of_canonicallyOrderedAdd E1 #

∀ {σ : Type u_1} {M : Type u_2} {τ : Type u_5} {f : σ → τ} [inst : AddCommMonoid M] [inst_1 : PartialOrder M]
  [CanonicallyOrderedAdd M] {x : τ →₀ M} (hf : Set.InjOn f (f ⁻¹' ↑x.support)),
  Finsupp.degree (Finsupp.comapDomain f x hf) ≤ Finsupp.degree x

theorem Finsupp.degree_mono E1 #

∀ {σ : Type u_1} {R : Type u_5} [inst : AddCommMonoid R] [inst_1 : PartialOrder R] [CanonicallyOrderedAdd R],
  Monotone ⇑Finsupp.degree

theorem Finsupp.degree_strictMono E1 #

∀ {σ : Type u_1} {R : Type u_5} [inst : AddCommMonoid R] [inst_1 : PartialOrder R] [CanonicallyOrderedAdd R]
  [IsOrderedCancelAddMonoid R], StrictMono ⇑Finsupp.degree

theorem Finsupp.exists_le_degree_eq E0 #

∀ {σ : Type u_5} (f : σ →₀ ℕ), ∀ n ≤ Finsupp.degree f, ∃ g ≤ f, Finsupp.degree g = n

theorem Finsupp.degree_preimage_add E1 #

∀ {σ : Type u_5} (s t : Set ℕ), ⇑Finsupp.degree ⁻¹' (s + t) = ⇑Finsupp.degree ⁻¹' s + ⇑Finsupp.degree ⁻¹' t

theorem Finsupp.degree_preimage_nsmul E1 #

∀ {σ : Type u_5} (s : Set ℕ) (n : ℕ), n ≠ 0 → ⇑Finsupp.degree ⁻¹' (n • s) = n • ⇑Finsupp.degree ⁻¹' s

theorem Finsupp.nsmul_single_one_image E1 #

∀ {α : Type u_5} {n : ℕ} {s : Set α}, n • (fun x ↦ fun₀ | x => 1) '' s = {x | Finsupp.degree x = n ∧ ↑x.support ⊆ s}

theorem Finsupp.image_pow_eq_finsuppProd_image E1 #

∀ {α : Type u_5} {β : Type u_6} [inst : CommMonoid β] {f : α → β} {n : ℕ} {s : Set α},
  (f '' s) ^ n = (fun x ↦ x.prod fun x1 x2 ↦ f x1 ^ x2) '' {x | Finsupp.degree x = n ∧ ↑x.support ⊆ s}