l3lab/ntp-mathlib huggingface dataset:
/-- The non-commutative version of `Finset.prod_union` -/
@[to_additive "The non-commutative version of `Finset.sum_union`"]
theorem noncommProd_union_of_disjoint [DecidableEq α] {s t : Finset α} (h : Disjoint s t)
    (f : α → β) (comm : { x | x ∈ s ∪ t }.Pairwise fun a b => Commute (f a) (f b)) :
    noncommProd (s ∪ t) f comm =
      noncommProd s f (comm.mono <| coe_subset.2 <| subset_union_left _ _) *
        noncommProd t f (comm.mono <| coe_subset.2 <| subset_union_right _ _) := by
  obtain ⟨sl, sl', rfl⟩ := exists_list_nodup_eq s
  obtain ⟨tl, tl', rfl⟩ := exists_list_nodup_eq t
  rw [List.disjoint_toFinset_iff_disjoint] at h
  calc noncommProd (List.toFinset sl ∪ List.toFinset tl) f comm
     = noncommProd ⟨↑(sl ++ tl), Multiset.coe_nodup.2 (sl'.append tl' h)⟩ f
         (by convert comm; simp [Set.ext_iff]) := noncommProd_congr (by ext; simp) (by simp) _
   _ = noncommProd (List.toFinset sl) f (comm.mono <| coe_subset.2 <| subset_union_left _ _) *
         noncommProd (List.toFinset tl) f (comm.mono <| coe_subset.2 <| subset_union_right _ _) :=
    by 

Proof state:
F : Type u_1
ι : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
f✝ : α → β → β
op : α → α → α
inst✝² : Monoid β
inst✝¹ : Monoid γ
inst✝ : DecidableEq α
f : α → β
sl : List α
sl' : List.Nodup sl
tl : List α
tl' : List.Nodup tl
h : List.Disjoint sl tl
comm : Set.Pairwise {x | x ∈ List.toFinset sl ∪ List.toFinset tl} fun a b => Commute (f a) (f b)
⊢ noncommProd { val := ↑(sl ++ tl), nodup := (_ : Multiset.Nodup ↑(sl ++ tl)) } f
      (_ :
        Set.Pairwise ↑{ val := ↑(sl ++ tl), nodup := (_ : Multiset.Nodup ↑(sl ++ tl)) } fun a b =>
          Commute (f a) (f b)) =
    noncommProd (List.toFinset sl) f (_ : Set.Pairwise ↑(List.toFinset sl) fun a b => Commute (f a) (f b)) *
      noncommProd (List.toFinset tl) f (_ : Set.Pairwise ↑(List.toFinset tl) fun a b => Commute (f a) (f b))

Next tactic:
simp [noncommProd, List.dedup_eq_self.2 sl', List.dedup_eq_self.2 tl', h]
@[to_additive]
theorem noncommProd_mul_distrib_aux {s : Finset α} {f : α → β} {g : α → β}
    (comm_ff : (s : Set α).Pairwise fun x y => Commute (f x) (f y))
    (comm_gg : (s : Set α).Pairwise fun x y => Commute (g x) (g y))
    (comm_gf : (s : Set α).Pairwise fun x y => Commute (g x) (f y)) :
    (s : Set α).Pairwise fun x y => Commute ((f * g) x) ((f * g) y) := by
  

Proof state:
F : Type u_1
ι : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
f✝ : α → β → β
op : α → α → α
inst✝¹ : Monoid β
inst✝ : Monoid γ
s : Finset α
f g : α → β
comm_ff : Set.Pairwise ↑s fun x y => Commute (f x) (f y)
comm_gg : Set.Pairwise ↑s fun x y => Commute (g x) (g y)
comm_gf : Set.Pairwise ↑s fun x y => Commute (g x) (f y)
⊢ Set.Pairwise ↑s fun x y => Commute ((f * g) x) ((f * g) y)

Next tactic:
intro x hx y hy h
@[to_additive]
theorem noncommProd_mul_distrib_aux {s : Finset α} {f : α → β} {g : α → β}
    (comm_ff : (s : Set α).Pairwise fun x y => Commute (f x) (f y))
    (comm_gg : (s : Set α).Pairwise fun x y => Commute (g x) (g y))
    (comm_gf : (s : Set α).Pairwise fun x y => Commute (g x) (f y)) :
    (s : Set α).Pairwise fun x y => Commute ((f * g) x) ((f * g) y) := by
  intro x hx y hy h
  

Proof state:
F : Type u_1
ι : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
f✝ : α → β → β
op : α → α → α
inst✝¹ : Monoid β
inst✝ : Monoid γ
s : Finset α
f g : α → β
comm_ff : Set.Pairwise ↑s fun x y => Commute (f x) (f y)
comm_gg : Set.Pairwise ↑s fun x y => Commute (g x) (g y)
comm_gf : Set.Pairwise ↑s fun x y => Commute (g x) (f y)
x : α
hx : x ∈ ↑s
y : α
hy : y ∈ ↑s
h : x ≠ y
⊢ Commute ((f * g) x) ((f * g) y)

Next tactic:
apply Commute.mul_left
@[to_additive]
theorem noncommProd_mul_distrib_aux {s : Finset α} {f : α → β} {g : α → β}
    (comm_ff : (s : Set α).Pairwise fun x y => Commute (f x) (f y))
    (comm_gg : (s : Set α).Pairwise fun x y => Commute (g x) (g y))
    (comm_gf : (s : Set α).Pairwise fun x y => Commute (g x) (f y)) :
    (s : Set α).Pairwise fun x y => Commute ((f * g) x) ((f * g) y) := by
  intro x hx y hy h
  apply Commute.mul_left <;> 

Proof state:
case hac
F : Type u_1
ι : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
f✝ : α → β → β
op : α → α → α
inst✝¹ : Monoid β
inst✝ : Monoid γ
s : Finset α
f g : α → β
comm_ff : Set.Pairwise ↑s fun x y => Commute (f x) (f y)
comm_gg : Set.Pairwise ↑s fun x y => Commute (g x) (g y)
comm_gf : Set.Pairwise ↑s fun x y => Commute (g x) (f y)
x : α
hx : x ∈ ↑s
y : α
hy : y ∈ ↑s
h : x ≠ y
⊢ Commute (f x) ((f * g) y)

Next tactic:
apply Commute.mul_right
@[to_additive]
theorem noncommProd_mul_distrib_aux {s : Finset α} {f : α → β} {g : α → β}
    (comm_ff : (s : Set α).Pairwise fun x y => Commute (f x) (f y))
    (comm_gg : (s : Set α).Pairwise fun x y => Commute (g x) (g y))
    (comm_gf : (s : Set α).Pairwise fun x y => Commute (g x) (f y)) :
    (s : Set α).Pairwise fun x y => Commute ((f * g) x) ((f * g) y) := by
  intro x hx y hy h
  apply Commute.mul_left <;> 

Proof state:
case hbc
F : Type u_1
ι : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
f✝ : α → β → β
op : α → α → α
inst✝¹ : Monoid β
inst✝ : Monoid γ
s : Finset α
f g : α → β
comm_ff : Set.Pairwise ↑s fun x y => Commute (f x) (f y)
comm_gg : Set.Pairwise ↑s fun x y => Commute (g x) (g y)
comm_gf : Set.Pairwise ↑s fun x y => Commute (g x) (f y)
x : α
hx : x ∈ ↑s
y : α
hy : y ∈ ↑s
h : x ≠ y
⊢ Commute (g x) ((f * g) y)

Next tactic:
apply Commute.mul_right
@[to_additive]
theorem noncommProd_mul_distrib_aux {s : Finset α} {f : α → β} {g : α → β}
    (comm_ff : (s : Set α).Pairwise fun x y => Commute (f x) (f y))
    (comm_gg : (s : Set α).Pairwise fun x y => Commute (g x) (g y))
    (comm_gf : (s : Set α).Pairwise fun x y => Commute (g x) (f y)) :
    (s : Set α).Pairwise fun x y => Commute ((f * g) x) ((f * g) y) := by
  intro x hx y hy h
  apply Commute.mul_left <;> apply Commute.mul_right
  · 

Proof state:
case hac.hab
F : Type u_1
ι : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
f✝ : α → β → β
op : α → α → α
inst✝¹ : Monoid β
inst✝ : Monoid γ
s : Finset α
f g : α → β
comm_ff : Set.Pairwise ↑s fun x y => Commute (f x) (f y)
comm_gg : Set.Pairwise ↑s fun x y => Commute (g x) (g y)
comm_gf : Set.Pairwise ↑s fun x y => Commute (g x) (f y)
x : α
hx : x ∈ ↑s
y : α
hy : y ∈ ↑s
h : x ≠ y
⊢ Commute (f x) (f y)

Next tactic:
exact comm_ff.of_refl hx hy
@[to_additive]
theorem noncommProd_mul_distrib_aux {s : Finset α} {f : α → β} {g : α → β}
    (comm_ff : (s : Set α).Pairwise fun x y => Commute (f x) (f y))
    (comm_gg : (s : Set α).Pairwise fun x y => Commute (g x) (g y))
    (comm_gf : (s : Set α).Pairwise fun x y => Commute (g x) (f y)) :
    (s : Set α).Pairwise fun x y => Commute ((f * g) x) ((f * g) y) := by
  intro x hx y hy h
  apply Commute.mul_left <;> apply Commute.mul_right
  · exact comm_ff.of_refl hx hy
  · 

Proof state:
case hac.hac
F : Type u_1
ι : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
f✝ : α → β → β
op : α → α → α
inst✝¹ : Monoid β
inst✝ : Monoid γ
s : Finset α
f g : α → β
comm_ff : Set.Pairwise ↑s fun x y => Commute (f x) (f y)
comm_gg : Set.Pairwise ↑s fun x y => Commute (g x) (g y)
comm_gf : Set.Pairwise ↑s fun x y => Commute (g x) (f y)
x : α
hx : x ∈ ↑s
y : α
hy : y ∈ ↑s
h : x ≠ y
⊢ Commute (f x) (g y)

Next tactic:
exact (comm_gf hy hx h.symm).symm
@[to_additive]
theorem noncommProd_mul_distrib_aux {s : Finset α} {f : α → β} {g : α → β}
    (comm_ff : (s : Set α).Pairwise fun x y => Commute (f x) (f y))
    (comm_gg : (s : Set α).Pairwise fun x y => Commute (g x) (g y))
    (comm_gf : (s : Set α).Pairwise fun x y => Commute (g x) (f y)) :
    (s : Set α).Pairwise fun x y => Commute ((f * g) x) ((f * g) y) := by
  intro x hx y hy h
  apply Commute.mul_left <;> apply Commute.mul_right
  · exact comm_ff.of_refl hx hy
  · exact (comm_gf hy hx h.symm).symm
  · 

Proof state:
case hbc.hab
F : Type u_1
ι : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
f✝ : α → β → β
op : α → α → α
inst✝¹ : Monoid β
inst✝ : Monoid γ
s : Finset α
f g : α → β
comm_ff : Set.Pairwise ↑s fun x y => Commute (f x) (f y)
comm_gg : Set.Pairwise ↑s fun x y => Commute (g x) (g y)
comm_gf : Set.Pairwise ↑s fun x y => Commute (g x) (f y)
x : α
hx : x ∈ ↑s
y : α
hy : y ∈ ↑s
h : x ≠ y
⊢ Commute (g x) (f y)

Next tactic:
exact comm_gf hx hy h
@[to_additive]
theorem noncommProd_mul_distrib_aux {s : Finset α} {f : α → β} {g : α → β}
    (comm_ff : (s : Set α).Pairwise fun x y => Commute (f x) (f y))
    (comm_gg : (s : Set α).Pairwise fun x y => Commute (g x) (g y))
    (comm_gf : (s : Set α).Pairwise fun x y => Commute (g x) (f y)) :
    (s : Set α).Pairwise fun x y => Commute ((f * g) x) ((f * g) y) := by
  intro x hx y hy h
  apply Commute.mul_left <;> apply Commute.mul_right
  · exact comm_ff.of_refl hx hy
  · exact (comm_gf hy hx h.symm).symm
  · exact comm_gf hx hy h
  · 

Proof state:
case hbc.hac
F : Type u_1
ι : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
f✝ : α → β → β
op : α → α → α
inst✝¹ : Monoid β
inst✝ : Monoid γ
s : Finset α
f g : α → β
comm_ff : Set.Pairwise ↑s fun x y => Commute (f x) (f y)
comm_gg : Set.Pairwise ↑s fun x y => Commute (g x) (g y)
comm_gf : Set.Pairwise ↑s fun x y => Commute (g x) (f y)
x : α
hx : x ∈ ↑s
y : α
hy : y ∈ ↑s
h : x ≠ y
⊢ Commute (g x) (g y)

Next tactic:
exact comm_gg.of_refl hx hy
/-- The non-commutative version of `Finset.prod_mul_distrib` -/
@[to_additive "The non-commutative version of `Finset.sum_add_distrib`"]
theorem noncommProd_mul_distrib {s : Finset α} (f : α → β) (g : α → β) (comm_ff comm_gg comm_gf) :
    noncommProd s (f * g) (noncommProd_mul_distrib_aux comm_ff comm_gg comm_gf) =
      noncommProd s f comm_ff * noncommProd s g comm_gg := by
  

Proof state:
F : Type u_1
ι : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
f✝ : α → β → β
op : α → α → α
inst✝¹ : Monoid β
inst✝ : Monoid γ
s : Finset α
f g : α → β
comm_ff : Set.Pairwise ↑s fun x y => Commute (f x) (f y)
comm_gg : Set.Pairwise ↑s fun x y => Commute (g x) (g y)
comm_gf : Set.Pairwise ↑s fun x y => Commute (g x) (f y)
⊢ noncommProd s (f * g) (_ : Set.Pairwise ↑s fun x y => Commute ((f * g) x) ((f * g) y)) =
    noncommProd s f comm_ff * noncommProd s g comm_gg

Next tactic:
classical
    induction' s using Finset.induction_on with x s hnmem ih
    · simp
    simp only [Finset.noncommProd_insert_of_not_mem _ _ _ _ hnmem]
    specialize
      ih (comm_ff.mono fun _ => mem_insert_of_mem) (comm_gg.mono fun _ => mem_insert_of_mem)
        (comm_gf.mono fun _ => mem_insert_of_mem)
    rw [ih, Pi.mul_apply]
    simp only [mul_assoc]
    congr 1
    simp only [← mul_assoc]
    congr 1
    refine' noncommProd_commute _ _ _ _ fun y hy => _
    exact comm_gf (mem_insert_self x s) (mem_insert_of_mem hy) (ne_of_mem_of_not_mem hy hnmem).symm
/-- The non-commutative version of `Finset.prod_mul_distrib` -/
@[to_additive "The non-commutative version of `Finset.sum_add_distrib`"]
theorem noncommProd_mul_distrib {s : Finset α} (f : α → β) (g : α → β) (comm_ff comm_gg comm_gf) :
    noncommProd s (f * g) (noncommProd_mul_distrib_aux comm_ff comm_gg comm_gf) =
      noncommProd s f comm_ff * noncommProd s g comm_gg := by
  classical
    

Proof state:
F : Type u_1
ι : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
f✝ : α → β → β
op : α → α → α
inst✝¹ : Monoid β
inst✝ : Monoid γ
s : Finset α
f g : α → β
comm_ff : Set.Pairwise ↑s fun x y => Commute (f x) (f y)
comm_gg : Set.Pairwise ↑s fun x y => Commute (g x) (g y)
comm_gf : Set.Pairwise ↑s fun x y => Commute (g x) (f y)
⊢ noncommProd s (f * g) (_ : Set.Pairwise ↑s fun x y => Commute ((f * g) x) ((f * g) y)) =
    noncommProd s f comm_ff * noncommProd s g comm_gg

Next tactic:
induction' s using Finset.induction_on with x s hnmem ih
/-- The non-commutative version of `Finset.prod_mul_distrib` -/
@[to_additive "The non-commutative version of `Finset.sum_add_distrib`"]
theorem noncommProd_mul_distrib {s : Finset α} (f : α → β) (g : α → β) (comm_ff comm_gg comm_gf) :
    noncommProd s (f * g) (noncommProd_mul_distrib_aux comm_ff comm_gg comm_gf) =
      noncommProd s f comm_ff * noncommProd s g comm_gg := by
  classical
    induction' s using Finset.induction_on with x s hnmem ih
    · 

Proof state:
case empty
F : Type u_1
ι : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
f✝ : α → β → β
op : α → α → α
inst✝¹ : Monoid β
inst✝ : Monoid γ
f g : α → β
comm_ff : Set.Pairwise ↑∅ fun x y => Commute (f x) (f y)
comm_gg : Set.Pairwise ↑∅ fun x y => Commute (g x) (g y)
comm_gf : Set.Pairwise ↑∅ fun x y => Commute (g x) (f y)
⊢ noncommProd ∅ (f * g) (_ : Set.Pairwise ↑∅ fun x y => Commute ((f * g) x) ((f * g) y)) =
    noncommProd ∅ f comm_ff * noncommProd ∅ g comm_gg

Next tactic:
simp
/-- The non-commutative version of `Finset.prod_mul_distrib` -/
@[to_additive "The non-commutative version of `Finset.sum_add_distrib`"]
theorem noncommProd_mul_distrib {s : Finset α} (f : α → β) (g : α → β) (comm_ff comm_gg comm_gf) :
    noncommProd s (f * g) (noncommProd_mul_distrib_aux comm_ff comm_gg comm_gf) =
      noncommProd s f comm_ff * noncommProd s g comm_gg := by
  classical
    induction' s using Finset.induction_on with x s hnmem ih
    · simp
    

Proof state:
case insert
F : Type u_1
ι : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
f✝ : α → β → β
op : α → α → α
inst✝¹ : Monoid β
inst✝ : Monoid γ
f g : α → β
x : α
s : Finset α
hnmem : x ∉ s
ih :
  ∀ (comm_ff : Set.Pairwise ↑s fun x y => Commute (f x) (f y))
    (comm_gg : Set.Pairwise ↑s fun x y => Commute (g x) (g y))
    (comm_gf : Set.Pairwise ↑s fun x y => Commute (g x) (f y)),
    noncommProd s (f * g) (_ : Set.Pairwise ↑s fun x y => Commute ((f * g) x) ((f * g) y)) =
      noncommProd s f comm_ff * noncommProd s g comm_gg
comm_ff : Set.Pairwise ↑(insert x s) fun x y => Commute (f x) (f y)
comm_gg : Set.Pairwise ↑(insert x s) fun x y => Commute (g x) (g y)
comm_gf : Set.Pairwise ↑(insert x s) fun x y => Commute (g x) (f y)
⊢ noncommProd (insert x s) (f * g) (_ : Set.Pairwise ↑(insert x s) fun x y => Commute ((f * g) x) ((f * g) y)) =
    noncommProd (insert x s) f comm_ff * noncommProd (insert x s) g comm_gg

Next tactic:
simp only [Finset.noncommProd_insert_of_not_mem _ _ _ _ hnmem]
/-- The non-commutative version of `Finset.prod_mul_distrib` -/
@[to_additive "The non-commutative version of `Finset.sum_add_distrib`"]
theorem noncommProd_mul_distrib {s : Finset α} (f : α → β) (g : α → β) (comm_ff comm_gg comm_gf) :
    noncommProd s (f * g) (noncommProd_mul_distrib_aux comm_ff comm_gg comm_gf) =
      noncommProd s f comm_ff * noncommProd s g comm_gg := by
  classical
    induction' s using Finset.induction_on with x s hnmem ih
    · simp
    simp only [Finset.noncommProd_insert_of_not_mem _ _ _ _ hnmem]
    

Proof state:
case insert
F : Type u_1
ι : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
f✝ : α → β → β
op : α → α → α
inst✝¹ : Monoid β
inst✝ : Monoid γ
f g : α → β
x : α
s : Finset α
hnmem : x ∉ s
ih :
  ∀ (comm_ff : Set.Pairwise ↑s fun x y => Commute (f x) (f y))
    (comm_gg : Set.Pairwise ↑s fun x y => Commute (g x) (g y))
    (comm_gf : Set.Pairwise ↑s fun x y => Commute (g x) (f y)),
    noncommProd s (f * g) (_ : Set.Pairwise ↑s fun x y => Commute ((f * g) x) ((f * g) y)) =
      noncommProd s f comm_ff * noncommProd s g comm_gg
comm_ff : Set.Pairwise ↑(insert x s) fun x y => Commute (f x) (f y)
comm_gg : Set.Pairwise ↑(insert x s) fun x y => Commute (g x) (g y)
comm_gf : Set.Pairwise ↑(insert x s) fun x y => Commute (g x) (f y)
⊢ (f * g) x * noncommProd s (f * g) (_ : Set.Pairwise ↑s fun a b => Commute ((f * g) a) ((f * g) b)) =
    f x * noncommProd s f (_ : Set.Pairwise ↑s fun a b => Commute (f a) (f b)) *
      (g x * noncommProd s g (_ : Set.Pairwise ↑s fun a b => Commute (g a) (g b)))

Next tactic:
specialize
      ih (comm_ff.mono fun _ => mem_insert_of_mem) (comm_gg.mono fun _ => mem_insert_of_mem)
        (comm_gf.mono fun _ => mem_insert_of_mem)
/-- The non-commutative version of `Finset.prod_mul_distrib` -/
@[to_additive "The non-commutative version of `Finset.sum_add_distrib`"]
theorem noncommProd_mul_distrib {s : Finset α} (f : α → β) (g : α → β) (comm_ff comm_gg comm_gf) :
    noncommProd s (f * g) (noncommProd_mul_distrib_aux comm_ff comm_gg comm_gf) =
      noncommProd s f comm_ff * noncommProd s g comm_gg := by
  classical
    induction' s using Finset.induction_on with x s hnmem ih
    · simp
    simp only [Finset.noncommProd_insert_of_not_mem _ _ _ _ hnmem]
    specialize
      ih (comm_ff.mono fun _ => mem_insert_of_mem) (comm_gg.mono fun _ => mem_insert_of_mem)
        (comm_gf.mono fun _ => mem_insert_of_mem)
    

Proof state:
case insert
F : Type u_1
ι : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
f✝ : α → β → β
op : α → α → α
inst✝¹ : Monoid β
inst✝ : Monoid γ
f g : α → β
x : α
s : Finset α
hnmem : x ∉ s
comm_ff : Set.Pairwise ↑(insert x s) fun x y => Commute (f x) (f y)
comm_gg : Set.Pairwise ↑(insert x s) fun x y => Commute (g x) (g y)
comm_gf : Set.Pairwise ↑(insert x s) fun x y => Commute (g x) (f y)
ih :
  noncommProd s (f * g) (_ : Set.Pairwise ↑s fun x y => Commute ((f * g) x) ((f * g) y)) =
    noncommProd s f (_ : Set.Pairwise ↑s fun x y => Commute (f x) (f y)) *
      noncommProd s g (_ : Set.Pairwise ↑s fun x y => Commute (g x) (g y))
⊢ (f * g) x * noncommProd s (f * g) (_ : Set.Pairwise ↑s fun a b => Commute ((f * g) a) ((f * g) b)) =
    f x * noncommProd s f (_ : Set.Pairwise ↑s fun a b => Commute (f a) (f b)) *
      (g x * noncommProd s g (_ : Set.Pairwise ↑s fun a b => Commute (g a) (g b)))

Next tactic:
rw [ih, Pi.mul_apply]
/-- The non-commutative version of `Finset.prod_mul_distrib` -/
@[to_additive "The non-commutative version of `Finset.sum_add_distrib`"]
theorem noncommProd_mul_distrib {s : Finset α} (f : α → β) (g : α → β) (comm_ff comm_gg comm_gf) :
    noncommProd s (f * g) (noncommProd_mul_distrib_aux comm_ff comm_gg comm_gf) =
      noncommProd s f comm_ff * noncommProd s g comm_gg := by
  classical
    induction' s using Finset.induction_on with x s hnmem ih
    · simp
    simp only [Finset.noncommProd_insert_of_not_mem _ _ _ _ hnmem]
    specialize
      ih (comm_ff.mono fun _ => mem_insert_of_mem) (comm_gg.mono fun _ => mem_insert_of_mem)
        (comm_gf.mono fun _ => mem_insert_of_mem)
    rw [ih, Pi.mul_apply]
    

Proof state:
case insert
F : Type u_1
ι : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
f✝ : α → β → β
op : α → α → α
inst✝¹ : Monoid β
inst✝ : Monoid γ
f g : α → β
x : α
s : Finset α
hnmem : x ∉ s
comm_ff : Set.Pairwise ↑(insert x s) fun x y => Commute (f x) (f y)
comm_gg : Set.Pairwise ↑(insert x s) fun x y => Commute (g x) (g y)
comm_gf : Set.Pairwise ↑(insert x s) fun x y => Commute (g x) (f y)
ih :
  noncommProd s (f * g) (_ : Set.Pairwise ↑s fun x y => Commute ((f * g) x) ((f * g) y)) =
    noncommProd s f (_ : Set.Pairwise ↑s fun x y => Commute (f x) (f y)) *
      noncommProd s g (_ : Set.Pairwise ↑s fun x y => Commute (g x) (g y))
⊢ f x * g x *
      (noncommProd s f (_ : Set.Pairwise ↑s fun x y => Commute (f x) (f y)) *
        noncommProd s g (_ : Set.Pairwise ↑s fun x y => Commute (g x) (g y))) =
    f x * noncommProd s f (_ : Set.Pairwise ↑s fun a b => Commute (f a) (f b)) *
      (g x * noncommProd s g (_ : Set.Pairwise ↑s fun a b => Commute (g a) (g b)))

Next tactic:
simp only [mul_assoc]
/-- The non-commutative version of `Finset.prod_mul_distrib` -/
@[to_additive "The non-commutative version of `Finset.sum_add_distrib`"]
theorem noncommProd_mul_distrib {s : Finset α} (f : α → β) (g : α → β) (comm_ff comm_gg comm_gf) :
    noncommProd s (f * g) (noncommProd_mul_distrib_aux comm_ff comm_gg comm_gf) =
      noncommProd s f comm_ff * noncommProd s g comm_gg := by
  classical
    induction' s using Finset.induction_on with x s hnmem ih
    · simp
    simp only [Finset.noncommProd_insert_of_not_mem _ _ _ _ hnmem]
    specialize
      ih (comm_ff.mono fun _ => mem_insert_of_mem) (comm_gg.mono fun _ => mem_insert_of_mem)
        (comm_gf.mono fun _ => mem_insert_of_mem)
    rw [ih, Pi.mul_apply]
    simp only [mul_assoc]
    

Proof state:
case insert
F : Type u_1
ι : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
f✝ : α → β → β
op : α → α → α
inst✝¹ : Monoid β
inst✝ : Monoid γ
f g : α → β
x : α
s : Finset α
hnmem : x ∉ s
comm_ff : Set.Pairwise ↑(insert x s) fun x y => Commute (f x) (f y)
comm_gg : Set.Pairwise ↑(insert x s) fun x y => Commute (g x) (g y)
comm_gf : Set.Pairwise ↑(insert x s) fun x y => Commute (g x) (f y)
ih :
  noncommProd s (f * g) (_ : Set.Pairwise ↑s fun x y => Commute ((f * g) x) ((f * g) y)) =
    noncommProd s f (_ : Set.Pairwise ↑s fun x y => Commute (f x) (f y)) *
      noncommProd s g (_ : Set.Pairwise ↑s fun x y => Commute (g x) (g y))
⊢ f x *
      (g x *
        (noncommProd s f (_ : Set.Pairwise ↑s fun x y => Commute (f x) (f y)) *
          noncommProd s g (_ : Set.Pairwise ↑s fun x y => Commute (g x) (g y)))) =
    f x *
      (noncommProd s f (_ : Set.Pairwise ↑s fun x y => Commute (f x) (f y)) *
        (g x * noncommProd s g (_ : Set.Pairwise ↑s fun x y => Commute (g x) (g y))))

Next tactic:
congr 1
/-- The non-commutative version of `Finset.prod_mul_distrib` -/
@[to_additive "The non-commutative version of `Finset.sum_add_distrib`"]
theorem noncommProd_mul_distrib {s : Finset α} (f : α → β) (g : α → β) (comm_ff comm_gg comm_gf) :
    noncommProd s (f * g) (noncommProd_mul_distrib_aux comm_ff comm_gg comm_gf) =
      noncommProd s f comm_ff * noncommProd s g comm_gg := by
  classical
    induction' s using Finset.induction_on with x s hnmem ih
    · simp
    simp only [Finset.noncommProd_insert_of_not_mem _ _ _ _ hnmem]
    specialize
      ih (comm_ff.mono fun _ => mem_insert_of_mem) (comm_gg.mono fun _ => mem_insert_of_mem)
        (comm_gf.mono fun _ => mem_insert_of_mem)
    rw [ih, Pi.mul_apply]
    simp only [mul_assoc]
    congr 1
    

Proof state:
case insert.e_a
F : Type u_1
ι : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
f✝ : α → β → β
op : α → α → α
inst✝¹ : Monoid β
inst✝ : Monoid γ
f g : α → β
x : α
s : Finset α
hnmem : x ∉ s
comm_ff : Set.Pairwise ↑(insert x s) fun x y => Commute (f x) (f y)
comm_gg : Set.Pairwise ↑(insert x s) fun x y => Commute (g x) (g y)
comm_gf : Set.Pairwise ↑(insert x s) fun x y => Commute (g x) (f y)
ih :
  noncommProd s (f * g) (_ : Set.Pairwise ↑s fun x y => Commute ((f * g) x) ((f * g) y)) =
    noncommProd s f (_ : Set.Pairwise ↑s fun x y => Commute (f x) (f y)) *
      noncommProd s g (_ : Set.Pairwise ↑s fun x y => Commute (g x) (g y))
⊢ g x *
      (noncommProd s f (_ : Set.Pairwise ↑s fun x y => Commute (f x) (f y)) *
        noncommProd s g (_ : Set.Pairwise ↑s fun x y => Commute (g x) (g y))) =
    noncommProd s f (_ : Set.Pairwise ↑s fun x y => Commute (f x) (f y)) *
      (g x * noncommProd s g (_ : Set.Pairwise ↑s fun x y => Commute (g x) (g y)))

Next tactic:
simp only [← mul_assoc]