The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V03. Sets, finite structures and big operators

Mathlib.Algebra.BigOperators.Finprod

287 declarations and 7 deprecated aliases. Mathlib docs · Source

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 - sets
  • M, N - additive or multiplicative commutative monoids
  • f, g - functions

Definitions in this file:

  • finsum f : M : the sum of f x as x ranges over the support of f, if it's finite. Zero otherwise.

  • finprod f : M : the product of f x as x ranges over the multiplicative support of f, if it's finite. One otherwise.

Notation

  • ∑ᶠ i, f i and ∑ᶠ i : α, f i for finsum f

  • ∏ᶠ i, f i and ∏ᶠ i : α, f i for finprod f

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

  • ∑ᶠ i ∈ s, f i, where f : α → M, s : Set α : sum over the set s;
  • ∑ᶠ n < 5, f n, where f : ℕ → M : same as f 0 + f 1 + f 2 + f 3 + f 4;
  • ∏ᶠ (n >= -2) (hn : n < 3), f n, where f : ℤ → M : same as f (-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” functions. 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

Some API for fun a ↦ f a ^ count a s on multisets

def finprod E1 #

{M : Type u_2} → {α : Sort u_4} → [CommMonoid M] → (α → M) → M

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

def finsum E1 #

{M : Type u_2} → {α : Sort u_4} → [AddCommMonoid M] → (α → M) → M

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

theorem finsum_def' E1 #

∀ {M : Type u_2} {α : Sort u_4} [inst : AddCommMonoid M] (f : α → M),
  finsum f = if h : Function.HasFiniteSupport (f ∘ PLift.down) then ∑ i ∈ Set.Finite.toFinset h, f i.down else 0

theorem finprod_def' E1 #

∀ {M : Type u_2} {α : Sort u_4} [inst : CommMonoid M] (f : α → M),
  finprod f = if h : Function.HasFiniteMulSupport (f ∘ PLift.down) then ∏ i ∈ Set.Finite.toFinset h, f i.down else 1

Alias of _private.Mathlib.Algebra.BigOperators.Finprod.0.finprod.eq_def.

def «term∑ᶠ_,_» E1 #

Lean.ParserDescr

∑ᶠ 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

def «term∏ᶠ_,_» E1 #

Lean.ParserDescr

∏ᶠ x, f x is notation for finprod f. It is the product 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

theorem finsum_eq_sum_plift_of_support_toFinset_subset E1 #

∀ {M : Type u_2} {α : Sort u_4} [inst : AddCommMonoid M] {f : α → M} (hf : Function.HasFiniteSupport (f ∘ PLift.down))
  {s : Finset (PLift α)}, Set.Finite.toFinset hf ⊆ s → ∑ᶠ (i : α), f i = ∑ i ∈ s, f i.down

theorem finprod_eq_prod_plift_of_mulSupport_toFinset_subset E1 #

∀ {M : Type u_2} {α : Sort u_4} [inst : CommMonoid M] {f : α → M} (hf : Function.HasFiniteMulSupport (f ∘ PLift.down))
  {s : Finset (PLift α)}, Set.Finite.toFinset hf ⊆ s → ∏ᶠ (i : α), f i = ∏ i ∈ s, f i.down

theorem finsum_eq_sum_plift_of_support_subset E1 #

∀ {M : Type u_2} {α : Sort u_4} [inst : AddCommMonoid M] {f : α → M} {s : Finset (PLift α)},
  Function.support (f ∘ PLift.down) ⊆ ↑s → ∑ᶠ (i : α), f i = ∑ i ∈ s, f i.down

theorem finprod_eq_prod_plift_of_mulSupport_subset E1 #

∀ {M : Type u_2} {α : Sort u_4} [inst : CommMonoid M] {f : α → M} {s : Finset (PLift α)},
  Function.mulSupport (f ∘ PLift.down) ⊆ ↑s → ∏ᶠ (i : α), f i = ∏ i ∈ s, f i.down

theorem finsum_zero E0 #

∀ {M : Type u_2} {α : Sort u_4} [inst : AddCommMonoid M], ∑ᶠ (x : α), 0 = 0

theorem finprod_one E0 #

∀ {M : Type u_2} {α : Sort u_4} [inst : CommMonoid M], ∏ᶠ (x : α), 1 = 1

theorem finsum_of_isEmpty E1 #

∀ {M : Type u_2} {α : Sort u_4} [inst : AddCommMonoid M] [IsEmpty α] (f : α → M), ∑ᶠ (i : α), f i = 0

theorem finprod_of_isEmpty E1 #

∀ {M : Type u_2} {α : Sort u_4} [inst : CommMonoid M] [IsEmpty α] (f : α → M), ∏ᶠ (i : α), f i = 1

theorem finprod_false E0 #

∀ {M : Type u_2} [inst : CommMonoid M] (f : False → M), ∏ᶠ (i : False), f i = 1

theorem finsum_false E0 #

∀ {M : Type u_2} [inst : AddCommMonoid M] (f : False → M), ∑ᶠ (i : False), f i = 0

theorem finprod_eq_single E1 #

∀ {M : Type u_2} {α : Sort u_4} [inst : CommMonoid M] (f : α → M) (a : α),
  (∀ (x : α), x ≠ a → f x = 1) → ∏ᶠ (x : α), f x = f a

theorem finsum_eq_single E1 #

∀ {M : Type u_2} {α : Sort u_4} [inst : AddCommMonoid M] (f : α → M) (a : α),
  (∀ (x : α), x ≠ a → f x = 0) → ∑ᶠ (x : α), f x = f a

theorem finsum_unique E1 #

∀ {M : Type u_2} {α : Sort u_4} [inst : AddCommMonoid M] [inst_1 : Unique α] (f : α → M), ∑ᶠ (i : α), f i = f default

theorem finprod_unique E1 #

∀ {M : Type u_2} {α : Sort u_4} [inst : CommMonoid M] [inst_1 : Unique α] (f : α → M), ∏ᶠ (i : α), f i = f default

theorem finprod_true E0 #

∀ {M : Type u_2} [inst : CommMonoid M] (f : True → M), ∏ᶠ (i : True), f i = f trivial

theorem finsum_true E0 #

∀ {M : Type u_2} [inst : AddCommMonoid M] (f : True → M), ∑ᶠ (i : True), f i = f trivial

theorem finsum_eq_dif E1 #

∀ {M : Type u_2} [inst : AddCommMonoid M] {p : Prop} [inst_1 : Decidable p] (f : p → M),
  ∑ᶠ (i : p), f i = if h : p then f h else 0

theorem finprod_eq_dif E1 #

∀ {M : Type u_2} [inst : CommMonoid M] {p : Prop} [inst_1 : Decidable p] (f : p → M),
  ∏ᶠ (i : p), f i = if h : p then f h else 1

theorem finprod_eq_if E1 #

∀ {M : Type u_2} [inst : CommMonoid M] {p : Prop} [inst_1 : Decidable p] {x : M}, ∏ᶠ (_ : p), x = if p then x else 1

theorem finsum_eq_if E1 #

∀ {M : Type u_2} [inst : AddCommMonoid M] {p : Prop} [inst_1 : Decidable p] {x : M}, ∑ᶠ (_ : p), x = if p then x else 0

theorem finsum_congr E1 #

∀ {M : Type u_2} {α : Sort u_4} [inst : AddCommMonoid M] {f g : α → M}, (∀ (x : α), f x = g x) → finsum f = finsum g

theorem finprod_congr E1 #

∀ {M : Type u_2} {α : Sort u_4} [inst : CommMonoid M] {f g : α → M}, (∀ (x : α), f x = g x) → finprod f = finprod g

theorem finsum_congr_Prop E1 #

∀ {M : Type u_2} [inst : AddCommMonoid M] {p q : Prop} {f : p → M} {g : q → M} (hpq : p = q),
  (∀ (h : q), f ⋯ = g h) → finsum f = finsum g

theorem finprod_congr_Prop E1 #

∀ {M : Type u_2} [inst : CommMonoid M] {p q : Prop} {f : p → M} {g : q → M} (hpq : p = q),
  (∀ (h : q), f ⋯ = g h) → finprod f = finprod g

theorem finprod_induction E1 #

∀ {M : Type u_2} {α : Sort u_4} [inst : CommMonoid M] {f : α → M} (p : M → Prop),
  p 1 → (∀ (x y : M), p x → p y → p (x * y)) → (∀ (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 finsum_induction E1 #

∀ {M : Type u_2} {α : Sort u_4} [inst : AddCommMonoid M] {f : α → M} (p : M → Prop),
  p 0 → (∀ (x y : M), p x → p y → p (x + y)) → (∀ (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_nonneg E1 #

∀ {α : Sort u_4} {R : Type u_6} [inst : CommMonoidWithZero R] [inst_1 : Preorder R] [ZeroLEOneClass R] [PosMulMono R]
  {f : α → R}, (∀ (x : α), 0 ≤ f x) → 0 ≤ ∏ᶠ (x : α), f x

theorem finsum_nonneg E1 #

∀ {α : Sort u_4} {M : Type u_6} [inst : AddCommMonoid M] [inst_1 : Preorder M] [IsOrderedAddMonoid M] {f : α → M},
  (∀ (i : α), 0 ≤ f i) → 0 ≤ ∑ᶠ (i : α), f i

theorem one_le_finprod' E1 #

∀ {α : Sort u_4} {M : Type u_6} [inst : CommMonoid M] [inst_1 : Preorder M] [IsOrderedMonoid M] {f : α → M},
  (∀ (i : α), 1 ≤ f i) → 1 ≤ ∏ᶠ (i : α), f i

theorem one_le_finprod E1 #

∀ {α : Sort u_4} {M : Type u_6} [inst : CommMonoidWithZero M] [inst_1 : Preorder M] [ZeroLEOneClass M] [PosMulMono M]
  {f : α → M}, (∀ (i : α), 1 ≤ f i) → 1 ≤ ∏ᶠ (i : α), f i

A version of one_le_finprod' for PosMulMono in place of MulLeftMono.

theorem AddMonoidHom.map_finsum_plift E0 #

∀ {M : Type u_2} {N : Type u_3} {α : Sort u_4} [inst : AddCommMonoid M] [inst_1 : AddCommMonoid N] (f : M →+ N)
  (g : α → M), Function.HasFiniteSupport (g ∘ PLift.down) → f (∑ᶠ (x : α), g x) = ∑ᶠ (x : α), f (g x)

theorem MonoidHom.map_finprod_plift E0 #

∀ {M : Type u_2} {N : Type u_3} {α : Sort u_4} [inst : CommMonoid M] [inst_1 : CommMonoid N] (f : M →* N) (g : α → M),
  Function.HasFiniteMulSupport (g ∘ PLift.down) → f (∏ᶠ (x : α), g x) = ∏ᶠ (x : α), f (g x)

theorem AddMonoidHom.map_finsum_Prop E0 #

∀ {M : Type u_2} {N : Type u_3} [inst : AddCommMonoid M] [inst_1 : AddCommMonoid N] {p : Prop} (f : M →+ N) (g : p → M),
  f (∑ᶠ (x : p), g x) = ∑ᶠ (x : p), f (g x)

theorem MonoidHom.map_finprod_Prop E0 #

∀ {M : Type u_2} {N : Type u_3} [inst : CommMonoid M] [inst_1 : CommMonoid N] {p : Prop} (f : M →* N) (g : p → M),
  f (∏ᶠ (x : p), g x) = ∏ᶠ (x : p), f (g x)

theorem MonoidHom.map_finprod_of_preimage_one E0 #

∀ {M : Type u_2} {N : Type u_3} {α : Sort u_4} [inst : CommMonoid M] [inst_1 : CommMonoid N] (f : M →* N),
  (∀ (x : M), f x = 1 → x = 1) → ∀ (g : α → M), f (∏ᶠ (i : α), g i) = ∏ᶠ (i : α), f (g i)

theorem AddMonoidHom.map_finsum_of_preimage_zero E0 #

∀ {M : Type u_2} {N : Type u_3} {α : Sort u_4} [inst : AddCommMonoid M] [inst_1 : AddCommMonoid N] (f : M →+ N),
  (∀ (x : M), f x = 0 → x = 0) → ∀ (g : α → M), f (∑ᶠ (i : α), g i) = ∑ᶠ (i : α), f (g i)

theorem AddMonoidHom.map_finsum_of_injective E0 #

∀ {M : Type u_2} {N : Type u_3} {α : Sort u_4} [inst : AddCommMonoid M] [inst_1 : AddCommMonoid N] (g : M →+ N),
  Function.Injective ⇑g → ∀ (f : α → M), g (∑ᶠ (i : α), f i) = ∑ᶠ (i : α), g (f i)

theorem MonoidHom.map_finprod_of_injective E0 #

∀ {M : Type u_2} {N : Type u_3} {α : Sort u_4} [inst : CommMonoid M] [inst_1 : CommMonoid N] (g : M →* N),
  Function.Injective ⇑g → ∀ (f : α → M), g (∏ᶠ (i : α), f i) = ∏ᶠ (i : α), g (f i)

theorem MulEquiv.map_finprod E0 #

∀ {M : Type u_2} {N : Type u_3} {α : Sort u_4} [inst : CommMonoid M] [inst_1 : CommMonoid N] (g : M ≃* N) (f : α → M),
  g (∏ᶠ (i : α), f i) = ∏ᶠ (i : α), g (f i)

theorem AddEquiv.map_finsum E0 #

∀ {M : Type u_2} {N : Type u_3} {α : Sort u_4} [inst : AddCommMonoid M] [inst_1 : AddCommMonoid N] (g : M ≃+ N)
  (f : α → M), g (∑ᶠ (i : α), f i) = ∑ᶠ (i : α), g (f i)

theorem MulEquivClass.map_finprod E0 #

∀ {M : Type u_2} {N : Type u_3} {α : Sort u_4} [inst : CommMonoid M] [inst_1 : CommMonoid N] {F : Type u_6}
  [inst_2 : EquivLike F M N] [MulEquivClass F M N] (g : F) (f : α → M), g (∏ᶠ (i : α), f i) = ∏ᶠ (i : α), g (f i)

theorem AddEquivClass.map_finsum E0 #

∀ {M : Type u_2} {N : Type u_3} {α : Sort u_4} [inst : AddCommMonoid M] [inst_1 : AddCommMonoid N] {F : Type u_6}
  [inst_2 : EquivLike F M N] [AddEquivClass F M N] (g : F) (f : α → M), g (∑ᶠ (i : α), f i) = ∑ᶠ (i : α), g (f i)

theorem finsum_smul E1 #

∀ {ι : Sort u_5} {R : Type u_6} {M : Type u_7} [inst : Ring R] [IsDomain R] [inst_2 : AddCommGroup M]
  [inst_3 : Module R M] [Module.IsTorsionFree R M] (f : ι → R) (x : M), (∑ᶠ (i : ι), f i) • x = ∑ᶠ (i : ι), f i • x

The torsion-free assumption makes sure that the result holds even when the support of f is infinite. For a more usual version assuming HasFiniteSupport f instead, see finsum_smul'.

theorem smul_finsum E1 #

∀ {ι : Sort u_5} {R : Type u_6} {M : Type u_7} [inst : Semiring R] [IsDomain R] [inst_2 : AddCommGroup M]
  [inst_3 : Module R M] [Module.IsTorsionFree R M] (c : R) (f : ι → M), c • ∑ᶠ (i : ι), f i = ∑ᶠ (i : ι), c • f i

The torsion-free assumption makes sure that the result holds even when the support of f is infinite. For a more usual version assuming HasFiniteSupport f instead, see smul_finsum'.

theorem finsum_neg_distrib E1 #

∀ {G : Type u_1} {α : Sort u_4} [inst : SubtractionCommMonoid G] (f : α → G), ∑ᶠ (x : α), -f x = -∑ᶠ (x : α), f x

theorem finprod_inv_distrib E1 #

∀ {G : Type u_1} {α : Sort u_4} [inst : DivisionCommMonoid G] (f : α → G), ∏ᶠ (x : α), (f x)⁻¹ = (∏ᶠ (x : α), f x)⁻¹

theorem finsum_eq_indicator_apply E0 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] (s : Set α) (f : α → M) (a : α),
  ∑ᶠ (_ : a ∈ s), f a = s.indicator f a

theorem finprod_eq_mulIndicator_apply E0 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] (s : Set α) (f : α → M) (a : α),
  ∏ᶠ (_ : a ∈ s), f a = s.mulIndicator f a

theorem finprod_apply_ne_one E0 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] (f : α → M) (a : α), ∏ᶠ (_ : f a ≠ 1), f a = f a

theorem finsum_apply_ne_zero E0 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] (f : α → M) (a : α), ∑ᶠ (_ : f a ≠ 0), f a = f a

theorem finprod_mem_def E0 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] (s : Set α) (f : α → M),
  ∏ᶠ (a : α) (_ : a ∈ s), f a = ∏ᶠ (a : α), s.mulIndicator f a

theorem finsum_mem_def E0 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] (s : Set α) (f : α → M),
  ∑ᶠ (a : α) (_ : a ∈ s), f a = ∑ᶠ (a : α), s.indicator f a

theorem finsum_mem_support E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] (f : α → M),
  ∑ᶠ (a : α) (_ : a ∈ Function.support f), f a = ∑ᶠ (a : α), f a

theorem finprod_mem_mulSupport E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] (f : α → M),
  ∏ᶠ (a : α) (_ : a ∈ Function.mulSupport f), f a = ∏ᶠ (a : α), f a

theorem finsum_eq_sum_of_support_subset E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] (f : α → M) {s : Finset α},
  Function.support f ⊆ ↑s → ∑ᶠ (i : α), f i = ∑ i ∈ s, f i

theorem finprod_eq_prod_of_mulSupport_subset E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] (f : α → M) {s : Finset α},
  Function.mulSupport f ⊆ ↑s → ∏ᶠ (i : α), f i = ∏ i ∈ s, f i

theorem finprod_eq_prod_of_mulSupport_toFinset_subset E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] (f : α → M) (hf : Function.HasFiniteMulSupport f) {s : Finset α},
  Set.Finite.toFinset hf ⊆ s → ∏ᶠ (i : α), f i = ∏ i ∈ s, f i

theorem finsum_eq_sum_of_support_toFinset_subset E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] (f : α → M) (hf : Function.HasFiniteSupport f) {s : Finset α},
  Set.Finite.toFinset hf ⊆ s → ∑ᶠ (i : α), f i = ∑ i ∈ s, f i

theorem finsum_eq_sum_of_support_subset_of_finite E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] (f : α → M) {s : Set α},
  Function.support f ⊆ s → ∀ (hs : s.Finite), ∑ᶠ (i : α), f i = ∑ i ∈ hs.toFinset, f i

theorem finprod_eq_prod_of_mulSupport_subset_of_finite E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] (f : α → M) {s : Set α},
  Function.mulSupport f ⊆ s → ∀ (hs : s.Finite), ∏ᶠ (i : α), f i = ∏ i ∈ hs.toFinset, f i

theorem finsum_eq_finsetSum_of_support_subset E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] (f : α → M) {s : Finset α},
  Function.support f ⊆ ↑s → ∑ᶠ (i : α), f i = ∑ i ∈ s, f i

theorem finprod_eq_finsetProd_of_mulSupport_subset E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] (f : α → M) {s : Finset α},
  Function.mulSupport f ⊆ ↑s → ∏ᶠ (i : α), f i = ∏ i ∈ s, f i

theorem finsum_def E0 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] (f : α → M) [inst_1 : Decidable (Function.HasFiniteSupport f)],
  ∑ᶠ (i : α), f i = if h : Function.HasFiniteSupport f then ∑ i ∈ Set.Finite.toFinset h, f i else 0

theorem finprod_def E0 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] (f : α → M) [inst_1 : Decidable (Function.HasFiniteMulSupport f)],
  ∏ᶠ (i : α), f i = if h : Function.HasFiniteMulSupport f then ∏ i ∈ Set.Finite.toFinset h, f i else 1

theorem finprod_of_infinite_mulSupport E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] {f : α → M},
  (Function.mulSupport f).Infinite → ∏ᶠ (i : α), f i = 1

theorem finsum_of_infinite_support E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] {f : α → M},
  (Function.support f).Infinite → ∑ᶠ (i : α), f i = 0

theorem finprod_of_not_hasFiniteMulSupport E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] {f : α → M}, ¬Function.HasFiniteMulSupport f → ∏ᶠ (i : α), f i = 1

theorem finsum_of_not_hasFiniteSupport E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] {f : α → M}, ¬Function.HasFiniteSupport f → ∑ᶠ (i : α), f i = 0

theorem hasFiniteSupport_of_finsum_ne_zero E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] {f : α → M}, ∑ᶠ (i : α), f i ≠ 0 → Function.HasFiniteSupport f

theorem hasFiniteMulSupport_of_finprod_ne_one E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] {f : α → M}, ∏ᶠ (i : α), f i ≠ 1 → Function.HasFiniteMulSupport f

theorem hasFiniteSupport_of_finsum_eq_one E1 #

∀ {α : Type u_1} {R : Type u_7} [inst : NonAssocSemiring R] {f : α → R},
  ∑ᶠ (i : α), f i = 1 → Function.HasFiniteSupport f

theorem finsum_eq_sum E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] (f : α → M) (hf : Function.HasFiniteSupport f),
  ∑ᶠ (i : α), f i = ∑ i ∈ Set.Finite.toFinset hf, f i

theorem finprod_eq_prod E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] (f : α → M) (hf : Function.HasFiniteMulSupport f),
  ∏ᶠ (i : α), f i = ∏ i ∈ Set.Finite.toFinset hf, f i

theorem finprod_eq_prod_of_fintype E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] [inst_1 : Fintype α] (f : α → M), ∏ᶠ (i : α), f i = ∏ i, f i

theorem finsum_eq_sum_of_fintype E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] [inst_1 : Fintype α] (f : α → M), ∑ᶠ (i : α), f i = ∑ i, f i

theorem finprod_ne_zero E1 #

∀ {α : Type u_1} {M₀ : Type u_7} [inst : CommMonoidWithZero M₀] [Nontrivial M₀] [NoZeroDivisors M₀] {f : α → M₀},
  (∀ (i : α), f i ≠ 0) → ∏ᶠ (i : α), f i ≠ 0

theorem finprod_apply_ne_zero E1 #

∀ {ι : Type u_7} {N₀ : Type u_8} {M₀ : Type u_9} [inst : CommMonoidWithZero M₀] [Nontrivial M₀] [NoZeroDivisors M₀]
  {n : N₀} {f : ι → N₀ → M₀}, (∀ (i : ι), f i n ≠ 0) → (∏ᶠ (i : ι), f i) n ≠ 0

theorem map_finsetSum E0 #

∀ {M : Type u_5} {N : Type u_6} [inst : AddCommMonoid M] [inst_1 : AddCommMonoid N] {α : Type u_7} {F : Type u_8}
  [inst_2 : Fintype α] [inst_3 : EquivLike F M N] [AddEquivClass F M N] (f : F) (g : α → M), f (∑ i, g i) = ∑ i, f (g i)

theorem map_finsetProd E0 #

∀ {M : Type u_5} {N : Type u_6} [inst : CommMonoid M] [inst_1 : CommMonoid N] {α : Type u_7} {F : Type u_8}
  [inst_2 : Fintype α] [inst_3 : EquivLike F M N] [MulEquivClass F M N] (f : F) (g : α → M), f (∏ i, g i) = ∏ i, f (g i)

theorem finsum_cond_eq_sum_of_cond_iff E0 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] (f : α → M) {p : α → Prop} {t : Finset α},
  (∀ {x : α}, f x ≠ 0 → (p x ↔ x ∈ t)) → ∑ᶠ (i : α) (_ : p i), f i = ∑ i ∈ t, f i

theorem finprod_cond_eq_prod_of_cond_iff E0 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] (f : α → M) {p : α → Prop} {t : Finset α},
  (∀ {x : α}, f x ≠ 1 → (p x ↔ x ∈ t)) → ∏ᶠ (i : α) (_ : p i), f i = ∏ i ∈ t, f i

theorem finsum_cond_ne E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] (f : α → M) (a : α) [inst_1 : DecidableEq α]
  (hf : Function.HasFiniteSupport f), ∑ᶠ (i : α) (_ : i ≠ a), f i = ∑ i ∈ (Set.Finite.toFinset hf).erase a, f i

theorem finprod_cond_ne E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] (f : α → M) (a : α) [inst_1 : DecidableEq α]
  (hf : Function.HasFiniteMulSupport f), ∏ᶠ (i : α) (_ : i ≠ a), f i = ∏ i ∈ (Set.Finite.toFinset hf).erase a, f i

theorem finprod_mem_eq_prod_of_inter_mulSupport_eq E0 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] (f : α → M) {s : Set α} {t : Finset α},
  s ∩ Function.mulSupport f = ↑t ∩ Function.mulSupport f → ∏ᶠ (i : α) (_ : i ∈ s), f i = ∏ i ∈ t, f i

theorem finsum_mem_eq_sum_of_inter_support_eq E0 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] (f : α → M) {s : Set α} {t : Finset α},
  s ∩ Function.support f = ↑t ∩ Function.support f → ∑ᶠ (i : α) (_ : i ∈ s), f i = ∑ i ∈ t, f i

theorem finsum_mem_eq_sum_of_subset E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] (f : α → M) {s : Set α} {t : Finset α},
  s ∩ Function.support f ⊆ ↑t → ↑t ⊆ s → ∑ᶠ (i : α) (_ : i ∈ s), f i = ∑ i ∈ t, f i

theorem finprod_mem_eq_prod_of_subset E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] (f : α → M) {s : Set α} {t : Finset α},
  s ∩ Function.mulSupport f ⊆ ↑t → ↑t ⊆ s → ∏ᶠ (i : α) (_ : i ∈ s), f i = ∏ i ∈ t, f i

theorem finsum_mem_eq_sum E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] (f : α → M) {s : Set α} (hf : (s ∩ Function.support f).Finite),
  ∑ᶠ (i : α) (_ : i ∈ s), f i = ∑ i ∈ hf.toFinset, f i

theorem finprod_mem_eq_prod E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] (f : α → M) {s : Set α} (hf : (s ∩ Function.mulSupport f).Finite),
  ∏ᶠ (i : α) (_ : i ∈ s), f i = ∏ i ∈ hf.toFinset, f i

theorem finsum_mem_eq_sum_filter E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] (f : α → M) (s : Set α) [inst_1 : DecidablePred fun x ↦ x ∈ s]
  (hf : Function.HasFiniteSupport f), ∑ᶠ (i : α) (_ : i ∈ s), f i = ∑ i ∈ Set.Finite.toFinset hf with i ∈ s, f i

theorem finprod_mem_eq_prod_filter E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] (f : α → M) (s : Set α) [inst_1 : DecidablePred fun x ↦ x ∈ s]
  (hf : Function.HasFiniteMulSupport f), ∏ᶠ (i : α) (_ : i ∈ s), f i = ∏ i ∈ Set.Finite.toFinset hf with i ∈ s, f i

theorem finsum_mem_eq_toFinset_sum E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] (f : α → M) (s : Set α) [inst_1 : Fintype ↑s],
  ∑ᶠ (i : α) (_ : i ∈ s), f i = ∑ i ∈ s.toFinset, f i

theorem finprod_mem_eq_toFinset_prod E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] (f : α → M) (s : Set α) [inst_1 : Fintype ↑s],
  ∏ᶠ (i : α) (_ : i ∈ s), f i = ∏ i ∈ s.toFinset, f i

theorem finsum_mem_eq_finite_toFinset_sum E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] (f : α → M) {s : Set α} (hs : s.Finite),
  ∑ᶠ (i : α) (_ : i ∈ s), f i = ∑ i ∈ hs.toFinset, f i

theorem finprod_mem_eq_finite_toFinset_prod E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] (f : α → M) {s : Set α} (hs : s.Finite),
  ∏ᶠ (i : α) (_ : i ∈ s), f i = ∏ i ∈ hs.toFinset, f i

theorem finsum_mem_finset_eq_sum E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] (f : α → M) (s : Finset α),
  ∑ᶠ (i : α) (_ : i ∈ s), f i = ∑ i ∈ s, f i

theorem finprod_mem_finset_eq_prod E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] (f : α → M) (s : Finset α),
  ∏ᶠ (i : α) (_ : i ∈ s), f i = ∏ i ∈ s, f i

theorem finsum_mem_coe_finset E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] (f : α → M) (s : Finset α),
  ∑ᶠ (i : α) (_ : i ∈ ↑s), f i = ∑ i ∈ s, f i

theorem finprod_mem_coe_finset E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] (f : α → M) (s : Finset α),
  ∏ᶠ (i : α) (_ : i ∈ ↑s), f i = ∏ i ∈ s, f i

theorem finsum_mem_eq_zero_of_infinite E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] {f : α → M} {s : Set α},
  (s ∩ Function.support f).Infinite → ∑ᶠ (i : α) (_ : i ∈ s), f i = 0

theorem finprod_mem_eq_one_of_infinite E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] {f : α → M} {s : Set α},
  (s ∩ Function.mulSupport f).Infinite → ∏ᶠ (i : α) (_ : i ∈ s), f i = 1

theorem finprod_mem_eq_one_of_forall_eq_one E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] {f : α → M} {s : Set α},
  (∀ x ∈ s, f x = 1) → ∏ᶠ (i : α) (_ : i ∈ s), f i = 1

theorem finsum_mem_eq_zero_of_forall_eq_zero E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] {f : α → M} {s : Set α},
  (∀ x ∈ s, f x = 0) → ∑ᶠ (i : α) (_ : i ∈ s), f i = 0

theorem finprod_mem_inter_mulSupport E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] (f : α → M) (s : Set α),
  ∏ᶠ (i : α) (_ : i ∈ s ∩ Function.mulSupport f), f i = ∏ᶠ (i : α) (_ : i ∈ s), f i

theorem finsum_mem_inter_support E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] (f : α → M) (s : Set α),
  ∑ᶠ (i : α) (_ : i ∈ s ∩ Function.support f), f i = ∑ᶠ (i : α) (_ : i ∈ s), f i

theorem finsum_mem_inter_support_eq E0 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] (f : α → M) (s t : Set α),
  s ∩ Function.support f = t ∩ Function.support f → ∑ᶠ (i : α) (_ : i ∈ s), f i = ∑ᶠ (i : α) (_ : i ∈ t), f i

theorem finprod_mem_inter_mulSupport_eq E0 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] (f : α → M) (s t : Set α),
  s ∩ Function.mulSupport f = t ∩ Function.mulSupport f → ∏ᶠ (i : α) (_ : i ∈ s), f i = ∏ᶠ (i : α) (_ : i ∈ t), f i

theorem finprod_mem_inter_mulSupport_eq' E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] (f : α → M) (s t : Set α),
  (∀ x ∈ Function.mulSupport f, x ∈ s ↔ x ∈ t) → ∏ᶠ (i : α) (_ : i ∈ s), f i = ∏ᶠ (i : α) (_ : i ∈ t), f i

theorem finsum_mem_inter_support_eq' E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] (f : α → M) (s t : Set α),
  (∀ x ∈ Function.support f, x ∈ s ↔ x ∈ t) → ∑ᶠ (i : α) (_ : i ∈ s), f i = ∑ᶠ (i : α) (_ : i ∈ t), f i

theorem finsum_mem_univ E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] (f : α → M),
  ∑ᶠ (i : α) (_ : i ∈ Set.univ), f i = ∑ᶠ (i : α), f i

theorem finprod_mem_univ E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] (f : α → M), ∏ᶠ (i : α) (_ : i ∈ Set.univ), f i = ∏ᶠ (i : α), f i

theorem finsum_mem_congr E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] {f g : α → M} {s t : Set α},
  s = t → (∀ x ∈ t, f x = g x) → ∑ᶠ (i : α) (_ : i ∈ s), f i = ∑ᶠ (i : α) (_ : i ∈ t), g i

theorem finprod_mem_congr E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] {f g : α → M} {s t : Set α},
  s = t → (∀ x ∈ t, f x = g x) → ∏ᶠ (i : α) (_ : i ∈ s), f i = ∏ᶠ (i : α) (_ : i ∈ t), g i

theorem finprod_eq_one_of_forall_eq_one E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] {f : α → M}, (∀ (x : α), f x = 1) → ∏ᶠ (i : α), f i = 1

theorem finsum_eq_zero_of_forall_eq_zero E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] {f : α → M}, (∀ (x : α), f x = 0) → ∑ᶠ (i : α), f i = 0

theorem one_lt_finprod_cond E1 #

∀ {ι : Type u_3} {M : Type u_7} [inst : CommMonoid M] [inst_1 : PartialOrder M] [IsOrderedCancelMonoid M] {f : ι → M}
  {p : ι → Prop},
  (∀ (i : ι), p i → 1 ≤ f i) →
    (∃ i, p i ∧ 1 < f i) → (Function.mulSupport f ∩ {i | p i}).Finite → 1 < ∏ᶠ (i : ι) (_ : p i), f i

theorem finsum_cond_pos E1 #

∀ {ι : Type u_3} {M : Type u_7} [inst : AddCommMonoid M] [inst_1 : PartialOrder M] [IsOrderedCancelAddMonoid M]
  {f : ι → M} {p : ι → Prop},
  (∀ (i : ι), p i → 0 ≤ f i) →
    (∃ i, p i ∧ 0 < f i) → (Function.support f ∩ {i | p i}).Finite → 0 < ∑ᶠ (i : ι) (_ : p i), f i

theorem finsum_pos E1 #

∀ {ι : Type u_3} {M : Type u_7} [inst : AddCommMonoid M] [inst_1 : PartialOrder M] [IsOrderedCancelAddMonoid M]
  {f : ι → M}, (∀ (i : ι), 0 ≤ f i) → (∃ i, 0 < f i) → Function.HasFiniteSupport f → 0 < ∑ᶠ (i : ι), f i

theorem one_lt_finprod E1 #

∀ {ι : Type u_3} {M : Type u_7} [inst : CommMonoid M] [inst_1 : PartialOrder M] [IsOrderedCancelMonoid M] {f : ι → M},
  (∀ (i : ι), 1 ≤ f i) → (∃ i, 1 < f i) → Function.HasFiniteMulSupport f → 1 < ∏ᶠ (i : ι), f i

theorem finprod_le_finprod E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] {f g : α → M} [inst_1 : PartialOrder M] [MulLeftMono M],
  Function.HasFiniteMulSupport f → Function.HasFiniteMulSupport g → f ≤ g → ∏ᶠ (a : α), f a ≤ ∏ᶠ (a : α), g a

Monotonicity of finprod. See finprod_le_finprod₀ for a variant where M is a CommMonoidWithZero.

theorem finsum_le_finsum E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] {f g : α → M} [inst_1 : PartialOrder M] [AddLeftMono M],
  Function.HasFiniteSupport f → Function.HasFiniteSupport g → f ≤ g → ∑ᶠ (a : α), f a ≤ ∑ᶠ (a : α), g a

Monotonicity of finsum.

theorem finprod_le_finprod₀ E1 #

∀ {α : Type u_1} {M : Type u_7} [inst : CommMonoidWithZero M] [inst_1 : PartialOrder M] [ZeroLEOneClass M]
  [PosMulMono M] {f g : α → M},
  Function.HasFiniteMulSupport f →
    (∀ (a : α), 0 ≤ f a) → Function.HasFiniteMulSupport g → f ≤ g → ∏ᶠ (a : α), f a ≤ ∏ᶠ (a : α), g a

Monotonicity of finprod. See finprod_le_finprod for a variant where M is an ordered CommMonoid.

theorem finprod_zero_le_one E1 #

∀ {M : Type u_7} {α : Type u_8} [inst : CommMonoidWithZero M] [inst_1 : PartialOrder M] [ZeroLEOneClass M]
  [PosMulMono M], ∏ᶠ (x : α), 0 ≤ 1

theorem finprod_mul_distrib E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] {f g : α → M},
  Function.HasFiniteMulSupport f →
    Function.HasFiniteMulSupport 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_add_distrib E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] {f g : α → M},
  Function.HasFiniteSupport f →
    Function.HasFiniteSupport 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_div_distrib E1 #

∀ {α : Type u_1} {G : Type u_4} [inst : DivisionCommMonoid G] {f g : α → G},
  Function.HasFiniteMulSupport f →
    Function.HasFiniteMulSupport 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_sub_distrib E1 #

∀ {α : Type u_1} {G : Type u_4} [inst : SubtractionCommMonoid G] {f g : α → G},
  Function.HasFiniteSupport f →
    Function.HasFiniteSupport 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_mem_mul_distrib' E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] {f g : α → M} {s : Set α},
  (s ∩ Function.mulSupport f).Finite →
    (s ∩ Function.mulSupport g).Finite →
      ∏ᶠ (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_add_distrib' E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] {f g : α → M} {s : Set α},
  (s ∩ Function.support f).Finite →
    (s ∩ Function.support g).Finite →
      ∑ᶠ (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_one E1 #

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

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

theorem finsum_mem_zero E1 #

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

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

theorem finprod_mem_of_eqOn_one E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] {f : α → M} {s : Set α},
  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 finsum_mem_of_eqOn_zero E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] {f : α → M} {s : Set α},
  Set.EqOn f 0 s → ∑ᶠ (i : α) (_ : i ∈ s), f i = 0

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

theorem exists_ne_one_of_finprod_mem_ne_one E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] {f : α → M} {s : Set α},
  ∏ᶠ (i : α) (_ : i ∈ s), f i ≠ 1 → ∃ 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 exists_ne_zero_of_finsum_mem_ne_zero E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] {f : α → M} {s : Set α},
  ∑ᶠ (i : α) (_ : i ∈ s), f i ≠ 0 → ∃ x ∈ s, f x ≠ 0

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

theorem finprod_mem_mul_distrib E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] {f g : α → M} {s : Set α},
  s.Finite → ∏ᶠ (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 finsum_mem_add_distrib E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] {f g : α → M} {s : Set α},
  s.Finite → ∑ᶠ (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 AddMonoidHom.map_finsum E0 #

∀ {α : Type u_1} {M : Type u_5} {N : Type u_6} [inst : AddCommMonoid M] [inst_1 : AddCommMonoid N] {f : α → M}
  (g : M →+ N), Function.HasFiniteSupport f → g (∑ᶠ (i : α), f i) = ∑ᶠ (i : α), g (f i)

theorem MonoidHom.map_finprod E0 #

∀ {α : Type u_1} {M : Type u_5} {N : Type u_6} [inst : CommMonoid M] [inst_1 : CommMonoid N] {f : α → M} (g : M →* N),
  Function.HasFiniteMulSupport f → g (∏ᶠ (i : α), f i) = ∏ᶠ (i : α), g (f i)

theorem map_finprod E0 #

∀ {α : Type u_1} {M : Type u_5} {N : Type u_6} [inst : CommMonoid M] [inst_1 : CommMonoid N] {f : α → M} {G : Type u_7}
  [inst_2 : FunLike G M N] [MonoidHomClass G M N] (g : G),
  Function.HasFiniteMulSupport f → g (∏ᶠ (i : α), f i) = ∏ᶠ (i : α), g (f i)

theorem map_finsum E0 #

∀ {α : Type u_1} {M : Type u_5} {N : Type u_6} [inst : AddCommMonoid M] [inst_1 : AddCommMonoid N] {f : α → M}
  {G : Type u_7} [inst_2 : FunLike G M N] [AddMonoidHomClass G M N] (g : G),
  Function.HasFiniteSupport f → g (∑ᶠ (i : α), f i) = ∑ᶠ (i : α), g (f i)

theorem finsum_nsmul E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] {f : α → M},
  Function.HasFiniteSupport f → ∀ (n : ℕ), n • ∑ᶠ (i : α), f i = ∑ᶠ (i : α), n • f i

theorem finprod_pow E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] {f : α → M},
  Function.HasFiniteMulSupport f → ∀ (n : ℕ), (∏ᶠ (i : α), f i) ^ n = ∏ᶠ (i : α), f i ^ n

theorem finsum_smul' E1 #

∀ {ι : Type u_3} {R : Type u_7} {M : Type u_8} [inst : Semiring R] [inst_1 : AddCommMonoid M] [inst_2 : Module R M]
  {f : ι → R}, Function.HasFiniteSupport 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' E1 #

∀ {ι : Type u_3} {R : Type u_7} {M : Type u_8} [inst : AddCommMonoid M] [inst_1 : DistribSMul R M] (c : R) {f : ι → M},
  Function.HasFiniteSupport 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 MonoidHom.map_finprod_mem' E0 #

∀ {α : Type u_1} {M : Type u_5} {N : Type u_6} [inst : CommMonoid M] [inst_1 : CommMonoid N] {s : Set α} {f : α → M}
  (g : M →* N), (s ∩ Function.mulSupport f).Finite → 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' E0 #

∀ {α : Type u_1} {M : Type u_5} {N : Type u_6} [inst : AddCommMonoid M] [inst_1 : AddCommMonoid N] {s : Set α}
  {f : α → M} (g : M →+ N),
  (s ∩ Function.support f).Finite → 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 E0 #

∀ {α : Type u_1} {M : Type u_5} {N : Type u_6} [inst : CommMonoid M] [inst_1 : CommMonoid N] {s : Set α} (f : α → M)
  (g : M →* N), s.Finite → 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 AddMonoidHom.map_finsum_mem E0 #

∀ {α : Type u_1} {M : Type u_5} {N : Type u_6} [inst : AddCommMonoid M] [inst_1 : AddCommMonoid N] {s : Set α}
  (f : α → M) (g : M →+ N), s.Finite → 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 AddEquiv.map_finsum_mem E0 #

∀ {α : Type u_1} {M : Type u_5} {N : Type u_6} [inst : AddCommMonoid M] [inst_1 : AddCommMonoid N] (g : M ≃+ N)
  (f : α → M) {s : Set α}, s.Finite → g (∑ᶠ (i : α) (_ : i ∈ s), f i) = ∑ᶠ (i : α) (_ : i ∈ s), g (f i)

theorem MulEquiv.map_finprod_mem E0 #

∀ {α : Type u_1} {M : Type u_5} {N : Type u_6} [inst : CommMonoid M] [inst_1 : CommMonoid N] (g : M ≃* N) (f : α → M)
  {s : Set α}, s.Finite → g (∏ᶠ (i : α) (_ : i ∈ s), f i) = ∏ᶠ (i : α) (_ : i ∈ s), g (f i)

theorem finsum_mem_neg_distrib E1 #

∀ {α : Type u_1} {G : Type u_4} {s : Set α} [inst : SubtractionCommMonoid G] (f : α → G),
  s.Finite → ∑ᶠ (x : α) (_ : x ∈ s), -f x = -∑ᶠ (x : α) (_ : x ∈ s), f x

theorem finprod_mem_inv_distrib E1 #

∀ {α : Type u_1} {G : Type u_4} {s : Set α} [inst : DivisionCommMonoid G] (f : α → G),
  s.Finite → ∏ᶠ (x : α) (_ : x ∈ s), (f x)⁻¹ = (∏ᶠ (x : α) (_ : x ∈ s), f x)⁻¹

theorem finprod_mem_div_distrib E1 #

∀ {α : Type u_1} {G : Type u_4} {s : Set α} [inst : DivisionCommMonoid G] (f g : α → G),
  s.Finite → ∏ᶠ (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.

theorem finsum_mem_sub_distrib E1 #

∀ {α : Type u_1} {G : Type u_4} {s : Set α} [inst : SubtractionCommMonoid G] (f g : α → G),
  s.Finite → ∑ᶠ (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_empty E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] {f : α → M}, ∏ᶠ (i : α) (_ : i ∈ ∅), f i = 1

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

theorem finsum_mem_empty E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] {f : α → M}, ∑ᶠ (i : α) (_ : i ∈ ∅), f i = 0

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

theorem nonempty_of_finprod_mem_ne_one E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] {f : α → M} {s : Set α},
  ∏ᶠ (i : α) (_ : i ∈ s), f i ≠ 1 → s.Nonempty

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

theorem nonempty_of_finsum_mem_ne_zero E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] {f : α → M} {s : Set α},
  ∑ᶠ (i : α) (_ : i ∈ s), f i ≠ 0 → s.Nonempty

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

theorem finprod_mem_union_inter E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] {f : α → M} {s t : Set α},
  s.Finite →
    t.Finite →
      (∏ᶠ (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 E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] {f : α → M} {s t : Set α},
  s.Finite →
    t.Finite →
      ∑ᶠ (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' E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] {f : α → M} {s t : Set α},
  (s ∩ Function.mulSupport f).Finite →
    (t ∩ Function.mulSupport f).Finite →
      (∏ᶠ (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_inter' E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] {f : α → M} {s t : Set α},
  (s ∩ Function.support f).Finite →
    (t ∩ Function.support f).Finite →
      ∑ᶠ (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' E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] {f : α → M} {s t : Set α},
  Disjoint s t →
    (s ∩ Function.mulSupport f).Finite →
      (t ∩ Function.mulSupport f).Finite →
        ∏ᶠ (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' E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] {f : α → M} {s t : Set α},
  Disjoint s t →
    (s ∩ Function.support f).Finite →
      (t ∩ Function.support f).Finite →
        ∑ᶠ (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 E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] {f : α → M} {s t : Set α},
  Disjoint s t →
    s.Finite → t.Finite → ∏ᶠ (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 E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] {f : α → M} {s t : Set α},
  Disjoint s t →
    s.Finite → t.Finite → ∑ᶠ (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'' E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] {f : α → M} {s t : Set α},
  Disjoint (s ∩ Function.mulSupport f) (t ∩ Function.mulSupport f) →
    (s ∩ Function.mulSupport f).Finite →
      (t ∩ Function.mulSupport f).Finite →
        ∏ᶠ (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_union'' E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] {f : α → M} {s t : Set α},
  Disjoint (s ∩ Function.support f) (t ∩ Function.support f) →
    (s ∩ Function.support f).Finite →
      (t ∩ Function.support f).Finite →
        ∑ᶠ (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_singleton E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] {f : α → M} {a : α}, ∏ᶠ (i : α) (_ : i ∈ {a}), f i = f a

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

theorem finsum_mem_singleton E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : 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_cond_eq_left E0 #

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

theorem finsum_cond_eq_left E0 #

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

theorem finprod_cond_eq_right E0 #

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

theorem finsum_cond_eq_right E0 #

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

theorem finprod_mem_insert' E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] {a : α} {s : Set α} (f : α → M),
  a ∉ s → (s ∩ Function.mulSupport f).Finite → ∏ᶠ (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' E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] {a : α} {s : Set α} (f : α → M),
  a ∉ s → (s ∩ Function.support f).Finite → ∑ᶠ (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 E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] {a : α} {s : Set α} (f : α → M),
  a ∉ s → s.Finite → ∏ᶠ (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 E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] {a : α} {s : Set α} (f : α → M),
  a ∉ s → s.Finite → ∑ᶠ (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_of_eq_one_if_notMem E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] {f : α → M} {a : α} {s : Set α},
  (a ∉ s → f 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_of_eq_zero_if_notMem E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] {f : α → M} {a : α} {s : Set α},
  (a ∉ s → f 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_one E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] {f : α → M} {a : α} {s : Set α},
  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 finsum_mem_insert_zero E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] {f : α → M} {a : α} {s : Set α},
  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_dvd E1 #

∀ {α : Type u_1} {N : Type u_6} [inst : CommMonoid N] {f : α → N} (a : α),
  Function.HasFiniteMulSupport 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 finprod_mem_pair E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] {f : α → M} {a b : α},
  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_pair E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] {f : α → M} {a b : α},
  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_image' E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : CommMonoid M] {f : α → M} {s : Set β} {g : β → α},
  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' E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddCommMonoid M] {f : α → M} {s : Set β} {g : β → α},
  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 E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : CommMonoid M] {f : α → M} {s : Set β} {g : β → α},
  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_image E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddCommMonoid M] {f : α → M} {s : Set β} {g : β → α},
  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_range' E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : CommMonoid M] {f : α → M} {g : β → α},
  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' E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddCommMonoid M] {f : α → M} {g : β → α},
  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 E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : CommMonoid M] {f : α → M} {g : β → α},
  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_range E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddCommMonoid M] {f : α → M} {g : β → α},
  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_eq_of_bijOn E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : CommMonoid M] {s : Set α} {t : Set β} {f : α → M} {g : β → M}
  (e : α → β), Set.BijOn e s t → (∀ x ∈ s, f x = g (e x)) → ∏ᶠ (i : α) (_ : i ∈ s), f i = ∏ᶠ (j : β) (_ : j ∈ t), g j

See also Finset.prod_bij.

theorem finsum_mem_eq_of_bijOn E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddCommMonoid M] {s : Set α} {t : Set β} {f : α → M} {g : β → M}
  (e : α → β), Set.BijOn e s t → (∀ x ∈ s, f x = g (e x)) → ∑ᶠ (i : α) (_ : i ∈ s), f i = ∑ᶠ (j : β) (_ : j ∈ t), g j

See also Finset.sum_bij.

theorem finprod_eq_of_bijective E1 #

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

See finprod_comp, Fintype.prod_bijective and Finset.prod_bij.

theorem finsum_eq_of_bijective E1 #

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

See finsum_comp, Fintype.sum_bijective and Finset.sum_bij.

theorem finprod_comp E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : CommMonoid M] {g : β → M} (e : α → β),
  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 E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddCommMonoid M] {g : β → M} (e : α → β),
  Function.Bijective e → ∑ᶠ (i : α), g (e i) = ∑ᶠ (j : β), g j

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

theorem finsum_comp_equiv E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddCommMonoid M] (e : α ≃ β) {f : β → M},
  ∑ᶠ (i : α), f (e i) = ∑ᶠ (i' : β), f i'

theorem finprod_comp_equiv E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : CommMonoid M] (e : α ≃ β) {f : β → M},
  ∏ᶠ (i : α), f (e i) = ∏ᶠ (i' : β), f i'

theorem finprod_set_coe_eq_finprod_mem E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] {f : α → M} (s : Set α),
  ∏ᶠ (j : ↑s), f ↑j = ∏ᶠ (i : α) (_ : i ∈ s), f i

theorem finsum_set_coe_eq_finsum_mem E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] {f : α → M} (s : Set α),
  ∑ᶠ (j : ↑s), f ↑j = ∑ᶠ (i : α) (_ : i ∈ s), f i

theorem finprod_subtype_eq_finprod_cond E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] {f : α → M} (p : α → Prop),
  ∏ᶠ (j : Subtype p), f ↑j = ∏ᶠ (i : α) (_ : p i), f i

theorem finsum_subtype_eq_finsum_cond E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] {f : α → M} (p : α → Prop),
  ∑ᶠ (j : Subtype p), f ↑j = ∑ᶠ (i : α) (_ : p i), f i

theorem finsum_mem_inter_add_sdiff' E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] {f : α → M} {s : Set α} (t : Set α),
  (s ∩ Function.support f).Finite →
    ∑ᶠ (i : α) (_ : i ∈ s ∩ t), f i + ∑ᶠ (i : α) (_ : i ∈ s \ t), f i = ∑ᶠ (i : α) (_ : i ∈ s), f i

theorem finprod_mem_inter_mul_sdiff' E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] {f : α → M} {s : Set α} (t : Set α),
  (s ∩ Function.mulSupport f).Finite →
    (∏ᶠ (i : α) (_ : i ∈ s ∩ t), f i) * ∏ᶠ (i : α) (_ : i ∈ s \ t), f i = ∏ᶠ (i : α) (_ : i ∈ s), f i

theorem finsum_mem_inter_add_sdiff E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] {f : α → M} {s : Set α} (t : Set α),
  s.Finite → ∑ᶠ (i : α) (_ : i ∈ s ∩ t), f i + ∑ᶠ (i : α) (_ : i ∈ s \ t), f i = ∑ᶠ (i : α) (_ : i ∈ s), f i

theorem finprod_mem_inter_mul_sdiff E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] {f : α → M} {s : Set α} (t : Set α),
  s.Finite → (∏ᶠ (i : α) (_ : i ∈ s ∩ t), f i) * ∏ᶠ (i : α) (_ : i ∈ s \ t), f i = ∏ᶠ (i : α) (_ : i ∈ s), f i

theorem finprod_mem_mul_sdiff' E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] {f : α → M} {s t : Set α},
  s ⊆ t →
    (t ∩ Function.mulSupport f).Finite →
      (∏ᶠ (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_sdiff' E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] {f : α → M} {s t : Set α},
  s ⊆ t →
    (t ∩ Function.support f).Finite →
      ∑ᶠ (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_sdiff E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] {f : α → M} {s t : Set α},
  s ⊆ t → t.Finite → (∏ᶠ (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_add_sdiff E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] {f : α → M} {s t : Set α},
  s ⊆ t → t.Finite → ∑ᶠ (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_iUnion E1 #

∀ {α : Type u_1} {ι : Type u_3} {M : Type u_5} [inst : CommMonoid M] {f : α → M} [Finite ι] {t : ι → Set α},
  Pairwise (Function.onFun Disjoint t) →
    (∀ (i : ι), (t i).Finite) → ∏ᶠ (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_iUnion E1 #

∀ {α : Type u_1} {ι : Type u_3} {M : Type u_5} [inst : AddCommMonoid M] {f : α → M} [Finite ι] {t : ι → Set α},
  Pairwise (Function.onFun Disjoint t) →
    (∀ (i : ι), (t i).Finite) → ∑ᶠ (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_biUnion E1 #

∀ {α : Type u_1} {ι : Type u_3} {M : Type u_5} [inst : CommMonoid M] {f : α → M} {I : Set ι} {t : ι → Set α},
  I.PairwiseDisjoint t →
    I.Finite →
      (∀ i ∈ I, (t i).Finite) →
        ∏ᶠ (a : α) (_ : a ∈ ⋃ 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_biUnion E1 #

∀ {α : Type u_1} {ι : Type u_3} {M : Type u_5} [inst : AddCommMonoid M] {f : α → M} {I : Set ι} {t : ι → Set α},
  I.PairwiseDisjoint t →
    I.Finite →
      (∀ i ∈ I, (t i).Finite) →
        ∑ᶠ (a : α) (_ : a ∈ ⋃ 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_sUnion E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] {f : α → M} {t : Set (Set α)},
  t.PairwiseDisjoint id →
    t.Finite →
      (∀ x ∈ t, x.Finite) → ∏ᶠ (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 finsum_mem_sUnion E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] {f : α → M} {t : Set (Set α)},
  t.PairwiseDisjoint id →
    t.Finite →
      (∀ x ∈ t, x.Finite) → ∑ᶠ (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_option E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] {f : Option α → M},
  Function.HasFiniteMulSupport (f ∘ some) → ∏ᶠ (o : Option α), f o = f none * ∏ᶠ (a : α), f (some a)

theorem finsum_option E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] {f : Option α → M},
  Function.HasFiniteSupport (f ∘ some) → ∑ᶠ (o : Option α), f o = f none + ∑ᶠ (a : α), f (some a)

theorem finprod_mem_powerset_insert E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] {f : Set α → M} {s : Set α} {a : α},
  s.Finite →
    a ∉ s →
      ∏ᶠ (t : Set α) (_ : t ∈ 𝒫 insert a s), f t =
        (∏ᶠ (t : Set α) (_ : t ∈ 𝒫 s), f t) * ∏ᶠ (t : Set α) (_ : t ∈ 𝒫 s), f (insert a t)

theorem finsum_mem_powerset_insert E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] {f : Set α → M} {s : Set α} {a : α},
  s.Finite →
    a ∉ s →
      ∑ᶠ (t : Set α) (_ : t ∈ 𝒫 insert a s), f t =
        ∑ᶠ (t : Set α) (_ : t ∈ 𝒫 s), f t + ∑ᶠ (t : Set α) (_ : t ∈ 𝒫 s), f (insert a t)

theorem finsum_mem_powerset_sdiff_elem E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] {f : Set α → M} {s : Set α} {a : α},
  s.Finite →
    a ∈ s →
      ∑ᶠ (t : Set α) (_ : t ∈ 𝒫 s), f t =
        ∑ᶠ (t : Set α) (_ : t ∈ 𝒫 (s \ {a})), f t + ∑ᶠ (t : Set α) (_ : t ∈ 𝒫 (s \ {a})), f (insert a t)

theorem finprod_mem_powerset_sdiff_elem E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] {f : Set α → M} {s : Set α} {a : α},
  s.Finite →
    a ∈ s →
      ∏ᶠ (t : Set α) (_ : t ∈ 𝒫 s), f t =
        (∏ᶠ (t : Set α) (_ : t ∈ 𝒫 (s \ {a})), f t) * ∏ᶠ (t : Set α) (_ : t ∈ 𝒫 (s \ {a})), f (insert a t)

theorem add_finsum_cond_ne E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] {f : α → M} (a : α),
  Function.HasFiniteSupport f → f a + ∑ᶠ (i : α) (_ : i ≠ a), f i = ∑ᶠ (i : α), f i

theorem mul_finprod_cond_ne E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] {f : α → M} (a : α),
  Function.HasFiniteMulSupport f → f a * ∏ᶠ (i : α) (_ : i ≠ a), f i = ∏ᶠ (i : α), f i

theorem finprod_mem_comm E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : CommMonoid M] {s : Set α} {t : Set β} (f : α → β → M),
  s.Finite →
    t.Finite → ∏ᶠ (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_comm E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddCommMonoid M] {s : Set α} {t : Set β} (f : α → β → M),
  s.Finite →
    t.Finite → ∑ᶠ (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_induction E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] {f : α → M} {s : Set α} (p : M → Prop),
  p 1 → (∀ (x y : M), p x → p y → p (x * y)) → (∀ x ∈ s, p (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 finsum_mem_induction E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] {f : α → M} {s : Set α} (p : M → Prop),
  p 0 → (∀ (x y : M), p x → p y → p (x + y)) → (∀ x ∈ s, p (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_cond_nonneg E1 #

∀ {α : Type u_1} {R : Type u_7} [inst : CommSemiring R] [inst_1 : PartialOrder R] [IsOrderedRing R] {p : α → Prop}
  {f : α → R}, (∀ (x : α), p x → 0 ≤ f x) → 0 ≤ ∏ᶠ (x : α) (_ : p x), f x

theorem single_le_finsum E1 #

∀ {α : Type u_1} {M : Type u_7} [inst : AddCommMonoid M] [inst_1 : Preorder M] [IsOrderedAddMonoid M] (i : α)
  {f : α → M}, Function.HasFiniteSupport f → (∀ (j : α), 0 ≤ f j) → f i ≤ ∑ᶠ (j : α), f j

theorem single_le_finprod E1 #

∀ {α : Type u_1} {M : Type u_7} [inst : CommMonoid M] [inst_1 : Preorder M] [IsOrderedMonoid M] (i : α) {f : α → M},
  Function.HasFiniteMulSupport f → (∀ (j : α), 1 ≤ f j) → f i ≤ ∏ᶠ (j : α), f j

theorem finprod_eq_zero E1 #

∀ {α : Type u_1} {M₀ : Type u_7} [inst : CommMonoidWithZero M₀] (f : α → M₀) (x : α),
  f x = 0 → Function.HasFiniteMulSupport f → ∏ᶠ (x : α), f x = 0

theorem finsum_sum_comm E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddCommMonoid M] (s : Finset β) (f : α → β → M),
  (∀ b ∈ s, Function.HasFiniteSupport fun a ↦ f a b) → ∑ᶠ (a : α), ∑ b ∈ s, f a b = ∑ b ∈ s, ∑ᶠ (a : α), f a b

theorem finprod_prod_comm E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : CommMonoid M] (s : Finset β) (f : α → β → M),
  (∀ b ∈ s, Function.HasFiniteMulSupport fun a ↦ f a b) → ∏ᶠ (a : α), ∏ b ∈ s, f a b = ∏ b ∈ s, ∏ᶠ (a : α), f a b

theorem prod_finprod_comm E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : CommMonoid M] (s : Finset α) (f : α → β → M),
  (∀ a ∈ s, Function.HasFiniteMulSupport (f a)) → ∏ a ∈ s, ∏ᶠ (b : β), f a b = ∏ᶠ (b : β), ∏ a ∈ s, f a b

theorem sum_finsum_comm E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddCommMonoid M] (s : Finset α) (f : α → β → M),
  (∀ a ∈ s, Function.HasFiniteSupport (f a)) → ∑ a ∈ s, ∑ᶠ (b : β), f a b = ∑ᶠ (b : β), ∑ a ∈ s, f a b

theorem finprod_prod_filter E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : CommMonoid M] [inst_1 : DecidableEq α] (f : β → α) (s : Finset β)
  (g : β → M), ∏ᶠ (x : α), ∏ y ∈ s with f y = x, g y = ∏ k ∈ s, g k

theorem finsum_sum_filter E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddCommMonoid M] [inst_1 : DecidableEq α] (f : β → α)
  (s : Finset β) (g : β → M), ∑ᶠ (x : α), ∑ y ∈ s with f y = x, g y = ∑ k ∈ s, g k

theorem mul_finsum' E1 #

∀ {α : Type u_1} {R : Type u_7} [inst : NonUnitalNonAssocSemiring R] (f : α → R) (r : R),
  Function.HasFiniteSupport f → r * ∑ᶠ (a : α), f a = ∑ᶠ (a : α), r * f a

For functions with finite support, multiplication commutes with finsums. See mul_finsum for a statement assuming that R has no zero divisors.

theorem mul_finsum_mem' E1 #

∀ {α : Type u_1} {R : Type u_7} [inst : NonUnitalNonAssocSemiring R] {s : Set α} (f : α → R) (r : R),
  s.Finite → r * ∑ᶠ (a : α) (_ : a ∈ s), f a = ∑ᶠ (a : α) (_ : a ∈ s), r * f a

For finite sets, multiplication commutes with finsum_mem. See mul_finsum_mem' for a statement assuming finiteness of support.

theorem finsum_mul' E1 #

∀ {α : Type u_1} {R : Type u_7} [inst : NonUnitalNonAssocSemiring R] (f : α → R) (r : R),
  Function.HasFiniteSupport f → (∑ᶠ (a : α), f a) * r = ∑ᶠ (a : α), f a * r

For functions with finite support, multiplication commutes with finsums. See finsum_mul for a statement assuming that R has no zero divisors.

theorem finsum_mem_mul' E1 #

∀ {α : Type u_1} {R : Type u_7} [inst : NonUnitalNonAssocSemiring R] {s : Set α} (f : α → R) (r : R),
  s.Finite → (∑ᶠ (a : α) (_ : a ∈ s), f a) * r = ∑ᶠ (a : α) (_ : a ∈ s), f a * r

For finite sets, multiplication commutes with finsum_mem. See finsum_mem_mul' for a statement assuming finiteness of support.

theorem mul_finsum E1 #

∀ {α : Type u_1} {R : Type u_7} [inst : NonUnitalNonAssocSemiring R] [NoZeroDivisors R] (f : α → R) (r : R),
  r * ∑ᶠ (a : α), f a = ∑ᶠ (a : α), r * f a

If R has no zero divisors, then multiplication commutes with finsums. See mul_finsum' for a statement assuming finiteness of support.

theorem mul_finsum_mem E1 #

∀ {α : Type u_1} {R : Type u_7} [inst : NonUnitalNonAssocSemiring R] [NoZeroDivisors R] {s : Set α} (f : α → R) (r : R),
  r * ∑ᶠ (a : α) (_ : a ∈ s), f a = ∑ᶠ (a : α) (_ : a ∈ s), r * f a

If R has no zero divisors, then multiplication commutes with finsum_mem. See mul_finsum_mem' for a statement assuming finiteness of support.

theorem finsum_mul E1 #

∀ {α : Type u_1} {R : Type u_7} [inst : NonUnitalNonAssocSemiring R] [NoZeroDivisors R] (f : α → R) (r : R),
  (∑ᶠ (a : α), f a) * r = ∑ᶠ (a : α), f a * r

If R has no zero divisors, then multiplication commutes with finsums. See finsum_mul' for a statement assuming finiteness of support.

theorem finsum_mem_mul E1 #

∀ {α : Type u_1} {R : Type u_7} [inst : NonUnitalNonAssocSemiring R] [NoZeroDivisors R] {s : Set α} (f : α → R) (r : R),
  (∑ᶠ (a : α) (_ : a ∈ s), f a) * r = ∑ᶠ (a : α) (_ : a ∈ s), f a * r

If R has no zero divisors, then multiplication commutes with finsum_mem. See finsum_mem_mul' for a statement assuming finiteness of support.

theorem finsum_apply E0 #

∀ {N : Type u_6} [inst : AddCommMonoid N] {α : Type u_7} {ι : Type u_8} {f : ι → α → N},
  Function.HasFiniteSupport f → ∀ (a : α), (∑ᶠ (i : ι), f i) a = ∑ᶠ (i : ι), f i a

theorem finprod_apply E0 #

∀ {N : Type u_6} [inst : CommMonoid N] {α : Type u_7} {ι : Type u_8} {f : ι → α → N},
  Function.HasFiniteMulSupport f → ∀ (a : α), (∏ᶠ (i : ι), f i) a = ∏ᶠ (i : ι), f i a

theorem Finset.support_of_fiberwise_sum_subset_image E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddCommMonoid M] [inst_1 : DecidableEq β] (s : Finset α)
  (f : α → M) (g : α → β), (Function.support fun b ↦ ∑ a ∈ s with g a = b, f a) ⊆ ↑(Finset.image g s)

theorem Finset.mulSupport_of_fiberwise_prod_subset_image E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : CommMonoid M] [inst_1 : DecidableEq β] (s : Finset α) (f : α → M)
  (g : α → β), (Function.mulSupport fun b ↦ ∏ a ∈ s with g a = b, f a) ⊆ ↑(Finset.image g s)

theorem finprod_mem_finset_product' E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : CommMonoid M] [inst_1 : DecidableEq α] [inst_2 : DecidableEq β]
  (s : Finset (α × β)) (f : α × β → M),
  ∏ᶠ (ab : α × β) (_ : ab ∈ s), f ab =
    ∏ᶠ (a : α) (b : β) (_ : b ∈ Finset.image Prod.snd ({ab ∈ s | ab.1 = a})), 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' E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddCommMonoid M] [inst_1 : DecidableEq α]
  [inst_2 : DecidableEq β] (s : Finset (α × β)) (f : α × β → M),
  ∑ᶠ (ab : α × β) (_ : ab ∈ s), f ab =
    ∑ᶠ (a : α) (b : β) (_ : b ∈ Finset.image Prod.snd ({ab ∈ s | ab.1 = a})), 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 E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : 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 E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : 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₃ E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : 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_mem_finset_product₃ E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : 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_curry E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : CommMonoid M] (f : α × β → M),
  Function.HasFiniteMulSupport f → ∏ᶠ (ab : α × β), f ab = ∏ᶠ (a : α) (b : β), f (a, b)

theorem finsum_curry E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddCommMonoid M] (f : α × β → M),
  Function.HasFiniteSupport f → ∑ᶠ (ab : α × β), f ab = ∑ᶠ (a : α) (b : β), f (a, b)

theorem finprod_curry₃ E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : CommMonoid M] {γ : Type u_7} (f : α × β × γ → M),
  Function.HasFiniteMulSupport f → ∏ᶠ (abc : α × β × γ), f abc = ∏ᶠ (a : α) (b : β) (c : γ), f (a, b, c)

theorem finsum_curry₃ E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddCommMonoid M] {γ : Type u_7} (f : α × β × γ → M),
  Function.HasFiniteSupport f → ∑ᶠ (abc : α × β × γ), f abc = ∑ᶠ (a : α) (b : β) (c : γ), f (a, b, c)

theorem finsum_dmem E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] {s : Set α} [inst_1 : DecidablePred fun x ↦ x ∈ s]
  (f : (a : α) → a ∈ s → M), ∑ᶠ (a : α) (h : a ∈ s), f a h = ∑ᶠ (a : α) (_ : a ∈ s), if h' : a ∈ s then f a h' else 0

theorem finprod_dmem E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : CommMonoid M] {s : Set α} [inst_1 : DecidablePred fun x ↦ x ∈ s]
  (f : (a : α) → a ∈ s → M), ∏ᶠ (a : α) (h : a ∈ s), f a h = ∏ᶠ (a : α) (_ : a ∈ s), if h' : a ∈ s then f a h' else 1

theorem finsum_emb_domain' E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddCommMonoid M] {f : α → β},
  Function.Injective f →
    ∀ [inst_1 : 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' E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : CommMonoid M] {f : α → β},
  Function.Injective f →
    ∀ [inst_1 : 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 finprod_emb_domain E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : CommMonoid M] (f : α ↪ β)
  [inst_1 : 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 E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddCommMonoid M] (f : α ↪ β)
  [inst_1 : 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 Nat.cast_finprod E0 #

∀ {ι : Type u_3} [Finite ι] {R : Type u_7} [inst : CommSemiring R] (f : ι → ℕ), ↑(∏ᶠ (x : ι), f x) = ∏ᶠ (x : ι), ↑(f x)

theorem Nat.cast_finprod' E0 #

∀ {ι : Type u_3} {R : Type u_7} [inst : CommSemiring R] [CharZero R] (f : ι → ℕ),
  ↑(∏ᶠ (x : ι), f x) = ∏ᶠ (x : ι), ↑(f x)

This version does not assume that ι is finite (compare Nat.cast_finprod), but instead needs to assume characteristic zero to deal with the infinite case.

theorem Nat.cast_finprod_mem E0 #

∀ {ι : Type u_3} {s : Set ι},
  s.Finite →
    ∀ {R : Type u_7} [inst : CommSemiring R] (f : ι → ℕ),
      ↑(∏ᶠ (x : ι) (_ : x ∈ s), f x) = ∏ᶠ (x : ι) (_ : x ∈ s), ↑(f x)

theorem Nat.cast_finsum E0 #

∀ {ι : Type u_3} [Finite ι] {M : Type u_7} [inst : AddCommMonoidWithOne M] (f : ι → ℕ),
  ↑(∑ᶠ (x : ι), f x) = ∑ᶠ (x : ι), ↑(f x)

theorem Nat.cast_finsum_mem E0 #

∀ {ι : Type u_3} {s : Set ι},
  s.Finite →
    ∀ {M : Type u_7} [inst : AddCommMonoidWithOne M] (f : ι → ℕ),
      ↑(∑ᶠ (x : ι) (_ : x ∈ s), f x) = ∑ᶠ (x : ι) (_ : x ∈ s), ↑(f x)

theorem Multiset.mulSupport_fun_pow_count_subset E1 #

∀ {α : Type u_1} {M : Type u_2} [inst : DecidableEq α] [inst_1 : CommMonoid M] (s : Multiset α) (f : α → M),
  (Function.mulSupport fun a ↦ f a ^ Multiset.count a s) ⊆ ↑s.toFinset

theorem Multiset.support_fun_nsmul_count_subset E1 #

∀ {α : Type u_1} {M : Type u_2} [inst : DecidableEq α] [inst_1 : AddCommMonoid M] (s : Multiset α) (f : α → M),
  (Function.support fun a ↦ Multiset.count a s • f a) ⊆ ↑s.toFinset

theorem Multiset.hasFiniteMulSupport_fun_pow_count E1 #

∀ {α : Type u_1} {M : Type u_2} [inst : DecidableEq α] [inst_1 : CommMonoid M] (s : Multiset α) (f : α → M),
  Function.HasFiniteMulSupport fun a ↦ f a ^ Multiset.count a s

theorem Multiset.hasFiniteSupport_fun_nsmul_count E1 #

∀ {α : Type u_1} {M : Type u_2} [inst : DecidableEq α] [inst_1 : AddCommMonoid M] (s : Multiset α) (f : α → M),
  Function.HasFiniteSupport fun a ↦ Multiset.count a s • f a

theorem Multiset.sum_map_eq_finsum E1 #

∀ {α : Type u_1} {M : Type u_2} [inst : DecidableEq α] [inst_1 : AddCommMonoid M] (s : Multiset α) (f : α → M),
  (Multiset.map f s).sum = ∑ᶠ (a : α), Multiset.count a s • f a

theorem Multiset.prod_map_eq_finprod E1 #

∀ {α : Type u_1} {M : Type u_2} [inst : DecidableEq α] [inst_1 : CommMonoid M] (s : Multiset α) (f : α → M),
  (Multiset.map f s).prod = ∏ᶠ (a : α), f a ^ Multiset.count a s

Deprecated aliases

NameNew nameSince
finprod_le_finprod'finprod_le_finprod2026-09-01
finprod_mem_inter_mul_difffinprod_mem_inter_mul_sdiff2026-06-03
finprod_mem_inter_mul_diff'finprod_mem_inter_mul_sdiff'2026-06-03
finprod_mem_mul_difffinprod_mem_mul_sdiff2026-06-03
finprod_mem_mul_diff'finprod_mem_mul_sdiff'2026-06-03
finprod_mem_powerset_diff_elemfinprod_mem_powerset_sdiff_elem2026-06-03
finsum_le_finsum'finsum_le_finsum2026-09-01