Documentation

Mathlib.Data.Finsupp.Antidiagonal

The Finsupp counterpart of Multiset.antidiagonal. #

The antidiagonal of s : α →₀ ℕ consists of all pairs (t₁, t₂) : (α →₀ ℕ) × (α →₀ ℕ) such that t₁ + t₂ = s.

noncomputable def Finsupp.antidiagonal' {α : Type u} [DecidableEq α] (f : α →₀ ℕ) :

The Finsupp counterpart of Multiset.antidiagonal: the antidiagonal of s : α →₀ ℕ consists of all pairs (t₁, t₂) : (α →₀ ℕ) × (α →₀ ℕ) such that t₁ + t₂ = s. The finitely supported function antidiagonal s is equal to the multiplicities of these pairs.

Equations
Instances For
    @[instance_reducible]

    The antidiagonal of s : α →₀ ℕ is the finset of all pairs (t₁, t₂) : (α →₀ ℕ) × (α →₀ ℕ) such that t₁ + t₂ = s.

    Equations
    theorem Finsupp.prod_antidiagonal_swap {α : Type u} [DecidableEq α] {M : Type u_1} [CommMonoid M] (n : α →₀ ℕ) (f : (α →₀ ℕ) → (α →₀ ℕ) → M) :
    ∏ p ∈ Finset.antidiagonal n, f p.1 p.2 = ∏ p ∈ Finset.antidiagonal n, f p.2 p.1
    theorem Finsupp.sum_antidiagonal_swap {α : Type u} [DecidableEq α] {M : Type u_1} [AddCommMonoid M] (n : α →₀ ℕ) (f : (α →₀ ℕ) → (α →₀ ℕ) → M) :
    ∑ p ∈ Finset.antidiagonal n, f p.1 p.2 = ∑ p ∈ Finset.antidiagonal n, f p.2 p.1
    @[simp]
    theorem Finsupp.antidiagonal_single {α : Type u} [DecidableEq α] (a : α) (n : ℕ) :
    Finset.antidiagonal (single a n) = Finset.map ({ toFun := single a, inj' := ⋯ }.prodMap { toFun := single a, inj' := ⋯ }) (Finset.antidiagonal n)
    theorem Finsupp.image_sumElim_product_antidiagonal {α : Type u} [DecidableEq α] {β : Type u_1} [DecidableEq β] {x : α →₀ ℕ} {y : β →₀ ℕ} :
    Finset.image (fun (x : ((α →₀ ℕ) × (α →₀ ℕ)) × (β →₀ ℕ) × (β →₀ ℕ)) => match x with | ((x, y), z, w) => (x.sumElim z, y.sumElim w)) (Finset.antidiagonal x ×ˢ Finset.antidiagonal y) = Finset.antidiagonal (x.sumElim y)