Built with doc-gen4, running Lean4. Bubbles () indicate interactive fragments: hover for details, tap to reveal contents. Use Ctrl+↑Ctrl+↓to navigate, Ctrl+🖱️to focus. On Mac, use Cmdinstead of Ctrl.
/-
Copyright (c) 2015 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro

! This file was ported from Lean 3 source module algebra.big_operators.multiset.basic
! leanprover-community/mathlib commit 6c5f73fd6f6cc83122788a80a27cdd54663609f4
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
import Mathlib.Data.List.BigOperators.Basic
import Mathlib.Data.Multiset.Basic

/-!
# Sums and products over multisets

In this file we define products and sums indexed by multisets. This is later used to define products
and sums indexed by finite sets.

## Main declarations

* `Multiset.prod`: `s.prod f` is the product of `f i` over all `i ∈ s`. Not to be mistaken with
  the cartesian product `Multiset.product`.
* `Multiset.sum`: `s.sum f` is the sum of `f i` over all `i ∈ s`.

## Implementation notes

Nov 2022: To speed the Lean 4 port, lemmas requiring extra algebra imports
(`data.list.big_operators.lemmas` rather than `.basic`) have been moved to a separate file,
`algebra.big_operators.multiset.lemmas`.  This split does not need to be permanent.
-/


variable {
ι: Type ?u.128885
ι
α: Type ?u.39789
α
β: Type ?u.8
β
γ: Type ?u.90448
γ
:
Type _: Type (?u.120170+1)
Type _
} namespace Multiset section CommMonoid variable [
CommMonoid: Type ?u.13328 → Type ?u.13328
CommMonoid
α: Type ?u.51
α
] {
s: Multiset α
s
t: Multiset α
t
:
Multiset: Type ?u.12263 → Type ?u.12263
Multiset
α: Type ?u.82612
α
} {
a: α
a
:
α: Type ?u.51
α
} {
m: Multiset ι
m
:
Multiset: Type ?u.19294 → Type ?u.19294
Multiset
ι: Type ?u.22648
ι
} {
f: ια
f
g: ια
g
:
ι: Type ?u.14
ι
α: Type ?u.7179
α
} /-- Product of a multiset given a commutative monoid structure on `α`. `prod {a, b, c} = a * b * c` -/ @[
to_additive: {α : Type u_1} → [inst : AddCommMonoid α] → Multiset αα
to_additive
"Sum of a multiset given a commutative additive monoid structure on `α`. `sum {a, b, c} = a + b + c`"] def
prod: Multiset αα
prod
:
Multiset: Type ?u.83 → Type ?u.83
Multiset
α: Type ?u.51
α
α: Type ?u.51
α
:=
foldr: {α : Type ?u.87} → {β : Type ?u.86} → (f : αββ) → LeftCommutative fβMultiset αβ
foldr
(· * ·): ααα
(· * ·)
(fun
x: ?m.915
x
y: ?m.918
y
z: ?m.921
z
=>

Goals accomplished! 🐙
ι: Type ?u.48

α: Type ?u.51

β: Type ?u.54

γ: Type ?u.57

inst✝: CommMonoid α

s, t: Multiset α

a: α

m: Multiset ι

f, g: ια

x, y, z: α


(fun x x_1 => x * x_1) x ((fun x x_1 => x * x_1) y z) = (fun x x_1 => x * x_1) y ((fun x x_1 => x * x_1) x z)

Goals accomplished! 🐙
)
1: ?m.929
1
#align multiset.prod
Multiset.prod: {α : Type u_1} → [inst : CommMonoid α] → Multiset αα
Multiset.prod
#align multiset.sum
Multiset.sum: {α : Type u_1} → [inst : AddCommMonoid α] → Multiset αα
Multiset.sum
@[
to_additive: ∀ {α : Type u_1} [inst : AddCommMonoid α] (s : Multiset α), sum s = foldr (fun x x_1 => x + x_1) (_ : ∀ (x y z : α), x + (y + z) = y + (x + z)) 0 s
to_additive
] theorem
prod_eq_foldr: ∀ (s : Multiset α), prod s = foldr (fun x x_1 => x * x_1) (_ : ∀ (x y z : α), x * (y * z) = y * (x * z)) 1 s
prod_eq_foldr
(
s: Multiset α
s
:
Multiset: Type ?u.1848 → Type ?u.1848
Multiset
α: Type ?u.1817
α
) :
prod: {α : Type ?u.1852} → [inst : CommMonoid α] → Multiset αα
prod
s: Multiset α
s
=
foldr: {α : Type ?u.1871} → {β : Type ?u.1870} → (f : αββ) → LeftCommutative fβMultiset αβ
foldr
(· * ·): ααα
(· * ·)
(fun
x: ?m.1903
x
y: ?m.1906
y
z: ?m.1909
z
=>

Goals accomplished! 🐙
ι: Type ?u.1814

α: Type ?u.1817

β: Type ?u.1820

γ: Type ?u.1823

inst✝: CommMonoid α

s✝, t: Multiset α

a: α

m: Multiset ι

f, g: ια

s: Multiset α

x, y, z: α


(fun x x_1 => x * x_1) x ((fun x x_1 => x * x_1) y z) = (fun x x_1 => x * x_1) y ((fun x x_1 => x * x_1) x z)

Goals accomplished! 🐙
)
1: ?m.1917
1
s: Multiset α
s
:=
rfl: ∀ {α : Sort ?u.2992} {a : α}, a = a
rfl
#align multiset.prod_eq_foldr
Multiset.prod_eq_foldr: ∀ {α : Type u_1} [inst : CommMonoid α] (s : Multiset α), prod s = foldr (fun x x_1 => x * x_1) (_ : ∀ (x y z : α), x * (y * z) = y * (x * z)) 1 s
Multiset.prod_eq_foldr
#align multiset.sum_eq_foldr
Multiset.sum_eq_foldr: ∀ {α : Type u_1} [inst : AddCommMonoid α] (s : Multiset α), sum s = foldr (fun x x_1 => x + x_1) (_ : ∀ (x y z : α), x + (y + z) = y + (x + z)) 0 s
Multiset.sum_eq_foldr
@[
to_additive: ∀ {α : Type u_1} [inst : AddCommMonoid α] (s : Multiset α), sum s = foldl (fun x x_1 => x + x_1) (_ : ∀ (x y z : α), x + y + z = x + z + y) 0 s
to_additive
] theorem
prod_eq_foldl: ∀ (s : Multiset α), prod s = foldl (fun x x_1 => x * x_1) (_ : ∀ (x y z : α), x * y * z = x * z * y) 1 s
prod_eq_foldl
(
s: Multiset α
s
:
Multiset: Type ?u.3065 → Type ?u.3065
Multiset
α: Type ?u.3034
α
) :
prod: {α : Type ?u.3069} → [inst : CommMonoid α] → Multiset αα
prod
s: Multiset α
s
=
foldl: {α : Type ?u.3088} → {β : Type ?u.3087} → (f : βαβ) → RightCommutative fβMultiset αβ
foldl
(· * ·): ααα
(· * ·)
(fun
x: ?m.3120
x
y: ?m.3123
y
z: ?m.3126
z
=>

Goals accomplished! 🐙
ι: Type ?u.3031

α: Type ?u.3034

β: Type ?u.3037

γ: Type ?u.3040

inst✝: CommMonoid α

s✝, t: Multiset α

a: α

m: Multiset ι

f, g: ια

s: Multiset α

x, y, z: α


(fun x x_1 => x * x_1) ((fun x x_1 => x * x_1) x y) z = (fun x x_1 => x * x_1) ((fun x x_1 => x * x_1) x z) y

Goals accomplished! 🐙
)
1: ?m.3134
1
s: Multiset α
s
:= (
foldr_swap: ∀ {α : Type ?u.4209} {β : Type ?u.4210} (f : αββ) (H : LeftCommutative f) (b : β) (s : Multiset α), foldr f H b s = foldl (fun x y => f y x) (_ : ∀ (_x : β) (_y _z : α), f _z (f _y _x) = f _y (f _z _x)) b s
foldr_swap
_: ?m.4211?m.4212?m.4212
_
_: LeftCommutative ?m.4213
_
_: ?m.4212
_
_: Multiset ?m.4211
_
).
trans: ∀ {α : Sort ?u.4217} {a b c : α}, a = bb = ca = c
trans
(

Goals accomplished! 🐙
ι: Type ?u.3031

α: Type u_1

β: Type ?u.3037

γ: Type ?u.3040

inst✝: CommMonoid α

s✝, t: Multiset α

a: α

m: Multiset ι

f, g: ια

s: Multiset α


foldl (fun x y => y * x) (_ : ∀ (_x _y _z : α), _z * (_y * _x) = _y * (_z * _x)) 1 s = foldl (fun x x_1 => x * x_1) (_ : ∀ (x y z : α), x * y * z = x * z * y) 1 s

Goals accomplished! 🐙
) #align multiset.prod_eq_foldl
Multiset.prod_eq_foldl: ∀ {α : Type u_1} [inst : CommMonoid α] (s : Multiset α), prod s = foldl (fun x x_1 => x * x_1) (_ : ∀ (x y z : α), x * y * z = x * z * y) 1 s
Multiset.prod_eq_foldl
#align multiset.sum_eq_foldl
Multiset.sum_eq_foldl: ∀ {α : Type u_1} [inst : AddCommMonoid α] (s : Multiset α), sum s = foldl (fun x x_1 => x + x_1) (_ : ∀ (x y z : α), x + y + z = x + z + y) 0 s
Multiset.sum_eq_foldl
@[
to_additive: ∀ {α : Type u_1} [inst : AddCommMonoid α] (l : List α), sum l = List.sum l
to_additive
(attr := simp, norm_cast)] theorem
coe_prod: ∀ (l : List α), prod l = List.prod l
coe_prod
(
l: List α
l
:
List: Type ?u.4798 → Type ?u.4798
List
α: Type ?u.4767
α
) :
prod: {α : Type ?u.4802} → [inst : CommMonoid α] → Multiset αα
prod
l: List α
l
=
l: List α
l
.
prod: {α : Type ?u.4999} → [inst : Mul α] → [inst : One α] → List αα
prod
:=
prod_eq_foldl: ∀ {α : Type ?u.5921} [inst : CommMonoid α] (s : Multiset α), prod s = foldl (fun x x_1 => x * x_1) (_ : ∀ (x y z : α), x * y * z = x * z * y) 1 s
prod_eq_foldl
_: Multiset ?m.5922
_
#align multiset.coe_prod
Multiset.coe_prod: ∀ {α : Type u_1} [inst : CommMonoid α] (l : List α), prod l = List.prod l
Multiset.coe_prod
#align multiset.coe_sum
Multiset.coe_sum: ∀ {α : Type u_1} [inst : AddCommMonoid α] (l : List α), sum l = List.sum l
Multiset.coe_sum
@[
to_additive: ∀ {α : Type u_1} [inst : AddCommMonoid α] (s : Multiset α), List.sum (toList s) = sum s
to_additive
(attr := simp)] theorem
prod_toList: ∀ {α : Type u_1} [inst : CommMonoid α] (s : Multiset α), List.prod (toList s) = prod s
prod_toList
(
s: Multiset α
s
:
Multiset: Type ?u.6142 → Type ?u.6142
Multiset
α: Type ?u.6111
α
) :
s: Multiset α
s
.
toList: {α : Type ?u.6146} → Multiset αList α
toList
.
prod: {α : Type ?u.6149} → [inst : Mul α] → [inst : One α] → List αα
prod
=
s: Multiset α
s
.
prod: {α : Type ?u.6922} → [inst : CommMonoid α] → Multiset αα
prod
:=

Goals accomplished! 🐙
ι: Type ?u.6108

α: Type u_1

β: Type ?u.6114

γ: Type ?u.6117

inst✝: CommMonoid α

s✝, t: Multiset α

a: α

m: Multiset ι

f, g: ια

s: Multiset α


ι: Type ?u.6108

α: Type u_1

β: Type ?u.6114

γ: Type ?u.6117

inst✝: CommMonoid α

s✝, t: Multiset α

a: α

m: Multiset ι

f, g: ια

s: Multiset α


ι: Type ?u.6108

α: Type u_1

β: Type ?u.6114

γ: Type ?u.6117

inst✝: CommMonoid α

s✝, t: Multiset α

a: α

m: Multiset ι

f, g: ια

s: Multiset α


ι: Type ?u.6108

α: Type u_1

β: Type ?u.6114

γ: Type ?u.6117

inst✝: CommMonoid α

s✝, t: Multiset α

a: α

m: Multiset ι

f, g: ια

s: Multiset α


prod ↑(toList s)
ι: Type ?u.6108

α: Type u_1

β: Type ?u.6114

γ: Type ?u.6117

inst✝: CommMonoid α

s✝, t: Multiset α

a: α

m: Multiset ι

f, g: ια

s: Multiset α


prod ↑(toList s)
ι: Type ?u.6108

α: Type u_1

β: Type ?u.6114

γ: Type ?u.6117

inst✝: CommMonoid α

s✝, t: Multiset α

a: α

m: Multiset ι

f, g: ια

s: Multiset α


ι: Type ?u.6108

α: Type u_1

β: Type ?u.6114

γ: Type ?u.6117

inst✝: CommMonoid α

s✝, t: Multiset α

a: α

m: Multiset ι

f, g: ια

s: Multiset α


ι: Type ?u.6108

α: Type u_1

β: Type ?u.6114

γ: Type ?u.6117

inst✝: CommMonoid α

s✝, t: Multiset α

a: α

m: Multiset ι

f, g: ια

s: Multiset α



Goals accomplished! 🐙
#align multiset.prod_to_list
Multiset.prod_toList: ∀ {α : Type u_1} [inst : CommMonoid α] (s : Multiset α), List.prod (toList s) = prod s
Multiset.prod_toList
#align multiset.sum_to_list
Multiset.sum_toList: ∀ {α : Type u_1} [inst : AddCommMonoid α] (s : Multiset α), List.sum (toList s) = sum s
Multiset.sum_toList
@[
to_additive: ∀ {α : Type u_1} [inst : AddCommMonoid α], sum 0 = 0
to_additive
(attr := simp)] theorem
prod_zero: prod 0 = 1
prod_zero
: @
prod: {α : Type ?u.7211} → [inst : CommMonoid α] → Multiset αα
prod
α: Type ?u.7179
α
_
0: ?m.7214
0
=
1: ?m.7257
1
:=
rfl: ∀ {α : Sort ?u.7677} {a : α}, a = a
rfl
#align multiset.prod_zero
Multiset.prod_zero: ∀ {α : Type u_1} [inst : CommMonoid α], prod 0 = 1
Multiset.prod_zero
#align multiset.sum_zero
Multiset.sum_zero: ∀ {α : Type u_1} [inst : AddCommMonoid α], sum 0 = 0
Multiset.sum_zero
@[
to_additive: ∀ {α : Type u_1} [inst : AddCommMonoid α] (a : α) (s : Multiset α), sum (a ::ₘ s) = a + sum s
to_additive
(attr := simp)] theorem
prod_cons: ∀ (a : α) (s : Multiset α), prod (a ::ₘ s) = a * prod s
prod_cons
(
a: α
a
:
α: Type ?u.7728
α
) (
s: ?m.7761
s
) :
prod: {α : Type ?u.7765} → [inst : CommMonoid α] → Multiset αα
prod
(
a: α
a
::ₘ
s: ?m.7761
s
) =
a: α
a
*
prod: {α : Type ?u.7788} → [inst : CommMonoid α] → Multiset αα
prod
s: ?m.7761
s
:=
foldr_cons: ∀ {α : Type ?u.8602} {β : Type ?u.8603} (f : αββ) (H : LeftCommutative f) (b : β) (a : α) (s : Multiset α), foldr f H b (a ::ₘ s) = f a (foldr f H b s)
foldr_cons
_: ?m.8604?m.8605?m.8605
_
_: LeftCommutative ?m.8606
_
_: ?m.8605
_
_: ?m.8604
_
_: Multiset ?m.8604
_
#align multiset.prod_cons
Multiset.prod_cons: ∀ {α : Type u_1} [inst : CommMonoid α] (a : α) (s : Multiset α), prod (a ::ₘ s) = a * prod s
Multiset.prod_cons
#align multiset.sum_cons
Multiset.sum_cons: ∀ {α : Type u_1} [inst : AddCommMonoid α] (a : α) (s : Multiset α), sum (a ::ₘ s) = a + sum s
Multiset.sum_cons
@[
to_additive: ∀ {α : Type u_1} [inst : AddCommMonoid α] {s : Multiset α} {a : α} [inst_1 : DecidableEq α], a sa + sum (erase s a) = sum s
to_additive
(attr := simp)] theorem
prod_erase: ∀ {α : Type u_1} [inst : CommMonoid α] {s : Multiset α} {a : α} [inst_1 : DecidableEq α], a sa * prod (erase s a) = prod s
prod_erase
[
DecidableEq: Sort ?u.8725 → Sort (max1?u.8725)
DecidableEq
α: Type ?u.8694
α
] (
h: a s
h
:
a: α
a
s: Multiset α
s
) :
a: α
a
* (
s: Multiset α
s
.
erase: {α : Type ?u.8766} → [inst : DecidableEq α] → Multiset ααMultiset α
erase
a: α
a
).
prod: {α : Type ?u.8813} → [inst : CommMonoid α] → Multiset αα
prod
=
s: Multiset α
s
.
prod: {α : Type ?u.8832} → [inst : CommMonoid α] → Multiset αα
prod
:=

Goals accomplished! 🐙
ι: Type ?u.8691

α: Type u_1

β: Type ?u.8697

γ: Type ?u.8700

inst✝¹: CommMonoid α

s, t: Multiset α

a: α

m: Multiset ι

f, g: ια

inst✝: DecidableEq α

h: a s


a * prod (erase s a) = prod s
ι: Type ?u.8691

α: Type u_1

β: Type ?u.8697

γ: Type ?u.8700

inst✝¹: CommMonoid α

s, t: Multiset α

a: α

m: Multiset ι

f, g: ια

inst✝: DecidableEq α

h: a s


a * prod (erase s a) = prod s
ι: Type ?u.8691

α: Type u_1

β: Type ?u.8697

γ: Type ?u.8700

inst✝¹: CommMonoid α

s, t: Multiset α

a: α

m: Multiset ι

f, g: ια

inst✝: DecidableEq α

h: a s


a * prod (erase (↑(toList s)) a) = prod ↑(toList s)
ι: Type ?u.8691

α: Type u_1

β: Type ?u.8697

γ: Type ?u.8700

inst✝¹: CommMonoid α

s, t: Multiset α

a: α

m: Multiset ι

f, g: ια

inst✝: DecidableEq α

h: a s


a * prod (erase s a) = prod s
ι: Type ?u.8691

α: Type u_1

β: Type ?u.8697

γ: Type ?u.8700

inst✝¹: CommMonoid α

s, t: Multiset α

a: α

m: Multiset ι

f, g: ια

inst✝: DecidableEq α

h: a s


a * prod ↑(List.erase (toList s) a) = prod ↑(toList s)
ι: Type ?u.8691

α: Type u_1

β: Type ?u.8697

γ: Type ?u.8700

inst✝¹: CommMonoid α

s, t: Multiset α

a: α

m: Multiset ι

f, g: ια

inst✝: DecidableEq α

h: a s


a * prod (erase s a) = prod s
ι: Type ?u.8691

α: Type u_1

β: Type ?u.8697

γ: Type ?u.8700

inst✝¹: CommMonoid α

s, t: Multiset α

a: α

m: Multiset ι

f, g: ια

inst✝: DecidableEq α

h: a s


ι: Type ?u.8691

α: Type u_1

β: Type ?u.8697

γ: Type ?u.8700

inst✝¹: CommMonoid α

s, t: Multiset α

a: α

m: Multiset ι

f, g: ια

inst✝: DecidableEq α

h: a s


a * prod (erase s a) = prod s
ι: Type ?u.8691

α: Type u_1

β: Type ?u.8697

γ: Type ?u.8700

inst✝¹: CommMonoid α

s, t: Multiset α

a: α

m: Multiset ι

f, g: ια

inst✝: DecidableEq α

h: a s


ι: Type ?u.8691

α: Type u_1

β: Type ?u.8697

γ: Type ?u.8700

inst✝¹: CommMonoid α

s, t: Multiset α

a: α

m: Multiset ι

f, g: ια

inst✝: DecidableEq α

h: a s


a * prod (erase s a) = prod s
ι: Type ?u.8691

α: Type u_1

β: Type ?u.8697

γ: Type ?u.8700

inst✝¹: CommMonoid α

s, t: Multiset α

a: α

m: Multiset ι

f, g: ια

inst✝: DecidableEq α

h: a s



Goals accomplished! 🐙
#align multiset.prod_erase
Multiset.prod_erase: ∀ {α : Type u_1} [inst : CommMonoid α] {s : Multiset α} {a : α} [inst_1 : DecidableEq α], a sa * prod (erase s a) = prod s
Multiset.prod_erase
#align multiset.sum_erase
Multiset.sum_erase: ∀ {α : Type u_1} [inst : AddCommMonoid α] {s : Multiset α} {a : α} [inst_1 : DecidableEq α], a sa + sum (erase s a) = sum s
Multiset.sum_erase
@[
to_additive: ∀ {ι : Type u_1} {α : Type u_2} [inst : AddCommMonoid α] {m : Multiset ι} {f : ια} [inst_1 : DecidableEq ι] {a : ι}, a mf a + sum (map f (erase m a)) = sum (map f m)
to_additive
(attr := simp)] theorem
prod_map_erase: ∀ {ι : Type u_1} {α : Type u_2} [inst : CommMonoid α] {m : Multiset ι} {f : ια} [inst_1 : DecidableEq ι] {a : ι}, a mf a * prod (map f (erase m a)) = prod (map f m)
prod_map_erase
[
DecidableEq: Sort ?u.10099 → Sort (max1?u.10099)
DecidableEq
ι: Type ?u.10065
ι
] {
a: ι
a
:
ι: Type ?u.10065
ι
} (
h: a m
h
:
a: ι
a
m: Multiset ι
m
) :
f: ια
f
a: ι
a
* ((
m: Multiset ι
m
.
erase: {α : Type ?u.10142} → [inst : DecidableEq α] → Multiset ααMultiset α
erase
a: ι
a
).
map: {α : Type ?u.10190} → {β : Type ?u.10189} → (αβ) → Multiset αMultiset β
map
f: ια
f
).
prod: {α : Type ?u.10200} → [inst : CommMonoid α] → Multiset αα
prod
= (
m: Multiset ι
m
.
map: {α : Type ?u.10221} → {β : Type ?u.10220} → (αβ) → Multiset αMultiset β
map
f: ια
f
).
prod: {α : Type ?u.10231} → [inst : CommMonoid α] → Multiset αα
prod
:=

Goals accomplished! 🐙
ι: Type u_1

α: Type u_2

β: Type ?u.10071

γ: Type ?u.10074

inst✝¹: CommMonoid α

s, t: Multiset α

a✝: α

m: Multiset ι

f, g: ια

inst✝: DecidableEq ι

a: ι

h: a m


f a * prod (map f (erase m a)) = prod (map f m)
ι: Type u_1

α: Type u_2

β: Type ?u.10071

γ: Type ?u.10074

inst✝¹: CommMonoid α

s, t: Multiset α

a✝: α

m: Multiset ι

f, g: ια

inst✝: DecidableEq ι

a: ι

h: a m


f a * prod (map f (erase m a)) = prod (map f m)
ι: Type u_1

α: Type u_2

β: Type ?u.10071

γ: Type ?u.10074

inst✝¹: CommMonoid α

s, t: Multiset α

a✝: α

m: Multiset ι

f, g: ια

inst✝: DecidableEq ι

a: ι

h: a m


f a * prod (map f (erase (↑(toList m)) a)) = prod (map f ↑(toList m))
ι: Type u_1

α: Type u_2

β: Type ?u.10071

γ: Type ?u.10074

inst✝¹: CommMonoid α

s, t: Multiset α

a✝: α

m: Multiset ι

f, g: ια

inst✝: DecidableEq ι

a: ι

h: a m


f a * prod (map f (erase m a)) = prod (map f m)
ι: Type u_1

α: Type u_2

β: Type ?u.10071

γ: Type ?u.10074

inst✝¹: CommMonoid α

s, t: Multiset α

a✝: α

m: Multiset ι

f, g: ια

inst✝: DecidableEq ι

a: ι

h: a m


f a * prod (map f ↑(List.erase (toList m) a)) = prod (map f ↑(toList m))
ι: Type u_1

α: Type u_2

β: Type ?u.10071

γ: Type ?u.10074

inst✝¹: CommMonoid α

s, t: Multiset α

a✝: α

m: Multiset ι

f, g: ια

inst✝: DecidableEq ι

a: ι

h: a m


f a * prod (map f (erase m a)) = prod (map f m)
ι: Type u_1

α: Type u_2

β: Type ?u.10071

γ: Type ?u.10074

inst✝¹: CommMonoid α

s, t: Multiset α

a✝: α

m: Multiset ι

f, g: ια

inst✝: DecidableEq ι

a: ι

h: a m


f a * prod ↑(List.map f (List.erase (toList m) a)) = prod (map f ↑(toList m))
ι: Type u_1

α: Type u_2

β: Type ?u.10071

γ: Type ?u.10074

inst✝¹: CommMonoid α

s, t: Multiset α

a✝: α

m: Multiset ι

f, g: ια

inst✝: DecidableEq ι

a: ι

h: a m


f a * prod (map f (erase m a)) = prod (map f m)
ι: Type u_1

α: Type u_2

β: Type ?u.10071

γ: Type ?u.10074

inst✝¹: CommMonoid α

s, t: Multiset α

a✝: α

m: Multiset ι

f, g: ια

inst✝: DecidableEq ι

a: ι

h: a m


f a * prod ↑(List.map f (List.erase (toList m) a)) = prod ↑(List.map f (toList m))
ι: Type u_1

α: Type u_2

β: Type ?u.10071

γ: Type ?u.10074

inst✝¹: CommMonoid α

s, t: Multiset α

a✝: α

m: Multiset ι

f, g: ια

inst✝: DecidableEq ι

a: ι

h: a m


f a * prod (map f (erase m a)) = prod (map f m)
ι: Type u_1

α: Type u_2

β: Type ?u.10071

γ: Type ?u.10074

inst✝¹: CommMonoid α

s, t: Multiset α

a✝: α

m: Multiset ι

f, g: ια

inst✝: DecidableEq ι

a: ι

h: a m


ι: Type u_1

α: Type u_2

β: Type ?u.10071

γ: Type ?u.10074

inst✝¹: CommMonoid α

s, t: Multiset α

a✝: α

m: Multiset ι

f, g: ια

inst✝: DecidableEq ι

a: ι

h: a m


f a * prod (map f (erase m a)) = prod (map f m)
ι: Type u_1

α: Type u_2

β: Type ?u.10071

γ: Type ?u.10074

inst✝¹: CommMonoid α

s, t: Multiset α

a✝: α

m: Multiset ι

f, g: ια

inst✝: DecidableEq ι

a: ι

h: a m


ι: Type u_1

α: Type u_2

β: Type ?u.10071

γ: Type ?u.10074

inst✝¹: CommMonoid α

s, t: Multiset α

a✝: α

m: Multiset ι

f, g: ια

inst✝: DecidableEq ι

a: ι

h: a m


f a * prod (map f (erase m a)) = prod (map f m)
ι: Type u_1

α: Type u_2

β: Type ?u.10071

γ: Type ?u.10074

inst✝¹: CommMonoid α

s, t: Multiset α

a✝: α

m: Multiset ι

f, g: ια

inst✝: DecidableEq ι

a: ι

h: a m



Goals accomplished! 🐙
#align multiset.prod_map_erase
Multiset.prod_map_erase: ∀ {ι : Type u_1} {α : Type u_2} [inst : CommMonoid α] {m : Multiset ι} {f : ια} [inst_1 : DecidableEq ι] {a : ι}, a mf a * prod (map f (erase m a)) = prod (map f m)
Multiset.prod_map_erase
#align multiset.sum_map_erase
Multiset.sum_map_erase: ∀ {ι : Type u_1} {α : Type u_2} [inst : AddCommMonoid α] {m : Multiset ι} {f : ια} [inst_1 : DecidableEq ι] {a : ι}, a mf a + sum (map f (erase m a)) = sum (map f m)
Multiset.sum_map_erase
@[
to_additive: ∀ {α : Type u_1} [inst : AddCommMonoid α] (a : α), sum {a} = a
to_additive
(attr := simp)] theorem
prod_singleton: ∀ (a : α), prod {a} = a
prod_singleton
(
a: α
a
:
α: Type ?u.11544
α
) :
prod: {α : Type ?u.11578} → [inst : CommMonoid α] → Multiset αα
prod
{
a: α
a
} =
a: α
a
:=

Goals accomplished! 🐙
ι: Type ?u.11541

α: Type u_1

β: Type ?u.11547

γ: Type ?u.11550

inst✝: CommMonoid α

s, t: Multiset α

a✝: α

m: Multiset ι

f, g: ια

a: α


prod {a} = a

Goals accomplished! 🐙
#align multiset.prod_singleton
Multiset.prod_singleton: ∀ {α : Type u_1} [inst : CommMonoid α] (a : α), prod {a} = a
Multiset.prod_singleton
#align multiset.sum_singleton
Multiset.sum_singleton: ∀ {α : Type u_1} [inst : AddCommMonoid α] (a : α), sum {a} = a
Multiset.sum_singleton
@[
to_additive: ∀ {α : Type u_1} [inst : AddCommMonoid α] (a b : α), sum {a, b} = a + b
to_additive
] theorem
prod_pair: ∀ {α : Type u_1} [inst : CommMonoid α] (a b : α), prod {a, b} = a * b
prod_pair
(
a: α
a
b: α
b
:
α: Type ?u.12248
α
) : ({
a: α
a
,
b: α
b
} :
Multiset: Type ?u.12285 → Type ?u.12285
Multiset
α: Type ?u.12248
α
).
prod: {α : Type ?u.12332} → [inst : CommMonoid α] → Multiset αα
prod
=
a: α
a
*
b: α
b
:=

Goals accomplished! 🐙
ι: Type ?u.12245

α: Type u_1

β: Type ?u.12251

γ: Type ?u.12254

inst✝: CommMonoid α

s, t: Multiset α

a✝: α

m: Multiset ι

f, g: ια

a, b: α


prod {a, b} = a * b
ι: Type ?u.12245

α: Type u_1

β: Type ?u.12251

γ: Type ?u.12254

inst✝: CommMonoid α

s, t: Multiset α

a✝: α

m: Multiset ι

f, g: ια

a, b: α


prod {a, b} = a * b
ι: Type ?u.12245

α: Type u_1

β: Type ?u.12251

γ: Type ?u.12254

inst✝: CommMonoid α

s, t: Multiset α

a✝: α

m: Multiset ι

f, g: ια

a, b: α


prod (a ::ₘ {b}) = a * b
ι: Type ?u.12245

α: Type u_1

β: Type ?u.12251

γ: Type ?u.12254

inst✝: CommMonoid α

s, t: Multiset α

a✝: α

m: Multiset ι

f, g: ια

a, b: α


prod {a, b} = a * b
ι: Type ?u.12245

α: Type u_1

β: Type ?u.12251

γ: Type ?u.12254

inst✝: CommMonoid α

s, t: Multiset α

a✝: α

m: Multiset ι

f, g: ια

a, b: α


a * prod {b} = a * b
ι: Type ?u.12245

α: Type u_1

β: Type ?u.12251

γ: Type ?u.12254

inst✝: CommMonoid α

s, t: Multiset α

a✝: α

m: Multiset ι

f, g: ια

a, b: α


prod {a, b} = a * b
ι: Type ?u.12245

α: Type u_1

β: Type ?u.12251

γ: Type ?u.12254

inst✝: CommMonoid α

s, t: Multiset α

a✝: α

m: Multiset ι

f, g: ια

a, b: α


a * b = a * b

Goals accomplished! 🐙
#align multiset.prod_pair
Multiset.prod_pair: ∀ {α : Type u_1} [inst : CommMonoid α] (a b : α), prod {a, b} = a * b
Multiset.prod_pair
#align multiset.sum_pair
Multiset.sum_pair: ∀ {α : Type u_1} [inst : AddCommMonoid α] (a b : α), sum {a, b} = a + b
Multiset.sum_pair
@[
to_additive: ∀ {α : Type u_1} [inst : AddCommMonoid α] (s t : Multiset α), sum (s + t) = sum s + sum t
to_additive
(attr := simp)] theorem
prod_add: ∀ (s t : Multiset α), prod (s + t) = prod s * prod t
prod_add
(
s: Multiset α
s
t: Multiset α
t
:
Multiset: Type ?u.13350 → Type ?u.13350
Multiset
α: Type ?u.13319
α
) :
prod: {α : Type ?u.13357} → [inst : CommMonoid α] → Multiset αα
prod
(
s: Multiset α
s
+
t: Multiset α
t
) =
prod: {α : Type ?u.13448} → [inst : CommMonoid α] → Multiset αα
prod
s: Multiset α
s
*
prod: {α : Type ?u.13452} → [inst : CommMonoid α] → Multiset αα
prod
t: Multiset α
t
:=
Quotient.inductionOn₂: ∀ {α : Sort ?u.14267} {β : Sort ?u.14266} {s₁ : Setoid α} {s₂ : Setoid β} {motive : Quotient s₁Quotient s₂Prop} (q₁ : Quotient s₁) (q₂ : Quotient s₂), (∀ (a : α) (b : β), motive (Quotient.mk s₁ a) (Quotient.mk s₂ b)) → motive q₁ q₂
Quotient.inductionOn₂
s: Multiset α
s
t: Multiset α
t
fun
l₁: ?m.14313
l₁
l₂: ?m.14316
l₂
=>

Goals accomplished! 🐙
ι: Type ?u.13316

α: Type u_1

β: Type ?u.13322

γ: Type ?u.13325

inst✝: CommMonoid α

s✝, t✝: Multiset α

a: α

m: Multiset ι

f, g: ια

s, t: Multiset α

l₁, l₂: List α



Goals accomplished! 🐙
#align multiset.prod_add
Multiset.prod_add: ∀ {α : Type u_1} [inst : CommMonoid α] (s t : Multiset α), prod (s + t) = prod s * prod t
Multiset.prod_add
#align multiset.sum_add
Multiset.sum_add: ∀ {α : Type u_1} [inst : AddCommMonoid α] (s t : Multiset α), sum (s + t) = sum s + sum t
Multiset.sum_add
theorem
prod_nsmul: ∀ (m : Multiset α) (n : ), prod (n m) = prod m ^ n
prod_nsmul
(
m: Multiset α
m
:
Multiset: Type ?u.14979 → Type ?u.14979
Multiset
α: Type ?u.14948
α
) : ∀
n:
n
:
: Type
, (
n:
n
m: Multiset α
m
).
prod: {α : Type ?u.15334} → [inst : CommMonoid α] → Multiset αα
prod
=
m: Multiset α
m
.
prod: {α : Type ?u.15356} → [inst : CommMonoid α] → Multiset αα
prod
^
n:
n
|
0:
0
=>

Goals accomplished! 🐙
ι: Type ?u.14945

α: Type u_1

β: Type ?u.14951

γ: Type ?u.14954

inst✝: CommMonoid α

s, t: Multiset α

a: α

m✝: Multiset ι

f, g: ια

m: Multiset α


prod (0 m) = prod m ^ 0
ι: Type ?u.14945

α: Type u_1

β: Type ?u.14951

γ: Type ?u.14954

inst✝: CommMonoid α

s, t: Multiset α

a: α

m✝: Multiset ι

f, g: ια

m: Multiset α


prod (0 m) = prod m ^ 0
ι: Type ?u.14945

α: Type u_1

β: Type ?u.14951

γ: Type ?u.14954

inst✝: CommMonoid α

s, t: Multiset α

a: α

m✝: Multiset ι

f, g: ια

m: Multiset α


prod 0 = prod m ^ 0
ι: Type ?u.14945

α: Type u_1

β: Type ?u.14951

γ: Type ?u.14954

inst✝: CommMonoid α

s, t: Multiset α

a: α

m✝: Multiset ι

f, g: ια

m: Multiset α


prod (0 m) = prod m ^ 0
ι: Type ?u.14945

α: Type u_1

β: Type ?u.14951

γ: Type ?u.14954

inst✝: CommMonoid α

s, t: Multiset α

a: α

m✝: Multiset ι

f, g: ια

m: Multiset α


prod 0 = 1
ι: Type ?u.14945

α: Type u_1

β: Type ?u.14951

γ: Type ?u.14954

inst✝: CommMonoid α

s, t: Multiset α

a: α

m✝: Multiset ι

f, g: ια

m: Multiset α


prod 0 = 1
ι: Type ?u.14945

α: Type u_1

β: Type ?u.14951

γ: Type ?u.14954

inst✝: CommMonoid α

s, t: Multiset α

a: α

m✝: Multiset ι

f, g: ια

m: Multiset α


prod (0 m) = prod m ^ 0

Goals accomplished! 🐙
|
n:
n
+ 1 =>

Goals accomplished! 🐙
ι: Type ?u.14945

α: Type u_1

β: Type ?u.14951

γ: Type ?u.14954

inst✝: CommMonoid α

s, t: Multiset α

a: α

m✝: Multiset ι

f, g: ια

m: Multiset α

n:


prod ((n + 1) m) = prod m ^ (n + 1)
ι: Type ?u.14945

α: Type u_1

β: Type ?u.14951

γ: Type ?u.14954

inst✝: CommMonoid α

s, t: Multiset α

a: α

m✝: Multiset ι

f, g: ια

m: Multiset α

n:


prod ((n + 1) m) = prod m ^ (n + 1)
ι: Type ?u.14945

α: Type u_1

β: Type ?u.14951

γ: Type ?u.14954

inst✝: CommMonoid α

s, t: Multiset α

a: α

m✝: Multiset ι

f, g: ια

m: Multiset α

n:


prod (n m + 1 m) = prod m ^ (n + 1)
ι: Type ?u.14945

α: Type u_1

β: Type ?u.14951

γ: Type ?u.14954

inst✝: CommMonoid α

s, t: Multiset α

a: α

m✝: Multiset ι

f, g: ια

m: Multiset α

n:


prod ((n + 1) m) = prod m ^ (n + 1)
ι: Type ?u.14945

α: Type u_1

β: Type ?u.14951

γ: Type ?u.14954

inst✝: CommMonoid α

s, t: Multiset α

a: α

m✝: Multiset ι

f, g: ια

m: Multiset α

n:


prod (n m + m) = prod m ^ (n + 1)
ι: Type ?u.14945

α: Type u_1

β: Type ?u.14951

γ: Type ?u.14954

inst✝: CommMonoid α

s, t: Multiset α

a: α

m✝: Multiset ι

f, g: ια

m: Multiset α

n:


prod ((n + 1) m) = prod m ^ (n + 1)
ι: Type ?u.14945

α: Type u_1

β: Type ?u.14951

γ: Type ?u.14954

inst✝: CommMonoid α

s, t: Multiset α

a: α

m✝: Multiset ι

f, g: ια

m: Multiset α

n:


prod (n m + m) = prod m ^ n * prod m ^ 1
ι: Type ?u.14945

α: Type u_1

β: Type ?u.14951

γ: Type ?u.14954

inst✝: CommMonoid α

s, t: Multiset α

a: α

m✝: Multiset ι

f, g: ια

m: Multiset α

n:


prod ((n + 1) m) = prod m ^ (n + 1)
ι: Type ?u.14945

α: Type u_1

β: Type ?u.14951

γ: Type ?u.14954

inst✝: CommMonoid α

s, t: Multiset α

a: α

m✝: Multiset ι

f, g: ια

m: Multiset α

n:


prod (n m + m) = prod m ^ n * prod m
ι: Type ?u.14945

α: Type u_1

β: Type ?u.14951

γ: Type ?u.14954

inst✝: CommMonoid α

s, t: Multiset α

a: α

m✝: Multiset ι

f, g: ια

m: Multiset α

n:


prod ((n + 1) m) = prod m ^ (n + 1)
ι: Type ?u.14945

α: Type u_1

β: Type ?u.14951

γ: Type ?u.14954

inst✝: CommMonoid α

s, t: Multiset α

a: α

m✝: Multiset ι

f, g: ια

m: Multiset α

n:


prod (n m) * prod m = prod m ^ n * prod m
ι: Type ?u.14945

α: Type u_1

β: Type ?u.14951

γ: Type ?u.14954

inst✝: CommMonoid α

s, t: Multiset α

a: α

m✝: Multiset ι

f, g: ια

m: Multiset α

n:


prod ((n + 1) m) = prod m ^ (n + 1)
ι: Type ?u.14945

α: Type u_1

β: Type ?u.14951

γ: Type ?u.14954

inst✝: CommMonoid α

s, t: Multiset α

a: α

m✝: Multiset ι

f, g: ια

m: Multiset α

n:


prod m ^ n * prod m = prod m ^ n * prod m

Goals accomplished! 🐙
#align multiset.prod_nsmul
Multiset.prod_nsmul: ∀ {α : Type u_1} [inst : CommMonoid α] (m : Multiset α) (n : ), prod (n m) = prod m ^ n
Multiset.prod_nsmul
@[
to_additive: ∀ {α : Type u_1} [inst : AddCommMonoid α] (n : ) (a : α), sum (replicate n a) = n a
to_additive
(attr := simp)] theorem
prod_replicate: ∀ (n : ) (a : α), prod (replicate n a) = a ^ n
prod_replicate
(
n:
n
:
: Type
) (
a: α
a
:
α: Type ?u.19274
α
) : (
replicate: {α : Type ?u.19310} → αMultiset α
replicate
n:
n
a: α
a
).
prod: {α : Type ?u.19312} → [inst : CommMonoid α] → Multiset αα
prod
=
a: α
a
^
n:
n
:=

Goals accomplished! 🐙
ι: Type ?u.19271

α: Type u_1

β: Type ?u.19277

γ: Type ?u.19280

inst✝: CommMonoid α

s, t: Multiset α

a✝: α

m: Multiset ι

f, g: ια

n:

a: α


prod (replicate n a) = a ^ n

Goals accomplished! 🐙
#align multiset.prod_replicate
Multiset.prod_replicate: ∀ {α : Type u_1} [inst : CommMonoid α] (n : ) (a : α), prod (replicate n a) = a ^ n
Multiset.prod_replicate
#align multiset.sum_replicate
Multiset.sum_replicate: ∀ {α : Type u_1} [inst : AddCommMonoid α] (n : ) (a : α), sum (replicate n a) = n a
Multiset.sum_replicate
@[
to_additive: ∀ {ι : Type u_1} {α : Type u_2} [inst : AddCommMonoid α] {m : Multiset ι} {f : ια} [inst_1 : DecidableEq ι] (i : ι), (∀ (i' : ι), i' ii' mf i' = 0) → sum (map f m) = count i m f i
to_additive
] theorem
prod_map_eq_pow_single: ∀ {ι : Type u_1} {α : Type u_2} [inst : CommMonoid α] {m : Multiset ι} {f : ια} [inst_1 : DecidableEq ι] (i : ι), (∀ (i' : ι), i' ii' mf i' = 1) → prod (map f m) = f i ^ count i m
prod_map_eq_pow_single
[
DecidableEq: Sort ?u.22682 → Sort (max1?u.22682)
DecidableEq
ι: Type ?u.22648
ι
] (
i: ι
i
:
ι: Type ?u.22648
ι
) (
hf: ∀ (i' : ι), i' ii' mf i' = 1
hf
: ∀ (
i': ?m.22694
i'
) (
_: i' i
_
:
i': ?m.22694
i'
i: ι
i
),
i': ?m.22694
i'
m: Multiset ι
m
f: ια
f
i': ?m.22694
i'
=
1: ?m.22731
1
) : (
m: Multiset ι
m
.
map: {α : Type ?u.23160} → {β : Type ?u.23159} → (αβ) → Multiset αMultiset β
map
f: ια
f
).
prod: {α : Type ?u.23170} → [inst : CommMonoid α] → Multiset αα
prod
=
f: ια
f
i: ι
i
^
m: Multiset ι
m
.
count: {α : Type ?u.23191} → [inst : DecidableEq α] → αMultiset α
count
i: ι
i
:=

Goals accomplished! 🐙
ι: Type u_1

α: Type u_2

β: Type ?u.22654

γ: Type ?u.22657

inst✝¹: CommMonoid α

s, t: Multiset α

a: α

m: Multiset ι

f, g: ια

inst✝: DecidableEq ι

i: ι

hf: ∀ (i' : ι), i' ii' mf i' = 1


prod (map f m) = f i ^ count i m
ι: Type u_1

α: Type u_2

β: Type ?u.22654

γ: Type ?u.22657

inst✝¹: CommMonoid α

s, t: Multiset α

a: α

m: Multiset ι

f, g: ια

inst✝: DecidableEq ι

i: ι

hf✝: ∀ (i' : ι), i' ii' mf i' = 1

l: List ι

hf: ∀ (i' : ι), i' ii' Quotient.mk (List.isSetoid ι) lf i' = 1


h
ι: Type u_1

α: Type u_2

β: Type ?u.22654

γ: Type ?u.22657

inst✝¹: CommMonoid α

s, t: Multiset α

a: α

m: Multiset ι

f, g: ια

inst✝: DecidableEq ι

i: ι

hf: ∀ (i' : ι), i' ii' mf i' = 1


prod (map f m) = f i ^ count i m

Goals accomplished! 🐙
#align multiset.prod_map_eq_pow_single
Multiset.prod_map_eq_pow_single: ∀ {ι : Type u_1} {α : Type u_2} [inst : CommMonoid α] {m : Multiset ι} {f : ια} [inst_1 : DecidableEq ι] (i : ι), (∀ (i' : ι), i' ii' mf i' = 1) → prod (map f m) = f i ^ count i m
Multiset.prod_map_eq_pow_single
#align multiset.sum_map_eq_nsmul_single
Multiset.sum_map_eq_nsmul_single: ∀ {ι : Type u_1} {α : Type u_2} [inst : AddCommMonoid α] {m : Multiset ι} {f : ια} [inst_1 : DecidableEq ι] (i : ι), (∀ (i' : ι), i' ii' mf i' = 0) → sum (map f m) = count i m f i
Multiset.sum_map_eq_nsmul_single
@[
to_additive: ∀ {α : Type u_1} [inst : AddCommMonoid α] {s : Multiset α} [inst_1 : DecidableEq α] (a : α), (∀ (a' : α), a' aa' sa' = 0) → sum s = count a s a
to_additive
] theorem
prod_eq_pow_single: ∀ [inst : DecidableEq α] (a : α), (∀ (a' : α), a' aa' sa' = 1) → prod s = a ^ count a s
prod_eq_pow_single
[
DecidableEq: Sort ?u.29728 → Sort (max1?u.29728)
DecidableEq
α: Type ?u.29697
α
] (
a: α
a
:
α: Type ?u.29697
α
) (
h: ∀ (a' : α), a' aa' sa' = 1
h
: ∀ (
a': ?m.29740
a'
) (
_: a' a
_
:
a': ?m.29740
a'
a: α
a
),
a': ?m.29740
a'
s: Multiset α
s
a': ?m.29740
a'
=
1: ?m.29777
1
) :
s: Multiset α
s
.
prod: {α : Type ?u.30205} → [inst : CommMonoid α] → Multiset αα
prod
=
a: α
a
^
s: Multiset α
s
.
count: {α : Type ?u.30225} → [inst : DecidableEq α] → αMultiset α
count
a: α
a
:=

Goals accomplished! 🐙
ι: Type ?u.29694

α: Type u_1

β: Type ?u.29700

γ: Type ?u.29703

inst✝¹: CommMonoid α

s, t: Multiset α

a✝: α

m: Multiset ι

f, g: ια

inst✝: DecidableEq α

a: α

h: ∀ (a' : α), a' aa' sa' = 1


prod s = a ^ count a s
ι: Type ?u.29694

α: Type u_1

β: Type ?u.29700

γ: Type ?u.29703

inst✝¹: CommMonoid α

s, t: Multiset α

a✝: α

m: Multiset ι

f, g: ια

inst✝: DecidableEq α

a: α

h✝: ∀ (a' : α), a' aa' sa' = 1

l: List α

h: ∀ (a' : α), a' aa' Quotient.mk (List.isSetoid α) la' = 1


h
ι: Type ?u.29694

α: Type u_1

β: Type ?u.29700

γ: Type ?u.29703

inst✝¹: CommMonoid α

s, t: Multiset α

a✝: α

m: Multiset ι

f, g: ια

inst✝: DecidableEq α

a: α

h: ∀ (a' : α), a' aa' sa' = 1


prod s = a ^ count a s

Goals accomplished! 🐙
#align multiset.prod_eq_pow_single
Multiset.prod_eq_pow_single: ∀ {α : Type u_1} [inst : CommMonoid α] {s : Multiset α} [inst_1 : DecidableEq α] (a : α), (∀ (a' : α), a' aa' sa' = 1) → prod s = a ^ count a s
Multiset.prod_eq_pow_single
#align multiset.sum_eq_nsmul_single
Multiset.sum_eq_nsmul_single: ∀ {α : Type u_1} [inst : AddCommMonoid α] {s : Multiset α} [inst_1 : DecidableEq α] (a : α), (∀ (a' : α), a' aa' sa' = 0) → sum s = count a s a
Multiset.sum_eq_nsmul_single
@[
to_additive: ∀ {α : Type u_1} [inst : AddCommMonoid α] {s : Multiset α} [inst_1 : DecidableEq α] (a : α), count a s a = sum (filter (Eq a) s)
to_additive
] theorem
pow_count: ∀ {α : Type u_1} [inst : CommMonoid α] {s : Multiset α} [inst_1 : DecidableEq α] (a : α), a ^ count a s = prod (filter (Eq a) s)
pow_count
[
DecidableEq: Sort ?u.36655 → Sort (max1?u.36655)
DecidableEq
α: Type ?u.36624
α
] (
a: α
a
:
α: Type ?u.36624
α
) :
a: α
a
^
s: Multiset α
s
.
count: {α : Type ?u.36670} → [inst : DecidableEq α] → αMultiset α
count
a: α
a
= (
s: Multiset α
s
.
filter: {α : Type ?u.36718} → (p : αProp) → [inst : DecidablePred p] → Multiset αMultiset α
filter
(
Eq: {α : Sort ?u.36725} → ααProp
Eq
a: α
a
)).
prod: {α : Type ?u.36753} → [inst : CommMonoid α] → Multiset αα
prod
:=

Goals accomplished! 🐙
ι: Type ?u.36621

α: Type u_1

β: Type ?u.36627

γ: Type ?u.36630

inst✝¹: CommMonoid α

s, t: Multiset α

a✝: α

m: Multiset ι

f, g: ια

inst✝: DecidableEq α

a: α


a ^ count a s = prod (filter (Eq a) s)
ι: Type ?u.36621

α: Type u_1

β: Type ?u.36627

γ: Type ?u.36630

inst✝¹: CommMonoid α

s, t: Multiset α

a✝: α

m: Multiset ι

f, g: ια

inst✝: DecidableEq α

a: α


a ^ count a s = prod (filter (Eq a) s)
ι: Type ?u.36621

α: Type u_1

β: Type ?u.36627

γ: Type ?u.36630

inst✝¹: CommMonoid α

s, t: Multiset α

a✝: α

m: Multiset ι

f, g: ια

inst✝: DecidableEq α

a: α


a ^ count a s = prod (replicate (count a s) a)
ι: Type ?u.36621

α: Type u_1

β: Type ?u.36627

γ: Type ?u.36630

inst✝¹: CommMonoid α

s, t: Multiset α

a✝: α

m: Multiset ι

f, g: ια

inst✝: DecidableEq α

a: α


a ^ count a s = prod (filter (Eq a) s)
ι: Type ?u.36621

α: Type u_1

β: Type ?u.36627

γ: Type ?u.36630

inst✝¹: CommMonoid α

s, t: Multiset α

a✝: α

m: Multiset ι

f, g: ια

inst✝: DecidableEq α

a: α


a ^ count a s = a ^ count a s

Goals accomplished! 🐙
#align multiset.pow_count
Multiset.pow_count: ∀ {α : Type u_1} [inst : CommMonoid α] {s : Multiset α} [inst_1 : DecidableEq α] (a : α), a ^ count a s = prod (filter (Eq a) s)
Multiset.pow_count
#align multiset.nsmul_count
Multiset.nsmul_count: ∀ {α : Type u_1} [inst : AddCommMonoid α] {s : Multiset α} [inst_1 : DecidableEq α] (a : α), count a s a = sum (filter (Eq a) s)
Multiset.nsmul_count
@[
to_additive: ∀ {α : Type u_2} {β : Type u_1} [inst : AddCommMonoid α] [inst_1 : AddCommMonoid β] (s : Multiset α) {F : Type u_3} [inst_2 : AddMonoidHomClass F α β] (f : F), sum (map (f) s) = f (sum s)
to_additive
] theorem
prod_hom: ∀ [inst : CommMonoid β] (s : Multiset α) {F : Type u_3} [inst_1 : MonoidHomClass F α β] (f : F), prod (map (f) s) = f (prod s)
prod_hom
[
CommMonoid: Type ?u.39820 → Type ?u.39820
CommMonoid
β: Type ?u.39792
β
] (
s: Multiset α
s
:
Multiset: Type ?u.39823 → Type ?u.39823
Multiset
α: Type ?u.39789
α
) {
F: Type ?u.39826
F
:
Type _: Type (?u.39826+1)
Type _
} [
MonoidHomClass: Type ?u.39831 → (M : outParam (Type ?u.39830)) → (N : outParam (Type ?u.39829)) → [inst : MulOneClass M] → [inst : MulOneClass N] → Type (max(max?u.39831?u.39830)?u.39829)
MonoidHomClass
F: Type ?u.39826
F
α: Type ?u.39789
α
β: Type ?u.39792
β
] (
f: F
f
:
F: Type ?u.39826
F
) : (
s: Multiset α
s
.
map: {α : Type ?u.40532} → {β : Type ?u.40531} → (αβ) → Multiset αMultiset β
map
f: F
f
).
prod: {α : Type ?u.40985} → [inst : CommMonoid α] → Multiset αα
prod
=
f: F
f
s: Multiset α
s
.
prod: {α : Type ?u.41434} → [inst : CommMonoid α] → Multiset αα
prod
:=
Quotient.inductionOn: ∀ {α : Sort ?u.41458} {s : Setoid α} {motive : Quotient sProp} (q : Quotient s), (∀ (a : α), motive (Quotient.mk s a)) → motive q
Quotient.inductionOn
s: Multiset α
s
fun
l: ?m.41487
l
=>

Goals accomplished! 🐙
ι: Type ?u.39786

α: Type u_2

β: Type u_1

γ: Type ?u.39795

inst✝²: CommMonoid α

s✝, t: Multiset α

a: α

m: Multiset ι

f✝, g: ια

inst✝¹: CommMonoid β

s: Multiset α

F: Type u_3

inst✝: MonoidHomClass F α β

f: F

l: List α


prod (map (f) (Quotient.mk (List.isSetoid α) l)) = f (prod (Quotient.mk (List.isSetoid α) l))

Goals accomplished! 🐙
#align multiset.prod_hom
Multiset.prod_hom: ∀ {α : Type u_2} {β : Type u_1} [inst : CommMonoid α] [inst_1 : CommMonoid β] (s : Multiset α) {F : Type u_3} [inst_2 : MonoidHomClass F α β] (f : F), prod (map (f) s) = f (prod s)
Multiset.prod_hom
#align multiset.sum_hom
Multiset.sum_hom: ∀ {α : Type u_2} {β : Type u_1} [inst : AddCommMonoid α] [inst_1 : AddCommMonoid β] (s : Multiset α) {F : Type u_3} [inst_2 : AddMonoidHomClass F α β] (f : F), sum (map (f) s) = f (sum s)
Multiset.sum_hom
@[
to_additive: ∀ {ι : Type u_2} {α : Type u_4} {β : Type u_1} [inst : AddCommMonoid α] [inst_1 : AddCommMonoid β] (s : Multiset ι) {F : Type u_3} [inst_2 : AddMonoidHomClass F α β] (f : F) (g : ια), sum (map (fun i => f (g i)) s) = f (sum (map g s))
to_additive
] theorem
prod_hom': ∀ {ι : Type u_2} {α : Type u_4} {β : Type u_1} [inst : CommMonoid α] [inst_1 : CommMonoid β] (s : Multiset ι) {F : Type u_3} [inst_2 : MonoidHomClass F α β] (f : F) (g : ια), prod (map (fun i => f (g i)) s) = f (prod (map g s))
prod_hom'
[
CommMonoid: Type ?u.42650 → Type ?u.42650
CommMonoid
β: Type ?u.42622
β
] (
s: Multiset ι
s
:
Multiset: Type ?u.42653 → Type ?u.42653
Multiset
ι: Type ?u.42616
ι
) {
F: Type u_3
F
:
Type _: Type (?u.42656+1)
Type _
} [
MonoidHomClass: Type ?u.42661 → (M : outParam (Type ?u.42660)) → (N : outParam (Type ?u.42659)) → [inst : MulOneClass M] → [inst : MulOneClass N] → Type (max(max?u.42661?u.42660)?u.42659)
MonoidHomClass
F: Type ?u.42656
F
α: Type ?u.42619
α
β: Type ?u.42622
β
] (
f: F
f
:
F: Type ?u.42656
F
) (
g: ια
g
:
ι: Type ?u.42616
ι
α: Type ?u.42619
α
) : (
s: Multiset ι
s
.
map: {α : Type ?u.43366} → {β : Type ?u.43365} → (αβ) → Multiset αMultiset β
map
fun
i: ?m.43374
i
=>
f: F
f
<|
g: ια
g
i: ?m.43374
i
).
prod: {α : Type ?u.43822} → [inst : CommMonoid α] → Multiset αα
prod
=
f: F
f
(
s: Multiset ι
s
.
map: {α : Type ?u.44272} → {β : Type ?u.44271} → (αβ) → Multiset αMultiset β
map
g: ια
g
).
prod: {α : Type ?u.44282} → [inst : CommMonoid α] → Multiset αα
prod
:=

Goals accomplished! 🐙
ι: Type u_2

α: Type u_4

β: Type u_1

γ: Type ?u.42625

inst✝²: CommMonoid α

s✝, t: Multiset α

a: α

m: Multiset ι

f✝, g✝: ια

inst✝¹: CommMonoid β

s: Multiset ι

F: Type u_3

inst✝: MonoidHomClass F α β

f: F

g: ια


prod (map (fun i => f (g i)) s) = f (prod (map g s))
ι: Type u_2

α: Type u_4

β: Type u_1

γ: Type ?u.42625

inst✝²: CommMonoid α

s✝, t: Multiset α

a: α

m: Multiset ι

f✝, g✝: ια

inst✝¹: CommMonoid β

s: Multiset ι

F: Type u_3

inst✝: MonoidHomClass F α β

f: F

g: ια


h.e'_2.h.e'_3
map (fun i => f (g i)) s = map (f) (map g s)
ι: Type u_2

α: Type u_4

β: Type u_1

γ: Type ?u.42625

inst✝²: CommMonoid α

s✝, t: Multiset α

a: α

m: Multiset ι

f✝, g✝: ια

inst✝¹: CommMonoid β

s: Multiset ι

F: Type u_3

inst✝: MonoidHomClass F α β

f: F

g: ια


prod (map (fun i => f (g i)) s) = f (prod (map g s))

Goals accomplished! 🐙
#align multiset.prod_hom'
Multiset.prod_hom': ∀ {ι : Type u_2} {α : Type u_4} {β : Type u_1} [inst : CommMonoid α] [inst_1 : CommMonoid β] (s : Multiset ι) {F : Type u_3} [inst_2 : MonoidHomClass F α β] (f : F) (g : ια), prod (map (fun i => f (g i)) s) = f (prod (map g s))
Multiset.prod_hom'
#align multiset.sum_hom'
Multiset.sum_hom': ∀ {ι : Type u_2} {α : Type u_4} {β : Type u_1} [inst : AddCommMonoid α] [inst_1 : AddCommMonoid β] (s : Multiset ι) {F : Type u_3} [inst_2 : AddMonoidHomClass F α β] (f : F) (g : ια), sum (map (fun i => f (g i)) s) = f (sum (map g s))
Multiset.sum_hom'
@[
to_additive: ∀ {ι : Type u_3} {α : Type u_4} {β : Type u_1} {γ : Type u_2} [inst : AddCommMonoid α] [inst_1 : AddCommMonoid β] [inst_2 : AddCommMonoid γ] (s : Multiset ι) (f : αβγ), (∀ (a b : α) (c d : β), f (a + b) (c + d) = f a c + f b d) → f 0 0 = 0∀ (f₁ : ια) (f₂ : ιβ), sum (map (fun i => f (f₁ i) (f₂ i)) s) = f (sum (map f₁ s)) (sum (map f₂ s))
to_additive
] theorem
prod_hom₂: ∀ {ι : Type u_3} {α : Type u_4} {β : Type u_1} {γ : Type u_2} [inst : CommMonoid α] [inst_1 : CommMonoid β] [inst_2 : CommMonoid γ] (s : Multiset ι) (f : αβγ), (∀ (a b : α) (c d : β), f (a * b) (c * d) = f a c * f b d) → f 1 1 = 1∀ (f₁ : ια) (f₂ : ιβ), prod (map (fun i => f (f₁ i) (f₂ i)) s) = f (prod (map f₁ s)) (prod (map f₂ s))
prod_hom₂
[
CommMonoid: Type ?u.48185 → Type ?u.48185
CommMonoid
β: Type ?u.48157
β
] [
CommMonoid: Type ?u.48188 → Type ?u.48188
CommMonoid
γ: Type ?u.48160
γ
] (
s: Multiset ι
s
:
Multiset: Type ?u.48191 → Type ?u.48191
Multiset
ι: Type ?u.48151
ι
) (
f: αβγ
f
:
α: Type ?u.48154
α
β: Type ?u.48157
β
γ: Type ?u.48160
γ
) (
hf: ∀ (a b : α) (c d : β), f (a * b) (c * d) = f a c * f b d
hf
: ∀
a: ?m.48201
a
b: ?m.48204
b
c: ?m.48207
c
d: ?m.48210
d
,
f: αβγ
f
(
a: ?m.48201
a
*
b: ?m.48204
b
) (
c: ?m.48207
c
*
d: ?m.48210
d
) =
f: αβγ
f
a: ?m.48201
a
c: ?m.48207
c
*
f: αβγ
f
b: ?m.48204
b
d: ?m.48210
d
) (
hf': f 1 1 = 1
hf'
:
f: αβγ
f
1: ?m.50652
1
1: ?m.50985
1
=
1: ?m.51318
1
) (
f₁: ια
f₁
:
ι: Type ?u.48151
ι
α: Type ?u.48154
α
) (
f₂: ιβ
f₂
:
ι: Type ?u.48151
ι
β: Type ?u.48157
β
) : (
s: Multiset ι
s
.
map: {α : Type ?u.51676} → {β : Type ?u.51675} → (αβ) → Multiset αMultiset β
map
fun
i: ?m.51684
i
=>
f: αβγ
f
(
f₁: ια
f₁
i: ?m.51684
i
) (
f₂: ιβ
f₂
i: ?m.51684
i
)).
prod: {α : Type ?u.51689} → [inst : CommMonoid α] → Multiset αα
prod
=
f: αβγ
f
(
s: Multiset ι
s
.
map: {α : Type ?u.51708} → {β : Type ?u.51707} → (αβ) → Multiset αMultiset β
map
f₁: ια
f₁
).
prod: {α : Type ?u.51718} → [inst : CommMonoid α] → Multiset αα
prod
(
s: Multiset ι
s
.
map: {α : Type ?u.51737} → {β : Type ?u.51736} → (αβ) → Multiset αMultiset β
map
f₂: ιβ
f₂
).
prod: {α : Type ?u.51747} → [inst : CommMonoid α] → Multiset αα
prod
:=
Quotient.inductionOn: ∀ {α : Sort ?u.51775} {s : Setoid α} {motive : Quotient sProp} (q : Quotient s), (∀ (a : α), motive (Quotient.mk s a)) → motive q
Quotient.inductionOn
s: Multiset ι
s
fun
l: ?m.51804
l
=>

Goals accomplished! 🐙
ι: Type u_3

α: Type u_4

β: Type u_1

γ: Type u_2

inst✝²: CommMonoid α

s✝, t: Multiset α

a: α

m: Multiset ι

f✝, g: ια

inst✝¹: CommMonoid β

inst✝: CommMonoid γ

s: Multiset ι

f: αβγ

hf: ∀ (a b : α) (c d : β), f (a * b) (c * d) = f a c * f b d

hf': f 1 1 = 1

f₁: ια

f₂: ιβ

l: List ι


prod (map (fun i => f (f₁ i) (f₂ i)) (Quotient.mk (List.isSetoid ι) l)) = f (prod (map f₁ (Quotient.mk (List.isSetoid ι) l))) (prod (map f₂ (Quotient.mk (List.isSetoid ι) l)))

Goals accomplished! 🐙
#align multiset.prod_hom₂
Multiset.prod_hom₂: ∀ {ι : Type u_3} {α : Type u_4} {β : Type u_1} {γ : Type u_2} [inst : CommMonoid α] [inst_1 : CommMonoid β] [inst_2 : CommMonoid γ] (s : Multiset ι) (f : αβγ), (∀ (a b : α) (c d : β), f (a * b) (c * d) = f a c * f b d) → f 1 1 = 1∀ (f₁ : ια) (f₂ : ιβ), prod (map (fun i => f (f₁ i) (f₂ i)) s) = f (prod (map f₁ s)) (prod (map f₂ s))
Multiset.prod_hom₂
#align multiset.sum_hom₂
Multiset.sum_hom₂: ∀ {ι : Type u_3} {α : Type u_4} {β : Type u_1} {γ : Type u_2} [inst : AddCommMonoid α] [inst_1 : AddCommMonoid β] [inst_2 : AddCommMonoid γ] (s : Multiset ι) (f : αβγ), (∀ (a b : α) (c d : β), f (a + b) (c + d) = f a c + f b d) → f 0 0 = 0∀ (f₁ : ια) (f₂ : ιβ), sum (map (fun i => f (f₁ i) (f₂ i)) s) = f (sum (map f₁ s)) (sum (map f₂ s))
Multiset.sum_hom₂
@[
to_additive: ∀ {ι : Type u_2} {α : Type u_3} {β : Type u_1} [inst : AddCommMonoid α] [inst_1 : AddCommMonoid β] (s : Multiset ι) {r : αβProp} {f : ια} {g : ιβ}, r 0 0(∀ ⦃a : ι⦄ ⦃b : α⦄ ⦃c : β⦄, r b cr (f a + b) (g a + c)) → r (sum (map f s)) (sum (map g s))
to_additive
] theorem
prod_hom_rel: ∀ {ι : Type u_2} {α : Type u_3} {β : Type u_1} [inst : CommMonoid α] [inst_1 : CommMonoid β] (s : Multiset ι) {r : αβProp} {f : ια} {g : ιβ}, r 1 1(∀ ⦃a : ι⦄ ⦃b : α⦄ ⦃c : β⦄, r b cr (f a * b) (g a * c)) → r (prod (map f s)) (prod (map g s))
prod_hom_rel
[
CommMonoid: Type ?u.53544 → Type ?u.53544
CommMonoid
β: Type ?u.53516
β
] (
s: Multiset ι
s
:
Multiset: Type ?u.53547 → Type ?u.53547
Multiset
ι: Type ?u.53510
ι
) {
r: αβProp
r
:
α: Type ?u.53513
α
β: Type ?u.53516
β
Prop: Type
Prop
} {
f: ια
f
:
ι: Type ?u.53510
ι
α: Type ?u.53513
α
} {
g: ιβ
g
:
ι: Type ?u.53510
ι
β: Type ?u.53516
β
} (
h₁: r 1 1
h₁
:
r: αβProp
r
1: ?m.53565
1
1: ?m.53977
1
) (
h₂: ∀ ⦃a : ι⦄ ⦃b : α⦄ ⦃c : β⦄, r b cr (f a * b) (g a * c)
h₂
: ∀ ⦃
a: ?m.54391
a
b: ?m.54394
b
c: ?m.54397
c
⦄,
r: αβProp
r
b: ?m.54394
b
c: ?m.54397
c
r: αβProp
r
(
f: ια
f
a: ?m.54391
a
*
b: ?m.54394
b
) (
g: ιβ
g
a: ?m.54391
a
*
c: ?m.54397
c
)) :
r: αβProp
r
(
s: Multiset ι
s
.
map: {α : Type ?u.55869} → {β : Type ?u.55868} → (αβ) → Multiset αMultiset β
map
f: ια
f
).
prod: {α : Type ?u.55880} → [inst : CommMonoid α] → Multiset αα
prod
(
s: Multiset ι
s
.
map: {α : Type ?u.55899} → {β : Type ?u.55898} → (αβ) → Multiset αMultiset β
map
g: ιβ
g
).
prod: {α : Type ?u.55909} → [inst : CommMonoid α] → Multiset αα
prod
:=
Quotient.inductionOn: ∀ {α : Sort ?u.55935} {s : Setoid α} {motive : Quotient sProp} (q : Quotient s), (∀ (a : α), motive (Quotient.mk s a)) → motive q
Quotient.inductionOn
s: Multiset ι
s
fun
l: ?m.55964
l
=>

Goals accomplished! 🐙
ι: Type u_2

α: Type u_3

β: Type u_1

γ: Type ?u.53519

inst✝¹: CommMonoid α

s✝, t: Multiset α

a: α

m: Multiset ι

f✝, g✝: ια

inst✝: CommMonoid β

s: Multiset ι

r: αβProp

f: ια

g: ιβ

h₁: r 1 1

h₂: ∀ ⦃a : ι⦄ ⦃b : α⦄ ⦃c : β⦄, r b cr (f a * b) (g a * c)

l: List ι



Goals accomplished! 🐙
#align multiset.prod_hom_rel
Multiset.prod_hom_rel: ∀ {ι : Type u_2} {α : Type u_3} {β : Type u_1} [inst : CommMonoid α] [inst_1 : CommMonoid β] (s : Multiset ι) {r : αβProp} {f : ια} {g : ιβ}, r 1 1(∀ ⦃a : ι⦄ ⦃b : α⦄ ⦃c : β⦄, r b cr (f a * b) (g a * c)) → r (prod (map f s)) (prod (map g s))
Multiset.prod_hom_rel
#align multiset.sum_hom_rel
Multiset.sum_hom_rel: ∀ {ι : Type u_2} {α : Type u_3} {β : Type u_1} [inst : AddCommMonoid α] [inst_1 : AddCommMonoid β] (s : Multiset ι) {r : αβProp} {f : ια} {g : ιβ}, r 0 0(∀ ⦃a : ι⦄ ⦃b : α⦄ ⦃c : β⦄, r b cr (f a + b) (g a + c)) → r (sum (map f s)) (sum (map g s))
Multiset.sum_hom_rel
@[
to_additive: ∀ {ι : Type u_2} {α : Type u_1} [inst : AddCommMonoid α] {m : Multiset ι}, sum (map (fun x => 0) m) = 0
to_additive
] theorem
prod_map_one: prod (map (fun x => 1) m) = 1
prod_map_one
:
prod: {α : Type ?u.57162} → [inst : CommMonoid α] → Multiset αα
prod
(
m: Multiset ι
m
.
map: {α : Type ?u.57166} → {β : Type ?u.57165} → (αβ) → Multiset αMultiset β
map
fun
_: ?m.57175
_
=> (
1: ?m.57179
1
:
α: Type ?u.57130
α
)) =
1: ?m.57606
1
:=

Goals accomplished! 🐙
ι: Type u_2

α: Type u_1

β: Type ?u.57133

γ: Type ?u.57136

inst✝: CommMonoid α

s, t: Multiset α

a: α

m: Multiset ι

f, g: ια


prod (map (fun x => 1) m) = 1
ι: Type u_2

α: Type u_1

β: Type ?u.57133

γ: Type ?u.57136

inst✝: CommMonoid α

s, t: Multiset α

a: α

m: Multiset ι

f, g: ια


prod (map (fun x => 1) m) = 1
ι: Type u_2

α: Type u_1

β: Type ?u.57133

γ: Type ?u.57136

inst✝: CommMonoid α

s, t: Multiset α

a: α

m: Multiset ι

f, g: ια


prod (replicate (card m) 1) = 1
ι: Type u_2

α: Type u_1

β: Type ?u.57133

γ: Type ?u.57136

inst✝: CommMonoid α

s, t: Multiset α

a: α

m: Multiset ι

f, g: ια


prod (map (fun x => 1) m) = 1
ι: Type u_2

α: Type u_1

β: Type ?u.57133

γ: Type ?u.57136

inst✝: CommMonoid α

s, t: Multiset α

a: α

m: Multiset ι

f, g: ια


1 ^ card m = 1
ι: Type u_2

α: Type u_1

β: Type ?u.57133

γ: Type ?u.57136

inst✝: CommMonoid α

s, t: Multiset α

a: α

m: Multiset ι

f, g: ια


prod (map (fun x => 1) m) = 1
ι: Type u_2

α: Type u_1

β: Type ?u.57133

γ: Type ?u.57136

inst✝: CommMonoid α

s, t: Multiset α

a: α

m: Multiset ι

f, g: ια


1 = 1

Goals accomplished! 🐙
#align multiset.prod_map_one
Multiset.prod_map_one: ∀ {ι : Type u_2} {α : Type u_1} [inst : CommMonoid α] {m : Multiset ι}, prod (map (fun x => 1) m) = 1
Multiset.prod_map_one
#align multiset.sum_map_zero
Multiset.sum_map_zero: ∀ {ι : Type u_2} {α : Type u_1} [inst : AddCommMonoid α] {m : Multiset ι}, sum (map (fun x => 0) m) = 0
Multiset.sum_map_zero
@[
to_additive: ∀ {ι : Type u_2} {α : Type u_1} [inst : AddCommMonoid α] {m : Multiset ι} {f g : ια}, sum (map (fun i => f i + g i) m) = sum (map f m) + sum (map g m)
to_additive
(attr := simp)] theorem
prod_map_mul: prod (map (fun i => f i * g i) m) = prod (map f m) * prod (map g m)
prod_map_mul
: (
m: Multiset ι
m
.
map: {α : Type ?u.58162} → {β : Type ?u.58161} → (αβ) → Multiset αMultiset β
map
fun
i: ?m.58170
i
=>
f: ια
f
i: ?m.58170
i
*
g: ια
g
i: ?m.58170
i
).
prod: {α : Type ?u.58986} → [inst : CommMonoid α] → Multiset αα
prod
= (
m: Multiset ι
m
.
map: {α : Type ?u.59008} → {β : Type ?u.59007} → (αβ) → Multiset αMultiset β
map
f: ια
f
).
prod: {α : Type ?u.59018} → [inst : CommMonoid α] → Multiset αα
prod
* (
m: Multiset ι
m
.
map: {α : Type ?u.59025} → {β : Type ?u.59024} → (αβ) → Multiset αMultiset β
map
g: ια
g
).
prod: {α : Type ?u.59035} → [inst : CommMonoid α] → Multiset αα
prod
:=
m: Multiset ι
m
.
prod_hom₂: ∀ {ι : Type ?u.59401} {α : Type ?u.59402} {β : Type ?u.59399} {γ : Type ?u.59400} [inst : CommMonoid α] [inst_1 : CommMonoid β] [inst_2 : CommMonoid γ] (s : Multiset ι) (f : αβγ), (∀ (a b : α) (c d : β), f (a * b) (c * d) = f a c * f b d) → f 1 1 = 1∀ (f₁ : ια) (f₂ : ιβ), prod (map (fun i => f (f₁ i) (f₂ i)) s) = f (prod (map f₁ s)) (prod (map f₂ s))
prod_hom₂
(· * ·): ααα
(· * ·)
mul_mul_mul_comm: ∀ {G : Type ?u.59452} [inst : CommSemigroup G] (a b c d : G), a * b * (c * d) = a * c * (b * d)
mul_mul_mul_comm
(
mul_one: ∀ {M : Type ?u.61246} [inst : MulOneClass M] (a : M), a * 1 = a
mul_one
_: ?m.61247
_
)
_: ?m.59416?m.59417
_
_: ?m.59416?m.59418
_
#align multiset.prod_map_mul
Multiset.prod_map_mul: ∀ {ι : Type u_2} {α : Type u_1} [inst : CommMonoid α] {m : Multiset ι} {f g : ια}, prod (map (fun i => f i * g i) m) = prod (map f m) * prod (map g m)
Multiset.prod_map_mul
#align multiset.sum_map_add
Multiset.sum_map_add: ∀ {ι : Type u_2} {α : Type u_1} [inst : AddCommMonoid α] {m : Multiset ι} {f g : ια}, sum (map (fun i => f i + g i) m) = sum (map f m) + sum (map g m)
Multiset.sum_map_add
@[simp] theorem
prod_map_neg: ∀ {α : Type u_1} [inst : CommMonoid α] [inst_1 : HasDistribNeg α] (s : Multiset α), prod (map Neg.neg s) = (-1) ^ card s * prod s
prod_map_neg
[
HasDistribNeg: (α : Type ?u.63367) → [inst : Mul α] → Type ?u.63367
HasDistribNeg
α: Type ?u.63336
α
] (
s: Multiset α
s
:
Multiset: Type ?u.63813 → Type ?u.63813
Multiset
α: Type ?u.63336
α
) : (
s: Multiset α
s
.
map: {α : Type ?u.63818} → {β : Type ?u.63817} → (αβ) → Multiset αMultiset β
map
Neg.neg: {α : Type ?u.63825} → [self : Neg α] → αα
Neg.neg
).
prod: {α : Type ?u.63875} → [inst : CommMonoid α] → Multiset αα
prod
= (-
1: ?m.64368
1
) ^
card: {α : Type ?u.64378} → Multiset α →+
card
s: Multiset α
s
*
s: Multiset α
s
.
prod: {α : Type ?u.65136} → [inst : CommMonoid α] → Multiset αα
prod
:=
Quotient.inductionOn: ∀ {α : Sort ?u.68908} {s : Setoid α} {motive : Quotient sProp} (q : Quotient s), (∀ (a : α), motive (Quotient.mk s a)) → motive q
Quotient.inductionOn
s: Multiset α
s
(

Goals accomplished! 🐙
ι: Type ?u.63333

α: Type u_1

β: Type ?u.63339

γ: Type ?u.63342

inst✝¹: CommMonoid α

s✝, t: Multiset α

a: α

m: Multiset ι

f, g: ια

inst✝: HasDistribNeg α

s: Multiset α


∀ (a : List α), prod (map Neg.neg (Quotient.mk (List.isSetoid α) a)) = (-1) ^ card (Quotient.mk (List.isSetoid α) a) * prod (Quotient.mk (List.isSetoid α) a)

Goals accomplished! 🐙
) #align multiset.prod_map_neg
Multiset.prod_map_neg: ∀ {α : Type u_1} [inst : CommMonoid α] [inst_1 : HasDistribNeg α] (s : Multiset α), prod (map Neg.neg s) = (-1) ^ card s * prod s
Multiset.prod_map_neg
@[
to_additive: ∀ {ι : Type u_2} {α : Type u_1} [inst : AddCommMonoid α] {m : Multiset ι} {f : ια} {n : }, sum (map (fun i => n f i) m) = n sum (map f m)
to_additive
] theorem
prod_map_pow: ∀ {ι : Type u_2} {α : Type u_1} [inst : CommMonoid α] {m : Multiset ι} {f : ια} {n : }, prod (map (fun i => f i ^ n) m) = prod (map f m) ^ n
prod_map_pow
{
n:
n
:
: Type
} : (
m: Multiset ι
m
.
map: {α : Type ?u.70359} → {β : Type ?u.70358} → (αβ) → Multiset αMultiset β
map
fun
i: ?m.70367
i
=>
f: ια
f
i: ?m.70367
i
^
n:
n
).
prod: {α : Type ?u.73125} → [inst : CommMonoid α] → Multiset αα
prod
= (
m: Multiset ι
m
.
map: {α : Type ?u.73147} → {β : Type ?u.73146} → (αβ) → Multiset αMultiset β
map
f: ια
f
).
prod: {α : Type ?u.73157} → [inst : CommMonoid α] → Multiset αα
prod
^
n:
n
:=
m: Multiset ι
m
.
prod_hom': ∀ {ι : Type ?u.75729} {α : Type ?u.75731} {β : Type ?u.75728} [inst : CommMonoid α] [inst_1 : CommMonoid β] (s : Multiset ι) {F : Type ?u.75730} [inst_2 : MonoidHomClass F α β] (f : F) (g : ια), prod (map (fun i => f (g i)) s) = f (prod (map g s))
prod_hom'
(
powMonoidHom: {M : Type ?u.76101} → [inst : CommMonoid M] → M →* M
powMonoidHom
n:
n
:
α: Type ?u.70324
α
→*
α: Type ?u.70324
α
)
f: ια
f
#align multiset.prod_map_pow
Multiset.prod_map_pow: ∀ {ι : Type u_2} {α : Type u_1} [inst : CommMonoid α] {m : Multiset ι} {f : ια} {n : }, prod (map (fun i => f i ^ n) m) = prod (map f m) ^ n
Multiset.prod_map_pow
#align multiset.sum_map_nsmul
Multiset.sum_map_nsmul: ∀ {ι : Type u_2} {α : Type u_1} [inst : AddCommMonoid α] {m : Multiset ι} {f : ια} {n : }, sum (map (fun i => n f i) m) = n sum (map f m)
Multiset.sum_map_nsmul
@[
to_additive: ∀ {α : Type u_3} {β : Type u_1} {γ : Type u_2} [inst : AddCommMonoid α] (m : Multiset β) (n : Multiset γ) {f : βγα}, sum (map (fun a => sum (map (fun b => f a b) n)) m) = sum (map (fun b => sum (map (fun a => f a b) m)) n)
to_additive
] theorem
prod_map_prod_map: ∀ (m : Multiset β) (n : Multiset γ) {f : βγα}, prod (map (fun a => prod (map (fun b => f a b) n)) m) = prod (map (fun b => prod (map (fun a => f a b) m)) n)
prod_map_prod_map
(
m: Multiset β
m
:
Multiset: Type ?u.76278 → Type ?u.76278
Multiset
β: Type ?u.76250
β
) (
n: Multiset γ
n
:
Multiset: Type ?u.76281 → Type ?u.76281
Multiset
γ: Type ?u.76253
γ
) {
f: βγα
f
:
β: Type ?u.76250
β
γ: Type ?u.76253
γ
α: Type ?u.76247
α
} :
prod: {α : Type ?u.76291} → [inst : CommMonoid α] → Multiset αα
prod
(
m: Multiset β
m
.
map: {α : Type ?u.76295} → {β : Type ?u.76294} → (αβ) → Multiset αMultiset β
map
fun
a: ?m.76304
a
=>
prod: {α : Type ?u.76306} → [inst : CommMonoid α] → Multiset αα
prod
<|
n: Multiset γ
n
.
map: {α : Type ?u.76327} → {β : Type ?u.76326} → (αβ) → Multiset αMultiset β
map
fun
b: ?m.76337
b
=>
f: βγα
f
a: ?m.76304
a
b: ?m.76337
b
) =
prod: {α : Type ?u.76359} → [inst : CommMonoid α] → Multiset αα
prod
(
n: Multiset γ
n
.
map: {α : Type ?u.76363} → {β : Type ?u.76362} → (αβ) → Multiset αMultiset β
map
fun
b: ?m.76372
b
=>
prod: {α : Type ?u.76374} → [inst : CommMonoid α] → Multiset αα
prod
<|
m: Multiset β
m
.
map: {α : Type ?u.76395} → {β : Type ?u.76394} → (αβ) → Multiset αMultiset β
map
fun
a: ?m.76405
a
=>
f: βγα
f
a: ?m.76405
a
b: ?m.76372
b
) :=
Multiset.induction_on: ∀ {α : Type ?u.76416} {p : Multiset αProp} (s : Multiset α), p 0(∀ ⦃a : α⦄ {s : Multiset α}, p sp (a ::ₘ s)) → p s
Multiset.induction_on
m: Multiset β
m
(

Goals accomplished! 🐙
ι: Type ?u.76244

α: Type u_3

β: Type u_1

γ: Type u_2

inst✝: CommMonoid α

s, t: Multiset α

a: α

m✝: Multiset ι

f✝, g: ια

m: Multiset β

n: Multiset γ

f: βγα


prod (map (fun a => prod (map (fun b => f a b) n)) 0) = prod (map (fun b => prod (map (fun a => f a b) 0)) n)

Goals accomplished! 🐙
) fun
a: ?m.76448
a
m: ?m.76451
m
ih: ?m.76454
ih
=>

Goals accomplished! 🐙
ι: Type ?u.76244

α: Type u_3

β: Type u_1

γ: Type u_2

inst✝: CommMonoid α

s, t: Multiset α

a✝: α

m✝¹: Multiset ι

f✝, g: ια

m✝: Multiset β

n: Multiset γ

f: βγα

a: β

m: Multiset β

ih: prod (map (fun a => prod (map (fun b => f a b) n)) m) = prod (map (fun b => prod (map (fun a => f a b) m)) n)


prod (map (fun a => prod (map (fun b => f a b) n)) (a ::ₘ m)) = prod (map (fun b => prod (map (fun a => f a b) (a ::ₘ m))) n)

Goals accomplished! 🐙
#align multiset.prod_map_prod_map
Multiset.prod_map_prod_map: ∀ {α : Type u_3} {β : Type u_1} {γ : Type u_2} [inst : CommMonoid α] (m : Multiset β) (n : Multiset γ) {f : βγα}, prod (map (fun a => prod (map (fun b => f a b) n)) m) = prod (map (fun b => prod (map (fun a => f a b) m)) n)
Multiset.prod_map_prod_map
#align multiset.sum_map_sum_map
Multiset.sum_map_sum_map: ∀ {α : Type u_3} {β : Type u_1} {γ : Type u_2} [inst : AddCommMonoid α] (m : Multiset β) (n : Multiset γ) {f : βγα}, sum (map (fun a => sum (map (fun b => f a b) n)) m) = sum (map (fun b => sum (map (fun a => f a b) m)) n)
Multiset.sum_map_sum_map
@[
to_additive: ∀ {α : Type u_1} [inst : AddCommMonoid α] (p : αProp) (s : Multiset α), (∀ (a b : α), p ap bp (a + b)) → p 0(∀ (a : α), a sp a) → p (sum s)
to_additive
] theorem
prod_induction: ∀ {α : Type u_1} [inst : CommMonoid α] (p : αProp) (s : Multiset α), (∀ (a b : α), p ap bp (a * b)) → p 1(∀ (a : α), a sp a) → p (prod s)
prod_induction
(
p: αProp
p
:
α: Type ?u.79717
α
Prop: Type
Prop
) (
s: Multiset α
s
:
Multiset: Type ?u.79752 → Type ?u.79752
Multiset
α: Type ?u.79717
α
) (
p_mul: ∀ (a b : α), p ap bp (a * b)
p_mul
: ∀
a: ?m.79756
a
b: ?m.79759
b
,
p: αProp
p
a: ?m.79756
a
p: αProp
p
b: ?m.79759
b
p: αProp
p
(
a: ?m.79756
a
*
b: ?m.79759
b
)) (
p_one: p 1
p_one
:
p: αProp
p
1: ?m.80580
1
) (
p_s: ∀ (a : α), a sp a
p_s
: ∀
a: ?m.80915
a
s: Multiset α
s
,
p: αProp
p
a: ?m.80915
a
) :
p: αProp
p
s: Multiset α
s
.
prod: {α : Type ?u.80950} → [inst : CommMonoid α] → Multiset αα
prod
:=

Goals accomplished! 🐙
ι: Type ?u.79714

α: Type u_1

β: Type ?u.79720

γ: Type ?u.79723

inst✝: CommMonoid α

s✝, t: Multiset α

a: α

m: Multiset ι

f, g: ια

p: αProp

s: Multiset α

p_mul: ∀ (a b : α), p ap bp (a * b)

p_one: p 1

p_s: ∀ (a : α), a sp a


p (prod s)
ι: Type ?u.79714

α: Type u_1

β: Type ?u.79720

γ: Type ?u.79723

inst✝: CommMonoid α

s✝, t: Multiset α

a: α

m: Multiset ι

f, g: ια

p: αProp

s: Multiset α

p_mul: ∀ (a b : α), p ap bp (a * b)

p_one: p 1

p_s: ∀ (a : α), a sp a


p (prod s)
ι: Type ?u.79714

α: Type u_1

β: Type ?u.79720

γ: Type ?u.79723

inst✝: CommMonoid α

s✝, t: Multiset α

a: α

m: Multiset ι

f, g: ια

p: αProp

s: Multiset α

p_mul: ∀ (a b : α), p ap bp (a * b)

p_one: p 1

p_s: ∀ (a : α), a sp a


p (foldr (fun x x_1 => x * x_1) (_ : ∀ (x y z : α), x * (y * z) = y * (x * z)) 1 s)
ι: Type ?u.79714

α: Type u_1

β: Type ?u.79720

γ: Type ?u.79723

inst✝: CommMonoid α

s✝, t: Multiset α

a: α

m: Multiset ι

f, g: ια

p: αProp

s: Multiset α

p_mul: ∀ (a b : α), p ap bp (a * b)

p_one: p 1

p_s: ∀ (a : α), a sp a


p (foldr (fun x x_1 => x * x_1) (_ : ∀ (x y z : α), x * (y * z) = y * (x * z)) 1 s)
ι: Type ?u.79714

α: Type u_1

β: Type ?u.79720

γ: Type ?u.79723

inst✝: CommMonoid α

s✝, t: Multiset α

a: α

m: Multiset ι

f, g: ια

p: αProp

s: Multiset α

p_mul: ∀ (a b : α), p ap bp (a * b)

p_one: p 1

p_s: ∀ (a : α), a sp a


p (prod s)
ι: Type ?u.79714

α: Type u_1

β: Type ?u.79720

γ: Type ?u.79723

inst✝: CommMonoid α

s✝, t: Multiset α

a: α

m: Multiset ι

f, g: ια

p: αProp

s: Multiset α

p_mul: ∀ (a b : α), p ap bp (a * b)

p_one: p 1

p_s: ∀ (a : α), a sp a


p (foldr (fun x x_1 => x * x_1) (_ : ∀ (x y z : α), x * (y * z) = y * (x * z)) 1 s)

Goals accomplished! 🐙
ι: Type ?u.79714

α: Type u_1

β: Type ?u.79720

γ: Type ?u.79723

inst✝: CommMonoid α

s✝, t: Multiset α

a: α

m: Multiset ι

f, g: ια

p: αProp

s: Multiset α

p_mul: ∀ (a b : α), p ap bp (a * b)

p_one: p 1

p_s: ∀ (a : α), a sp a

x, y, z: α


(fun x x_1 => x * x_1) x ((fun x x_1 => x * x_1) y z) = (fun x x_1 => x * x_1) y ((fun x x_1 => x * x_1) x z)

Goals accomplished! 🐙

Goals accomplished! 🐙
#align multiset.prod_induction
Multiset.prod_induction: ∀ {α : Type u_1} [inst : CommMonoid α] (p : αProp) (s : Multiset α), (∀ (a b : α), p ap bp (a * b)) → p 1(∀ (a : α), a sp a) → p (prod s)
Multiset.prod_induction
#align multiset.sum_induction
Multiset.sum_induction: ∀ {α : Type u_1} [inst : AddCommMonoid α] (p : αProp) (s : Multiset α), (∀ (a b : α), p ap bp (a + b)) → p 0(∀ (a : α), a sp a) → p (sum s)
Multiset.sum_induction
@[
to_additive: ∀ {α : Type u_1} [inst : AddCommMonoid α] {s : Multiset α} (p : αProp), (∀ (a b : α), p ap bp (a + b)) → s (∀ (a : α), a sp a) → p (sum s)
to_additive
] theorem
prod_induction_nonempty: ∀ {α : Type u_1} [inst : CommMonoid α] {s : Multiset α} (p : αProp), (∀ (a b : α), p ap bp (a * b)) → s (∀ (a : α), a sp a) → p (prod s)
prod_induction_nonempty
(
p: αProp
p
:
α: Type ?u.82612
α
Prop: Type
Prop
) (
p_mul: ∀ (a b : α), p ap bp (a * b)
p_mul
: ∀
a: ?m.82648
a
b: ?m.82651
b
,
p: αProp
p
a: ?m.82648
a
p: αProp
p
b: ?m.82651
b
p: αProp
p
(
a: ?m.82648
a
*
b: ?m.82651
b
)) (
hs: s
hs
:
s: Multiset α
s
: ?m.83475
) (
p_s: ∀ (a : α), a sp a
p_s
: ∀
a: ?m.83521
a
s: Multiset α
s
,
p: αProp
p
a: ?m.83521
a
) :
p: αProp
p
s: Multiset α
s
.
prod: {α : Type ?u.83554} → [inst : CommMonoid α] → Multiset αα
prod
:=

Goals accomplished! 🐙
ι: Type ?u.82609

α: Type u_1

β: Type ?u.82615

γ: Type ?u.82618

inst✝: CommMonoid α

s, t: Multiset α

a: α

m: Multiset ι

f, g: ια

p: αProp

p_mul: ∀ (a b : α), p ap bp (a * b)

hs: s

p_s: ∀ (a : α), a sp a


p (prod s)
ι: Type ?u.82609

α: Type u_1

β: Type ?u.82615

γ: Type ?u.82618

inst✝: CommMonoid α

s, t: Multiset α

a: α

m: Multiset ι

f, g: ια

p: αProp

p_mul: ∀ (a b : α), p ap bp (a * b)

hs✝: s

p_s✝: ∀ (a : α), a sp a

hs: 0

p_s: ∀ (a : α), a 0p a


empty
p (prod 0)
ι: Type ?u.82609

α: Type u_1

β: Type ?u.82615

γ: Type ?u.82618

inst✝