Counting pairs in Multiset.antidiagonal #
Multiset.antidiagonal w enumerates the ordered splits w = p.1 + p.2 with
multiplicities; this file computes those multiplicities: (u, v) occurs
∏ x, (w.count x).choose (v.count x) times when u + v = w, and 0 times otherwise.
Main results #
Multiset.antidiagonal_add:(F + G).antidiagonalas a bind/map product of the summands' antidiagonals — the+analogue ofMultiset.antidiagonal_cons.Multiset.powerset_partition_swap: a partition sum overC.powersetis invariant under the involutionC₁ ↦ C - C₁.Multiset.count_antidiagonal: the closed form for(antidiagonal w).count (u, v).Multiset.count_antidiagonal_eq_count_powerset: the guard-free bridge toMultiset.count_powerset_of_le.Multiset.count_antidiagonal_swap: the multiplicity is symmetric in the two slots.
[UPSTREAM] candidate; eventual mathlib home Mathlib.Data.Multiset.Antidiagonal, where
the closed form also evaluates Finsupp.antidiagonal'.
antidiagonal is invariant under Prod.swap: commutativity of + permutes the
ordered splits.
The antidiagonal of a sum decomposes as the bind/map product of the summands'
antidiagonals: transport of powerset_add through
antidiagonal_eq_map_powerset, closed by
(F + G) - (F₁ + G₁) = (F - F₁) + (G - G₁) for F₁ ≤ F, G₁ ≤ G. The + analogue
of antidiagonal_cons.
Reindex a partition-sum over C.powerset by the involution C₁ ↦ C - C₁: summing
f C₁ (C - C₁) equals summing f (C - C₁) C₁. Specialisation of
antidiagonal_swap to the (C₁, C - C₁) parametrisation.
The multiplicity of (s, t) in antidiagonal (s + t) is the number of ways to
select the sub-multiset t from s + t.
Closed form for the multiplicities of Multiset.antidiagonal: an ordered split
(u, v) of w occurs ∏ x, (w.count x).choose (v.count x) times.
The antidiagonal multiplicity is symmetric in the two slots.