Documentation

Mathlib.Algebra.BigOperators.Finprod

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:

Definitions in this file:

Notation #

This notation works for functions f : p → M, where p : Prop, so the following works:

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 #

theorem finsum_def' {M : Type u_7} {α : Sort u_8} [AddCommMonoid M] (f : αM) :
finsum f = if h : Set.Finite (Function.support (f PLift.down)) then Finset.sum (Set.Finite.toFinset h) fun i => f i.down else 0
@[irreducible]
noncomputable def finsum {M : Type u_7} {α : Sort u_8} [AddCommMonoid M] (f : αM) :
M

Sum of f x as x ranges over the elements of the support of f, if it's finite. Zero otherwise.

Equations
Instances For
    @[irreducible]
    noncomputable def finprod {M : Type u_7} {α : Sort u_8} [CommMonoid M] (f : αM) :
    M

    Product of f x as x ranges over the elements of the multiplicative support of f, if it's finite. One otherwise.

    Equations
    Instances For
      theorem finprod_def' {M : Type u_7} {α : Sort u_8} [CommMonoid M] (f : αM) :
      finprod f = if h : Set.Finite (Function.mulSupport (f PLift.down)) then Finset.prod (Set.Finite.toFinset h) fun i => f i.down else 1
      Equations
      • One or more equations did not get rendered due to their size.
      Instances For

        ∑ᶠ x, f x is notation for finsum f. It is the sum of f x, where x ranges over the support of f, if it's finite, zero otherwise. Taking the sum over multiple arguments or conditions is possible, e.g. ∏ᶠ (x) (y), f x y and ∏ᶠ (x) (h: x ∈ s), f x

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For

          ∏ᶠ x, f x is notation for finprod f. It is the sum of f x, where x ranges over the multiplicative support of f, if it's finite, one otherwise. Taking the product over multiple arguments or conditions is possible, e.g. ∏ᶠ (x) (y), f x y and ∏ᶠ (x) (h: x ∈ s), f x

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              theorem finsum_eq_sum_plift_of_support_toFinset_subset {M : Type u_2} {α : Sort u_4} [AddCommMonoid M] {f : αM} (hf : Set.Finite (Function.support (f PLift.down))) {s : Finset (PLift α)} (hs : Set.Finite.toFinset hf s) :
              ∑ᶠ (i : α), f i = Finset.sum s fun i => f i.down
              theorem finprod_eq_prod_plift_of_mulSupport_toFinset_subset {M : Type u_2} {α : Sort u_4} [CommMonoid M] {f : αM} (hf : Set.Finite (Function.mulSupport (f PLift.down))) {s : Finset (PLift α)} (hs : Set.Finite.toFinset hf s) :
              ∏ᶠ (i : α), f i = Finset.prod s fun i => f i.down
              theorem finsum_eq_sum_plift_of_support_subset {M : Type u_2} {α : Sort u_4} [AddCommMonoid M] {f : αM} {s : Finset (PLift α)} (hs : Function.support (f PLift.down) s) :
              ∑ᶠ (i : α), f i = Finset.sum s fun i => f i.down
              theorem finprod_eq_prod_plift_of_mulSupport_subset {M : Type u_2} {α : Sort u_4} [CommMonoid M] {f : αM} {s : Finset (PLift α)} (hs : Function.mulSupport (f PLift.down) s) :
              ∏ᶠ (i : α), f i = Finset.prod s fun i => f i.down
              @[simp]
              theorem finsum_zero {M : Type u_2} {α : Sort u_4} [AddCommMonoid M] :
              ∑ᶠ (x : α), 0 = 0
              @[simp]
              theorem finprod_one {M : Type u_2} {α : Sort u_4} [CommMonoid M] :
              ∏ᶠ (x : α), 1 = 1
              theorem finsum_of_isEmpty {M : Type u_2} {α : Sort u_4} [AddCommMonoid M] [IsEmpty α] (f : αM) :
              ∑ᶠ (i : α), f i = 0
              theorem finprod_of_isEmpty {M : Type u_2} {α : Sort u_4} [CommMonoid M] [IsEmpty α] (f : αM) :
              ∏ᶠ (i : α), f i = 1
              @[simp]
              theorem finsum_false {M : Type u_2} [AddCommMonoid M] (f : FalseM) :
              ∑ᶠ (i : False), f i = 0
              @[simp]
              theorem finprod_false {M : Type u_2} [CommMonoid M] (f : FalseM) :
              ∏ᶠ (i : False), f i = 1
              theorem finsum_eq_single {M : Type u_2} {α : Sort u_4} [AddCommMonoid M] (f : αM) (a : α) (ha : ∀ (x : α), x af x = 0) :
              ∑ᶠ (x : α), f x = f a
              theorem finprod_eq_single {M : Type u_2} {α : Sort u_4} [CommMonoid M] (f : αM) (a : α) (ha : ∀ (x : α), x af x = 1) :
              ∏ᶠ (x : α), f x = f a
              theorem finsum_unique {M : Type u_2} {α : Sort u_4} [AddCommMonoid M] [Unique α] (f : αM) :
              ∑ᶠ (i : α), f i = f default
              theorem finprod_unique {M : Type u_2} {α : Sort u_4} [CommMonoid M] [Unique α] (f : αM) :
              ∏ᶠ (i : α), f i = f default
              @[simp]
              theorem finsum_true {M : Type u_2} [AddCommMonoid M] (f : TrueM) :
              ∑ᶠ (i : True), f i = f trivial
              @[simp]
              theorem finprod_true {M : Type u_2} [CommMonoid M] (f : TrueM) :
              ∏ᶠ (i : True), f i = f trivial
              theorem finsum_eq_dif {M : Type u_2} [AddCommMonoid M] {p : Prop} [Decidable p] (f : pM) :
              ∑ᶠ (i : p), f i = if h : p then f h else 0
              theorem finprod_eq_dif {M : Type u_2} [CommMonoid M] {p : Prop} [Decidable p] (f : pM) :
              ∏ᶠ (i : p), f i = if h : p then f h else 1
              theorem finsum_eq_if {M : Type u_2} [AddCommMonoid M] {p : Prop} [Decidable p] {x : M} :
              ∑ᶠ (x : p), x = if p then x else 0
              theorem finprod_eq_if {M : Type u_2} [CommMonoid M] {p : Prop} [Decidable p] {x : M} :
              ∏ᶠ (x : p), x = if p then x else 1
              theorem finsum_congr {M : Type u_2} {α : Sort u_4} [AddCommMonoid M] {f : αM} {g : αM} (h : ∀ (x : α), f x = g x) :
              theorem finprod_congr {M : Type u_2} {α : Sort u_4} [CommMonoid M] {f : αM} {g : αM} (h : ∀ (x : α), f x = g x) :
              theorem finsum_congr_Prop {M : Type u_2} [AddCommMonoid M] {p : Prop} {q : Prop} {f : pM} {g : qM} (hpq : p = q) (hfg : ∀ (h : q), f (Eq.mpr hpq h) = g h) :
              theorem finprod_congr_Prop {M : Type u_2} [CommMonoid M] {p : Prop} {q : Prop} {f : pM} {g : qM} (hpq : p = q) (hfg : ∀ (h : q), f (Eq.mpr hpq h) = g h) :
              theorem finsum_induction {M : Type u_2} {α : Sort u_4} [AddCommMonoid M] {f : αM} (p : MProp) (hp₀ : p 0) (hp₁ : (x y : M) → p xp yp (x + y)) (hp₂ : (i : α) → p (f i)) :
              p (∑ᶠ (i : α), f i)

              To prove a property of a finite sum, it suffices to prove that the property is additive and holds on the summands.

              theorem finprod_induction {M : Type u_2} {α : Sort u_4} [CommMonoid M] {f : αM} (p : MProp) (hp₀ : p 1) (hp₁ : (x y : M) → p xp yp (x * y)) (hp₂ : (i : α) → p (f i)) :
              p (∏ᶠ (i : α), f i)

              To prove a property of a finite product, it suffices to prove that the property is multiplicative and holds on the factors.

              theorem finprod_nonneg {α : Sort u_4} {R : Type u_7} [OrderedCommSemiring R] {f : αR} (hf : ∀ (x : α), 0 f x) :
              0 ∏ᶠ (x : α), f x
              theorem finsum_nonneg {α : Sort u_4} {M : Type u_7} [OrderedAddCommMonoid M] {f : αM} (hf : ∀ (i : α), 0 f i) :
              0 ∑ᶠ (i : α), f i
              theorem one_le_finprod' {α : Sort u_4} {M : Type u_7} [OrderedCommMonoid M] {f : αM} (hf : ∀ (i : α), 1 f i) :
              1 ∏ᶠ (i : α), f i
              theorem AddMonoidHom.map_finsum_plift {M : Type u_2} {N : Type u_3} {α : Sort u_4} [AddCommMonoid M] [AddCommMonoid N] (f : M →+ N) (g : αM) (h : Set.Finite (Function.support (g PLift.down))) :
              f (∑ᶠ (x : α), g x) = ∑ᶠ (x : α), f (g x)
              theorem MonoidHom.map_finprod_plift {M : Type u_2} {N : Type u_3} {α : Sort u_4} [CommMonoid M] [CommMonoid N] (f : M →* N) (g : αM) (h : Set.Finite (Function.mulSupport (g PLift.down))) :
              f (∏ᶠ (x : α), g x) = ∏ᶠ (x : α), f (g x)
              theorem AddMonoidHom.map_finsum_Prop {M : Type u_2} {N : Type u_3} [AddCommMonoid M] [AddCommMonoid N] {p : Prop} (f : M →+ N) (g : pM) :
              f (∑ᶠ (x : p), g x) = ∑ᶠ (x : p), f (g x)
              theorem MonoidHom.map_finprod_Prop {M : Type u_2} {N : Type u_3} [CommMonoid M] [CommMonoid N] {p : Prop} (f : M →* N) (g : pM) :
              f (∏ᶠ (x : p), g x) = ∏ᶠ (x : p), f (g x)
              theorem AddMonoidHom.map_finsum_of_preimage_zero {M : Type u_2} {N : Type u_3} {α : Sort u_4} [AddCommMonoid M] [AddCommMonoid N] (f : M →+ N) (hf : ∀ (x : M), f x = 0x = 0) (g : αM) :
              f (∑ᶠ (i : α), g i) = ∑ᶠ (i : α), f (g i)
              theorem MonoidHom.map_finprod_of_preimage_one {M : Type u_2} {N : Type u_3} {α : Sort u_4} [CommMonoid M] [CommMonoid N] (f : M →* N) (hf : ∀ (x : M), f x = 1x = 1) (g : αM) :
              f (∏ᶠ (i : α), g i) = ∏ᶠ (i : α), f (g i)
              theorem AddMonoidHom.map_finsum_of_injective {M : Type u_2} {N : Type u_3} {α : Sort u_4} [AddCommMonoid M] [AddCommMonoid N] (g : M →+ N) (hg : Function.Injective g) (f : αM) :
              g (∑ᶠ (i : α), f i) = ∑ᶠ (i : α), g (f i)
              theorem MonoidHom.map_finprod_of_injective {M : Type u_2} {N : Type u_3} {α : Sort u_4} [CommMonoid M] [CommMonoid N] (g : M →* N) (hg : Function.Injective g) (f : αM) :
              g (∏ᶠ (i : α), f i) = ∏ᶠ (i : α), g (f i)
              theorem AddEquiv.map_finsum {M : Type u_2} {N : Type u_3} {α : Sort u_4} [AddCommMonoid M] [AddCommMonoid N] (g : M ≃+ N) (f : αM) :
              g (∑ᶠ (i : α), f i) = ∑ᶠ (i : α), g (f i)
              theorem MulEquiv.map_finprod {M : Type u_2} {N : Type u_3} {α : Sort u_4} [CommMonoid M] [CommMonoid N] (g : M ≃* N) (f : αM) :
              g (∏ᶠ (i : α), f i) = ∏ᶠ (i : α), g (f i)
              theorem finsum_smul {ι : Sort u_6} {R : Type u_7} {M : Type u_8} [Ring R] [AddCommGroup M] [Module R M] [NoZeroSMulDivisors R M] (f : ιR) (x : M) :
              (∑ᶠ (i : ι), f i) x = ∑ᶠ (i : ι), f i x

              The NoZeroSMulDivisors makes sure that the result holds even when the support of f is infinite. For a more usual version assuming (support f).Finite instead, see finsum_smul'.

              theorem smul_finsum {ι : Sort u_6} {R : Type u_7} {M : Type u_8} [Ring R] [AddCommGroup M] [Module R M] [NoZeroSMulDivisors R M] (c : R) (f : ιM) :
              c ∑ᶠ (i : ι), f i = ∑ᶠ (i : ι), c f i

              The NoZeroSMulDivisors makes sure that the result holds even when the support of f is infinite. For a more usual version assuming (support f).Finite instead, see smul_finsum'.

              theorem finsum_neg_distrib {G : Type u_1} {α : Sort u_4} [SubtractionCommMonoid G] (f : αG) :
              ∑ᶠ (x : α), -f x = -∑ᶠ (x : α), f x
              theorem finprod_inv_distrib {G : Type u_1} {α : Sort u_4} [DivisionCommMonoid G] (f : αG) :
              ∏ᶠ (x : α), (f x)⁻¹ = (∏ᶠ (x : α), f x)⁻¹
              theorem finsum_eq_indicator_apply {α : Type u_1} {M : Type u_5} [AddCommMonoid M] (s : Set α) (f : αM) (a : α) :
              ∑ᶠ (_ : a s), f a = Set.indicator s f a
              theorem finprod_eq_mulIndicator_apply {α : Type u_1} {M : Type u_5} [CommMonoid M] (s : Set α) (f : αM) (a : α) :
              ∏ᶠ (_ : a s), f a = Set.mulIndicator s f a
              @[simp]
              theorem finsum_mem_support {α : Type u_1} {M : Type u_5} [AddCommMonoid M] (f : αM) (a : α) :
              ∑ᶠ (_ : f a 0), f a = f a
              @[simp]
              theorem finprod_mem_mulSupport {α : Type u_1} {M : Type u_5} [CommMonoid M] (f : αM) (a : α) :
              ∏ᶠ (_ : f a 1), f a = f a
              theorem finsum_mem_def {α : Type u_1} {M : Type u_5} [AddCommMonoid M] (s : Set α) (f : αM) :
              ∑ᶠ (a : α) (_ : a s), f a = ∑ᶠ (a : α), Set.indicator s f a
              theorem finprod_mem_def {α : Type u_1} {M : Type u_5} [CommMonoid M] (s : Set α) (f : αM) :
              ∏ᶠ (a : α) (_ : a s), f a = ∏ᶠ (a : α), Set.mulIndicator s f a
              theorem finsum_eq_sum_of_support_subset {α : Type u_1} {M : Type u_5} [AddCommMonoid M] (f : αM) {s : Finset α} (h : Function.support f s) :
              ∑ᶠ (i : α), f i = Finset.sum s fun i => f i
              theorem finprod_eq_prod_of_mulSupport_subset {α : Type u_1} {M : Type u_5} [CommMonoid M] (f : αM) {s : Finset α} (h : Function.mulSupport f s) :
              ∏ᶠ (i : α), f i = Finset.prod s fun i => f i
              theorem finsum_eq_sum_of_support_toFinset_subset {α : Type u_1} {M : Type u_5} [AddCommMonoid M] (f : αM) (hf : Set.Finite (Function.support f)) {s : Finset α} (h : Set.Finite.toFinset hf s) :
              ∑ᶠ (i : α), f i = Finset.sum s fun i => f i
              theorem finprod_eq_prod_of_mulSupport_toFinset_subset {α : Type u_1} {M : Type u_5} [CommMonoid M] (f : αM) (hf : Set.Finite (Function.mulSupport f)) {s : Finset α} (h : Set.Finite.toFinset hf s) :
              ∏ᶠ (i : α), f i = Finset.prod s fun i => f i
              theorem finsum_eq_finset_sum_of_support_subset {α : Type u_1} {M : Type u_5} [AddCommMonoid M] (f : αM) {s : Finset α} (h : Function.support f s) :
              ∑ᶠ (i : α), f i = Finset.sum s fun i => f i
              theorem finprod_eq_finset_prod_of_mulSupport_subset {α : Type u_1} {M : Type u_5} [CommMonoid M] (f : αM) {s : Finset α} (h : Function.mulSupport f s) :
              ∏ᶠ (i : α), f i = Finset.prod s fun i => f i
              theorem finsum_def {α : Type u_1} {M : Type u_5} [AddCommMonoid M] (f : αM) [Decidable (Set.Finite (Function.support f))] :
              ∑ᶠ (i : α), f i = if h : Set.Finite (Function.support f) then Finset.sum (Set.Finite.toFinset h) fun i => f i else 0
              theorem finprod_def {α : Type u_1} {M : Type u_5} [CommMonoid M] (f : αM) [Decidable (Set.Finite (Function.mulSupport f))] :
              ∏ᶠ (i : α), f i = if h : Set.Finite (Function.mulSupport f) then Finset.prod (Set.Finite.toFinset h) fun i => f i else 1
              theorem finsum_of_infinite_support {α : Type u_1} {M : Type u_5} [AddCommMonoid M] {f : αM} (hf : Set.Infinite (Function.support f)) :
              ∑ᶠ (i : α), f i = 0
              theorem finprod_of_infinite_mulSupport {α : Type u_1} {M : Type u_5} [CommMonoid M] {f : αM} (hf : Set.Infinite (Function.mulSupport f)) :
              ∏ᶠ (i : α), f i = 1
              theorem finsum_eq_sum {α : Type u_1} {M : Type u_5} [AddCommMonoid M] (f : αM) (hf : Set.Finite (Function.support f)) :
              ∑ᶠ (i : α), f i = Finset.sum (Set.Finite.toFinset hf) fun i => f i
              theorem finprod_eq_prod {α : Type u_1} {M : Type u_5} [CommMonoid M] (f : αM) (hf : Set.Finite (Function.mulSupport f)) :
              ∏ᶠ (i : α), f i = Finset.prod (Set.Finite.toFinset hf) fun i => f i
              theorem finsum_eq_sum_of_fintype {α : Type u_1} {M : Type u_5} [AddCommMonoid M] [Fintype α] (f : αM) :
              ∑ᶠ (i : α), f i = Finset.sum Finset.univ fun i => f i
              theorem finprod_eq_prod_of_fintype {α : Type u_1} {M : Type u_5} [CommMonoid M] [Fintype α] (f : αM) :
              ∏ᶠ (i : α), f i = Finset.prod Finset.univ fun i => f i
              theorem finsum_cond_eq_sum_of_cond_iff {α : Type u_1} {M : Type u_5} [AddCommMonoid M] (f : αM) {p : αProp} {t : Finset α} (h : ∀ {x : α}, f x 0 → (p x x t)) :
              ∑ᶠ (i : α) (x : p i), f i = Finset.sum t fun i => f i
              theorem finprod_cond_eq_prod_of_cond_iff {α : Type u_1} {M : Type u_5} [CommMonoid M] (f : αM) {p : αProp} {t : Finset α} (h : ∀ {x : α}, f x 1 → (p x x t)) :
              ∏ᶠ (i : α) (x : p i), f i = Finset.prod t fun i => f i
              theorem finsum_cond_ne {α : Type u_1} {M : Type u_5} [AddCommMonoid M] (f : αM) (a : α) [DecidableEq α] (hf : Set.Finite (Function.support f)) :
              ∑ᶠ (i : α) (_ : i a), f i = Finset.sum (Finset.erase (Set.Finite.toFinset hf) a) fun i => f i
              theorem finprod_cond_ne {α : Type u_1} {M : Type u_5} [CommMonoid M] (f : αM) (a : α) [DecidableEq α] (hf : Set.Finite (Function.mulSupport f)) :
              ∏ᶠ (i : α) (_ : i a), f i = Finset.prod (Finset.erase (Set.Finite.toFinset hf) a) fun i => f i
              theorem finsum_mem_eq_sum_of_inter_support_eq {α : Type u_1} {M : Type u_5} [AddCommMonoid M] (f : αM) {s : Set α} {t : Finset α} (h : s Function.support f = t Function.support f) :
              ∑ᶠ (i : α) (_ : i s), f i = Finset.sum t fun i => f i
              theorem finprod_mem_eq_prod_of_inter_mulSupport_eq {α : Type u_1} {M : Type u_5} [CommMonoid M] (f : αM) {s : Set α} {t : Finset α} (h : s Function.mulSupport f = t Function.mulSupport f) :
              ∏ᶠ (i : α) (_ : i s), f i = Finset.prod t fun i => f i
              theorem finsum_mem_eq_sum_of_subset {α : Type u_1} {M : Type u_5} [AddCommMonoid M] (f : αM) {s : Set α} {t : Finset α} (h₁ : s Function.support f t) (h₂ : t s) :
              ∑ᶠ (i : α) (_ : i s), f i = Finset.sum t fun i => f i
              theorem finprod_mem_eq_prod_of_subset {α : Type u_1} {M : Type u_5} [CommMonoid M] (f : αM) {s : Set α} {t : Finset α} (h₁ : s Function.mulSupport f t) (h₂ : t s) :
              ∏ᶠ (i : α) (_ : i s), f i = Finset.prod t fun i => f i
              theorem finsum_mem_eq_sum {α : Type u_1} {M : Type u_5} [AddCommMonoid M] (f : αM) {s : Set α} (hf : Set.Finite (s Function.support f)) :
              ∑ᶠ (i : α) (_ : i s), f i = Finset.sum (Set.Finite.toFinset hf) fun i => f i
              theorem finprod_mem_eq_prod {α : Type u_1} {M : Type u_5} [CommMonoid M] (f : αM) {s : Set α} (hf : Set.Finite (s Function.mulSupport f)) :
              ∏ᶠ (i : α) (_ : i s), f i = Finset.prod (Set.Finite.toFinset hf) fun i => f i
              theorem finsum_mem_eq_sum_filter {α : Type u_1} {M : Type u_5} [AddCommMonoid M] (f : αM) (s : Set α) [DecidablePred fun x => x s] (hf : Set.Finite (Function.support f)) :
              ∑ᶠ (i : α) (_ : i s), f i = Finset.sum (Finset.filter (fun x => x s) (Set.Finite.toFinset hf)) fun i => f i
              theorem finprod_mem_eq_prod_filter {α : Type u_1} {M : Type u_5} [CommMonoid M] (f : αM) (s : Set α) [DecidablePred fun x => x s] (hf : Set.Finite (Function.mulSupport f)) :
              ∏ᶠ (i : α) (_ : i s), f i = Finset.prod (Finset.filter (fun x => x s) (Set.Finite.toFinset hf)) fun i => f i
              theorem finsum_mem_eq_toFinset_sum {α : Type u_1} {M : Type u_5} [AddCommMonoid M] (f : αM) (s : Set α) [Fintype s] :
              ∑ᶠ (i : α) (_ : i s), f i = Finset.sum (Set.toFinset s) fun i => f i
              theorem finprod_mem_eq_toFinset_prod {α : Type u_1} {M : Type u_5} [CommMonoid M] (f : αM) (s : Set α) [Fintype s] :
              ∏ᶠ (i : α) (_ : i s), f i = Finset.prod (Set.toFinset s) fun i => f i
              theorem finsum_mem_eq_finite_toFinset_sum {α : Type u_1} {M : Type u_5} [AddCommMonoid M] (f : αM) {s : Set α} (hs : Set.Finite s) :
              ∑ᶠ (i : α) (_ : i s), f i = Finset.sum (Set.Finite.toFinset hs) fun i => f i
              theorem finprod_mem_eq_finite_toFinset_prod {α : Type u_1} {M : Type u_5} [CommMonoid M] (f : αM) {s : Set α} (hs : Set.Finite s) :
              ∏ᶠ (i : α) (_ : i s), f i = Finset.prod (Set.Finite.toFinset hs) fun i => f i
              theorem finsum_mem_finset_eq_sum {α : Type u_1} {M : Type u_5} [AddCommMonoid M] (f : αM) (s : Finset α) :
              ∑ᶠ (i : α) (_ : i s), f i = Finset.sum s fun i => f i
              theorem finprod_mem_finset_eq_prod {α : Type u_1} {M : Type u_5} [CommMonoid M] (f : αM) (s : Finset α) :
              ∏ᶠ (i : α) (_ : i s), f i = Finset.prod s fun i => f i
              theorem finsum_mem_coe_finset {α : Type u_1} {M : Type u_5} [AddCommMonoid M] (f : αM) (s : Finset α) :
              ∑ᶠ (i : α) (_ : i s), f i = Finset.sum s fun i => f i
              theorem finprod_mem_coe_finset {α : Type u_1} {M : Type u_5} [CommMonoid M] (f : αM) (s : Finset α) :
              ∏ᶠ (i : α) (_ : i s), f i = Finset.prod s fun i => f i
              theorem finsum_mem_eq_zero_of_infinite {α : Type u_1} {M : Type u_5} [AddCommMonoid M] {f : αM} {s : Set α} (hs : Set.Infinite (s Function.support f)) :
              ∑ᶠ (i : α) (_ : i s), f i = 0
              theorem finprod_mem_eq_one_of_infinite {α : Type u_1} {M : Type u_5} [CommMonoid M] {f : αM} {s : Set α} (hs : Set.Infinite (s Function.mulSupport f)) :
              ∏ᶠ (i : α) (_ : i s), f i = 1
              theorem finsum_mem_eq_zero_of_forall_eq_zero {α : Type u_1} {M : Type u_5} [AddCommMonoid M] {f : αM} {s : Set α} (h : ∀ (x : α), x sf x = 0) :
              ∑ᶠ (i : α) (_ : i s), f i = 0
              theorem finprod_mem_eq_one_of_forall_eq_one {α : Type u_1} {M : Type u_5} [CommMonoid M] {f : αM} {s : Set α} (h : ∀ (x : α), x sf x = 1) :
              ∏ᶠ (i : α) (_ : i s), f i = 1
              theorem finsum_mem_inter_support {α : Type u_1} {M : Type u_5} [AddCommMonoid M] (f : αM) (s : Set α) :
              ∑ᶠ (i : α) (_ : i s Function.support f), f i = ∑ᶠ (i : α) (_ : i s), f i
              theorem finprod_mem_inter_mulSupport {α : Type u_1} {M : Type u_5} [CommMonoid M] (f : αM) (s : Set α) :
              ∏ᶠ (i : α) (_ : i s Function.mulSupport f), f i = ∏ᶠ (i : α) (_ : i s), f i
              theorem finsum_mem_inter_support_eq {α : Type u_1} {M : Type u_5} [AddCommMonoid M] (f : αM) (s : Set α) (t : Set α) (h : s Function.support f = t Function.support f) :
              ∑ᶠ (i : α) (_ : i s), f i = ∑ᶠ (i : α) (_ : i t), f i
              theorem finprod_mem_inter_mulSupport_eq {α : Type u_1} {M : Type u_5} [CommMonoid M] (f : αM) (s : Set α) (t : Set α) (h : s Function.mulSupport f = t Function.mulSupport f) :
              ∏ᶠ (i : α) (_ : i s), f i = ∏ᶠ (i : α) (_ : i t), f i
              theorem finsum_mem_inter_support_eq' {α : Type u_1} {M : Type u_5} [AddCommMonoid M] (f : αM) (s : Set α) (t : Set α) (h : ∀ (x : α), x Function.support f → (x s x t)) :
              ∑ᶠ (i : α) (_ : i s), f i = ∑ᶠ (i : α) (_ : i t), f i
              theorem finprod_mem_inter_mulSupport_eq' {α : Type u_1} {M : Type u_5} [CommMonoid M] (f : αM) (s : Set α) (t : Set α) (h : ∀ (x : α), x Function.mulSupport f → (x s x t)) :
              ∏ᶠ (i : α) (_ : i s), f i = ∏ᶠ (i : α) (_ : i t), f i
              theorem finsum_mem_univ {α : Type u_1} {M : Type u_5} [AddCommMonoid M] (f : αM) :
              ∑ᶠ (i : α) (_ : i Set.univ), f i = ∑ᶠ (i : α), f i
              theorem finprod_mem_univ {α : Type u_1} {M : Type u_5} [CommMonoid M] (f : αM) :
              ∏ᶠ (i : α) (_ : i Set.univ), f i = ∏ᶠ (i : α), f i
              theorem finsum_mem_congr {α : Type u_1} {M : Type u_5} [AddCommMonoid M] {f : αM} {g : αM} {s : Set α} {t : Set α} (h₀ : s = t) (h₁ : ∀ (x : α), x tf x = g x) :
              ∑ᶠ (i : α) (_ : i s), f i = ∑ᶠ (i : α) (_ : i t), g i
              theorem finprod_mem_congr {α : Type u_1} {M : Type u_5} [CommMonoid M] {f : αM} {g : αM} {s : Set α} {t : Set α} (h₀ : s = t) (h₁ : ∀ (x : α), x tf x = g x) :
              ∏ᶠ (i : α) (_ : i s), f i = ∏ᶠ (i : α) (_ : i t), g i
              theorem finsum_eq_zero_of_forall_eq_zero {α : Type u_1} {M : Type u_5} [AddCommMonoid M] {f : αM} (h : ∀ (x : α), f x = 0) :
              ∑ᶠ (i : α), f i = 0
              theorem finprod_eq_one_of_forall_eq_one {α : Type u_1} {M : Type u_5} [CommMonoid M] {f : αM} (h : ∀ (x : α), f x = 1) :
              ∏ᶠ (i : α), f i = 1
              theorem finsum_pos' {ι : Type u_3} {M : Type u_7} [OrderedCancelAddCommMonoid M] {f : ιM} (h : ∀ (i : ι), 0 f i) (h' : i, 0 < f i) (hf : Set.Finite (Function.support f)) :
              0 < ∑ᶠ (i : ι), f i
              theorem one_lt_finprod' {ι : Type u_3} {M : Type u_7} [OrderedCancelCommMonoid M] {f : ιM} (h : ∀ (i : ι), 1 f i) (h' : i, 1 < f i) (hf : Set.Finite (Function.mulSupport f)) :
              1 < ∏ᶠ (i : ι), f i

              Distributivity w.r.t. addition, subtraction, and (scalar) multiplication #

              theorem finsum_add_distrib {α : Type u_1} {M : Type u_5} [AddCommMonoid M] {f : αM} {g : αM} (hf : Set.Finite (Function.support f)) (hg : Set.Finite (Function.support g)) :
              ∑ᶠ (i : α), (f i + g i) = ∑ᶠ (i : α), f i + ∑ᶠ (i : α), g i

              If the additive supports of f and g are finite, then the sum of f i + g i equals the sum of f i plus the sum of g i.

              theorem finprod_mul_distrib {α : Type u_1} {M : Type u_5} [CommMonoid M] {f : αM} {g : αM} (hf : Set.Finite (Function.mulSupport f)) (hg : Set.Finite (Function.mulSupport g)) :
              ∏ᶠ (i : α), f i * g i = (∏ᶠ (i : α), f i) * ∏ᶠ (i : α), g i

              If the multiplicative supports of f and g are finite, then the product of f i * g i equals the product of f i multiplied by the product of g i.

              theorem finsum_sub_distrib {α : Type u_1} {G : Type u_4} [SubtractionCommMonoid G] {f : αG} {g : αG} (hf : Set.Finite (Function.support f)) (hg : Set.Finite (Function.support g)) :
              ∑ᶠ (i : α), (f i - g i) = ∑ᶠ (i : α), f i - ∑ᶠ (i : α), g i

              If the additive supports of f and g are finite, then the sum of f i - g i equals the sum of f i minus the sum of g i.

              theorem finprod_div_distrib {α : Type u_1} {G : Type u_4} [DivisionCommMonoid G] {f : αG} {g : αG} (hf : Set.Finite (Function.mulSupport f)) (hg : Set.Finite (Function.mulSupport g)) :
              ∏ᶠ (i : α), f i / g i = (∏ᶠ (i : α), f i) / ∏ᶠ (i : α), g i

              If the multiplicative supports of f and g are finite, then the product of f i / g i equals the product of f i divided by the product of g i.

              theorem finsum_mem_add_distrib' {α : Type u_1} {M : Type u_5} [AddCommMonoid M] {f : αM} {g : αM} {s : Set α} (hf : Set.Finite (s Function.support f)) (hg : Set.Finite (s Function.support g)) :
              ∑ᶠ (i : α) (_ : i s), (f i + g i) = ∑ᶠ (i : α) (_ : i s), f i + ∑ᶠ (i : α) (_ : i s), g i

              A more general version of finsum_mem_add_distrib that only requires s ∩ support f and s ∩ support g rather than s to be finite.

              theorem finprod_mem_mul_distrib' {α : Type u_1} {M : Type u_5} [CommMonoid M] {f : αM} {g : αM} {s : Set α} (hf : Set.Finite (s Function.mulSupport f)) (hg : Set.Finite (s Function.mulSupport g)) :
              ∏ᶠ (i : α) (_ : i s), f i * g i = (∏ᶠ (i : α) (_ : i s), f i) * ∏ᶠ (i : α) (_ : i s), g i

              A more general version of finprod_mem_mul_distrib that only requires s ∩ mulSupport f and s ∩ mulSupport g rather than s to be finite.

              theorem finsum_mem_zero {α : Type u_1} {M : Type u_5} [AddCommMonoid M] (s : Set α) :
              ∑ᶠ (i : α) (_ : i s), 0 = 0

              The product of the constant function 0 over any set equals 0.

              theorem finprod_mem_one {α : Type u_1} {M : Type u_5} [CommMonoid M] (s : Set α) :
              ∏ᶠ (i : α) (_ : i s), 1 = 1

              The product of the constant function 1 over any set equals 1.

              theorem finsum_mem_of_eqOn_zero {α : Type u_1} {M : Type u_5} [AddCommMonoid M] {f : αM} {s : Set α} (hf : Set.EqOn f 0 s) :
              ∑ᶠ (i : α) (_ : i s), f i = 0

              If a function f equals 0 on a set s, then the product of f i over i ∈ s equals 0.

              theorem finprod_mem_of_eqOn_one {α : Type u_1} {M : Type u_5} [CommMonoid M] {f : αM} {s : Set α} (hf : Set.EqOn f 1 s) :
              ∏ᶠ (i : α) (_ : i s), f i = 1

              If a function f equals 1 on a set s, then the product of f i over i ∈ s equals 1.

              theorem exists_ne_zero_of_finsum_mem_ne_zero {α : Type u_1} {M : Type u_5} [AddCommMonoid M] {f : αM} {s : Set α} (h : ∑ᶠ (i : α) (_ : i s), f i 0) :
              x, x s f x 0

              If the product of f i over i ∈ s is not equal to 0, then there is some x ∈ s such that f x ≠ 0.

              theorem exists_ne_one_of_finprod_mem_ne_one {α : Type u_1} {M : Type u_5} [CommMonoid M] {f : αM} {s : Set α} (h : ∏ᶠ (i : α) (_ : i s), f i 1) :
              x, x s f x 1

              If the product of f i over i ∈ s is not equal to 1, then there is some x ∈ s such that f x ≠ 1.

              theorem finsum_mem_add_distrib {α : Type u_1} {M : Type u_5} [AddCommMonoid M] {f : αM} {g : αM} {s : Set α} (hs : Set.Finite s) :
              ∑ᶠ (i : α) (_ : i s), (f i + g i) = ∑ᶠ (i : α) (_ : i s), f i + ∑ᶠ (i : α) (_ : i s), g i

              Given a finite set s, the sum of f i + g i over i ∈ s equals the sum of f i over i ∈ s plus the sum of g i over i ∈ s.

              theorem finprod_mem_mul_distrib {α : Type u_1} {M : Type u_5} [CommMonoid M] {f : αM} {g : αM} {s : Set α} (hs : Set.Finite s) :
              ∏ᶠ (i : α) (_ : i s), f i * g i = (∏ᶠ (i : α) (_ : i s), f i) * ∏ᶠ (i : α) (_ : i s), g i

              Given a finite set s, the product of f i * g i over i ∈ s equals the product of f i over i ∈ s times the product of g i over i ∈ s.

              theorem AddMonoidHom.map_finsum {α : Type u_1} {M : Type u_5} {N : Type u_6} [AddCommMonoid M] [AddCommMonoid N] {f : αM} (g : M →+ N) (hf : Set.Finite (Function.support f)) :
              g (∑ᶠ (i : α), f i) = ∑ᶠ (i : α), g (f i)
              theorem MonoidHom.map_finprod {α : Type u_1} {M : Type u_5} {N : Type u_6} [CommMonoid M] [CommMonoid N] {f : αM} (g : M →* N) (hf : Set.Finite (Function.mulSupport f)) :
              g (∏ᶠ (i : α), f i) = ∏ᶠ (i : α), g (f i)
              theorem finsum_nsmul {α : Type u_1} {M : Type u_5} [AddCommMonoid M] {f : αM} (hf : Set.Finite (Function.support f)) (n : ) :
              n ∑ᶠ (i : α), f i = ∑ᶠ (i : α), n f i
              theorem finprod_pow {α : Type u_1} {M : Type u_5} [CommMonoid M] {f : αM} (hf : Set.Finite (Function.mulSupport f)) (n : ) :
              (∏ᶠ (i : α), f i) ^ n = ∏ᶠ (i : α), f i ^ n
              theorem finsum_smul' {ι : Type u_3} {R : Type u_7} {M : Type u_8} [Semiring R] [AddCommMonoid M] [Module R M] {f : ιR} (hf : Set.Finite (Function.support f)) (x : M) :
              (∑ᶠ (i : ι), f i) x = ∑ᶠ (i : ι), f i x

              See also finsum_smul for a version that works even when the support of f is not finite, but with slightly stronger typeclass requirements.

              theorem smul_finsum' {ι : Type u_3} {R : Type u_7} {M : Type u_8} [Semiring R] [AddCommMonoid M] [Module R M] (c : R) {f : ιM} (hf : Set.Finite (Function.support f)) :
              c ∑ᶠ (i : ι), f i = ∑ᶠ (i : ι), c f i

              See also smul_finsum for a version that works even when the support of f is not finite, but with slightly stronger typeclass requirements.

              theorem AddMonoidHom.map_finsum_mem' {α : Type u_1} {M : Type u_5} {N : Type u_6} [AddCommMonoid M] [AddCommMonoid N] {s : Set α} {f : αM} (g : M →+ N) (h₀ : Set.Finite (s Function.support f)) :
              g (∑ᶠ (j : α) (_ : j s), f j) = ∑ᶠ (i : α) (_ : i s), g (f i)

              A more general version of AddMonoidHom.map_finsum_mem that requires s ∩ support f rather than s to be finite.

              theorem MonoidHom.map_finprod_mem' {α : Type u_1} {M : Type u_5} {N : Type u_6} [CommMonoid M] [CommMonoid N] {s : Set α} {f : αM} (g : M →* N) (h₀ : Set.Finite (s Function.mulSupport f)) :
              g (∏ᶠ (j : α) (_ : j s), f j) = ∏ᶠ (i : α) (_ : i s), g (f i)

              A more general version of MonoidHom.map_finprod_mem that requires s ∩ mulSupport f rather than s to be finite.

              theorem AddMonoidHom.map_finsum_mem {α : Type u_1} {M : Type u_5} {N : Type u_6} [AddCommMonoid M] [AddCommMonoid N] {s : Set α} (f : αM) (g : M →+ N) (hs : Set.Finite s) :
              g (∑ᶠ (j : α) (_ : j s), f j) = ∑ᶠ (i : α) (_ : i s), g (f i)

              Given an additive monoid homomorphism g : M →* N and a function f : α → M, the value of g at the sum of f i over i ∈ s equals the sum of g (f i) over s.

              theorem MonoidHom.map_finprod_mem {α : Type u_1} {M : Type u_5} {N : Type u_6} [CommMonoid M] [CommMonoid N] {s : Set α} (f : αM) (g : M →* N) (hs : Set.Finite s) :
              g (∏ᶠ (j : α) (_ : j s), f j) = ∏ᶠ (i : α) (_ : i s), g (f i)

              Given a monoid homomorphism g : M →* N and a function f : α → M, the value of g at the product of f i over i ∈ s equals the product of g (f i) over s.

              theorem AddEquiv.map_finsum_mem {α : Type u_1} {M : Type u_5} {N : Type u_6} [AddCommMonoid M] [AddCommMonoid N] (g : M ≃+ N) (f : αM) {s : Set α} (hs : Set.Finite s) :
              g (∑ᶠ (i : α) (_ : i s), f i) = ∑ᶠ (i : α) (_ : i s), g (f i)
              theorem MulEquiv.map_finprod_mem {α : Type u_1} {M : Type u_5} {N : Type u_6} [CommMonoid M] [CommMonoid N] (g : M ≃* N) (f : αM) {s : Set α} (hs : Set.Finite s) :
              g (∏ᶠ (i : α) (_ : i s), f i) = ∏ᶠ (i : α) (_ : i s), g (f i)
              theorem finsum_mem_neg_distrib {α : Type u_1} {G : Type u_4} {s : Set α} [SubtractionCommMonoid G] (f : αG) (hs : Set.Finite s) :
              ∑ᶠ (x : α) (_ : x s), -f x = -∑ᶠ (x : α) (_ : x s), f x
              theorem finprod_mem_inv_distrib {α : Type u_1} {G : Type u_4} {s : Set α} [DivisionCommMonoid G] (f : αG) (hs : Set.Finite s) :
              ∏ᶠ (x : α) (_ : x s), (f x)⁻¹ = (∏ᶠ (x : α) (_ : x s), f x)⁻¹
              theorem finsum_mem_sub_distrib {α : Type u_1} {G : Type u_4} {s : Set α} [SubtractionCommMonoid G] (f : αG) (g : αG) (hs : Set.Finite s) :
              ∑ᶠ (i : α) (_ : i s), (f i - g i) = ∑ᶠ (i : α) (_ : i s), f i - ∑ᶠ (i : α) (_ : i s), g i

              Given a finite set s, the sum of f i / g i over i ∈ s equals the sum of f i over i ∈ s minus the sum of g i over i ∈ s.

              theorem finprod_mem_div_distrib {α : Type u_1} {G : Type u_4} {s : Set α} [DivisionCommMonoid G] (f : αG) (g : αG) (hs : Set.Finite s) :
              ∏ᶠ (i : α) (_ : i s), f i / g i = (∏ᶠ (i : α) (_ : i s), f i) / ∏ᶠ (i : α) (_ : i s), g i

              Given a finite set s, the product of f i / g i over i ∈ s equals the product of f i over i ∈ s divided by the product of g i over i ∈ s.

              ∏ᶠ x ∈ s, f x and set operations #

              theorem finsum_mem_empty {α : Type u_1} {M : Type u_5} [AddCommMonoid M] {f : αM} :
              ∑ᶠ (i : α) (_ : i ), f i = 0

              The sum of any function over an empty set is 0.

              theorem finprod_mem_empty {α : Type u_1} {M : Type u_5} [CommMonoid M] {f : αM} :
              ∏ᶠ (i : α) (_ : i ), f i = 1

              The product of any function over an empty set is 1.

              theorem nonempty_of_finsum_mem_ne_zero {α : Type u_1} {M : Type u_5} [AddCommMonoid M] {f : αM} {s : Set α} (h : ∑ᶠ (i : α) (_ : i s), f i 0) :

              A set s is nonempty if the sum of some function over s is not equal to 0.

              theorem nonempty_of_finprod_mem_ne_one {α : Type u_1} {M : Type u_5} [CommMonoid M] {f : αM} {s : Set α} (h : ∏ᶠ (i : α) (_ : i s), f i 1) :

              A set s is nonempty if the product of some function over s is not equal to 1.

              theorem finsum_mem_union_inter {α : Type u_1} {M : Type u_5} [AddCommMonoid M] {f : αM} {s : Set α} {t : Set α} (hs : Set.Finite s) (ht : Set.Finite t) :
              ∑ᶠ (i : α) (_ : i s t), f i + ∑ᶠ (i : α) (_ : i s t), f i = ∑ᶠ (i : α) (_ : i s), f i + ∑ᶠ (i : α) (_ : i t), f i

              Given finite sets s and t, the sum of f i over i ∈ s ∪ t plus the sum of f i over i ∈ s ∩ t equals the sum of f i over i ∈ s plus the sum of f i over i ∈ t.

              theorem finprod_mem_union_inter {α : Type u_1} {M : Type u_5} [CommMonoid M] {f : αM} {s : Set α} {t : Set α} (hs : Set.Finite s) (ht : Set.Finite t) :
              (∏ᶠ (i : α) (_ : i s t), f i) * ∏ᶠ (i : α) (_ : i s t), f i = (∏ᶠ (i : α) (_ : i s), f i) * ∏ᶠ (i : α) (_ : i t), f i

              Given finite sets s and t, the product of f i over i ∈ s ∪ t times the product of f i over i ∈ s ∩ t equals the product of f i over i ∈ s times the product of f i over i ∈ t.

              theorem finsum_mem_union_inter' {α : Type u_1} {M : Type u_5} [AddCommMonoid M] {f : αM} {s : Set α} {t : Set α} (hs : Set.Finite (s Function.support f)) (ht : Set.Finite (t Function.support f)) :
              ∑ᶠ (i : α) (_ : i s t), f i + ∑ᶠ (i : α) (_ : i s t), f i = ∑ᶠ (i : α) (_ : i s), f i + ∑ᶠ (i : α) (_ : i t), f i

              A more general version of finsum_mem_union_inter that requires s ∩ support f and t ∩ support f rather than s and t to be finite.

              theorem finprod_mem_union_inter' {α : Type u_1} {M : Type u_5} [CommMonoid M] {f : αM} {s : Set α} {t : Set α} (hs : Set.Finite (s Function.mulSupport f)) (ht : Set.Finite (t Function.mulSupport f)) :
              (∏ᶠ (i : α) (_ : i s t), f i) * ∏ᶠ (i : α) (_ : i s t), f i = (∏ᶠ (i : α) (_ : i s), f i) * ∏ᶠ (i : α) (_ : i t), f i

              A more general version of finprod_mem_union_inter that requires s ∩ mulSupport f and t ∩ mulSupport f rather than s and t to be finite.

              theorem finsum_mem_union' {α : Type u_1} {M : Type u_5} [AddCommMonoid M] {f : αM} {s : Set α} {t : Set α} (hst : Disjoint s t) (hs : Set.Finite (s Function.support f)) (ht : Set.Finite (t Function.support f)) :
              ∑ᶠ (i : α) (_ : i s t), f i = ∑ᶠ (i : α) (_ : i s), f i + ∑ᶠ (i : α) (_ : i t), f i

              A more general version of finsum_mem_union that requires s ∩ support f and t ∩ support f rather than s and t to be finite.

              theorem finprod_mem_union' {α : Type u_1} {M : Type u_5} [CommMonoid M] {f : αM} {s : Set α} {t : Set α} (hst : Disjoint s t) (hs : Set.Finite (s Function.mulSupport f)) (ht : Set.Finite (t Function.mulSupport f)) :
              ∏ᶠ (i : α) (_ : i s t), f i = (∏ᶠ (i : α) (_ : i s), f i) * ∏ᶠ (i : α) (_ : i t), f i

              A more general version of finprod_mem_union that requires s ∩ mulSupport f and t ∩ mulSupport f rather than s and t to be finite.

              theorem finsum_mem_union {α : Type u_1} {M : Type u_5} [AddCommMonoid M] {f : αM} {s : Set α} {t : Set α} (hst : Disjoint s t) (hs : Set.Finite s) (ht : Set.Finite t) :
              ∑ᶠ (i : α) (_ : i s t), f i = ∑ᶠ (i : α) (_ : i s), f i + ∑ᶠ (i : α) (_ : i t), f i

              Given two finite disjoint sets s and t, the sum of f i over i ∈ s ∪ t equals the sum of f i over i ∈ s plus the sum of f i over i ∈ t.

              theorem finprod_mem_union {α : Type u_1} {M : Type u_5} [CommMonoid M] {f : αM} {s : Set α} {t : Set α} (hst : Disjoint s t) (hs : Set.Finite s) (ht : Set.Finite t) :
              ∏ᶠ (i : α) (_ : i s t), f i = (∏ᶠ (i : α) (_ : i s), f i) * ∏ᶠ (i : α) (_ : i t), f i

              Given two finite disjoint sets s and t, the product of f i over i ∈ s ∪ t equals the product of f i over i ∈ s times the product of f i over i ∈ t.

              theorem finsum_mem_union'' {α : Type u_1} {M : Type u_5} [AddCommMonoid M] {f : αM} {s : Set α} {t : Set α} (hst : Disjoint (s Function.support f) (t Function.support f)) (hs : Set.Finite (s Function.support f)) (ht : Set.Finite (t Function.support f)) :
              ∑ᶠ (i : α) (_ : i s t), f i = ∑ᶠ (i : α) (_ : i s), f i + ∑ᶠ (i : α) (_ : i t), f i

              A more general version of finsum_mem_union' that requires s ∩ support f and t ∩ support f rather than s and t to be disjoint

              theorem finprod_mem_union'' {α : Type u_1} {M : Type u_5} [CommMonoid M] {f : αM} {s : Set α} {t : Set α} (hst : Disjoint (s Function.mulSupport f) (t Function.mulSupport f)) (hs : Set.Finite (s Function.mulSupport f)) (ht : Set.Finite (t Function.mulSupport f)) :
              ∏ᶠ (i : α) (_ : i s t), f i = (∏ᶠ (i : α) (_ : i s), f i) * ∏ᶠ (i : α) (_ : i t), f i

              A more general version of finprod_mem_union' that requires s ∩ mulSupport f and t ∩ mulSupport f rather than s and t to be disjoint

              theorem finsum_mem_singleton {α : Type u_1} {M : Type u_5} [AddCommMonoid M] {f : αM} {a : α} :
              ∑ᶠ (i : α) (_ : i {a}), f i = f a

              The sum of f i over i ∈ {a} equals f a.

              theorem finprod_mem_singleton {α : Type u_1} {M : Type u_5} [CommMonoid M] {f : αM} {a : α} :
              ∏ᶠ (i : α) (_ : i {a}), f i = f a

              The product of f i over i ∈ {a} equals f a.

              @[simp]
              theorem finsum_cond_eq_left {α : Type u_1} {M : Type u_5} [AddCommMonoid M] {f : αM} {a : α} :
              ∑ᶠ (i : α) (_ : i = a), f i = f a
              @[simp]
              theorem finprod_cond_eq_left {α : Type u_1} {M : Type u_5} [CommMonoid M] {f : αM} {a : α} :
              ∏ᶠ (i : α) (_ : i = a), f i = f a
              @[simp]
              theorem finsum_cond_eq_right {α : Type u_1} {M : Type u_5} [AddCommMonoid M] {f : αM} {a : α} :
              ∑ᶠ (i : α) (_ : a = i), f i = f a
              @[simp]
              theorem finprod_cond_eq_right {α : Type u_1} {M : Type u_5} [CommMonoid M] {f : αM} {a : α} :
              ∏ᶠ (i : α) (_ : a = i), f i = f a
              theorem finsum_mem_insert' {α : Type u_1} {M : Type u_5} [AddCommMonoid M] {a : α} {s : Set α} (f : αM) (h : ¬a s) (hs : Set.Finite (s Function.support f)) :
              ∑ᶠ (i : α) (_ : i insert a s), f i = f a + ∑ᶠ (i : α) (_ : i s), f i

              A more general version of finsum_mem_insert that requires s ∩ support f rather than s to be finite.

              theorem finprod_mem_insert' {α : Type u_1} {M : Type u_5} [CommMonoid M] {a : α} {s : Set α} (f : αM) (h : ¬a s) (hs : Set.Finite (s Function.mulSupport f)) :
              ∏ᶠ (i : α) (_ : i insert a s), f i = f a * ∏ᶠ (i : α) (_ : i s), f i

              A more general version of finprod_mem_insert that requires s ∩ mulSupport f rather than s to be finite.

              theorem finsum_mem_insert {α : Type u_1} {M : Type u_5} [AddCommMonoid M] {a : α} {s : Set α} (f : αM) (h : ¬a s) (hs : Set.Finite s) :
              ∑ᶠ (i : α) (_ : i insert a s), f i = f a + ∑ᶠ (i : α) (_ : i s), f i

              Given a finite set s and an element a ∉ s, the sum of f i over i ∈ insert a s equals f a plus the sum of f i over i ∈ s.

              theorem finprod_mem_insert {α : Type u_1} {M : Type u_5} [CommMonoid M] {a : α} {s : Set α} (f : αM) (h : ¬a s) (hs : Set.Finite s) :
              ∏ᶠ (i : α) (_ : i insert a s), f i = f a * ∏ᶠ (i : α) (_ : i s), f i

              Given a finite set s and an element a ∉ s, the product of f i over i ∈ insert a s equals f a times the product of f i over i ∈ s.

              theorem finsum_mem_insert_of_eq_zero_if_not_mem {α : Type u_1} {M : Type u_5} [AddCommMonoid M] {f : αM} {a : α} {s : Set α} (h : ¬a sf a = 0) :
              ∑ᶠ (i : α) (_ : i insert a s), f i = ∑ᶠ (i : α) (_ : i s), f i

              If f a = 0 when a ∉ s, then the sum of f i over i ∈ insert a s equals the sum of f i over i ∈ s.

              theorem finprod_mem_insert_of_eq_one_if_not_mem {α : Type u_1} {M : Type u_5} [CommMonoid M] {f : αM} {a : α} {s : Set α} (h : ¬a sf a = 1) :
              ∏ᶠ (i : α) (_ : i insert a s), f i = ∏ᶠ (i : α) (_ : i s), f i

              If f a = 1 when a ∉ s, then the product of f i over i ∈ insert a s equals the product of f i over i ∈ s.

              theorem finsum_mem_insert_zero {α : Type u_1} {M : Type u_5} [AddCommMonoid M] {f : αM} {a : α} {s : Set α} (h : f a = 0) :
              ∑ᶠ (i : α) (_ : i insert a s), f i = ∑ᶠ (i : α) (_ : i s), f i

              If f a = 0, then the sum of f i over i ∈ insert a s equals the sum of f i over i ∈ s.

              theorem finprod_mem_insert_one {α : Type u_1} {M : Type u_5} [CommMonoid M] {f : αM} {a : α} {s : Set α} (h : f a = 1) :
              ∏ᶠ (i : α) (_ : i insert a s), f i = ∏ᶠ (i : α) (_ : i s), f i

              If f a = 1, then the product of f i over i ∈ insert a s equals the product of f i over i ∈ s.

              theorem finprod_mem_dvd {α : Type u_1} {N : Type u_6} [CommMonoid N] {f : αN} (a : α) (hf : Set.Finite (Function.mulSupport f)) :
              f a finprod f

              If the multiplicative support of f is finite, then for every x in the domain of f, f x divides finprod f.

              theorem finsum_mem_pair {α : Type u_1} {M : Type u_5} [AddCommMonoid M] {f : αM} {a : α} {b : α} (h : a b) :
              ∑ᶠ (i : α) (_ : i {a, b}), f i = f a + f b

              The sum of f i over i ∈ {a, b}, a ≠ b, is equal to f a + f b.

              theorem finprod_mem_pair {α : Type u_1} {M : Type u_5} [CommMonoid M] {f : αM} {a : α} {b : α} (h : a b) :
              ∏ᶠ (i : α) (_ : i {a, b}), f i = f a * f b

              The product of f i over i ∈ {a, b}, a ≠ b, is equal to f a * f b.

              theorem finsum_mem_image' {α : Type u_1} {β : Type u_2} {M : Type u_5} [AddCommMonoid M] {f : αM} {s : Set β} {g : βα} (hg : Set.InjOn g (s Function.support (f g))) :
              ∑ᶠ (i : α) (_ : i g '' s), f i = ∑ᶠ (j : β) (_ : j s), f (g j)

              The sum of f y over y ∈ g '' s equals the sum of f (g i) over s provided that g is injective on s ∩ support (f ∘ g).

              theorem finprod_mem_image' {α : Type u_1} {β : Type u_2} {M : Type u_5} [CommMonoid M] {f : αM} {s : Set β} {g : βα} (hg : Set.InjOn g (s Function.mulSupport (f g))) :
              ∏ᶠ (i : α) (_ : i g '' s), f i = ∏ᶠ (j : β) (_ : j s), f (g j)

              The product of f y over y ∈ g '' s equals the product of f (g i) over s provided that g is injective on s ∩ mulSupport (f ∘ g).

              theorem finsum_mem_image {α : Type u_1} {β : Type u_2} {M : Type u_5} [AddCommMonoid M] {f : αM} {s : Set β} {g : βα} (hg : Set.InjOn g s) :
              ∑ᶠ (i : α) (_ : i g '' s), f i = ∑ᶠ (j : β) (_ : j s), f (g j)

              The sum of f y over y ∈ g '' s equals the sum of f (g i) over s provided that g is injective on s.

              theorem finprod_mem_image {α : Type u_1} {β : Type u_2} {M : Type u_5} [CommMonoid M] {f : αM} {s : Set β} {g : βα} (hg : Set.InjOn g s) :
              ∏ᶠ (i : α) (_ : i g '' s), f i = ∏ᶠ (j : β) (_ : j s), f (g j)

              The product of f y over y ∈ g '' s equals the product of f (g i) over s provided that g is injective on s.

              theorem finsum_mem_range' {α : Type u_1} {β : Type u_2} {M : Type u_5} [AddCommMonoid M] {f : αM} {g : βα} (hg : Set.InjOn g (Function.support (f g))) :
              ∑ᶠ (i : α) (_ : i Set.range g), f i = ∑ᶠ (j : β), f (g j)

              The sum of f y over y ∈ Set.range g equals the sum of f (g i) over all i provided that g is injective on support (f ∘ g).

              theorem finprod_mem_range' {α : Type u_1} {β : Type u_2} {M : Type u_5} [CommMonoid M] {f : αM} {g : βα} (hg : Set.InjOn g (Function.mulSupport (f g))) :
              ∏ᶠ (i : α) (_ : i Set.range g), f i = ∏ᶠ (j : β), f (g j)

              The product of f y over y ∈ Set.range g equals the product of f (g i) over all i provided that g is injective on mulSupport (f ∘ g).

              theorem finsum_mem_range {α : Type u_1} {β : Type u_2} {M : Type u_5} [AddCommMonoid M] {f : αM} {g : βα} (hg : Function.Injective g) :
              ∑ᶠ (i : α) (_ : i Set.range g), f i = ∑ᶠ (j : β), f (g j)

              The sum of f y over y ∈ Set.range g equals the sum of f (g i) over all i provided that g is injective.

              theorem finprod_mem_range {α : Type u_1} {β : Type u_2} {M : Type u_5} [CommMonoid M] {f : αM} {g : βα} (hg : Function.Injective g) :
              ∏ᶠ (i : α) (_ : i Set.range g), f i = ∏ᶠ (j : β), f (g j)

              The product of f y over y ∈ Set.range g equals the product of f (g i) over all i provided that g is injective.

              theorem finsum_mem_eq_of_bijOn {α : Type u_1} {β : Type u_2} {M : Type u_5} [AddCommMonoid M] {s : Set α} {t : Set β} {f : αM} {g : βM} (e : αβ) (he₀ : Set.BijOn e s t) (he₁ : ∀ (x : α), x sf x = g (e x)) :
              ∑ᶠ (i : α) (_ : i s), f i = ∑ᶠ (j : β) (_ : j t), g j

              See also Finset.sum_bij.

              theorem finprod_mem_eq_of_bijOn {α : Type u_1} {β : Type u_2} {M : Type u_5} [CommMonoid M] {s : Set α} {t : Set β} {f : αM} {g : βM} (e : αβ) (he₀ : Set.BijOn e s t) (he₁ : ∀ (x : α), x sf x = g (e x)) :
              ∏ᶠ (i : α) (_ : i s), f i = ∏ᶠ (j : β) (_ : j t), g j

              See also Finset.prod_bij.

              theorem finsum_eq_of_bijective {α : Type u_1} {β : Type u_2} {M : Type u_5} [AddCommMonoid M] {f : αM} {g : βM} (e : αβ) (he₀ : Function.Bijective e) (he₁ : ∀ (x : α), f x = g (e x)) :
              ∑ᶠ (i : α), f i = ∑ᶠ (j : β), g j

              See finsum_comp, Fintype.sum_bijective and Finset.sum_bij.

              theorem finprod_eq_of_bijective {α : Type u_1} {β : Type u_2} {M : Type u_5} [CommMonoid M] {f : αM} {g : βM} (e : αβ) (he₀ : Function.Bijective e) (he₁ : ∀ (x : α), f x = g (e x)) :
              ∏ᶠ (i : α), f i = ∏ᶠ (j : β), g j

              See finprod_comp, Fintype.prod_bijective and Finset.prod_bij.

              theorem finsum_comp {α : Type u_1} {β : Type u_2} {M : Type u_5} [AddCommMonoid M] {g : βM} (e : αβ) (he₀ : Function.Bijective e) :
              ∑ᶠ (i : α), g (e i) = ∑ᶠ (j : β), g j

              See also finsum_eq_of_bijective, Fintype.sum_bijective and Finset.sum_bij.

              theorem finprod_comp {α : Type u_1} {β : Type u_2} {M : Type u_5} [CommMonoid M] {g : βM} (e : αβ) (he₀ : Function.Bijective e) :
              ∏ᶠ (i : α), g (e i) = ∏ᶠ (j : β), g j

              See also finprod_eq_of_bijective, Fintype.prod_bijective and Finset.prod_bij.

              theorem finsum_comp_equiv {α : Type u_1} {β : Type u_2} {M : Type u_5} [AddCommMonoid M] (e : α β) {f : βM} :
              ∑ᶠ (i : α), f (e i) = ∑ᶠ (i' : β), f i'
              theorem finprod_comp_equiv {α : Type u_1} {β : Type u_2} {M : Type u_5} [CommMonoid M] (e : α β) {f : βM} :
              ∏ᶠ (i : α), f (e i) = ∏ᶠ (i' : β), f i'
              theorem finsum_set_coe_eq_finsum_mem {α : Type u_1} {M : Type u_5} [AddCommMonoid M] {f : αM} (s : Set α) :
              ∑ᶠ (j : s), f j = ∑ᶠ (i : α) (_ : i s), f i
              theorem finprod_set_coe_eq_finprod_mem {α : Type u_1} {M : Type u_5} [CommMonoid M] {f : αM} (s : Set α) :
              ∏ᶠ (j : s), f j = ∏ᶠ (i : α) (_ : i s), f i
              theorem finsum_subtype_eq_finsum_cond {α : Type u_1} {M : Type u_5} [AddCommMonoid M] {f : αM} (p : αProp) :
              ∑ᶠ (j : Subtype p), f j = ∑ᶠ (i : α) (x : p i), f i
              theorem finprod_subtype_eq_finprod_cond {α : Type u_1} {M : Type u_5} [CommMonoid M] {f : αM} (p : αProp) :
              ∏ᶠ (j : Subtype p), f j = ∏ᶠ (i : α) (x : p i), f i
              theorem finsum_mem_inter_add_diff' {α : Type u_1} {M : Type u_5} [AddCommMonoid M] {f : αM} {s : Set α} (t : Set α) (h : Set.Finite (s Function.support f)) :
              ∑ᶠ (i : α) (_ : i s t), f i + ∑ᶠ (i : α) (_ : i s \ t), f i = ∑ᶠ (i : α) (_ : i s), f i
              theorem finprod_mem_inter_mul_diff' {α : Type u_1} {M : Type u_5} [CommMonoid M] {f : αM} {s : Set α} (t : Set α) (h : Set.Finite (s Function.mulSupport f)) :
              (∏ᶠ (i : α) (_ : i s t), f i) * ∏ᶠ (i : α) (_ : i s \ t), f i = ∏ᶠ (i : α) (_ : i s), f i
              theorem finsum_mem_inter_add_diff {α : Type u_1} {M : Type u_5} [AddCommMonoid M] {f : αM} {s : Set α} (t : Set α) (h : Set.Finite s) :
              ∑ᶠ (i : α) (_ : i s t), f i + ∑ᶠ (i : α) (_ : i s \ t), f i = ∑ᶠ (i : α) (_ : i s), f i
              theorem finprod_mem_inter_mul_diff {α : Type u_1} {M : Type u_5} [CommMonoid M] {f : αM} {s : Set α} (t : Set α) (h : Set.Finite s) :
              (∏ᶠ (i : α) (_ : i s t), f i) * ∏ᶠ (i : α) (_ : i s \ t), f i = ∏ᶠ (i : α) (_ : i s), f i
              theorem finsum_mem_add_diff' {α : Type u_1} {M : Type u_5} [AddCommMonoid M] {f : αM} {s : Set α} {t : Set α} (hst : s t) (ht : Set.Finite (t Function.support f)) :
              ∑ᶠ (i : α) (_ : i s), f i + ∑ᶠ (i : α) (_ : i t \ s), f i = ∑ᶠ (i : α) (_ : i t), f i

              A more general version of finsum_mem_add_diff that requires t ∩ support f rather than t to be finite.

              theorem finprod_mem_mul_diff' {α : Type u_1} {M : Type u_5} [CommMonoid M] {f : αM} {s : Set α} {t : Set α} (hst : s t) (ht : Set.Finite (t Function.mulSupport f)) :
              (∏ᶠ (i : α) (_ : i s), f i) * ∏ᶠ (i : α) (_ : i t \ s), f i = ∏ᶠ (i : α) (_ : i t), f i

              A more general version of finprod_mem_mul_diff that requires t ∩ mulSupport f rather than t to be finite.

              theorem finsum_mem_add_diff {α : Type u_1} {M : Type u_5} [AddCommMonoid M] {f : αM} {s : Set α} {t : Set α} (hst : s t) (ht : Set.Finite t) :
              ∑ᶠ (i : α) (_ : i s), f i + ∑ᶠ (i : α) (_ : i t \ s), f i = ∑ᶠ (i : α) (_ : i t), f i

              Given a finite set t and a subset s of t, the sum of f i over i ∈ s plus the sum of f i over t \ s equals the sum of f i over i ∈ t.

              theorem finprod_mem_mul_diff {α : Type u_1} {M : Type u_5} [CommMonoid M] {f : αM} {s : Set α} {t : Set α} (hst : s t) (ht : Set.Finite t) :
              (∏ᶠ (i : α) (_ : i s), f i) * ∏ᶠ (i : α) (_ : i t \ s), f i = ∏ᶠ (i : α) (_ : i t), f i

              Given a finite set t and a subset s of t, the product of f i over i ∈ s times the product of f i over t \ s equals the product of f i over i ∈ t.

              theorem finsum_mem_iUnion {α : Type u_1} {ι : Type u_3} {M : Type u_5} [AddCommMonoid M] {f : αM} [Finite ι] {t : ιSet α} (h : Pairwise (Disjoint on t)) (ht : ∀ (i : ι), Set.Finite (t i)) :
              ∑ᶠ (a : α) (_ : a ⋃ (i : ι), t i), f a = ∑ᶠ (i : ι) (a : α) (_ : a t i), f a

              Given a family of pairwise disjoint finite sets t i indexed by a finite type, the sum of f a over the union ⋃ i, t i is equal to the sum over all indexes i of the sums of f a over a ∈ t i.

              theorem finprod_mem_iUnion {α : Type u_1} {ι : Type u_3} {M : Type u_5} [CommMonoid M] {f : αM} [Finite ι] {t : ιSet α} (h : Pairwise (Disjoint on t)) (ht : ∀ (i : ι), Set.Finite (t i)) :
              ∏ᶠ (a : α) (_ : a ⋃ (i : ι), t i), f a = ∏ᶠ (i : ι) (a : α) (_ : a t i), f a

              Given a family of pairwise disjoint finite sets t i indexed by a finite type, the product of f a over the union ⋃ i, t i is equal to the product over all indexes i of the products of f a over a ∈ t i.

              theorem finsum_mem_biUnion {α : Type u_1} {ι : Type u_3} {M : Type u_5} [AddCommMonoid M] {f : αM} {I : Set ι} {t : ιSet α} (h : Set.PairwiseDisjoint I t) (hI : Set.Finite I) (ht : ∀ (i : ι), i ISet.Finite (t i)) :
              ∑ᶠ (a : α) (_ : a ⋃ (x : ι) (_ : x I), t x), f a = ∑ᶠ (i : ι) (_ : i I) (j : α) (_ : j t i), f j

              Given a family of sets t : ι → Set α, a finite set I in the index type such that all sets t i, i ∈ I, are finite, if all t i, i ∈ I, are pairwise disjoint, then the sum of f a over a ∈ ⋃ i ∈ I, t i is equal to the sum over i ∈ I of the sums of f a over a ∈ t i.

              theorem finprod_mem_biUnion {α : Type u_1} {ι : Type u_3} {M : Type u_5} [CommMonoid M] {f : αM} {I : Set ι} {t : ιSet α} (h : Set.PairwiseDisjoint I t) (hI : Set.Finite I) (ht : ∀ (i : ι), i ISet.Finite (t i)) :
              ∏ᶠ (a : α) (_ : a ⋃ (x : ι) (_ : x I), t x), f a = ∏ᶠ (i : ι) (_ : i I) (j : α) (_ : j t i), f j

              Given a family of sets t : ι → Set α, a finite set I in the index type such that all sets t i, i ∈ I, are finite, if all t i, i ∈ I, are pairwise disjoint, then the product of f a over a ∈ ⋃ i ∈ I, t i is equal to the product over i ∈ I of the products of f a over a ∈ t i.

              theorem finsum_mem_sUnion {α : Type u_1} {M : Type u_5} [AddCommMonoid M] {f : αM} {t : Set (Set α)} (h : Set.PairwiseDisjoint t id) (ht₀ : Set.Finite t) (ht₁ : ∀ (x : Set α), x tSet.Finite x) :
              ∑ᶠ (a : α) (_ : a ⋃₀ t), f a = ∑ᶠ (s : Set α) (_ : s t) (a : α) (_ : a s), f a

              If t is a finite set of pairwise disjoint finite sets, then the sum of f a over a ∈ ⋃₀ t is the sum over s ∈ t of the sums of f a over a ∈ s.

              theorem finprod_mem_sUnion {α : Type u_1} {M : Type u_5} [CommMonoid M] {f : αM} {t : Set (Set α)} (h : Set.PairwiseDisjoint t id) (ht₀ : Set.Finite t) (ht₁ : ∀ (x : Set α), x tSet.Finite x) :
              ∏ᶠ (a : α) (_ : a ⋃₀ t), f a = ∏ᶠ (s : Set α) (_ : s t) (a : α) (_ : a s), f a

              If t is a finite set of pairwise disjoint finite sets, then the product of f a over a ∈ ⋃₀ t is the product over s ∈ t of the products of f a over a ∈ s.

              theorem add_finsum_cond_ne {α : Type u_1} {M : Type u_5} [AddCommMonoid M] {f : αM} (a : α) (hf : Set.Finite (Function.support f)) :
              f a + ∑ᶠ (i : α) (_ : i a), f i = ∑ᶠ (i : α), f i
              theorem mul_finprod_cond_ne {α : Type u_1} {M : Type u_5} [CommMonoid M] {f : αM} (a : α) (hf : Set.Finite (Function.mulSupport f)) :
              f a * ∏ᶠ (i : α) (_ : i a), f i = ∏ᶠ (i : α), f i
              theorem finsum_mem_comm {α : Type u_1} {β : Type u_2} {M : Type u_5} [AddCommMonoid M] {s : Set α} {t : Set β} (f : αβM) (hs : Set.Finite s) (ht : Set.Finite t) :
              ∑ᶠ (i : α) (_ : i s) (j : β) (_ : j t), f i j = ∑ᶠ (j : β) (_ : j t) (i : α) (_ : i s), f i j

              If s : Set α and t : Set β are finite sets, then summing over s commutes with summing over t.

              theorem finprod_mem_comm {α : Type u_1} {β : Type u_2} {M : Type u_5} [CommMonoid M] {s : Set α} {t : Set β} (f : αβM) (hs : Set.Finite s) (ht : Set.Finite t) :
              ∏ᶠ (i : α) (_ : i s) (j : β) (_ : j t), f i j = ∏ᶠ (j : β) (_ : j t) (i : α) (_ : i s), f i j

              If s : Set α and t : Set β are finite sets, then taking the product over s commutes with taking the product over t.

              theorem finsum_mem_induction {α : Type u_1} {M : Type u_5} [AddCommMonoid M] {f : αM} {s : Set α} (p : MProp) (hp₀ : p 0) (hp₁ : (x y : M) → p xp yp (x + y)) (hp₂ : (x : α) → x sp (f x)) :
              p (∑ᶠ (i : α) (_ : i s), f i)

              To prove a property of a finite sum, it suffices to prove that the property is additive and holds on summands.

              theorem finprod_mem_induction {α : Type u_1} {M : Type u_5} [CommMonoid M] {f : αM} {s : Set α} (p : MProp) (hp₀ : p 1) (hp₁ : (x y : M) → p xp yp (x * y)) (hp₂ : (x : α) → x sp (f x)) :
              p (∏ᶠ (i : α) (_ : i s), f i)

              To prove a property of a finite product, it suffices to prove that the property is multiplicative and holds on factors.

              theorem finprod_cond_nonneg {α : Type u_1} {R : Type u_7} [OrderedCommSemiring R] {p : αProp} {f : αR} (hf : ∀ (x : α), p x0 f x) :
              0 ∏ᶠ (x : α) (x_1 : p x), f x
              theorem single_le_finsum {α : Type u_1} {M : Type u_7} [OrderedAddCommMonoid M] (i : α) {f : αM} (hf : Set.Finite (Function.support f)) (h : ∀ (j : α), 0 f j) :
              f i ∑ᶠ (j : α), f j
              theorem single_le_finprod {α : Type u_1} {M : Type u_7} [OrderedCommMonoid M] (i : α) {f : αM} (hf : Set.Finite (Function.mulSupport f)) (h : ∀ (j : α), 1 f j) :
              f i ∏ᶠ (j : α), f j
              theorem finprod_eq_zero {α : Type u_1} {M₀ : Type u_7} [CommMonoidWithZero M₀] (f : αM₀) (x : α) (hx : f x = 0) (hf : Set.Finite (Function.mulSupport f)) :
              ∏ᶠ (x : α), f x = 0
              theorem finsum_sum_comm {α : Type u_1} {β : Type u_2} {M : Type u_5} [AddCommMonoid M] (s : Finset β) (f : αβM) (h : ∀ (b : β), b sSet.Finite (Function.support fun a => f a b)) :
              (∑ᶠ (a : α), Finset.sum s fun b => f a b) = Finset.sum s fun b => ∑ᶠ (a : α), f a b
              theorem finprod_prod_comm {α : Type u_1} {β : Type u_2} {M : Type u_5} [CommMonoid M] (s : Finset β) (f : αβM) (h : ∀ (b : β), b sSet.Finite (Function.mulSupport fun a => f a b)) :
              (∏ᶠ (a : α), Finset.prod s fun b => f a b) = Finset.prod s fun b => ∏ᶠ (a : α), f a b
              theorem sum_finsum_comm {α : Type u_1} {β : Type u_2} {M : Type u_5} [AddCommMonoid M] (s : Finset α) (f : αβM) (h : ∀ (a : α), a sSet.Finite (Function.support (f a))) :
              (Finset.sum s fun a => ∑ᶠ (b : β), f a b) = ∑ᶠ (b : β), Finset.sum s fun a => f a b
              theorem prod_finprod_comm {α : Type u_1} {β : Type u_2} {M : Type u_5} [CommMonoid M] (s : Finset α) (f : αβM) (h : ∀ (a : α), a sSet.Finite (Function.mulSupport (f a))) :
              (Finset.prod s fun a => ∏ᶠ (b : β), f a b) = ∏ᶠ (b : β), Finset.prod s fun a => f a b
              theorem mul_finsum {α : Type u_1} {R : Type u_7} [Semiring R] (f : αR) (r : R) (h : Set.Finite (Function.support f)) :
              r * ∑ᶠ (a : α), f a = ∑ᶠ (a : α), r * f a
              theorem finsum_mul {α : Type u_1} {R : Type u_7} [Semiring R] (f : αR) (r : R) (h : Set.Finite (Function.support f)) :
              (∑ᶠ (a : α), f a) * r = ∑ᶠ (a : α), f a * r
              theorem Finset.support_of_fiberwise_sum_subset_image {α : Type u_1} {β : Type u_2} {M : Type u_5} [AddCommMonoid M] [DecidableEq β] (s : Finset α) (f : αM) (g : αβ) :
              (Function.support fun b => Finset.sum (Finset.filter (fun a => g a = b) s) f) ↑(Finset.image g s)
              theorem Finset.mulSupport_of_fiberwise_prod_subset_image {α : Type u_1} {β : Type u_2} {M : Type u_5} [CommMonoid M] [DecidableEq β] (s : Finset α) (f : αM) (g : αβ) :
              (Function.mulSupport fun b => Finset.prod (Finset.filter (fun a => g a = b) s) f) ↑(Finset.image g s)
              theorem finsum_mem_finset_product' {α : Type u_1} {β : Type u_2} {M : Type u_5} [AddCommMonoid M] [DecidableEq α] [DecidableEq β] (s : Finset (α × β)) (f : α × βM) :
              ∑ᶠ (ab : α × β) (_ : ab s), f ab = ∑ᶠ (a : α) (b : β) (_ : b Finset.image Prod.snd (Finset.filter (fun ab => ab.fst = a) s)), f (a, b)

              Note that b ∈ (s.filter (fun ab => Prod.fst ab = a)).image Prod.snd iff (a, b) ∈ s so we can simplify the right hand side of this lemma. However the form stated here is more useful for iterating this lemma, e.g., if we have f : α × β × γ → M.

              theorem finprod_mem_finset_product' {α : Type u_1} {β : Type u_2} {M : Type u_5} [CommMonoid M] [DecidableEq α] [DecidableEq β] (s : Finset (α × β)) (f : α × βM) :
              ∏ᶠ (ab : α × β) (_ : ab s), f ab = ∏ᶠ (a : α) (b : β) (_ : b Finset.image Prod.snd (Finset.filter (fun ab => ab.fst = a) s)), f (a, b)

              Note that b ∈ (s.filter (fun ab => Prod.fst ab = a)).image Prod.snd iff (a, b) ∈ s so we can simplify the right hand side of this lemma. However the form stated here is more useful for iterating this lemma, e.g., if we have f : α × β × γ → M.

              theorem finsum_mem_finset_product {α : Type u_1} {β : Type u_2} {M : Type u_5} [AddCommMonoid M] (s : Finset (α × β)) (f : α × βM) :
              ∑ᶠ (ab : α × β) (_ : ab s), f ab = ∑ᶠ (a : α) (b : β) (_ : (a, b) s), f (a, b)

              See also finsum_mem_finset_product'.

              theorem finprod_mem_finset_product {α : Type u_1} {β : Type u_2} {M : Type u_5} [CommMonoid M] (s : Finset (α × β)) (f : α × βM) :
              ∏ᶠ (ab : α × β) (_ : ab s), f ab = ∏ᶠ (a : α) (b : β) (_ : (a, b) s), f (a, b)

              See also finprod_mem_finset_product'.

              theorem finsum_mem_finset_product₃ {α : Type u_1} {β : Type u_2} {M : Type u_5} [AddCommMonoid M] {γ : Type u_7} (s : Finset (α × β × γ)) (f : α × β × γM) :
              ∑ᶠ (abc : α × β × γ) (_ : abc s), f abc = ∑ᶠ (a : α) (b : β) (c : γ) (_ : (a, b, c) s), f (a, b, c)
              theorem finprod_mem_finset_product₃ {α : Type u_1} {β : Type u_2} {M : Type u_5} [CommMonoid M] {γ : Type u_7} (s : Finset (α × β × γ)) (f : α × β × γM) :
              ∏ᶠ (abc : α × β × γ) (_ : abc s), f abc = ∏ᶠ (a : α) (b : β) (c : γ) (_ : (a, b, c) s), f (a, b, c)
              theorem finsum_curry {α : Type u_1} {β : Type u_2} {M : Type u_5} [AddCommMonoid M] (f : α × βM) (hf : Set.Finite (Function.support f)) :
              ∑ᶠ (ab : α × β), f ab = ∑ᶠ (a : α) (b : β), f (a, b)
              theorem finprod_curry {α : Type u_1} {β : Type u_2} {M : Type u_5} [CommMonoid M] (f : α × βM) (hf : Set.Finite (Function.mulSupport f)) :
              ∏ᶠ (ab : α × β), f ab = ∏ᶠ (a : α) (b : β), f (a, b)
              theorem finsum_curry₃ {α : Type u_1} {β : Type u_2} {M : Type u_5} [AddCommMonoid M] {γ : Type u_7} (f : α × β × γM) (h : Set.Finite (Function.support f)) :
              ∑ᶠ (abc : α × β × γ), f abc = ∑ᶠ (a : α) (b : β) (c : γ), f (a, b, c)
              theorem finprod_curry₃ {α : Type u_1} {β : Type u_2} {M : Type u_5} [CommMonoid M] {γ : Type u_7} (f : α × β × γM) (h : Set.Finite (Function.mulSupport f)) :
              ∏ᶠ (abc : α × β × γ), f abc = ∏ᶠ (a : α) (b : β) (c : γ), f (a, b, c)
              theorem finsum_dmem {α : Type u_1} {M : Type u_5} [AddCommMonoid M] {s : Set α} [DecidablePred fun x => x s] (f : (a : α) → a sM) :
              ∑ᶠ (a : α) (h : a s), f a h = ∑ᶠ (a : α) (_ : a s), if h' : a s then f a h' else 0
              theorem finprod_dmem {α : Type u_1} {M : Type u_5} [CommMonoid M] {s : Set α} [DecidablePred fun x => x s] (f : (a : α) → a sM) :
              ∏ᶠ (a : α) (h : a s), f a h = ∏ᶠ (a : α) (_ : a s), if h' : a s then f a h' else 1
              theorem finsum_emb_domain' {α : Type u_1} {β : Type u_2} {M : Type u_5} [AddCommMonoid M] {f : αβ} (hf : Function.Injective f) [DecidablePred fun x => x Set.range f] (g : αM) :
              (∑ᶠ (b : β), if h : b Set.range f then g (Classical.choose h) else 0) = ∑ᶠ (a : α), g a
              theorem finprod_emb_domain' {α : Type u_1} {β : Type u_2} {M : Type u_5} [CommMonoid M] {f : αβ} (hf : Function.Injective f) [DecidablePred fun x => x Set.range f] (g : αM) :
              (∏ᶠ (b : β), if h : b Set.range f then g (Classical.choose h) else 1) = ∏ᶠ (a : α), g a
              theorem finsum_emb_domain {α : Type u_1} {β : Type u_2} {M : Type u_5} [AddCommMonoid M] (f : α β) [DecidablePred fun x => x Set.range f] (g : αM) :
              (∑ᶠ (b : β), if h : b Set.range f then g (Classical.choose h) else 0) = ∑ᶠ (a : α), g a
              theorem finprod_emb_domain {α : Type u_1} {β : Type u_2} {M : Type u_5} [CommMonoid M] (f : α β) [DecidablePred fun x => x Set.range f] (g : αM) :
              (∏ᶠ (b : β), if h : b Set.range f then g (Classical.choose h) else 1) = ∏ᶠ (a : α), g a