Partial HasAntidiagonal for functions with finite support #
For an AddCommMonoid
μ
,
Finset.HasAntidiagonal μ
provides a function antidiagonal : μ → Finset (μ × μ)
which maps n : μ
to a Finset
of pairs (a, b)
such that a + b = n
.
In this file, we provide an analogous definition for ι →₀ μ
,
with an explicit finiteness condition on the support,
assuming AddCommMonoid μ
, HasAntidiagonal μ
,
For computability reasons, we also need DecidableEq ι
and DecidableEq μ
.
This Finset could be viewed inside ι → μ
,
but the Finsupp
condition provides a natural DecidableEq
instance.
Main definitions #
Finset.finsuppAntidiag s n
is the finite set of all functionsf : ι →₀ μ
with finite support contained ins
and such that the sum of its values equalsn : μ
That condition is expressed byFinset.mem_finsuppAntidiag
Finset.mem_finsuppAntidiag'
rewrites theFinsupp.sum
condition as aFinset.sum
.
finAntidiagonal₀ d n
is the type of d-tuples with sum n
Equations
- One or more equations did not get rendered due to their size.
Instances For
The Finset of functions ι →₀ μ
with support contained in s
and sum n
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A function belongs to finsuppAntidiag s n
iff its support is contained in s
and the sum of its components is equal to n