Module docstring
{"# Finite products and sums over types and sets
We define products and sums over types and subsets of types, with no finiteness hypotheses.
All infinite products and sums are defined to be junk values (i.e. one or zero).
This approach is sometimes easier to use than Finset.sum,
when issues arise with Finset and Fintype being data.
Main definitions
We use the following variables:
α,β- types with no structure;s,t- setsM,N- additive or multiplicative commutative monoidsf,g- functions
Definitions in this file:
finsum f : M: the sum off xasxranges over the support off, if it's finite. Zero otherwise.finprod f : M: the product off xasxranges over the multiplicative support off, if it's finite. One otherwise.
Notation
∑ᶠ i, f iand∑ᶠ i : α, f iforfinsum f∏ᶠ i, f iand∏ᶠ i : α, f iforfinprod f
This notation works for functions f : p → M, where p : Prop, so the following works:
∑ᶠ i ∈ s, f i, wheref : α → M,s : Set α: sum over the sets;∑ᶠ n < 5, f n, wheref : ℕ → M: same asf 0 + f 1 + f 2 + f 3 + f 4;∏ᶠ (n >= -2) (hn : n < 3), f n, wheref : ℤ → M: same asf (-2) * f (-1) * f 0 * f 1 * f 2.
Implementation notes
finsum and finprod is \"yet another way of doing finite sums and products in Lean\". However
experiments in the wild (e.g. with matroids) indicate that it is a helpful approach in settings
where the user is not interested in computability and wants to do reasoning without running into
typeclass diamonds caused by the constructive finiteness used in definitions such as Finset and
Fintype. By sticking solely to Set.Finite we avoid these problems. We are aware that there are
other solutions but for beginner mathematicians this approach is easier in practice.
Another application is the construction of a partition of unity from a collection of “bump” function. In this case the finite set depends on the point and it's convenient to have a definition that does not mention the set explicitly.
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.
We did not add IsFinite (X : Type) : Prop, because it is simply Nonempty (Fintype X).
Tags
finsum, finprod, finite sum, finite product
","### Definition and relation to Finset.sum and Finset.prod
","### Distributivity w.r.t. addition, subtraction, and (scalar) multiplication
","### ∏ᶠ x ∈ s, f x and set operations
"}