More Subtractive Methods #
This file formalizes Section sec.cancel.moresub on more subtractive methods
in combinatorics, focusing on the technique of summing with varying signs to
achieve cancellation.
Main definitions #
IsAllEven: An n-tuplex : Fin n → Fin dis "all-even" if each element ofFin doccurs an even number of times in the tuple.signProduct: The producte_{x_1} * e_{x_2} * ... * e_{x_n}for a sign tupleeand index tuplex.signSum: The sum of entries of a sign tuple, as an integer.allEvenTuples: The set of all-even tuples in(Fin n → Fin d).signTupleEquivSubset: Equivalence between sign tuples and subsets of[d].
Main results #
sum_signSum_pow_eq_sum_signProduct: Sum interchange identity (Lemmalem.cancel.all-even.l1).sum_signProduct_not_allEven: If an n-tuple is not all-even, then the sum∑_{e ∈ {1,-1}^d} ∏_i e_{x_i}equals 0 (Lemmalem.cancel.all-even.l2(a)).sum_signProduct_allEven: If an n-tuple is all-even, then the sum∑_{e ∈ {1,-1}^d} ∏_i e_{x_i}equals 2^d (Lemmalem.cancel.all-even.l2(b)).allEven_count_formula: The number of all-even n-tuples in[d]^nequals(1/2^d) ∑_{k=0}^d C(d,k) (d-2k)^n(Theoremthm.cancel.all-even).sum_choose_pow_dvd_pow_two: The sum∑_{k=0}^d C(d,k) (d-2k)^nis divisible by2^d.sum_choose_pow_nonneg: The sum∑_{k=0}^d C(d,k) (d-2k)^nis nonnegative.
References #
- Source:
AlgebraicCombinatorics/tex/SignedCounting/SubtractiveMethods.tex
The all-even property #
An n-tuple (x₁, x₂, ..., xₙ) ∈ [d]ⁿ is called "all-even" if each element
of [d] occurs an even number of times in the tuple.
A tuple is all-even iff all multiplicities are even
Sign tuples #
We represent sign tuples as functions e : Fin d → ZMod 2, where
0 represents +1 and 1 represents -1. This gives us a natural
finite type structure. We then convert to ℤ when needed.
Convert a ZMod 2 value to a sign: 0 ↦ 1, 1 ↦ -1
Instances For
Helper lemmas about toSign and powers #
Lemma lem.cancel.all-even.l1: Sum interchange #
This lemma establishes that:
∑_{e ∈ {1,-1}^d} (e_1 + e_2 + ... + e_d)^n =
∑_{x ∈ [d]^n} ∑_{e ∈ {1,-1}^d} e_{x_1} * e_{x_2} * ... * e_{x_n}
The sum of entries of a sign tuple, as an integer
Equations
Instances For
Sum interchange identity (Lemma lem.cancel.all-even.l1):
The sum over sign tuples of (∑_k e_k)^n equals the double sum
over index tuples and sign tuples of the sign product.
This follows from expanding (∑_k e_k)^n using the distributive law.
Label: Lemma lem.cancel.all-even.l1
Lemma lem.cancel.all-even.l2: Computing the inner sums #
Part (a): If the tuple is not all-even, the sum of sign products is 0. Part (b): If the tuple is all-even, the sum of sign products is 2^d.
The involution for cancellation #
We define an involution on sign tuples that flips the sign at position k.
This is used to show cancellation when the tuple has odd multiplicity at k.
The involution that flips the k-th sign: if e_k = +1, make it -1, and vice versa
Equations
- AlgebraicCombinatorics.SubtractiveMethods.flipSign k e = Function.update e k (e k + 1)
Instances For
flipSign is an involution
Key lemma: flipping sign k negates the sign product when k has odd multiplicity
If an n-tuple is not all-even, then the sum over all sign tuples
of the sign product is zero (Lemma lem.cancel.all-even.l2(a)).
The proof uses an involution argument: if some element k has odd
multiplicity, flipping the sign of e_k negates the product, so
terms cancel in pairs.
Label: Lemma lem.cancel.all-even.l2(a)
If an n-tuple is all-even, then the sum over all sign tuples
of the sign product equals 2^d (Lemma lem.cancel.all-even.l2(b)).
The proof: when all multiplicities are even, each e_k^{m_k} = 1
(since (±1)^{even} = 1), so every sign product equals 1, and
there are 2^d sign tuples.
Label: Lemma lem.cancel.all-even.l2(b)
Theorem thm.cancel.all-even: The counting formula #
The number of all-even n-tuples in [d]^n equals
(1/2^d) ∑_{k=0}^d C(d,k) (d-2k)^n.
Bijection between sign tuples and subsets of [d]:
A sign tuple (e_1, ..., e_d) ∈ {1,-1}^d corresponds to the set
{i ∈ [d] | e_i = -1} of positions with -1.
Equations
- AlgebraicCombinatorics.SubtractiveMethods.signTupleToSubset e = {k : Fin d | e k = 1}
Instances For
Bijection between sign tuples and subsets #
Inverse of signTupleToSubset: given a subset S, produce the sign tuple where position k has value 1 (representing -1) iff k ∈ S
Instances For
Compute the double sum using lemma l2
The main counting formula (Theorem thm.cancel.all-even):
The number of all-even n-tuples in (Fin n → Fin d) equals
(1/2^d) ∑_{k=0}^d C(d,k) (d-2k)^n.
This formula implies that ∑_{k=0}^d C(d,k) (d-2k)^n is nonnegative
and divisible by 2^d, which is not obvious from the formula itself
due to the alternating signs when n is odd.
Label: Theorem thm.cancel.all-even