Product Rules (Generalized Distributive Laws) for Infinite Products #
This file formalizes the product rules for expanding products of sums, both finite and infinite, following the treatment in the AlgebraicCombinatorics book.
Main definitions #
EssentiallyFinite: A family(k_i)_{i ∈ I}is essentially finite if all but finitely manyi ∈ Isatisfyk_i = 0. This is used to describe which terms appear when expanding infinite products of sums.
Main results #
Finite Product Rules #
prod_sum_eq_sum_prod_finset: (Proposition prop.fps.prodrule-fin-fin) A finite product of finite sums equals a sum over the Cartesian product of the index sets.prod_tsum_eq_tsum_prod_finset: (Proposition prop.fps.prodrule-fin-inf) A finite product of infinite summable families equals a sum over the Cartesian product.
Infinite Product Rules #
tprod_tsum_eq_tsum_prod_essentiallyFinite_nat: (Proposition prop.fps.prodrule-inf-infN) An infinite product of sums (indexed by positive integers) equals a sum over essentially finite sequences.tprod_tsum_eq_tsum_prod_essentiallyFinite: (Proposition prop.fps.prodrule-inf-inf) General version with arbitrary index setI.
Applications #
euler_odd_parts_identity: (Proposition prop.gf.prod.euler-odd) Euler's identity:∏_{i>0} (1 - x^{2i-1})⁻¹ = ∏_{k>0} (1 + x^k)euler_distinct_odd_partitions: (Theorem thm.gf.prod.euler-comb) The number of partitions ofninto distinct parts equals the number of partitions into odd parts.
Substitution #
tprod_rescale_substitution: (Proposition prop.fps.subs.rule-infprod) Infinite products commute with rescaling (a special case of substitution).
Exp/Log #
The source material includes Propositions prop.fps.Exp-Log-infsum and prop.fps.Exp-Log-infprod
relating infinite sums/products via Exp and Log maps. The canonical definitions for FPS with
constant term 0 or 1 (PowerSeries₀ and PowerSeries₁) are in FPS/ExpLog.lean.
References #
- AlgebraicCombinatorics book, Section on Infinite Products (InfiniteProducts2.tex)
Essentially Finite Families #
A family (k_i)_{i ∈ I} is essentially finite if all but finitely many i ∈ I satisfy k_i = 0.
This notion is crucial for stating product rules for infinite products.
A family f : I → M is essentially finite if all but finitely many values are zero.
This is equivalent to f having finite support.
(Definition def.fps.prodrule.ess-fin)
Canonical definition: This is the canonical, most general definition of EssentiallyFinite.
It is definitionally equal to:
AlgebraicCombinatorics.FPS.EssentiallyFiniteinFPSDefinition.leanPowerSeries.EssentiallyFiniteinDetails/InfiniteProducts2.lean
All use {i | f i ≠ 0}.Finite which equals (Function.support f).Finite by definition.
This version has the richest API in the EssentiallyFinite namespace.
Equations
Instances For
A sequence (k₁, k₂, k₃, ...) of natural numbers is essentially finite if all but
finitely many terms are zero.
Equations
Instances For
The set of essentially finite functions from I to M.
Equations
- EssentiallyFiniteFamily I M = { f : I → M // EssentiallyFinite f }
Instances For
Basic Properties #
The zero function is essentially finite.
An essentially finite function has finite support.
A function with finite domain is essentially finite.
A function indexed by a Fintype is essentially finite.
A subfamily of an essentially finite family is essentially finite.
The constant function with value zero is essentially finite.
Characterization via Filter.cofinite #
EssentiallyFinite f is equivalent to f i = 0 holding eventually in the cofinite filter.
This is the key connection to the formulation used in the main theorems.
Alternative characterization: the support is finite.
Operations on Essentially Finite Families #
The negation of an essentially finite family is essentially finite.
The sum of two essentially finite families is essentially finite.
The difference of two essentially finite families is essentially finite.
Multiplication of an essentially finite family by a scalar is essentially finite.
Multiplication of a scalar by an essentially finite family is essentially finite.
Finset and Finsupp Operations #
Convert an essentially finite family to a Finsupp.
Equations
- hf.toFinsupp = Finsupp.ofSupportFinite f hf
Instances For
The support of an essentially finite family as a Finset.
Equations
Instances For
Examples #
Essentially Finite Subtype #
The type of essentially finite functions, used in the main product rule theorems.
The underlying function of an essentially finite family.
Instances For
Equations
- EssentiallyFiniteFamily.instCoeFunForall = { coe := fun (f : EssentiallyFiniteFamily I M) => ↑f }
The zero essentially finite family.
Equations
Instances For
Equations
An essentially finite family satisfies the cofinite condition.
The support of an essentially finite family is finite.
Finite Product Rules #
These are the basic distributive laws for products of sums.
Finite Product Rule for Finite Sums (Proposition prop.fps.prodrule-fin-fin)
A product of sums can be expanded into a sum over the Cartesian product:
∏_{i=1}^n (∑_{k=1}^{m_i} p_{i,k}) = ∑_{(k₁,...,k_n) ∈ [m₁]×...×[m_n]} ∏_{i=1}^n p_{i,k_i}
This is the generalized distributive law.
Finite Product Rule for Finite Sums (general index set version)
Same as above but with an arbitrary finite index set N.
Finite Products of Infinite Sums #
Product rules for finite products of infinite (but summable) families.
Helper lemma: The coefficient of a product is zero if one factor has all low coefficients zero. This is used in the proof of summability for product families.
Summability of finite product families (discrete case)
For discrete K, the family f ↦ ∏ i, p i (f i) is summable when each p i is summable.
This is the key technical lemma for prod_tsum_eq_tsum_prod_finset.
Proof strategy: For each coefficient d, only finitely many f contribute:
- Define
T i= union of supports ofcoeff m ∘ (p i)form ≤ d - Each
T iis finite (by discrete summability) - The set
{f | ∀ i, f i ∈ T i}is finite (product of finite sets) - If
f i ∉ T ifor somei, thencoeff d (∏ j, p j (f j)) = 0
This proves that the support of f ↦ coeff d (∏ i, p i (f i)) is finite.
Product of two summable families in K⟦X⟧ is summable (discrete case).
This is used in the proof of prod_tsum_eq_tsum_prod_finset_discrete.
Finite Product Rule for Infinite Sums (Proposition prop.fps.prodrule-fin-inf)
For a finite product of summable families:
∏_{i=1}^n (∑_{k ∈ S_i} p_{i,k}) = ∑_{(k₁,...,k_n) ∈ S₁×...×S_n} ∏_{i=1}^n p_{i,k_i}
(Proposition prop.fps.prodrule-fin-infJ is the version with general finite index set)
Proof strategy: By induction on n.
- Base case (n=0): Both sides equal 1.
- Inductive step: Split the product into first n factors and the last factor, use IH on the first n, then apply the multiplication rule for sums.
Note: This theorem requires DiscreteTopology K. This covers the main use cases
(integers, rationals, finite fields). For non-discrete K (like ℝ or ℂ), additional
assumptions (such as absolute summability) would be needed.
Version with general finite index set.
Note: This theorem requires DiscreteTopology K to use prod_tsum_eq_tsum_prod_finset.
Finite Product Rule for Infinite Sums (discrete case, fully proved)
For a finite product of summable families over Fin n:
∏_{i=1}^n (∑_{k ∈ S_i} p_{i,k}) = ∑_{(k₁,...,k_n) ∈ S₁×...×S_n} ∏_{i=1}^n p_{i,k_i}
This is the discrete topology version of prod_tsum_eq_tsum_prod_finset, with a complete proof.
The key insight is that in discrete topology, summability implies finite support for each
coefficient, which allows us to prove summability of the product family directly.
Proof strategy: By induction on n.
- Base case (n=0): Both sides equal 1.
- Inductive step: Split the product into first n factors and the last factor, use IH on the first n, then apply the multiplication rule for sums.
- Summability of the product family is proved using
summable_finProd_discreteandsummable_prod_of_summable_discrete.
Finite Product Rule for Infinite Sums (discrete case, general finite index set)
This is prop.fps.prodrule-fin-infJ for discrete topology, fully proved.
For a finite product of summable families over any finite type N:
∏_{i ∈ N} (∑_{k ∈ S_i} p_{i,k}) = ∑_{f : N → S} ∏_{i ∈ N} p_{i,f(i)}
This version uses prod_tsum_eq_tsum_prod_finset_discrete and reindexes via Fintype.equivFin.
Finite product over a finset equals tsum over functions.
This is a variant of prod_tsum_eq_tsum_prod_finset'_discrete for products over a finset
rather than a fintype. Useful for expanding ∏ i ∈ s, ∑' k, p i k.
Infinite Product Rules #
The main results: product rules for infinite products of sums.
For an essentially finite function f, the family (p i (f i))_i is multipliable when p i 0 = 1 for all i. This is because f i = 0 for all but finitely many i, so p i (f i) = p i 0 = 1 for all but finitely many i.
Technical Helper Lemmas #
These lemmas are used in the proof of summability for the RHS of the infinite product rule.
For discrete K, a subfamily via injective map is summable. This is used for proving that fibers of summable families are summable.
For discrete K, T'_n = {(i,k) : k ≠ 0, ∃ m ≤ n, coeff m (p i k) ≠ 0} is finite. This follows from coefficient-wise summability.
If a factor in a finite product has all coefficients up to n equal to zero, then the product also has coefficient n equal to zero.
Essentially finite functions whose graph is contained in a finite set form a finite set. This is the key combinatorial lemma for proving summability of the RHS.
Helper Lemmas for the General Infinite Product Rule #
These lemmas correspond to the claims in the detailed proof of Proposition prop.fps.prodrule-inf-inf.
Claim 1 from tex proof (discrete case): For each i ∈ I, the family (p_{i,k})_{k ∈ S_i} is summable.
This version is for discrete K, where the proof is straightforward using
summable_comp_injective_of_discrete.
For discrete K, the family (∑{k ∈ S_i, k ≠ 0} p{i,k})_{i ∈ I} is summable. This is a key lemma for proving multipliability of the tsum fiber family.
Summable Fiber Lemma (Complete Space Version) #
This section proves that fibers of summable families are summable when the coefficient ring K is a complete uniform space. This is stronger than the discrete case but requires completeness.
Claim 1 from tex proof: For each i ∈ I, the family (p_{i,k})_{k ∈ S_i} is summable.
This follows from the assumption that (p_{i,k})_{(i,k) ∈ S̄} is summable, since each subfamily is summable.
Proof strategy: The family (p i k)_{k ∈ S_i} is summable because:
- The subfamily (p i k)_{k ∈ S_i, k ≠ 0} is summable (as a subfamily of the summable family)
- Adding the term p i 0 preserves summability
The key steps are:
- Use
summable_iff_summable_coeffto reduce to coefficient-wise summability - For each coefficient, use
Summable.indicator_completeto show the fiber is summable - Split the sum at k = 0 and combine
Note: This proof requires CompleteSpace K because subfamilies of summable families
are only guaranteed to be summable in complete spaces. For the discrete topology case,
use summable_fiber_discrete instead (which doesn't require completeness).
Claim 2 from tex proof (discrete case): The family (∑{k ∈ S_i} p{i,k})_{i ∈ I} is multipliable.
For discrete K, this follows from coefficient-wise finiteness arguments. The key insight is that ∑k p{i,k} = 1 + ∑{k≠0} p{i,k}, and for discrete K, only finitely many finsets of indices contribute to each coefficient of the partial products.
Claim 7 from tex proof (discrete case): The family (∏i p{i,k_i})_{(k_i) ∈ S^I_fin} is summable.
For discrete K, this follows from the finiteness of T'_n and the helper lemmas above.
Claim 7 from tex proof: The family (∏i p{i,k_i})_{(k_i) ∈ S^I_fin} is summable.
This is the key summability result for the RHS. The proof shows that for each n, only finitely many essentially finite families (k_i) contribute to the n-th coefficient.
Proof strategy (following the tex source):
Use
summable_iff_summable_coeffto reduce to coefficient-wise summability.For each coefficient n, define T'_n = { (i,k) : k ≠ 0, ∃ m ≤ n, coeff m (p i k) ≠ 0 }. This set is finite because hp_summable implies coefficient-wise summability.
Define ValidFun_n = { f essentially finite | graph(f) ⊆ T'_n }. This set is finite because it injects into the powerset of T'_n.
Show that if f ∉ ValidFun_n, then coeff n (∏' i, p i (f.val i)) = 0. This uses the irrelevance lemma: if (i, f i) ∉ T'_n for some i with f i ≠ 0, then p i (f i) = 1 + (terms of order > n), so the n-th coefficient is unaffected.
Apply
summable_of_finite_supportto conclude.
Note: The proof requires discrete topology on K to show T'_n is finite via
Summable.finite_support_of_discreteTopology. For general topological rings,
the finiteness of T'_n from coefficient-wise summability would need additional
structure beyond T2Space.
Helper Lemmas for Coefficient Computation #
The following lemmas implement the key insight from the tex proof (Claims 9-10): factors with high order don't affect low-degree coefficients, allowing us to reduce infinite products to finite products when computing specific coefficients.
For a finite product where extra factors have high order, the coeff n is unchanged.
If s ⊆ t and for all i ∈ t \ s, g i has all coefficients up to n equal to 0,
then coeff n (∏ i ∈ t, (1 + g i)) = coeff n (∏ i ∈ s, (1 + g i)).
This is a key helper for reducing infinite products to finite products when computing individual coefficients.
For infinite products, if g i has high order for i ∉ I_n,
then coeff n of the tprod equals coeff n of the finite product over I_n.
This is the key lemma for reducing infinite products to finite products when computing individual coefficients. It implements Claim 10 from the tex proof.
Extension and Restriction Maps for Bijection #
These helper lemmas establish the bijection between functions on a finite subset I_n and essentially finite functions on the full index set I. This bijection is key to proving the infinite product rule.
Extension map: extend a function on a finite subset I_n to all of I by setting 0 outside. This is used to establish the bijection in the infinite product rule.
Instances For
Package the extension as a subtype of essentially finite functions.
Equations
- extendToI_subtype hI_n_finite f = ⟨extendToI hI_n_finite f, ⋯⟩
Instances For
Restriction map: restrict an essentially finite function on I to a finite subset I_n.
Equations
- restrictToI_n hI_n_finite f ⟨i, property⟩ = ↑f i
Instances For
For f with support in I_n, restriction followed by extension is the identity.
The finite product on I_n equals the tprod on I (after extension). This is key for showing the bijection preserves products.
General Infinite Product Rule (Proposition prop.fps.prodrule-inf-inf)
For any index set I, let (S_i)_{i ∈ I} be sets that all contain 0.
For p_{i,k} ∈ K⟦X⟧ with p_{i,0} = 1, if the family (p_{i,k})_{(i,k) ∈ S̄} is summable, then:
∏_{i ∈ I} (∑_{k ∈ S_i} p_{i,k}) = ∑_{essentially finite (k_i)_{i ∈ I}} ∏_{i ∈ I} p_{i,k_i}
The key insight is that only essentially finite families contribute to the sum on the RHS,
ensuring that each product ∏_{i ∈ I} p_{i,k_i} is well-defined (since all but finitely
many factors are p_{i,0} = 1).
Proof status: This theorem requires substantial infrastructure:
prod_tsum_eq_tsum_prod_finset'_discrete: finite product of infinite sums (fully proved)coeff_mul_tprod_one_add_eq_coeff: irrelevance of high-order terms (proved)
The proof strategy (from the tex source) involves:
- For each coefficient n, define finite approximating sets
- Show both sides reduce to finite sums/products on these sets
- Apply the finite distributive law
- Use the irrelevance lemma to show high-order terms don't contribute
Infinite Product Rule (Proposition prop.fps.prodrule-inf-infN)
Let S₁, S₂, S₃, ... be sets that all contain 0. For p_{i,k} ∈ K⟦X⟧ with p_{i,0} = 1,
if the family (p_{i,k})_{(i,k) ∈ S̄} is summable, then:
∏_{i=1}^∞ (∑_{k ∈ S_i} p_{i,k}) = ∑_{essentially finite (k₁,k₂,...)} ∏_{i=1}^∞ p_{i,k_i}
The key insight is that only essentially finite sequences contribute to the sum on the RHS,
ensuring that each product ∏_{i=1}^∞ p_{i,k_i} is well-defined (since all but finitely
many factors are p_{i,0} = 1).
This is a special case of tprod_tsum_eq_tsum_prod_essentiallyFinite with I = ℕ+.
Lemma on Irrelevance of High-Order Terms #
This lemma is used in the proof of the infinite product rule.
Irrelevance of High-Order Terms (Lemma lem.fps.prod.irlv.inf)
If a ∈ K⟦X⟧ and (f_i)_{i ∈ J} is a summable family with each f_i having
[x^m](f_i) = 0 for m ∈ {0, 1, ..., n}, then
[x^m](a · ∏_{i ∈ J}(1 + f_i)) = [x^m](a) for m ∈ {0, 1, ..., n}.
Intuitively, if all f_i have high order, then multiplying by ∏(1 + f_i)
doesn't affect the first n+1 coefficients.
Euler's Identity for Odd Parts #
A beautiful application of the product rules.
The coercion of oddPNatEquivPNat.symm i is 2 * i - 1.
Euler's Identity (Proposition prop.gf.prod.euler-odd)
∏_{i>0} (1 - x^{2i-1})⁻¹ = ∏_{k>0} (1 + x^k)
This identity relates the generating function for partitions into odd parts to the generating function for partitions into distinct parts.
The proof uses the fact that:
- The RHS is the generating function for partitions into distinct parts
- The LHS is the generating function for partitions into odd parts
- By Glaisher's theorem, these partition counts are equal
The algebraic proof (from the TeX source) shows:
(1 + x^k)(1 - x^k) = 1 - x^{2k}∏_{k>0}(1 + x^k) = ∏_{k>0}(1 - x^{2k}) / ∏_{k>0}(1 - x^k)- The even factors cancel, leaving
1 / ∏_{k odd}(1 - x^k)
Alternative form of Euler's identity using the set of odd positive integers.
This follows from euler_odd_parts_identity by reindexing the product using the
equivalence oddPNatEquivPNat between { n : ℕ+ // Odd n } and ℕ+.
Combinatorial Interpretation: Partitions #
The combinatorial consequence of Euler's identity.
Number of ways to write n as a sum of distinct positive integers.
Equations
Instances For
Number of ways to write n as a sum of odd positive integers.
Equations
Instances For
Euler's Partition Theorem (Theorem thm.gf.prod.euler-comb)
The number of partitions of n into distinct positive integers equals
the number of partitions of n into odd positive integers.
For example, for n = 6:
- Distinct partitions:
6,1+5,2+4,1+2+3(4 partitions) - Odd partitions:
1+5,3+3,3+1+1+1,1+1+1+1+1+1(4 partitions)
Infinite Products and Substitution #
The substitution rule extends to infinite products.
The rescale ring homomorphism is continuous in the pi topology on power series.
Substitution Rule for Infinite Products (Proposition prop.fps.subs.rule-infprod)
If (f_i)_{i ∈ I} is a multipliable family and a ∈ K, then rescaling commutes with
infinite products: rescale a (∏_{i ∈ I} f_i) = ∏_{i ∈ I} (rescale a (f_i)).
In the context of substitution, this says that (∏ f_i)(ax) = ∏ f_i(ax).
Exponentials, Logarithms and Infinite Products #
The Exp and Log maps convert between infinite sums and products. These results require K to be a ℚ-algebra for the formal exp and log to be defined.
Note on formalization status:
The source material (Propositions prop.fps.Exp-Log-infsum and prop.fps.Exp-Log-infprod) states:
Exp(∑_{i ∈ I} f_i) = ∏_{i ∈ I} Exp(f_i)for summable families inK⟦X⟧_0Log(∏_{i ∈ I} f_i) = ∑_{i ∈ I} Log(f_i)for multipliable families inK⟦X⟧_1
These require:
- A general composition/substitution operation for power series (to define
Exp(f)forfwith zero constant term) - A formal logarithm
Log : K⟦X⟧_1 → K⟦X⟧_0(not yet in Mathlib)
The finite versions use PowerSeries.exp_mul_exp_eq_exp_add: exp(aX) * exp(bX) = exp((a+b)X).
Once the infrastructure is available, the infinite versions should follow by taking limits.
Exp/Log Placeholder Section #
The source material includes Propositions prop.fps.Exp-Log-infsum and prop.fps.Exp-Log-infprod
relating infinite sums/products via Exp and Log maps.
Canonical definitions for FPS with constant term 0 or 1:
PowerSeries.PowerSeries₀(FPS with constant term 0) — seeFPS/ExpLog.leanPowerSeries.PowerSeries₁(FPS with constant term 1) — seeFPS/ExpLog.lean
These definitions have extensive API including:
PowerSeries₀.addSubgroup— additive subgroup structurePowerSeries₁.subgroup— multiplicative subgroup structure (for fields)- Membership lemmas (
mem_PowerSeries₀_iff,mem_PowerSeries₁_iff) - Closure properties (
add_mem,mul_mem,inv_mem, etc.) - Composition lemmas (
subst_mem,exp_subst_mem_PowerSeries₁, etc.) - The
ExpandLogmaps between these sets
Once the Exp/Log infrastructure from ExpLog.lean is integrated, the infinite versions
(prop.fps.Exp-Log-infsum and prop.fps.Exp-Log-infprod) can be formalized by taking limits.
The Binary Product Rule (eq.fps.prod.binary.prod-inf) #
The special case that motivated the general theory.
Binary Product Rule (Equation eq.fps.prod.binary.prod-inf)
For a summable sequence (a_n)_{n ∈ ℕ}:
∏_{i ∈ ℕ} (1 + a_i) = ∑_{i₁ < i₂ < ... < i_k} a_{i₁} a_{i₂} ... a_{i_k}
The RHS is a sum over all finite strictly increasing sequences of indices.
Note: This theorem requires K to have discrete topology. This covers the main use cases
(integers, rationals, finite fields). For non-discrete K (like ℝ or ℂ), additional
assumptions (such as completeness) may be needed.
Alternative formulation: the product equals a sum over finite subsets.