The Mathlib Handbook

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

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

Mathlib.Data.Finset.NoncommProd

82 declarations. Mathlib docs · Source

Products (respectively, sums) over a finset or a multiset.

The regular Finset.prod and Multiset.prod require [CommMonoid α]. Often, there are collections s : Finset α where [Monoid α] and we know, in a dependent fashion, that for all the terms ∀ (x ∈ s) (y ∈ s), Commute x y. This allows to still have a well-defined product over s.

Main definitions

  • Finset.noncommProd, requiring a proof of commutativity of held terms
  • Multiset.noncommProd, requiring a proof of commutativity of held terms

Implementation notes

While List.prod is defined via List.foldl, noncommProd is defined via Multiset.foldr for neater proofs and definitions. By the commutativity assumption, the two must be equal.

TODO: Tidy up this file by using the fact that the submonoid generated by commuting elements is commutative and using the Finset.prod versions of lemmas to prove the noncommProd version.

theorem Finset.noncommProd.congr_simp E1 #

∀ {α : Type u_3} {β : Type u_4} [inst : Monoid β] (s s_1 : Finset α) (e_s : s = s_1) (f f_1 : α → β) (e_f : f = f_1)
  (comm : (↑s).Pairwise (Function.onFun Commute f)), s.noncommProd f comm = s_1.noncommProd f_1 ⋯

theorem Multiset.noncommProd.congr_simp E1 #

∀ {α : Type u_3} [inst : Monoid α] (s s_1 : Multiset α) (e_s : s = s_1) (comm : {x | x ∈ s}.Pairwise Commute),
  s.noncommProd comm = s_1.noncommProd ⋯

theorem Multiset.noncommFold.congr_simp E1 #

∀ {α : Type u_3} (op op_1 : α → α → α) (e_op : op = op_1) [assoc : Std.Associative op] (s s_1 : Multiset α)
  (e_s : s = s_1) (comm : {x | x ∈ s}.Pairwise fun x y ↦ op x y = op y x) (a a_1 : α),
  a = a_1 → Multiset.noncommFold op s comm a = Multiset.noncommFold op_1 s_1 ⋯ a_1

theorem Multiset.noncommFoldr.congr_simp E1 #

∀ {α : Type u_3} {β : Type u_4} (f f_1 : α → β → β) (e_f : f = f_1) (s s_1 : Multiset α) (e_s : s = s_1)
  (comm : {x | x ∈ s}.Pairwise fun x y ↦ ∀ (b : β), f x (f y b) = f y (f x b)) (b b_1 : β),
  b = b_1 → Multiset.noncommFoldr f s comm b = Multiset.noncommFoldr f_1 s_1 ⋯ b_1

def Multiset.noncommFoldr E1 #

{α : Type u_3} →
  {β : Type u_4} →
    (f : α → β → β) → (s : Multiset α) → ({x | x ∈ s}.Pairwise fun x y ↦ ∀ (b : β), f x (f y b) = f y (f x b)) → β → β

Fold of a s : Multiset α with f : α → β → β, given a proof that LeftCommutative f on all elements x ∈ s.

theorem Multiset.noncommFoldr_coe E0 #

∀ {α : Type u_3} {β : Type u_4} (f : α → β → β) (l : List α)
  (comm : {x | x ∈ ↑l}.Pairwise fun x y ↦ ∀ (b : β), f x (f y b) = f y (f x b)) (b : β),
  Multiset.noncommFoldr f (↑l) comm b = List.foldr f b l

theorem Multiset.noncommFoldr_empty E0 #

∀ {α : Type u_3} {β : Type u_4} (f : α → β → β)
  (h : {x | x ∈ 0}.Pairwise fun x y ↦ ∀ (b : β), f x (f y b) = f y (f x b)) (b : β), Multiset.noncommFoldr f 0 h b = b

theorem Multiset.noncommFoldr_cons E1 #

∀ {α : Type u_3} {β : Type u_4} (f : α → β → β) (s : Multiset α) (a : α)
  (h : {x | x ∈ a ::ₘ s}.Pairwise fun x y ↦ ∀ (b : β), f x (f y b) = f y (f x b))
  (h' : {x | x ∈ s}.Pairwise fun x y ↦ ∀ (b : β), f x (f y b) = f y (f x b)) (b : β),
  Multiset.noncommFoldr f (a ::ₘ s) h b = f a (Multiset.noncommFoldr f s h' b)

theorem Multiset.noncommFoldr_eq_foldr E1 #

∀ {α : Type u_3} {β : Type u_4} (f : α → β → β) (s : Multiset α) [h : LeftCommutative f] (b : β),
  Multiset.noncommFoldr f s ⋯ b = Multiset.foldr f b s

def Multiset.noncommFold E1 #

{α : Type u_3} →
  (op : α → α → α) →
    [assoc : Std.Associative op] → (s : Multiset α) → ({x | x ∈ s}.Pairwise fun x y ↦ op x y = op y x) → α → α

Fold of a s : Multiset α with an associative op : α → α → α, given a proofs that op is commutative on all elements x ∈ s.

theorem Multiset.noncommFold_coe E0 #

∀ {α : Type u_3} (op : α → α → α) [assoc : Std.Associative op] (l : List α)
  (comm : {x | x ∈ ↑l}.Pairwise fun x y ↦ op x y = op y x) (a : α),
  Multiset.noncommFold op (↑l) comm a = List.foldr op a l

theorem Multiset.noncommFold_empty E0 #

∀ {α : Type u_3} (op : α → α → α) [assoc : Std.Associative op] (h : {x | x ∈ 0}.Pairwise fun x y ↦ op x y = op y x)
  (a : α), Multiset.noncommFold op 0 h a = a

theorem Multiset.noncommFold_cons E1 #

∀ {α : Type u_3} (op : α → α → α) [assoc : Std.Associative op] (s : Multiset α) (a : α)
  (h : {x | x ∈ a ::ₘ s}.Pairwise fun x y ↦ op x y = op y x) (h' : {x | x ∈ s}.Pairwise fun x y ↦ op x y = op y x)
  (x : α), Multiset.noncommFold op (a ::ₘ s) h x = op a (Multiset.noncommFold op s h' x)

theorem Multiset.noncommFold_eq_fold E1 #

∀ {α : Type u_3} (op : α → α → α) [assoc : Std.Associative op] (s : Multiset α) [inst : Std.Commutative op] (a : α),
  Multiset.noncommFold op s ⋯ a = Multiset.fold op a s

def Multiset.noncommProd E3 #

{α : Type u_3} → [inst : Monoid α] → (s : Multiset α) → {x | x ∈ s}.Pairwise Commute → α

Product of a s : Multiset α with [Monoid α], given a proof that * commutes on all elements x ∈ s.

def Multiset.noncommSum E1 #

{α : Type u_3} → [inst : AddMonoid α] → (s : Multiset α) → {x | x ∈ s}.Pairwise AddCommute → α

Sum of a s : Multiset α with [AddMonoid α], given a proof that + commutes on all elements x ∈ s.

theorem Multiset.noncommProd_coe E0 #

∀ {α : Type u_3} [inst : Monoid α] (l : List α) (comm : {x | x ∈ ↑l}.Pairwise Commute), (↑l).noncommProd comm = l.prod

theorem Multiset.noncommSum_coe E0 #

∀ {α : Type u_3} [inst : AddMonoid α] (l : List α) (comm : {x | x ∈ ↑l}.Pairwise AddCommute),
  (↑l).noncommSum comm = l.sum

theorem Multiset.noncommSum_empty E0 #

∀ {α : Type u_3} [inst : AddMonoid α] (h : {x | x ∈ 0}.Pairwise AddCommute), Multiset.noncommSum 0 h = 0

theorem Multiset.noncommProd_empty E0 #

∀ {α : Type u_3} [inst : Monoid α] (h : {x | x ∈ 0}.Pairwise Commute), Multiset.noncommProd 0 h = 1

theorem Multiset.noncommProd_cons E0 #

∀ {α : Type u_3} [inst : Monoid α] (s : Multiset α) (a : α) (comm : {x | x ∈ a ::ₘ s}.Pairwise Commute),
  (a ::ₘ s).noncommProd comm = a * s.noncommProd ⋯

theorem Multiset.noncommSum_cons E0 #

∀ {α : Type u_3} [inst : AddMonoid α] (s : Multiset α) (a : α) (comm : {x | x ∈ a ::ₘ s}.Pairwise AddCommute),
  (a ::ₘ s).noncommSum comm = a + s.noncommSum ⋯

theorem Multiset.noncommSum_cons' E1 #

∀ {α : Type u_3} [inst : AddMonoid α] (s : Multiset α) (a : α) (comm : {x | x ∈ a ::ₘ s}.Pairwise AddCommute),
  (a ::ₘ s).noncommSum comm = s.noncommSum ⋯ + a

theorem Multiset.noncommProd_cons' E1 #

∀ {α : Type u_3} [inst : Monoid α] (s : Multiset α) (a : α) (comm : {x | x ∈ a ::ₘ s}.Pairwise Commute),
  (a ::ₘ s).noncommProd comm = s.noncommProd ⋯ * a

theorem Multiset.noncommProd_add E1 #

∀ {α : Type u_3} [inst : Monoid α] (s t : Multiset α) (comm : {x | x ∈ s + t}.Pairwise Commute),
  (s + t).noncommProd comm = s.noncommProd ⋯ * t.noncommProd ⋯

theorem Multiset.noncommSum_add E1 #

∀ {α : Type u_3} [inst : AddMonoid α] (s t : Multiset α) (comm : {x | x ∈ s + t}.Pairwise AddCommute),
  (s + t).noncommSum comm = s.noncommSum ⋯ + t.noncommSum ⋯

theorem Multiset.noncommProd_induction E1 #

∀ {α : Type u_3} [inst : Monoid α] (s : Multiset α) (comm : {x | x ∈ s}.Pairwise Commute) (p : α → Prop),
  (∀ (a b : α), p a → p b → p (a * b)) → p 1 → (∀ x ∈ s, p x) → p (s.noncommProd comm)

theorem Multiset.noncommSum_induction E1 #

∀ {α : Type u_3} [inst : AddMonoid α] (s : Multiset α) (comm : {x | x ∈ s}.Pairwise AddCommute) (p : α → Prop),
  (∀ (a b : α), p a → p b → p (a + b)) → p 0 → (∀ x ∈ s, p x) → p (s.noncommSum comm)

theorem Multiset.map_noncommProd_aux E0 #

∀ {F : Type u_1} {α : Type u_3} {β : Type u_4} [inst : Monoid α] [inst_1 : Monoid β] [inst_2 : FunLike F α β]
  [MulHomClass F α β] (s : Multiset α),
  {x | x ∈ s}.Pairwise Commute → ∀ (f : F), {x | x ∈ Multiset.map (⇑f) s}.Pairwise Commute

theorem Multiset.map_noncommSum_aux E0 #

∀ {F : Type u_1} {α : Type u_3} {β : Type u_4} [inst : AddMonoid α] [inst_1 : AddMonoid β] [inst_2 : FunLike F α β]
  [AddHomClass F α β] (s : Multiset α),
  {x | x ∈ s}.Pairwise AddCommute → ∀ (f : F), {x | x ∈ Multiset.map (⇑f) s}.Pairwise AddCommute

theorem Multiset.map_noncommProd E0 #

∀ {F : Type u_1} {α : Type u_3} {β : Type u_4} [inst : Monoid α] [inst_1 : Monoid β] [inst_2 : FunLike F α β]
  [inst_3 : MonoidHomClass F α β] (s : Multiset α) (comm : {x | x ∈ s}.Pairwise Commute) (f : F),
  f (s.noncommProd comm) = (Multiset.map (⇑f) s).noncommProd ⋯

theorem Multiset.map_noncommSum E0 #

∀ {F : Type u_1} {α : Type u_3} {β : Type u_4} [inst : AddMonoid α] [inst_1 : AddMonoid β] [inst_2 : FunLike F α β]
  [inst_3 : AddMonoidHomClass F α β] (s : Multiset α) (comm : {x | x ∈ s}.Pairwise AddCommute) (f : F),
  f (s.noncommSum comm) = (Multiset.map (⇑f) s).noncommSum ⋯

theorem Multiset.noncommSum_eq_card_nsmul E1 #

∀ {α : Type u_3} [inst : AddMonoid α] (s : Multiset α) (comm : {x | x ∈ s}.Pairwise AddCommute) (m : α),
  (∀ x ∈ s, x = m) → s.noncommSum comm = s.card • m

theorem Multiset.noncommProd_eq_pow_card E1 #

∀ {α : Type u_3} [inst : Monoid α] (s : Multiset α) (comm : {x | x ∈ s}.Pairwise Commute) (m : α),
  (∀ x ∈ s, x = m) → s.noncommProd comm = m ^ s.card

theorem Multiset.noncommProd_eq_prod E1 #

∀ {α : Type u_6} [inst : CommMonoid α] (s : Multiset α), s.noncommProd ⋯ = s.prod

theorem Multiset.noncommSum_eq_sum E1 #

∀ {α : Type u_6} [inst : AddCommMonoid α] (s : Multiset α), s.noncommSum ⋯ = s.sum

theorem Multiset.noncommProd_commute E1 #

∀ {α : Type u_3} [inst : Monoid α] (s : Multiset α) (comm : {x | x ∈ s}.Pairwise Commute) (y : α),
  (∀ x ∈ s, Commute y x) → Commute y (s.noncommProd comm)

theorem Multiset.noncommSum_addCommute E1 #

∀ {α : Type u_3} [inst : AddMonoid α] (s : Multiset α) (comm : {x | x ∈ s}.Pairwise AddCommute) (y : α),
  (∀ x ∈ s, AddCommute y x) → AddCommute y (s.noncommSum comm)

theorem Multiset.mul_noncommProd_erase E1 #

∀ {α : Type u_3} [inst : Monoid α] [inst_1 : DecidableEq α] (s : Multiset α) {a : α},
  a ∈ s →
    ∀ (comm : {x | x ∈ s}.Pairwise Commute)
      (comm' : optParam (∀ x ∈ {x | x ∈ s.erase a}, ∀ x_1 ∈ {x | x ∈ s.erase a}, x ≠ x_1 → Commute x x_1) ⋯),
      a * (s.erase a).noncommProd comm' = s.noncommProd comm

theorem Multiset.noncommProd_erase_mul E1 #

∀ {α : Type u_3} [inst : Monoid α] [inst_1 : DecidableEq α] (s : Multiset α) {a : α},
  a ∈ s →
    ∀ (comm : {x | x ∈ s}.Pairwise Commute)
      (comm' : optParam (∀ x ∈ {x | x ∈ s.erase a}, ∀ x_1 ∈ {x | x ∈ s.erase a}, x ≠ x_1 → Commute x x_1) ⋯),
      (s.erase a).noncommProd comm' * a = s.noncommProd comm

theorem Finset.noncommProd_lemma E1 #

∀ {α : Type u_3} {β : Type u_4} [inst : Monoid β] (s : Finset α) (f : α → β),
  (↑s).Pairwise (Function.onFun Commute f) → {x | x ∈ Multiset.map f s.val}.Pairwise Commute

Proof used in definition of Finset.noncommProd

theorem Finset.noncommSum_lemma E1 #

∀ {α : Type u_3} {β : Type u_4} [inst : AddMonoid β] (s : Finset α) (f : α → β),
  (↑s).Pairwise (Function.onFun AddCommute f) → {x | x ∈ Multiset.map f s.val}.Pairwise AddCommute

Proof used in definition of Finset.noncommSum

def Finset.noncommProd E3 #

{α : Type u_3} →
  {β : Type u_4} → [inst : Monoid β] → (s : Finset α) → (f : α → β) → (↑s).Pairwise (Function.onFun Commute f) → β

Product of a s : Finset α mapped with f : α → β with [Monoid β], given a proof that * commutes on all elements f x for x ∈ s.

def Finset.noncommSum E1 #

{α : Type u_3} →
  {β : Type u_4} → [inst : AddMonoid β] → (s : Finset α) → (f : α → β) → (↑s).Pairwise (Function.onFun AddCommute f) → β

Sum of a s : Finset α mapped with f : α → β with [AddMonoid β], given a proof that + commutes on all elements f x for x ∈ s.

theorem Finset.noncommProd_induction E1 #

∀ {α : Type u_3} {β : Type u_4} [inst : Monoid β] (s : Finset α) (f : α → β)
  (comm : (↑s).Pairwise (Function.onFun Commute f)) (p : β → Prop),
  (∀ (a b : β), p a → p b → p (a * b)) → p 1 → (∀ x ∈ s, p (f x)) → p (s.noncommProd f comm)

theorem Finset.noncommSum_induction E1 #

∀ {α : Type u_3} {β : Type u_4} [inst : AddMonoid β] (s : Finset α) (f : α → β)
  (comm : (↑s).Pairwise (Function.onFun AddCommute f)) (p : β → Prop),
  (∀ (a b : β), p a → p b → p (a + b)) → p 0 → (∀ x ∈ s, p (f x)) → p (s.noncommSum f comm)

theorem Finset.noncommSum_congr E1 #

∀ {α : Type u_3} {β : Type u_4} [inst : AddMonoid β] {s₁ s₂ : Finset α} {f g : α → β} (h₁ : s₁ = s₂)
  (h₂ : ∀ x ∈ s₂, f x = g x) (comm : (↑s₁).Pairwise (Function.onFun AddCommute f)),
  s₁.noncommSum f comm = s₂.noncommSum g ⋯

theorem Finset.noncommProd_congr E1 #

∀ {α : Type u_3} {β : Type u_4} [inst : Monoid β] {s₁ s₂ : Finset α} {f g : α → β} (h₁ : s₁ = s₂)
  (h₂ : ∀ x ∈ s₂, f x = g x) (comm : (↑s₁).Pairwise (Function.onFun Commute f)),
  s₁.noncommProd f comm = s₂.noncommProd g ⋯

theorem Finset.noncommProd_toFinset E0 #

∀ {α : Type u_3} {β : Type u_4} [inst : Monoid β] [inst_1 : DecidableEq α] (l : List α) (f : α → β)
  (comm : (↑l.toFinset).Pairwise (Function.onFun Commute f)),
  l.Nodup → l.toFinset.noncommProd f comm = (List.map f l).prod

theorem Finset.noncommSum_toFinset E0 #

∀ {α : Type u_3} {β : Type u_4} [inst : AddMonoid β] [inst_1 : DecidableEq α] (l : List α) (f : α → β)
  (comm : (↑l.toFinset).Pairwise (Function.onFun AddCommute f)),
  l.Nodup → l.toFinset.noncommSum f comm = (List.map f l).sum

theorem Finset.noncommProd_empty E0 #

∀ {α : Type u_3} {β : Type u_4} [inst : Monoid β] (f : α → β) (h : (↑∅).Pairwise (Function.onFun Commute f)),
  ∅.noncommProd f h = 1

theorem Finset.noncommSum_empty E0 #

∀ {α : Type u_3} {β : Type u_4} [inst : AddMonoid β] (f : α → β) (h : (↑∅).Pairwise (Function.onFun AddCommute f)),
  ∅.noncommSum f h = 0

theorem Finset.noncommSum_cons E0 #

∀ {α : Type u_3} {β : Type u_4} [inst : AddMonoid β] (s : Finset α) (a : α) (f : α → β) (ha : a ∉ s)
  (comm : (↑(Finset.cons a s ha)).Pairwise (Function.onFun AddCommute f)),
  (Finset.cons a s ha).noncommSum f comm = f a + s.noncommSum f ⋯

theorem Finset.noncommProd_cons E0 #

∀ {α : Type u_3} {β : Type u_4} [inst : Monoid β] (s : Finset α) (a : α) (f : α → β) (ha : a ∉ s)
  (comm : (↑(Finset.cons a s ha)).Pairwise (Function.onFun Commute f)),
  (Finset.cons a s ha).noncommProd f comm = f a * s.noncommProd f ⋯

theorem Finset.noncommProd_cons' E1 #

∀ {α : Type u_3} {β : Type u_4} [inst : Monoid β] (s : Finset α) (a : α) (f : α → β) (ha : a ∉ s)
  (comm : (↑(Finset.cons a s ha)).Pairwise (Function.onFun Commute f)),
  (Finset.cons a s ha).noncommProd f comm = s.noncommProd f ⋯ * f a

theorem Finset.noncommSum_cons' E1 #

∀ {α : Type u_3} {β : Type u_4} [inst : AddMonoid β] (s : Finset α) (a : α) (f : α → β) (ha : a ∉ s)
  (comm : (↑(Finset.cons a s ha)).Pairwise (Function.onFun AddCommute f)),
  (Finset.cons a s ha).noncommSum f comm = s.noncommSum f ⋯ + f a

theorem Finset.noncommSum_insert_of_notMem E0 #

∀ {α : Type u_3} {β : Type u_4} [inst : AddMonoid β] [inst_1 : DecidableEq α] (s : Finset α) (a : α) (f : α → β)
  (comm : (↑(insert a s)).Pairwise (Function.onFun AddCommute f)),
  a ∉ s → (insert a s).noncommSum f comm = f a + s.noncommSum f ⋯

theorem Finset.noncommProd_insert_of_notMem E0 #

∀ {α : Type u_3} {β : Type u_4} [inst : Monoid β] [inst_1 : DecidableEq α] (s : Finset α) (a : α) (f : α → β)
  (comm : (↑(insert a s)).Pairwise (Function.onFun Commute f)),
  a ∉ s → (insert a s).noncommProd f comm = f a * s.noncommProd f ⋯

theorem Finset.noncommSum_insert_of_notMem' E1 #

∀ {α : Type u_3} {β : Type u_4} [inst : AddMonoid β] [inst_1 : DecidableEq α] (s : Finset α) (a : α) (f : α → β)
  (comm : (↑(insert a s)).Pairwise (Function.onFun AddCommute f)),
  a ∉ s → (insert a s).noncommSum f comm = s.noncommSum f ⋯ + f a

theorem Finset.noncommProd_insert_of_notMem' E1 #

∀ {α : Type u_3} {β : Type u_4} [inst : Monoid β] [inst_1 : DecidableEq α] (s : Finset α) (a : α) (f : α → β)
  (comm : (↑(insert a s)).Pairwise (Function.onFun Commute f)),
  a ∉ s → (insert a s).noncommProd f comm = s.noncommProd f ⋯ * f a

theorem Finset.noncommSum_singleton E0 #

∀ {α : Type u_3} {β : Type u_4} [inst : AddMonoid β] (a : α) (f : α → β), {a}.noncommSum f ⋯ = f a

theorem Finset.noncommProd_singleton E0 #

∀ {α : Type u_3} {β : Type u_4} [inst : Monoid β] (a : α) (f : α → β), {a}.noncommProd f ⋯ = f a

theorem Finset.map_noncommProd E0 #

∀ {F : Type u_1} {α : Type u_3} {β : Type u_4} {γ : Type u_5} [inst : Monoid β] [inst_1 : Monoid γ]
  [inst_2 : FunLike F β γ] [inst_3 : MonoidHomClass F β γ] (s : Finset α) (f : α → β)
  (comm : (↑s).Pairwise (Function.onFun Commute f)) (g : F),
  g (s.noncommProd f comm) = s.noncommProd (fun i ↦ g (f i)) ⋯

theorem Finset.map_noncommSum E0 #

∀ {F : Type u_1} {α : Type u_3} {β : Type u_4} {γ : Type u_5} [inst : AddMonoid β] [inst_1 : AddMonoid γ]
  [inst_2 : FunLike F β γ] [inst_3 : AddMonoidHomClass F β γ] (s : Finset α) (f : α → β)
  (comm : (↑s).Pairwise (Function.onFun AddCommute f)) (g : F),
  g (s.noncommSum f comm) = s.noncommSum (fun i ↦ g (f i)) ⋯

theorem Finset.noncommSum_eq_card_nsmul E1 #

∀ {α : Type u_3} {β : Type u_4} [inst : AddMonoid β] (s : Finset α) (f : α → β)
  (comm : (↑s).Pairwise (Function.onFun AddCommute f)) (m : β), (∀ x ∈ s, f x = m) → s.noncommSum f comm = s.card • m

theorem Finset.noncommProd_eq_pow_card E1 #

∀ {α : Type u_3} {β : Type u_4} [inst : Monoid β] (s : Finset α) (f : α → β)
  (comm : (↑s).Pairwise (Function.onFun Commute f)) (m : β), (∀ x ∈ s, f x = m) → s.noncommProd f comm = m ^ s.card

theorem Finset.noncommSum_addCommute E1 #

∀ {α : Type u_3} {β : Type u_4} [inst : AddMonoid β] (s : Finset α) (f : α → β)
  (comm : (↑s).Pairwise (Function.onFun AddCommute f)) (y : β),
  (∀ x ∈ s, AddCommute y (f x)) → AddCommute y (s.noncommSum f comm)

theorem Finset.noncommProd_commute E1 #

∀ {α : Type u_3} {β : Type u_4} [inst : Monoid β] (s : Finset α) (f : α → β)
  (comm : (↑s).Pairwise (Function.onFun Commute f)) (y : β),
  (∀ x ∈ s, Commute y (f x)) → Commute y (s.noncommProd f comm)

theorem Finset.mul_noncommProd_erase E1 #

∀ {α : Type u_3} {β : Type u_4} [inst : Monoid β] [inst_1 : DecidableEq α] (s : Finset α) {a : α},
  a ∈ s →
    ∀ (f : α → β) (comm : (↑s).Pairwise (Function.onFun Commute f))
      (comm' : optParam (∀ x ∈ ↑(s.erase a), ∀ x_1 ∈ ↑(s.erase a), x ≠ x_1 → Function.onFun Commute f x x_1) ⋯),
      f a * (s.erase a).noncommProd f comm' = s.noncommProd f comm

theorem Finset.noncommProd_erase_mul E1 #

∀ {α : Type u_3} {β : Type u_4} [inst : Monoid β] [inst_1 : DecidableEq α] (s : Finset α) {a : α},
  a ∈ s →
    ∀ (f : α → β) (comm : (↑s).Pairwise (Function.onFun Commute f))
      (comm' : optParam (∀ x ∈ ↑(s.erase a), ∀ x_1 ∈ ↑(s.erase a), x ≠ x_1 → Function.onFun Commute f x x_1) ⋯),
      (s.erase a).noncommProd f comm' * f a = s.noncommProd f comm

theorem Finset.noncommProd_eq_prod E1 #

∀ {α : Type u_3} {β : Type u_6} [inst : CommMonoid β] (s : Finset α) (f : α → β), s.noncommProd f ⋯ = s.prod f

theorem Finset.noncommSum_eq_sum E1 #

∀ {α : Type u_3} {β : Type u_6} [inst : AddCommMonoid β] (s : Finset α) (f : α → β), s.noncommSum f ⋯ = s.sum f

theorem Finset.noncommProd_union_of_disjoint E1 #

∀ {α : Type u_3} {β : Type u_4} [inst : Monoid β] [inst_1 : DecidableEq α] {s t : Finset α},
  Disjoint s t →
    ∀ (f : α → β) (comm : (↑(s ∪ t)).Pairwise (Function.onFun Commute f)),
      (s ∪ t).noncommProd f comm = s.noncommProd f ⋯ * t.noncommProd f ⋯

The non-commutative version of Finset.prod_union

theorem Finset.noncommSum_union_of_disjoint E1 #

∀ {α : Type u_3} {β : Type u_4} [inst : AddMonoid β] [inst_1 : DecidableEq α] {s t : Finset α},
  Disjoint s t →
    ∀ (f : α → β) (comm : (↑(s ∪ t)).Pairwise (Function.onFun AddCommute f)),
      (s ∪ t).noncommSum f comm = s.noncommSum f ⋯ + t.noncommSum f ⋯

The non-commutative version of Finset.sum_union

theorem Finset.noncommSum_add_distrib_aux E0 #

∀ {α : Type u_3} {β : Type u_4} [inst : AddMonoid β] {s : Finset α} {f g : α → β},
  (↑s).Pairwise (Function.onFun AddCommute f) →
    (↑s).Pairwise (Function.onFun AddCommute g) →
      ((↑s).Pairwise fun x y ↦ AddCommute (g x) (f y)) → (↑s).Pairwise fun x y ↦ AddCommute ((f + g) x) ((f + g) y)

theorem Finset.noncommProd_mul_distrib_aux E0 #

∀ {α : Type u_3} {β : Type u_4} [inst : Monoid β] {s : Finset α} {f g : α → β},
  (↑s).Pairwise (Function.onFun Commute f) →
    (↑s).Pairwise (Function.onFun Commute g) →
      ((↑s).Pairwise fun x y ↦ Commute (g x) (f y)) → (↑s).Pairwise fun x y ↦ Commute ((f * g) x) ((f * g) y)

theorem Finset.noncommProd_mul_distrib E1 #

∀ {α : Type u_3} {β : Type u_4} [inst : Monoid β] {s : Finset α} (f g : α → β)
  (comm_ff : (↑s).Pairwise (Function.onFun Commute f)) (comm_gg : (↑s).Pairwise (Function.onFun Commute g))
  (comm_gf : (↑s).Pairwise fun x y ↦ Commute (g x) (f y)),
  s.noncommProd (f * g) ⋯ = s.noncommProd f comm_ff * s.noncommProd g comm_gg

The non-commutative version of Finset.prod_mul_distrib

theorem Finset.noncommSum_add_distrib E1 #

∀ {α : Type u_3} {β : Type u_4} [inst : AddMonoid β] {s : Finset α} (f g : α → β)
  (comm_ff : (↑s).Pairwise (Function.onFun AddCommute f)) (comm_gg : (↑s).Pairwise (Function.onFun AddCommute g))
  (comm_gf : (↑s).Pairwise fun x y ↦ AddCommute (g x) (f y)),
  s.noncommSum (f + g) ⋯ = s.noncommSum f comm_ff + s.noncommSum g comm_gg

The non-commutative version of Finset.sum_add_distrib

theorem Finset.noncommSum_single E1 #

∀ {ι : Type u_2} {M : ι → Type u_6} [inst : (i : ι) → AddMonoid (M i)] [inst_1 : Fintype ι] [inst_2 : DecidableEq ι]
  (x : (i : ι) → M i), Finset.univ.noncommSum (fun i ↦ Pi.single i (x i)) ⋯ = x

theorem Finset.noncommProd_mulSingle E1 #

∀ {ι : Type u_2} {M : ι → Type u_6} [inst : (i : ι) → Monoid (M i)] [inst_1 : Fintype ι] [inst_2 : DecidableEq ι]
  (x : (i : ι) → M i), Finset.univ.noncommProd (fun i ↦ Pi.mulSingle i (x i)) ⋯ = x

theorem AddMonoidHom.pi_ext E1 #

∀ {ι : Type u_2} {γ : Type u_5} [inst : AddMonoid γ] {M : ι → Type u_6} [inst_1 : (i : ι) → AddMonoid (M i)] [Finite ι]
  [inst_3 : DecidableEq ι] {f g : ((i : ι) → M i) →+ γ},
  (∀ (i : ι) (x : M i), f (Pi.single i x) = g (Pi.single i x)) → f = g

theorem MonoidHom.pi_ext E1 #

∀ {ι : Type u_2} {γ : Type u_5} [inst : Monoid γ] {M : ι → Type u_6} [inst_1 : (i : ι) → Monoid (M i)] [Finite ι]
  [inst_3 : DecidableEq ι] {f g : ((i : ι) → M i) →* γ},
  (∀ (i : ι) (x : M i), f (Pi.mulSingle i x) = g (Pi.mulSingle i x)) → f = g