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.

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
    def Finsupp.antidiagonal {α : Type u} [DecidableEq α] (f : α →₀ ℕ) :

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

    Equations
    Instances For
      @[simp]
      theorem Finsupp.mem_antidiagonal {α : Type u} [DecidableEq α] {f : α →₀ ℕ} {p : (α →₀ ℕ) × (α →₀ ℕ)} :
      theorem Finsupp.antidiagonal_filter_fst_eq {α : Type u} [DecidableEq α] (f : α →₀ ℕ) (g : α →₀ ℕ) [D : (p : (α →₀ ℕ) × (α →₀ ℕ)) → Decidable (p.1 = g)] :
      Finset.filter (fun p => p.1 = g) (Finsupp.antidiagonal f) = if g ≤ f then {(g, f - g)} else ∅
      theorem Finsupp.antidiagonal_filter_snd_eq {α : Type u} [DecidableEq α] (f : α →₀ ℕ) (g : α →₀ ℕ) [D : (p : (α →₀ ℕ) × (α →₀ ℕ)) → Decidable (p.2 = g)] :
      Finset.filter (fun p => p.2 = g) (Finsupp.antidiagonal f) = if g ≤ f then {(f - g, g)} else ∅
      @[simp]
      theorem Finsupp.sum_antidiagonal_swap {α : Type u} [DecidableEq α] {M : Type u_1} [AddCommMonoid M] (n : α →₀ ℕ) (f : (α →₀ ℕ) → (α →₀ ℕ) → M) :
      (Finset.sum (Finsupp.antidiagonal n) fun p => f p.1 p.2) = Finset.sum (Finsupp.antidiagonal n) fun p => f p.2 p.1
      theorem Finsupp.prod_antidiagonal_swap {α : Type u} [DecidableEq α] {M : Type u_1} [CommMonoid M] (n : α →₀ ℕ) (f : (α →₀ ℕ) → (α →₀ ℕ) → M) :
      (Finset.prod (Finsupp.antidiagonal n) fun p => f p.1 p.2) = Finset.prod (Finsupp.antidiagonal n) fun p => f p.2 p.1
      @[simp]