The areas / V03. Sets, finite structures and big operators
Mathlib.Algebra.BigOperators.Group.Finset.Defs
139 declarations. Mathlib docs · Source
Big operators
In this file we define products and sums indexed by finite sets (specifically, Finset).
Notation
We introduce the following notation.
Let s be a Finset ι, and f : ι → β a function.
∏ x ∈ s, f xis notation forFinset.prod s f(assumingβis aCommMonoid)∑ x ∈ s, f xis notation forFinset.sum s f(assumingβis anAddCommMonoid)∏ x, f xis notation forFinset.prod Finset.univ f(assumingιis aFintypeandβis aCommMonoid)∑ x, f xis notation forFinset.sum Finset.univ f(assumingιis aFintypeandβis anAddCommMonoid)∏ x ∈ s with p x, f xis notation forFinset.prod (Finset.filter p s) f.∑ x ∈ s with p x, f xis notation forFinset.sum (Finset.filter p s) f.∏ (x ∈ s) (y ∈ t), f x yis notation forFinset.prod (s ×ˢ t) (fun ⟨x, y⟩ ↦ f x y).∑ (x ∈ s) (y ∈ t), f x yis notation forFinset.sum (s ×ˢ t) (fun ⟨x, y⟩ ↦ f x y).- Other supported binders:
x < n,x > n,x ≤ n,x ≥ n,x ≠ n,x ∉ s,x + y = n
Implementation notes
The first arguments in all definitions and lemmas is the codomain of the function of the big
operator. This is necessary for the heuristic in @[to_additive].
See the documentation of to_additive.attr for more information.
Additive, Multiplicative
def Finset.prod E1 #
{ι : Type u_1} → {M : Type u_3} → [CommMonoid M] → Finset ι → (ι → M) → M
∏ x ∈ s, f x is the product of f x as x ranges over the elements of the finite set s.
When the index type is a Fintype, the notation ∏ x, f x, is a shorthand for
∏ x ∈ Finset.univ, f x.
def Finset.sum E1 #
{ι : Type u_1} → {M : Type u_3} → [AddCommMonoid M] → Finset ι → (ι → M) → M
∑ x ∈ s, f x is the sum of f x as x ranges over the elements
of the finite set s.
When the index type is a Fintype, the notation ∑ x, f x, is a shorthand for
∑ x ∈ Finset.univ, f x.
theorem Finset.sum_mk E0 #
∀ {ι : Type u_1} {M : Type u_3} [inst : AddCommMonoid M] (s : Multiset ι) (hs : s.Nodup) (f : ι → M),
{ val := s, nodup := hs }.sum f = (Multiset.map f s).sum
theorem Finset.prod_mk E0 #
∀ {ι : Type u_1} {M : Type u_3} [inst : CommMonoid M] (s : Multiset ι) (hs : s.Nodup) (f : ι → M),
{ val := s, nodup := hs }.prod f = (Multiset.map f s).prod
theorem Finset.prod_val E0 #
∀ {M : Type u_3} [inst : CommMonoid M] (s : Finset M), s.val.prod = s.prod id
theorem Finset.sum_val E0 #
∀ {M : Type u_3} [inst : AddCommMonoid M] (s : Finset M), s.val.sum = s.sum id
def LibraryNote.operator_precedence_of_big_operators E1 #
Batteries.Util.LibraryNote
There is no established mathematical convention
for the operator precedence of big operators like ∏ and ∑.
We will have to make a choice.
Online discussions, such as https://math.stackexchange.com/q/185538/30839
seem to suggest that ∏ and ∑ should have the same precedence,
and that this should be somewhere between * and +.
The latter have precedence levels 70 and 65 respectively,
and we therefore choose the level 67.
In practice, this means that parentheses should be placed as follows:
∑ k ∈ K, (a k + b k) = ∑ k ∈ K, a k + ∑ k ∈ K, b k →
∏ k ∈ K, a k * b k = (∏ k ∈ K, a k) * (∏ k ∈ K, b k)
(Example taken from page 490 of Knuth's Concrete Mathematics.)
def BigOperators.bigOpBinder E1 #
Lean.ParserDescr
A bigOpBinder is like an extBinder and has the form x, x : ty, or x pred
where pred is a binderPred like < 2.
Unlike extBinder, x is a term.
def BigOperators.bigOpBinderParenthesized E1 #
Lean.ParserDescr
A BigOperator binder in parentheses
def BigOperators.bigOpBinderCollection E1 #
Lean.ParserDescr
A list of parenthesized binders
def BigOperators.bigOpBinders E1 #
Lean.ParserDescr
A single (unparenthesized) binder, or a list of parenthesized binders
def BigOperators.processBigOpBinder E1 #
Array (Lean.Term × Lean.Term) → Lean.TSyntax `BigOperators.bigOpBinder → Lean.MacroM (Array (Lean.Term × Lean.Term))
Collects additional binder/Finset pairs for the given bigOpBinder.
Note: this is not extensible at the moment, unlike the usual bigOpBinder expansions.
def BigOperators.processBigOpBinders E1 #
Lean.TSyntax `BigOperators.bigOpBinders → Lean.MacroM (Array (Lean.Term × Lean.Term))
Collects the binder/Finset pairs for the given bigOpBinders.
def BigOperators.bigOpBindersPattern E1 #
Array (Lean.Term × Lean.Term) → Lean.MacroM Lean.Term
Collects the binderIdents into a ⟨...⟩ expression.
def BigOperators.bigOpBindersProd E1 #
Array (Lean.Term × Lean.Term) → Lean.MacroM Lean.Term
Collects the terms into a product of sets.
def BigOperators.BigOpWith E1 #
Lean.ParserDescr
A with-clause in a big operator. Example usage: ∑ i < 100 with Even i, f i.
def BigOperators.bigsum E1 #
Lean.ParserDescr
∑ x, f xis notation forFinset.sum Finset.univ f. It is the sum off x, wherexranges over the finite domain off.∑ x ∈ s, f xis notation forFinset.sum s f. It is the sum off x, wherexranges over the finite sets(either aFinsetor aSetwith aFintypeinstance).∑ x ∈ s with p x, f xis notation forFinset.sum (Finset.filter p s) f.∑ x ∈ s with h : p x, f x his notation forFinset.sum s fun x ↦ if h : p x then f x h else 0.∑ (x ∈ s) (y ∈ t), f x yis notation forFinset.sum (s ×ˢ t) (fun ⟨x, y⟩ ↦ f x y).
These support destructuring, for example ∑ ⟨x, y⟩ ∈ s ×ˢ t, f x y.
Notation: "∑" bigOpBinders* (" with" (ident ":")? term)? "," term
def BigOperators.bigprod E1 #
Lean.ParserDescr
∏ x, f xis notation forFinset.prod Finset.univ f. It is the product off x, wherexranges over the finite domain off.∏ x ∈ s, f xis notation forFinset.prod s f. It is the product off x, wherexranges over the finite sets(either aFinsetor aSetwith aFintypeinstance).∏ x ∈ s with p x, f xis notation forFinset.prod (Finset.filter p s) f.∏ x ∈ s with h : p x, f x his notation forFinset.prod s fun x ↦ if h : p x then f x h else 1.∏ (x ∈ s) (y ∈ t), f x yis notation forFinset.prod (s ×ˢ t) (fun ⟨x, y⟩ ↦ f x y).
These support destructuring, for example ∏ ⟨x, y⟩ ∈ s ×ˢ t, f x y.
Notation: "∏" bigOpBinders* ("with" (ident ":")? term)? "," term
def BigOperators.delabFinsetProd E1 #
Lean.PrettyPrinter.Delaborator.Delab
Delaborator for Finset.prod. The pp.funBinderTypes option controls whether
to show the domain type when the product is over Finset.univ.
def BigOperators.delabFinsetSum E1 #
Lean.PrettyPrinter.Delaborator.Delab
Delaborator for Finset.sum. The pp.funBinderTypes option controls whether
to show the domain type when the sum is over Finset.univ.
theorem Finset.sum_eq_multiset_sum E1 #
∀ {ι : Type u_1} {M : Type u_3} [inst : AddCommMonoid M] (s : Finset ι) (f : ι → M),
∑ x ∈ s, f x = (Multiset.map f s.val).sum
theorem Finset.prod_eq_multiset_prod E1 #
∀ {ι : Type u_1} {M : Type u_3} [inst : CommMonoid M] (s : Finset ι) (f : ι → M),
∏ x ∈ s, f x = (Multiset.map f s.val).prod
theorem Finset.prod_map_val E0 #
∀ {ι : Type u_1} {M : Type u_3} [inst : CommMonoid M] (s : Finset ι) (f : ι → M),
(Multiset.map f s.val).prod = ∏ a ∈ s, f a
theorem Finset.sum_map_val E0 #
∀ {ι : Type u_1} {M : Type u_3} [inst : AddCommMonoid M] (s : Finset ι) (f : ι → M),
(Multiset.map f s.val).sum = ∑ a ∈ s, f a
theorem Finset.sum_multiset_singleton E0 #
∀ {ι : Type u_1} (s : Finset ι), ∑ a ∈ s, {a} = s.val
theorem map_sum E0 #
∀ {ι : Type u_1} {M : Type u_3} {N : Type u_4} [inst : AddCommMonoid M] [inst_1 : AddCommMonoid N] {G : Type u_7}
[inst_2 : FunLike G M N] [AddMonoidHomClass G M N] (g : G) (f : ι → M) (s : Finset ι),
g (∑ x ∈ s, f x) = ∑ x ∈ s, g (f x)
theorem map_prod E0 #
∀ {ι : Type u_1} {M : Type u_3} {N : Type u_4} [inst : CommMonoid M] [inst_1 : CommMonoid N] {G : Type u_7}
[inst_2 : FunLike G M N] [MonoidHomClass G M N] (g : G) (f : ι → M) (s : Finset ι),
g (∏ x ∈ s, f x) = ∏ x ∈ s, g (f x)
theorem Finset.prod_empty E0 #
∀ {ι : Type u_1} {M : Type u_3} {f : ι → M} [inst : CommMonoid M], ∏ x ∈ ∅, f x = 1
theorem Finset.sum_empty E0 #
∀ {ι : Type u_1} {M : Type u_3} {f : ι → M} [inst : AddCommMonoid M], ∑ x ∈ ∅, f x = 0
theorem Finset.prod_empty' E1 #
∀ {ι : Type u_1} {M : Type u_3} [inst : CommMonoid M], ∅.prod = fun x ↦ 1
Variant of prod_empty not applied to a function.
theorem Finset.sum_empty' E1 #
∀ {ι : Type u_1} {M : Type u_3} [inst : AddCommMonoid M], ∅.sum = fun x ↦ 0
theorem Finset.prod_of_isEmpty E1 #
∀ {ι : Type u_1} {M : Type u_3} {f : ι → M} [inst : CommMonoid M] [IsEmpty ι] (s : Finset ι), ∏ i ∈ s, f i = 1
theorem Finset.sum_of_isEmpty E1 #
∀ {ι : Type u_1} {M : Type u_3} {f : ι → M} [inst : AddCommMonoid M] [IsEmpty ι] (s : Finset ι), ∑ i ∈ s, f i = 0
theorem Finset.sum_const_zero E0 #
∀ {ι : Type u_1} {M : Type u_3} {s : Finset ι} [inst : AddCommMonoid M], ∑ _x ∈ s, 0 = 0
theorem Finset.prod_const_one E0 #
∀ {ι : Type u_1} {M : Type u_3} {s : Finset ι} [inst : CommMonoid M], ∏ _x ∈ s, 1 = 1
theorem Finset.sum_map E0 #
∀ {ι : Type u_1} {κ : Type u_2} {M : Type u_3} [inst : AddCommMonoid M] (s : Finset ι) (e : ι ↪ κ) (f : κ → M),
∑ x ∈ Finset.map e s, f x = ∑ x ∈ s, f (e x)
theorem Finset.prod_map E0 #
∀ {ι : Type u_1} {κ : Type u_2} {M : Type u_3} [inst : CommMonoid M] (s : Finset ι) (e : ι ↪ κ) (f : κ → M),
∏ x ∈ Finset.map e s, f x = ∏ x ∈ s, f (e x)
theorem Finset.prod_map' E1 #
∀ {ι : Type u_1} {κ : Type u_2} {M : Type u_3} [inst : CommMonoid M] (s : Finset ι) (e : ι ↪ κ),
(Finset.map e s).prod = fun f ↦ ∏ x ∈ s, f (e x)
Variant of prod_map not applied to a function.
theorem Finset.sum_map' E1 #
∀ {ι : Type u_1} {κ : Type u_2} {M : Type u_3} [inst : AddCommMonoid M] (s : Finset ι) (e : ι ↪ κ),
(Finset.map e s).sum = fun f ↦ ∑ x ∈ s, f (e x)
theorem Finset.prod_map_toList E0 #
∀ {ι : Type u_1} {M : Type u_3} [inst : CommMonoid M] (s : Finset ι) (f : ι → M), (List.map f s.toList).prod = s.prod f
theorem Finset.sum_map_toList E0 #
∀ {ι : Type u_1} {M : Type u_3} [inst : AddCommMonoid M] (s : Finset ι) (f : ι → M), (List.map f s.toList).sum = s.sum f
theorem Finset.sum_toList E0 #
∀ {M : Type u_7} [inst : AddCommMonoid M] (s : Finset M), s.toList.sum = ∑ x ∈ s, x
theorem Finset.prod_toList E0 #
∀ {M : Type u_7} [inst : CommMonoid M] (s : Finset M), s.toList.prod = ∏ x ∈ s, x
theorem Equiv.Perm.prod_comp E1 #
∀ {ι : Type u_1} {M : Type u_3} [inst : CommMonoid M] (σ : Equiv.Perm ι) (s : Finset ι) (f : ι → M),
{a | σ a ≠ a} ⊆ ↑s → ∏ x ∈ s, f (σ x) = ∏ x ∈ s, f x
theorem Equiv.Perm.sum_comp E1 #
∀ {ι : Type u_1} {M : Type u_3} [inst : AddCommMonoid M] (σ : Equiv.Perm ι) (s : Finset ι) (f : ι → M),
{a | σ a ≠ a} ⊆ ↑s → ∑ x ∈ s, f (σ x) = ∑ x ∈ s, f x
theorem Equiv.Perm.sum_comp' E1 #
∀ {ι : Type u_1} {M : Type u_3} [inst : AddCommMonoid M] (σ : Equiv.Perm ι) (s : Finset ι) (f : ι → ι → M),
{a | σ a ≠ a} ⊆ ↑s → ∑ x ∈ s, f (σ x) x = ∑ x ∈ s, f x ((Equiv.symm σ) x)
theorem Equiv.Perm.prod_comp' E1 #
∀ {ι : Type u_1} {M : Type u_3} [inst : CommMonoid M] (σ : Equiv.Perm ι) (s : Finset ι) (f : ι → ι → M),
{a | σ a ≠ a} ⊆ ↑s → ∏ x ∈ s, f (σ x) x = ∏ x ∈ s, f x ((Equiv.symm σ) x)
theorem Finset.prod_bij E1 #
∀ {ι : Type u_1} {κ : Type u_2} {M : Type u_3} [inst : CommMonoid M] {s : Finset ι} {t : Finset κ} {f : ι → M}
{g : κ → M} (i : (a : ι) → a ∈ s → κ),
(∀ (a : ι) (ha : a ∈ s), i a ha ∈ t) →
(∀ (a₁ : ι) (ha₁ : a₁ ∈ s) (a₂ : ι) (ha₂ : a₂ ∈ s), i a₁ ha₁ = i a₂ ha₂ → a₁ = a₂) →
(∀ b ∈ t, ∃ a, ∃ (ha : a ∈ s), i a ha = b) →
(∀ (a : ι) (ha : a ∈ s), f a = g (i a ha)) → ∏ x ∈ s, f x = ∏ x ∈ t, g x
Reorder a product.
The difference with Finset.prod_bij' is that the bijection is specified as a surjective injection,
rather than by an inverse function.
The difference with Finset.prod_nbij is that the bijection is allowed to use membership of the
domain of the product, rather than being a non-dependent function.
theorem Finset.sum_bij E1 #
∀ {ι : Type u_1} {κ : Type u_2} {M : Type u_3} [inst : AddCommMonoid M] {s : Finset ι} {t : Finset κ} {f : ι → M}
{g : κ → M} (i : (a : ι) → a ∈ s → κ),
(∀ (a : ι) (ha : a ∈ s), i a ha ∈ t) →
(∀ (a₁ : ι) (ha₁ : a₁ ∈ s) (a₂ : ι) (ha₂ : a₂ ∈ s), i a₁ ha₁ = i a₂ ha₂ → a₁ = a₂) →
(∀ b ∈ t, ∃ a, ∃ (ha : a ∈ s), i a ha = b) →
(∀ (a : ι) (ha : a ∈ s), f a = g (i a ha)) → ∑ x ∈ s, f x = ∑ x ∈ t, g x
Reorder a sum.
The difference with Finset.sum_bij' is that the bijection is specified as a surjective injection,
rather than by an inverse function.
The difference with Finset.sum_nbij is that the bijection is allowed to use membership of the
domain of the sum, rather than being a non-dependent function.
theorem Finset.prod_bij' E1 #
∀ {ι : Type u_1} {κ : Type u_2} {M : Type u_3} [inst : CommMonoid M] {s : Finset ι} {t : Finset κ} {f : ι → M}
{g : κ → M} (i : (a : ι) → a ∈ s → κ) (j : (a : κ) → a ∈ t → ι) (hi : ∀ (a : ι) (ha : a ∈ s), i a ha ∈ t)
(hj : ∀ (a : κ) (ha : a ∈ t), j a ha ∈ s),
(∀ (a : ι) (ha : a ∈ s), j (i a ha) ⋯ = a) →
(∀ (a : κ) (ha : a ∈ t), i (j a ha) ⋯ = a) →
(∀ (a : ι) (ha : a ∈ s), f a = g (i a ha)) → ∏ x ∈ s, f x = ∏ x ∈ t, g x
Reorder a product.
The difference with Finset.prod_bij is that the bijection is specified with an inverse, rather
than as a surjective injection.
The difference with Finset.prod_nbij' is that the bijection and its inverse are allowed to use
membership of the domains of the products, rather than being non-dependent functions.
theorem Finset.sum_bij' E1 #
∀ {ι : Type u_1} {κ : Type u_2} {M : Type u_3} [inst : AddCommMonoid M] {s : Finset ι} {t : Finset κ} {f : ι → M}
{g : κ → M} (i : (a : ι) → a ∈ s → κ) (j : (a : κ) → a ∈ t → ι) (hi : ∀ (a : ι) (ha : a ∈ s), i a ha ∈ t)
(hj : ∀ (a : κ) (ha : a ∈ t), j a ha ∈ s),
(∀ (a : ι) (ha : a ∈ s), j (i a ha) ⋯ = a) →
(∀ (a : κ) (ha : a ∈ t), i (j a ha) ⋯ = a) →
(∀ (a : ι) (ha : a ∈ s), f a = g (i a ha)) → ∑ x ∈ s, f x = ∑ x ∈ t, g x
Reorder a sum.
The difference with Finset.sum_bij is that the bijection is specified with an inverse, rather than
as a surjective injection.
The difference with Finset.sum_nbij' is that the bijection and its inverse are allowed to use
membership of the domains of the sums, rather than being non-dependent functions.
theorem Finset.prod_nbij E1 #
∀ {ι : Type u_1} {κ : Type u_2} {M : Type u_3} [inst : CommMonoid M] {s : Finset ι} {t : Finset κ} {f : ι → M}
{g : κ → M} (i : ι → κ),
(∀ a ∈ s, i a ∈ t) → Set.InjOn i ↑s → Set.SurjOn i ↑s ↑t → (∀ a ∈ s, f a = g (i a)) → ∏ x ∈ s, f x = ∏ x ∈ t, g x
Reorder a product.
The difference with Finset.prod_nbij' is that the bijection is specified as a surjective
injection, rather than by an inverse function.
The difference with Finset.prod_bij is that the bijection is a non-dependent function, rather than
being allowed to use membership of the domain of the product.
theorem Finset.sum_nbij E1 #
∀ {ι : Type u_1} {κ : Type u_2} {M : Type u_3} [inst : AddCommMonoid M] {s : Finset ι} {t : Finset κ} {f : ι → M}
{g : κ → M} (i : ι → κ),
(∀ a ∈ s, i a ∈ t) → Set.InjOn i ↑s → Set.SurjOn i ↑s ↑t → (∀ a ∈ s, f a = g (i a)) → ∑ x ∈ s, f x = ∑ x ∈ t, g x
Reorder a sum.
The difference with Finset.sum_nbij' is that the bijection is specified as a surjective injection,
rather than by an inverse function.
The difference with Finset.sum_bij is that the bijection is a non-dependent function, rather than
being allowed to use membership of the domain of the sum.
theorem Finset.prod_nbij' E1 #
∀ {ι : Type u_1} {κ : Type u_2} {M : Type u_3} [inst : CommMonoid M] {s : Finset ι} {t : Finset κ} {f : ι → M}
{g : κ → M} (i : ι → κ) (j : κ → ι),
(∀ a ∈ s, i a ∈ t) →
(∀ a ∈ t, j a ∈ s) →
(∀ a ∈ s, j (i a) = a) → (∀ a ∈ t, i (j a) = a) → (∀ a ∈ s, f a = g (i a)) → ∏ x ∈ s, f x = ∏ x ∈ t, g x
Reorder a product.
The difference with Finset.prod_nbij is that the bijection is specified with an inverse, rather
than as a surjective injection.
The difference with Finset.prod_bij' is that the bijection and its inverse are non-dependent
functions, rather than being allowed to use membership of the domains of the products.
The difference with Finset.prod_equiv is that bijectivity is only required to hold on the domains
of the products, rather than on the entire types.
theorem Finset.sum_nbij' E1 #
∀ {ι : Type u_1} {κ : Type u_2} {M : Type u_3} [inst : AddCommMonoid M] {s : Finset ι} {t : Finset κ} {f : ι → M}
{g : κ → M} (i : ι → κ) (j : κ → ι),
(∀ a ∈ s, i a ∈ t) →
(∀ a ∈ t, j a ∈ s) →
(∀ a ∈ s, j (i a) = a) → (∀ a ∈ t, i (j a) = a) → (∀ a ∈ s, f a = g (i a)) → ∑ x ∈ s, f x = ∑ x ∈ t, g x
Reorder a sum.
The difference with Finset.sum_nbij is that the bijection is specified with an inverse, rather
than as a surjective injection.
The difference with Finset.sum_bij' is that the bijection and its inverse are non-dependent
functions, rather than being allowed to use membership of the domains of the sums.
The difference with Finset.sum_equiv is that bijectivity is only required to hold on the domains
of the sums, rather than on the entire types.
theorem Finset.prod_equiv E1 #
∀ {ι : Type u_1} {κ : Type u_2} {M : Type u_3} [inst : CommMonoid M] {s : Finset ι} {t : Finset κ} {f : ι → M}
{g : κ → M} (e : ι ≃ κ), (∀ (i : ι), i ∈ s ↔ e i ∈ t) → (∀ i ∈ s, f i = g (e i)) → ∏ i ∈ s, f i = ∏ i ∈ t, g i
Specialization of Finset.prod_nbij' that automatically fills in most arguments.
See Fintype.prod_equiv for the version where s and t are univ.
theorem Finset.sum_equiv E1 #
∀ {ι : Type u_1} {κ : Type u_2} {M : Type u_3} [inst : AddCommMonoid M] {s : Finset ι} {t : Finset κ} {f : ι → M}
{g : κ → M} (e : ι ≃ κ), (∀ (i : ι), i ∈ s ↔ e i ∈ t) → (∀ i ∈ s, f i = g (e i)) → ∑ i ∈ s, f i = ∑ i ∈ t, g i
Specialization of Finset.sum_nbij' that automatically fills in most arguments.
See Fintype.sum_equiv for the version where s and t are univ.
theorem Finset.prod_bijective E1 #
∀ {ι : Type u_1} {κ : Type u_2} {M : Type u_3} [inst : CommMonoid M] {s : Finset ι} {t : Finset κ} {f : ι → M}
{g : κ → M} (e : ι → κ),
Function.Bijective e → (∀ (i : ι), i ∈ s ↔ e i ∈ t) → (∀ i ∈ s, f i = g (e i)) → ∏ i ∈ s, f i = ∏ i ∈ t, g i
Specialization of Finset.prod_bij that automatically fills in most arguments.
See Fintype.prod_bijective for the version where s and t are univ.
theorem Finset.sum_bijective E1 #
∀ {ι : Type u_1} {κ : Type u_2} {M : Type u_3} [inst : AddCommMonoid M] {s : Finset ι} {t : Finset κ} {f : ι → M}
{g : κ → M} (e : ι → κ),
Function.Bijective e → (∀ (i : ι), i ∈ s ↔ e i ∈ t) → (∀ i ∈ s, f i = g (e i)) → ∑ i ∈ s, f i = ∑ i ∈ t, g i
Specialization of Finset.sum_bij that automatically fills in most arguments.
See Fintype.sum_bijective for the version where s and t are univ.
theorem Finset.sum_hom_rel E1 #
∀ {ι : Type u_1} {M : Type u_3} {N : Type u_4} [inst : AddCommMonoid M] [inst_1 : AddCommMonoid N] {r : M → N → Prop}
{f : ι → M} {g : ι → N} {s : Finset ι},
r 0 0 → (∀ (a : ι) (b : M) (c : N), r b c → r (f a + b) (g a + c)) → r (∑ x ∈ s, f x) (∑ x ∈ s, g x)
theorem Finset.prod_hom_rel E1 #
∀ {ι : Type u_1} {M : Type u_3} {N : Type u_4} [inst : CommMonoid M] [inst_1 : CommMonoid N] {r : M → N → Prop}
{f : ι → M} {g : ι → N} {s : Finset ι},
r 1 1 → (∀ (a : ι) (b : M) (c : N), r b c → r (f a * b) (g a * c)) → r (∏ x ∈ s, f x) (∏ x ∈ s, g x)
theorem Finset.prod_coe_sort_eq_attach E1 #
∀ {ι : Type u_1} {M : Type u_3} (s : Finset ι) [inst : CommMonoid M] (f : ↥s → M), ∏ i, f i = ∏ i ∈ s.attach, f i
theorem Finset.sum_coe_sort_eq_attach E1 #
∀ {ι : Type u_1} {M : Type u_3} (s : Finset ι) [inst : AddCommMonoid M] (f : ↥s → M), ∑ i, f i = ∑ i ∈ s.attach, f i
theorem Finset.prod_ite_index E1 #
∀ {ι : Type u_1} {M : Type u_3} [inst : CommMonoid M] (p : Prop) [inst_1 : Decidable p] (s t : Finset ι) (f : ι → M),
∏ x ∈ if p then s else t, f x = if p then ∏ x ∈ s, f x else ∏ x ∈ t, f x
theorem Finset.sum_ite_index E1 #
∀ {ι : Type u_1} {M : Type u_3} [inst : AddCommMonoid M] (p : Prop) [inst_1 : Decidable p] (s t : Finset ι) (f : ι → M),
∑ x ∈ if p then s else t, f x = if p then ∑ x ∈ s, f x else ∑ x ∈ t, f x
theorem Finset.sum_ite_irrel E0 #
∀ {ι : Type u_1} {M : Type u_3} [inst : AddCommMonoid M] (p : Prop) [inst_1 : Decidable p] (s : Finset ι) (f g : ι → M),
(∑ x ∈ s, if p then f x else g x) = if p then ∑ x ∈ s, f x else ∑ x ∈ s, g x
theorem Finset.prod_ite_irrel E0 #
∀ {ι : Type u_1} {M : Type u_3} [inst : CommMonoid M] (p : Prop) [inst_1 : Decidable p] (s : Finset ι) (f g : ι → M),
(∏ x ∈ s, if p then f x else g x) = if p then ∏ x ∈ s, f x else ∏ x ∈ s, g x
theorem Finset.sum_dite_irrel E0 #
∀ {ι : Type u_1} {M : Type u_3} [inst : AddCommMonoid M] (p : Prop) [inst_1 : Decidable p] (s : Finset ι)
(f : p → ι → M) (g : ¬p → ι → M),
(∑ x ∈ s, if h : p then f h x else g h x) = if h : p then ∑ x ∈ s, f h x else ∑ x ∈ s, g h x
theorem Finset.prod_dite_irrel E0 #
∀ {ι : Type u_1} {M : Type u_3} [inst : CommMonoid M] (p : Prop) [inst_1 : Decidable p] (s : Finset ι) (f : p → ι → M)
(g : ¬p → ι → M), (∏ x ∈ s, if h : p then f h x else g h x) = if h : p then ∏ x ∈ s, f h x else ∏ x ∈ s, g h x
theorem Finset.ite_sum_zero E1 #
∀ {ι : Type u_1} {M : Type u_3} [inst : AddCommMonoid M] (p : Prop) [inst_1 : Decidable p] (s : Finset ι) (f : ι → M),
(if p then ∑ x ∈ s, f x else 0) = ∑ x ∈ s, if p then f x else 0
theorem Finset.ite_prod_one E1 #
∀ {ι : Type u_1} {M : Type u_3} [inst : CommMonoid M] (p : Prop) [inst_1 : Decidable p] (s : Finset ι) (f : ι → M),
(if p then ∏ x ∈ s, f x else 1) = ∏ x ∈ s, if p then f x else 1
theorem Finset.ite_zero_sum E1 #
∀ {ι : Type u_1} {M : Type u_3} [inst : AddCommMonoid M] (p : Prop) [inst_1 : Decidable p] (s : Finset ι) (f : ι → M),
(if p then 0 else ∑ x ∈ s, f x) = ∑ x ∈ s, if p then 0 else f x
theorem Finset.ite_one_prod E1 #
∀ {ι : Type u_1} {M : Type u_3} [inst : CommMonoid M] (p : Prop) [inst_1 : Decidable p] (s : Finset ι) (f : ι → M),
(if p then 1 else ∏ x ∈ s, f x) = ∏ x ∈ s, if p then 1 else f x
theorem Finset.nonempty_of_prod_ne_one E1 #
∀ {ι : Type u_1} {M : Type u_3} {s : Finset ι} {f : ι → M} [inst : CommMonoid M], ∏ x ∈ s, f x ≠ 1 → s.Nonempty
theorem Finset.nonempty_of_sum_ne_zero E1 #
∀ {ι : Type u_1} {M : Type u_3} {s : Finset ι} {f : ι → M} [inst : AddCommMonoid M], ∑ x ∈ s, f x ≠ 0 → s.Nonempty
theorem Finset.sum_range_zero E1 #
∀ {M : Type u_3} [inst : AddCommMonoid M] (f : ℕ → M), ∑ k ∈ Finset.range 0, f k = 0
theorem Finset.prod_range_zero E1 #
∀ {M : Type u_3} [inst : CommMonoid M] (f : ℕ → M), ∏ k ∈ Finset.range 0, f k = 1
theorem Finset.sum_filter_count_eq_countP E1 #
∀ {ι : Type u_1} [inst : DecidableEq ι] (p : ι → Prop) [inst_1 : DecidablePred p] (l : List ι),
∑ x ∈ l.toFinset with p x, List.count x l = List.countP (fun b ↦ decide (p b)) l
theorem Finset.sum_mem_multiset E1 #
∀ {ι : Type u_1} {M : Type u_3} [inst : AddCommMonoid M] [inst_1 : DecidableEq ι] (m : Multiset ι)
(f : { x // x ∈ m } → M) (g : ι → M), (∀ (x : { x // x ∈ m }), f x = g ↑x) → ∑ x, f x = ∑ x ∈ m.toFinset, g x
theorem Finset.prod_mem_multiset E1 #
∀ {ι : Type u_1} {M : Type u_3} [inst : CommMonoid M] [inst_1 : DecidableEq ι] (m : Multiset ι) (f : { x // x ∈ m } → M)
(g : ι → M), (∀ (x : { x // x ∈ m }), f x = g ↑x) → ∏ x, f x = ∏ x ∈ m.toFinset, g x
theorem Finset.prod_induction E1 #
∀ {ι : Type u_1} {s : Finset ι} {M : Type u_7} [inst : CommMonoid M] (f : ι → M) (p : M → Prop),
(∀ (a b : M), p a → p b → p (a * b)) → p 1 → (∀ x ∈ s, p (f x)) → p (∏ x ∈ s, f x)
To prove a property of a product, it suffices to prove that the property is multiplicative and holds on factors.
theorem Finset.sum_induction E1 #
∀ {ι : Type u_1} {s : Finset ι} {M : Type u_7} [inst : AddCommMonoid M] (f : ι → M) (p : M → Prop),
(∀ (a b : M), p a → p b → p (a + b)) → p 0 → (∀ x ∈ s, p (f x)) → p (∑ x ∈ s, f x)
To prove a property of a sum, it suffices to prove that the property is additive and holds on summands.
theorem Finset.prod_induction_nonempty E1 #
∀ {ι : Type u_1} {s : Finset ι} {M : Type u_7} [inst : CommMonoid M] (f : ι → M) (p : M → Prop),
(∀ (a b : M), p a → p b → p (a * b)) → s.Nonempty → (∀ x ∈ s, p (f x)) → p (∏ x ∈ s, f x)
To prove a property of a product, it suffices to prove that the property is multiplicative and holds on factors.
theorem Finset.sum_induction_nonempty E1 #
∀ {ι : Type u_1} {s : Finset ι} {M : Type u_7} [inst : AddCommMonoid M] (f : ι → M) (p : M → Prop),
(∀ (a b : M), p a → p b → p (a + b)) → s.Nonempty → (∀ x ∈ s, p (f x)) → p (∑ x ∈ s, f x)
To prove a property of a sum, it suffices to prove that the property is additive and holds on summands.
theorem Finset.sum_nsmul E1 #
∀ {ι : Type u_1} {M : Type u_3} [inst : AddCommMonoid M] (s : Finset ι) (n : ℕ) (f : ι → M),
∑ x ∈ s, n • f x = n • ∑ x ∈ s, f x
theorem Finset.prod_pow E1 #
∀ {ι : Type u_1} {M : Type u_3} [inst : CommMonoid M] (s : Finset ι) (n : ℕ) (f : ι → M),
∏ x ∈ s, f x ^ n = (∏ x ∈ s, f x) ^ n
theorem Finset.prod_dvd_prod_of_subset E1 #
∀ {ι : Type u_7} {M : Type u_8} [inst : CommMonoid M] (s t : Finset ι) (f : ι → M), s ⊆ t → ∏ i ∈ s, f i ∣ ∏ i ∈ t, f i
theorem Finset.op_sum E0 #
∀ {ι : Type u_1} {M : Type u_3} [inst : AddCommMonoid M] (s : Finset ι) (f : ι → M),
MulOpposite.op (∑ x ∈ s, f x) = ∑ x ∈ s, MulOpposite.op (f x)
Moving to the opposite additive commutative monoid commutes with summing.
theorem Finset.unop_sum E0 #
∀ {ι : Type u_1} {M : Type u_3} [inst : AddCommMonoid M] (s : Finset ι) (f : ι → Mᵐᵒᵖ),
MulOpposite.unop (∑ x ∈ s, f x) = ∑ x ∈ s, MulOpposite.unop (f x)
theorem Finset.op_prod E0 #
∀ {ι : Type u_1} {M : Type u_3} [inst : CommMonoid M] (s : Finset ι) (f : ι → M),
AddOpposite.op (∏ i ∈ s, f i) = ∏ i ∈ s, AddOpposite.op (f i)
theorem Finset.unop_prod E0 #
∀ {ι : Type u_1} {M : Type u_3} [inst : CommMonoid M] (s : Finset ι) (f : ι → Mᵐᵒᵖ),
AddOpposite.unop (∏ i ∈ s, f i) = ∏ i ∈ s, AddOpposite.unop (f i)
theorem Finset.prod_inv_distrib E0 #
∀ {ι : Type u_1} {G : Type u_5} {s : Finset ι} [inst : DivisionCommMonoid G] (f : ι → G),
∏ x ∈ s, (f x)⁻¹ = (∏ x ∈ s, f x)⁻¹
theorem Finset.sum_neg_distrib E0 #
∀ {ι : Type u_1} {G : Type u_5} {s : Finset ι} [inst : SubtractionCommMonoid G] (f : ι → G),
∑ x ∈ s, -f x = -∑ x ∈ s, f x
theorem Finset.sum_sub_distrib E0 #
∀ {ι : Type u_1} {G : Type u_5} {s : Finset ι} [inst : SubtractionCommMonoid G] (f g : ι → G),
∑ x ∈ s, (f x - g x) = ∑ x ∈ s, f x - ∑ x ∈ s, g x
theorem Finset.prod_div_distrib E0 #
∀ {ι : Type u_1} {G : Type u_5} {s : Finset ι} [inst : DivisionCommMonoid G] (f g : ι → G),
∏ x ∈ s, f x / g x = (∏ x ∈ s, f x) / ∏ x ∈ s, g x
theorem Finset.prod_zpow E1 #
∀ {ι : Type u_1} {G : Type u_5} [inst : DivisionCommMonoid G] (f : ι → G) (s : Finset ι) (n : ℤ),
∏ a ∈ s, f a ^ n = (∏ a ∈ s, f a) ^ n
theorem Finset.sum_zsmul E1 #
∀ {ι : Type u_1} {G : Type u_5} [inst : SubtractionCommMonoid G] (f : ι → G) (s : Finset ι) (n : ℤ),
∑ a ∈ s, n • f a = n • ∑ a ∈ s, f a
theorem Finset.sum_nat_mod E1 #
∀ {ι : Type u_1} (s : Finset ι) (n : ℕ) (f : ι → ℕ), (∑ i ∈ s, f i) % n = (∑ i ∈ s, f i % n) % n
theorem Finset.prod_nat_mod E1 #
∀ {ι : Type u_1} (s : Finset ι) (n : ℕ) (f : ι → ℕ), (∏ i ∈ s, f i) % n = (∏ i ∈ s, f i % n) % n
theorem Finset.sum_int_mod E1 #
∀ {ι : Type u_1} (s : Finset ι) (n : ℤ) (f : ι → ℤ), (∑ i ∈ s, f i) % n = (∑ i ∈ s, f i % n) % n
theorem Finset.prod_int_mod E1 #
∀ {ι : Type u_1} (s : Finset ι) (n : ℤ) (f : ι → ℤ), (∏ i ∈ s, f i) % n = (∏ i ∈ s, f i % n) % n
theorem Fintype.prod_bijective E1 #
∀ {ι : Type u_1} {κ : Type u_2} {M : Type u_3} [inst : Fintype ι] [inst_1 : Fintype κ] [inst_2 : CommMonoid M]
(e : ι → κ), Function.Bijective e → ∀ (f : ι → M) (g : κ → M), (∀ (x : ι), f x = g (e x)) → ∏ x, f x = ∏ x, g x
Fintype.prod_bijective is a variant of Finset.prod_bij that accepts Function.Bijective.
See Function.Bijective.prod_comp for a version without h.
theorem Fintype.sum_bijective E1 #
∀ {ι : Type u_1} {κ : Type u_2} {M : Type u_3} [inst : Fintype ι] [inst_1 : Fintype κ] [inst_2 : AddCommMonoid M]
(e : ι → κ), Function.Bijective e → ∀ (f : ι → M) (g : κ → M), (∀ (x : ι), f x = g (e x)) → ∑ x, f x = ∑ x, g x
Fintype.sum_bijective is a variant of Finset.sum_bij that accepts
Function.Bijective.
See Function.Bijective.sum_comp for a version without h.
theorem Function.Bijective.finsetProd E1 #
∀ {ι : Type u_1} {κ : Type u_2} {M : Type u_3} [inst : Fintype ι] [inst_1 : Fintype κ] [inst_2 : CommMonoid M]
(e : ι → κ), Function.Bijective e → ∀ (f : ι → M) (g : κ → M), (∀ (x : ι), f x = g (e x)) → ∏ x, f x = ∏ x, g x
Alias of Fintype.prod_bijective.
Fintype.prod_bijective is a variant of Finset.prod_bij that accepts Function.Bijective.
See Function.Bijective.prod_comp for a version without h.
theorem Function.Bijective.finsetSum E1 #
∀ {ι : Type u_1} {κ : Type u_2} {M : Type u_3} [inst : Fintype ι] [inst_1 : Fintype κ] [inst_2 : AddCommMonoid M]
(e : ι → κ), Function.Bijective e → ∀ (f : ι → M) (g : κ → M), (∀ (x : ι), f x = g (e x)) → ∑ x, f x = ∑ x, g x
Alias of Fintype.sum_bijective.
Fintype.sum_bijective is a variant of Finset.sum_bij that accepts
Function.Bijective.
See Function.Bijective.sum_comp for a version without h.
theorem Fintype.prod_equiv E1 #
∀ {ι : Type u_1} {κ : Type u_2} {M : Type u_3} [inst : Fintype ι] [inst_1 : Fintype κ] [inst_2 : CommMonoid M]
(e : ι ≃ κ) (f : ι → M) (g : κ → M), (∀ (x : ι), f x = g (e x)) → ∏ x, f x = ∏ x, g x
Fintype.prod_equiv is a specialization of Finset.prod_bij that
automatically fills in most arguments.
See Equiv.prod_comp for a version without h.
theorem Fintype.sum_equiv E1 #
∀ {ι : Type u_1} {κ : Type u_2} {M : Type u_3} [inst : Fintype ι] [inst_1 : Fintype κ] [inst_2 : AddCommMonoid M]
(e : ι ≃ κ) (f : ι → M) (g : κ → M), (∀ (x : ι), f x = g (e x)) → ∑ x, f x = ∑ x, g x
Fintype.sum_equiv is a specialization of Finset.sum_bij that
automatically fills in most arguments.
See Equiv.sum_comp for a version without h.
theorem Function.Bijective.sum_comp E1 #
∀ {ι : Type u_1} {κ : Type u_2} {M : Type u_3} [inst : Fintype ι] [inst_1 : Fintype κ] [inst_2 : AddCommMonoid M]
{e : ι → κ}, Function.Bijective e → ∀ (g : κ → M), ∑ i, g (e i) = ∑ i, g i
theorem Function.Bijective.prod_comp E1 #
∀ {ι : Type u_1} {κ : Type u_2} {M : Type u_3} [inst : Fintype ι] [inst_1 : Fintype κ] [inst_2 : CommMonoid M]
{e : ι → κ}, Function.Bijective e → ∀ (g : κ → M), ∏ i, g (e i) = ∏ i, g i
theorem Equiv.sum_comp E1 #
∀ {ι : Type u_1} {κ : Type u_2} {M : Type u_3} [inst : Fintype ι] [inst_1 : Fintype κ] [inst_2 : AddCommMonoid M]
(e : ι ≃ κ) (g : κ → M), ∑ i, g (e i) = ∑ i, g i
theorem Equiv.prod_comp E1 #
∀ {ι : Type u_1} {κ : Type u_2} {M : Type u_3} [inst : Fintype ι] [inst_1 : Fintype κ] [inst_2 : CommMonoid M]
(e : ι ≃ κ) (g : κ → M), ∏ i, g (e i) = ∏ i, g i
theorem Fintype.sum_empty E1 #
∀ {ι : Type u_1} {M : Type u_3} [inst : Fintype ι] [inst_1 : AddCommMonoid M] [IsEmpty ι] (f : ι → M), ∑ x, f x = 0
theorem Fintype.prod_empty E1 #
∀ {ι : Type u_1} {M : Type u_3} [inst : Fintype ι] [inst_1 : CommMonoid M] [IsEmpty ι] (f : ι → M), ∏ x, f x = 1
theorem Finset.prod_attach_univ E0 #
∀ {ι : Type u_1} {M : Type u_3} [inst : CommMonoid M] [inst_1 : Fintype ι] (f : ↥Finset.univ → M),
∏ i ∈ Finset.univ.attach, f i = ∏ i, f ⟨i, ⋯⟩
theorem Finset.sum_attach_univ E0 #
∀ {ι : Type u_1} {M : Type u_3} [inst : AddCommMonoid M] [inst_1 : Fintype ι] (f : ↥Finset.univ → M),
∑ i ∈ Finset.univ.attach, f i = ∑ i, f ⟨i, ⋯⟩
theorem Finset.sum_erase_attach E1 #
∀ {ι : Type u_1} {M : Type u_3} [inst : AddCommMonoid M] [inst_1 : DecidableEq ι] {s : Finset ι} (f : ι → M) (i : ↥s),
∑ j ∈ s.attach.erase i, f ↑j = ∑ j ∈ s.erase ↑i, f j
theorem Finset.prod_erase_attach E1 #
∀ {ι : Type u_1} {M : Type u_3} [inst : CommMonoid M] [inst_1 : DecidableEq ι] {s : Finset ι} (f : ι → M) (i : ↥s),
∏ j ∈ s.attach.erase i, f ↑j = ∏ j ∈ s.erase ↑i, f j
theorem Multiset.card_sum E0 #
∀ {ι : Type u_1} {α : Type u_6} (s : Finset ι) (f : ι → Multiset α), (∑ i ∈ s, f i).card = ∑ i ∈ s, (f i).card
theorem Multiset.disjoint_list_sum_left E1 #
∀ {α : Type u_6} {a : Multiset α} {l : List (Multiset α)}, Disjoint l.sum a ↔ ∀ b ∈ l, Disjoint b a
theorem Multiset.disjoint_list_sum_right E1 #
∀ {α : Type u_6} {a : Multiset α} {l : List (Multiset α)}, Disjoint a l.sum ↔ ∀ b ∈ l, Disjoint a b
theorem Multiset.disjoint_sum_left E1 #
∀ {α : Type u_6} {a : Multiset α} {i : Multiset (Multiset α)}, Disjoint i.sum a ↔ ∀ b ∈ i, Disjoint b a
theorem Multiset.disjoint_sum_right E1 #
∀ {α : Type u_6} {a : Multiset α} {i : Multiset (Multiset α)}, Disjoint a i.sum ↔ ∀ b ∈ i, Disjoint a b
theorem Multiset.disjoint_finsetSum_left E1 #
∀ {ι : Type u_1} {α : Type u_6} {i : Finset ι} {f : ι → Multiset α} {a : Multiset α},
Disjoint (i.sum f) a ↔ ∀ b ∈ i, Disjoint (f b) a
theorem Multiset.disjoint_finsetSum_right E1 #
∀ {ι : Type u_1} {α : Type u_6} {i : Finset ι} {f : ι → Multiset α} {a : Multiset α},
Disjoint a (i.sum f) ↔ ∀ b ∈ i, Disjoint a (f b)
theorem Multiset.count_sum' E1 #
∀ {ι : Type u_1} {α : Type u_6} [inst : DecidableEq α] {s : Finset ι} {a : α} {f : ι → Multiset α},
Multiset.count a (∑ x ∈ s, f x) = ∑ x ∈ s, Multiset.count a (f x)
theorem Multiset.toFinset_prod_dvd_prod E1 #
∀ {M : Type u_3} [inst : DecidableEq M] [inst_1 : CommMonoid M] (S : Multiset M), S.toFinset.prod id ∣ S.prod
theorem Units.coe_prod E0 #
∀ {M : Type u_3} {α : Type u_6} [inst : CommMonoid M] (f : α → Mˣ) (s : Finset α), ↑(∏ i ∈ s, f i) = ∏ i ∈ s, ↑(f i)
theorem ofMul_list_prod E0 #
∀ {M : Type u_3} [inst : Monoid M] (s : List M), Additive.ofMul s.prod = (List.map (⇑Additive.ofMul) s).sum
theorem toMul_list_sum E0 #
∀ {M : Type u_3} [inst : Monoid M] (s : List (Additive M)), Additive.toMul s.sum = (List.map (⇑Additive.toMul) s).prod
theorem ofAdd_list_prod E0 #
∀ {M : Type u_3} [inst : AddMonoid M] (s : List M),
Multiplicative.ofAdd s.sum = (List.map (⇑Multiplicative.ofAdd) s).prod
theorem toAdd_list_sum E0 #
∀ {M : Type u_3} [inst : AddMonoid M] (s : List (Multiplicative M)),
Multiplicative.toAdd s.prod = (List.map (⇑Multiplicative.toAdd) s).sum
theorem ofMul_multiset_prod E0 #
∀ {M : Type u_3} [inst : CommMonoid M] (s : Multiset M), Additive.ofMul s.prod = (Multiset.map (⇑Additive.ofMul) s).sum
theorem toMul_multiset_sum E0 #
∀ {M : Type u_3} [inst : CommMonoid M] (s : Multiset (Additive M)),
Additive.toMul s.sum = (Multiset.map (⇑Additive.toMul) s).prod
theorem ofMul_prod E0 #
∀ {ι : Type u_1} {M : Type u_3} [inst : CommMonoid M] (s : Finset ι) (f : ι → M),
Additive.ofMul (∏ i ∈ s, f i) = ∑ i ∈ s, Additive.ofMul (f i)
theorem toMul_sum E0 #
∀ {ι : Type u_1} {M : Type u_3} [inst : CommMonoid M] (s : Finset ι) (f : ι → Additive M),
Additive.toMul (∑ i ∈ s, f i) = ∏ i ∈ s, Additive.toMul (f i)
theorem ofAdd_multiset_prod E0 #
∀ {M : Type u_3} [inst : AddCommMonoid M] (s : Multiset M),
Multiplicative.ofAdd s.sum = (Multiset.map (⇑Multiplicative.ofAdd) s).prod
theorem toAdd_multiset_sum E0 #
∀ {M : Type u_3} [inst : AddCommMonoid M] (s : Multiset (Multiplicative M)),
Multiplicative.toAdd s.prod = (Multiset.map (⇑Multiplicative.toAdd) s).sum
theorem ofAdd_sum E0 #
∀ {ι : Type u_1} {M : Type u_3} [inst : AddCommMonoid M] (s : Finset ι) (f : ι → M),
Multiplicative.ofAdd (∑ i ∈ s, f i) = ∏ i ∈ s, Multiplicative.ofAdd (f i)
theorem toAdd_prod E0 #
∀ {ι : Type u_1} {M : Type u_3} [inst : AddCommMonoid M] (s : Finset ι) (f : ι → Multiplicative M),
Multiplicative.toAdd (∏ i ∈ s, f i) = ∑ i ∈ s, Multiplicative.toAdd (f i)