Documentation

Mathlib.Algebra.Order.Antidiag.Pi

Antidiagonal of functions as finsets #

This file provides the finset of functions summing to a specific value on a finset. Such finsets should be thought of as the "antidiagonals" in the space of functions.

TODO #

Finset.finAntidiagonal is strictly more general than Finset.Nat.antidiagonalTuple. Deduplicate.

Fin d → μ #

In this section, we define the antidiagonals in Fin d → μ by recursion on d. Note that this is computationally efficient, although probably not as efficient as Finset.Nat.antidiagonalTuple.

def Finset.finAntidiagonal {μ : Type u_2} [AddCommMonoid μ] [Finset.HasAntidiagonal μ] [DecidableEq μ] (d : ) (n : μ) :
Finset (Fin dμ)

finAntidiagonal d n is the type of d-tuples with sum n.

TODO: deduplicate with the less general Finset.Nat.antidiagonalTuple.

Equations
Instances For
    def Finset.finAntidiagonal.aux {μ : Type u_2} [AddCommMonoid μ] [Finset.HasAntidiagonal μ] [DecidableEq μ] (d : ) (n : μ) :
    { s : Finset (Fin dμ) // ∀ (f : Fin dμ), f s i : Fin d, f i = n }

    Auxiliary construction for finAntidiagonal that bundles a proof of lawfulness (mem_finAntidiagonal), as this is needed to invoke disjiUnion. Using Finset.disjiUnion makes this computationally much more efficient than using Finset.biUnion.

    Equations
    Instances For
      @[simp]
      theorem Finset.mem_finAntidiagonal {μ : Type u_2} [AddCommMonoid μ] [Finset.HasAntidiagonal μ] [DecidableEq μ] {n : μ} {d : } {f : Fin dμ} :
      f Finset.finAntidiagonal d n i : Fin d, f i = n