Big operators #
In this file we define products and sums indexed by finite sets (specifically, Finset).
Notation #
We introduce the following notation.
Let s be a Finset α, and f : α → β a function.
∏ x ∈ s, f xis notation forFinset.prod s f(assumingβis aCommMonoid)∑ x ∈ s, f xis notation forFinset.sum s f(assumingβis anAddCommMonoid)∏ x, f xis notation forFinset.prod Finset.univ f(assumingαis aFintypeandβis aCommMonoid)∑ x, f xis notation forFinset.sum Finset.univ f(assumingαis aFintypeandβis anAddCommMonoid)
Implementation Notes #
The first arguments in all definitions and lemmas is the codomain of the function of the big
operator. This is necessary for the heuristic in @[to_additive].
See the documentation of to_additive.attr for more information.
See also Finset.prod_apply, with the same conclusion but with the weaker hypothesis
f : α → β → γ
See also Finset.sum_apply, with the same conclusion but with the weaker hypothesis
f : α → β → γ
The product of f over insert a s is the same as
the product over s, as long as a is in s or f a = 1.
The sum of f over insert a s is the same as
the sum over s, as long as a is in s or f a = 0.
The product of f over insert a s is the same as
the product over s, as long as f a = 1.
The sum of f over insert a s is the same as
the sum over s, as long as f a = 0.
A product over all subsets of s ∪ {x} is obtained by multiplying the product over all subsets
of s, and over all subsets of s to which one adds x.
A sum over all subsets of s ∪ {x} is obtained by summing the sum over all subsets
of s, and over all subsets of s to which one adds x.
A product over all subsets of s ∪ {x} is obtained by multiplying the product over all subsets
of s, and over all subsets of s to which one adds x.
A sum over all subsets of s ∪ {x} is obtained by summing the sum over all subsets
of s, and over all subsets of s to which one adds x.
A product over powerset s is equal to the double product over sets of subsets of s with
#s = k, for k = 1, ..., #s.
A sum over powerset s is equal to the double sum over sets of subsets of s with
#s = k, for k = 1, ..., #s
Multiplying the products of a function over s and over sᶜ gives the whole product.
For a version expressed with subtypes, see Fintype.prod_subtype_mul_prod_subtype.
Adding the sums of a function over s and over sᶜ gives the whole sum.
For a version expressed with subtypes, see Fintype.sum_subtype_add_sum_subtype.
The product over a sigma type equals the product of the fiberwise products. For rewriting
in the reverse direction, use Finset.prod_sigma'.
The sum over a sigma type equals the sum of the fiberwise sums. For rewriting
in the reverse direction, use Finset.sum_sigma'
The product over a sigma type equals the product of the fiberwise products. For rewriting
in the reverse direction, use Finset.prod_sigma.
The sum over a sigma type equals the sum of the fiberwise sums. For rewriting
in the reverse direction, use Finset.sum_sigma
Taking a product over univ.pi t is the same as taking the product over Fintype.piFinset t.
univ.pi t and Fintype.piFinset t are essentially the same Finset, but differ
in the type of their element, univ.pi t is a Finset (Π a ∈ univ, t a) and
Fintype.piFinset t is a Finset (Π a, t a).
Taking a sum over univ.pi t is the same as taking the sum over
Fintype.piFinset t. univ.pi t and Fintype.piFinset t are essentially the same Finset,
but differ in the type of their element, univ.pi t is a Finset (Π a ∈ univ, t a) and
Fintype.piFinset t is a Finset (Π a, t a).
The product over a product set equals the product of the fiberwise products. For rewriting
in the reverse direction, use Finset.prod_product'.
The sum over a product set equals the sum of the fiberwise sums. For rewriting
in the reverse direction, use Finset.sum_product'
The product over a product set equals the product of the fiberwise products. For rewriting
in the reverse direction, use Finset.prod_product.
The sum over a product set equals the sum of the fiberwise sums. For rewriting
in the reverse direction, use Finset.sum_product
An uncurried version of Finset.prod_product_right.
An uncurried version of Finset.sum_product_right
Generalization of Finset.prod_comm to the case when the inner Finsets depend on the outer
variable.
Generalization of Finset.sum_comm to the case when the inner Finsets depend on
the outer variable.
A product over s.subtype p equals one over {x ∈ s | p x}.
A sum over s.subtype p equals one over {x ∈ s | p x}.
If all elements of a Finset satisfy the predicate p, a product
over s.subtype p equals that product over s.
If all elements of a Finset satisfy the predicate p, a sum
over s.subtype p equals that sum over s.
A product of a function over a Finset in a subtype equals a
product in the main type of a function that agrees with the first
function on that Finset.
A sum of a function over a Finset in a subtype equals a
sum in the main type of a function that agrees with the first
function on that Finset.
The product of a function g defined only on a set s is equal to
the product of a function f defined everywhere,
as long as f and g agree on s, and f = 1 off s.
The sum of a function g defined only on a set s is equal to
the sum of a function f defined everywhere,
as long as f and g agree on s, and f = 0 off s.
A product taken over a conditional whose condition is an equality test on the index and whose
alternative is 1 has value either the term at that index or 1.
The difference with Finset.prod_ite_eq is that the arguments to Eq are swapped.
A sum taken over a conditional whose condition is an equality
test on the index and whose alternative is 0 has value either the term at that index or 0.
The difference with Finset.sum_ite_eq is that the arguments to Eq are swapped.
The difference with Finset.prod_ite_eq_of_mem is that the arguments to Eq are swapped.
Consider a product of g i (f i) over a finset. Suppose g is a function such as
n ↦ (· ^ n), which maps a second argument of 1 to 1. Then if f is replaced by the
corresponding multiplicative indicator function, the finset may be replaced by a possibly larger
finset without changing the value of the product.
Consider a sum of g i (f i) over a finset. Suppose g is a function such as
n ↦ (n • ·), which maps a second argument of 0 to 0 (or a weighted sum of f i * h i or
f i • h i, where f gives the weights that are multiplied by some other function h). Then if
f is replaced by the corresponding indicator function, the finset may be replaced by a possibly
larger finset without changing the value of the sum.
Taking the product of an indicator function over a possibly larger finset is the same as taking the original function over the original finset.
Summing an indicator function over a possibly larger Finset is the same as summing
the original function over the original finset.
For any product along {0, ..., n - 1} of a commutative-monoid-valued function, we can verify
that it's equal to a different function just by checking ratios of adjacent terms.
This is a multiplicative discrete analogue of the fundamental theorem of calculus.
For any sum along {0, ..., n - 1} of a commutative-monoid-valued function, we can
verify that it's equal to a different function just by checking differences of adjacent terms.
This is a discrete analogue of the fundamental theorem of calculus.
A telescoping sum along {0, ..., n - 1} of an additive commutative group valued
function reduces to the difference of the last and first terms.
A telescoping sum along {0, ..., n-1} of an ℕ-valued function
reduces to the difference of the last and first terms
when the function we are summing is monotone.
A product over Finset.powersetCard which only depends on the size of the sets is constant.
A sum over Finset.powersetCard which only depends on the size of the sets is constant.
The difference with Finset.prod_ninvolution is that the involution is allowed to use
membership of the domain of the product, rather than being a non-dependent function.
The difference with Finset.sum_ninvolution is that the involution is allowed to use
membership of the domain of the sum, rather than being a non-dependent function.
The difference with Finset.prod_involution is that the involution is a non-dependent function,
rather than being allowed to use membership of the domain of the product.
The difference with Finset.sum_involution is that the involution is a non-dependent
function, rather than being allowed to use membership of the domain of the sum.
The product of the composition of functions f and g, is the product over b ∈ s.image g of
f b to the power of the cardinality of the fibre of b. See also Finset.prod_image.
The sum of the composition of functions f and g, is the sum over b ∈ s.image g
of f b times of the cardinality of the fibre of b. See also Finset.sum_image.
A product can be partitioned into a product of products, each equivalent under a setoid.
A sum can be partitioned into a sum of sums, each equivalent under a setoid.
If we can partition a product into subsets that cancel out, then the whole product cancels.
If we can partition a sum into subsets that cancel out, then the whole sum cancels.
Taking a product over s : Finset α is the same as multiplying the value on a single element
f a by the product of s.erase a.
See Multiset.prod_map_erase for the Multiset version.
Taking a sum over s : Finset α is the same as adding the value on a single element
f a to the sum over s.erase a.
See Multiset.sum_map_erase for the Multiset version.
A variant of Finset.mul_prod_erase with the multiplication swapped.
A variant of Finset.add_sum_erase with the addition swapped.
If a function applied at a point is 1, a product is unchanged by
removing that point, if present, from a Finset.
If a function applied at a point is 0, a sum is unchanged by
removing that point, if present, from a Finset.
See also Finset.prod_ite_zero.
See also Finset.sum_boole.
If a product is 1 and the function is 1 except possibly at one
point, it is 1 everywhere on the Finset.
If a sum is 0 and the function is 0 except possibly at one
point, it is 0 everywhere on the Finset.
See also Finset.prod_dite_eq.
See also Finset.sum_dite_eq.
See also Finset.prod_dite_eq'.
See also Finset.sum_dite_eq'.
See also Finset.prod_ite_eq.
See also Finset.sum_ite_eq.
See also Finset.prod_ite_eq'.
See also Finset.sum_ite_eq'.
See also Finset.prod_pi_mulSingle.
See also Finset.sum_pi_single.
See also Finset.prod_pi_mulSingle'.
See also Finset.sum_pi_single'.