l3lab/ntp-mathlib huggingface dataset:
@[simp]
theorem preimage_Ici (e : α ≃o β) (b : β) : e ⁻¹' Ici b = Ici (e.symm b) := by
  ext x
  

Proof state:
case h
α : Type u_2
β : Type u_1
inst✝¹ : Preorder α
inst✝ : Preorder β
e : α ≃o β
b : β
x : α
⊢ x ∈ ⇑e ⁻¹' Ici b ↔ x ∈ Ici ((symm e) b)

Next tactic:
simp [← e.le_iff_le]
@[simp]
theorem preimage_Iio (e : α ≃o β) (b : β) : e ⁻¹' Iio b = Iio (e.symm b) := by
  

Proof state:
α : Type u_2
β : Type u_1
inst✝¹ : Preorder α
inst✝ : Preorder β
e : α ≃o β
b : β
⊢ ⇑e ⁻¹' Iio b = Iio ((symm e) b)

Next tactic:
ext x
@[simp]
theorem preimage_Iio (e : α ≃o β) (b : β) : e ⁻¹' Iio b = Iio (e.symm b) := by
  ext x
  

Proof state:
case h
α : Type u_2
β : Type u_1
inst✝¹ : Preorder α
inst✝ : Preorder β
e : α ≃o β
b : β
x : α
⊢ x ∈ ⇑e ⁻¹' Iio b ↔ x ∈ Iio ((symm e) b)

Next tactic:
simp [← e.lt_iff_lt]
@[simp]
theorem preimage_Ioi (e : α ≃o β) (b : β) : e ⁻¹' Ioi b = Ioi (e.symm b) := by
  

Proof state:
α : Type u_2
β : Type u_1
inst✝¹ : Preorder α
inst✝ : Preorder β
e : α ≃o β
b : β
⊢ ⇑e ⁻¹' Ioi b = Ioi ((symm e) b)

Next tactic:
ext x
@[simp]
theorem preimage_Ioi (e : α ≃o β) (b : β) : e ⁻¹' Ioi b = Ioi (e.symm b) := by
  ext x
  

Proof state:
case h
α : Type u_2
β : Type u_1
inst✝¹ : Preorder α
inst✝ : Preorder β
e : α ≃o β
b : β
x : α
⊢ x ∈ ⇑e ⁻¹' Ioi b ↔ x ∈ Ioi ((symm e) b)

Next tactic:
simp [← e.lt_iff_lt]
@[simp]
theorem preimage_Icc (e : α ≃o β) (a b : β) : e ⁻¹' Icc a b = Icc (e.symm a) (e.symm b) := by
  

Proof state:
α : Type u_2
β : Type u_1
inst✝¹ : Preorder α
inst✝ : Preorder β
e : α ≃o β
a b : β
⊢ ⇑e ⁻¹' Icc a b = Icc ((symm e) a) ((symm e) b)

Next tactic:
simp [← Ici_inter_Iic]
@[simp]
theorem preimage_Ico (e : α ≃o β) (a b : β) : e ⁻¹' Ico a b = Ico (e.symm a) (e.symm b) := by
  

Proof state:
α : Type u_2
β : Type u_1
inst✝¹ : Preorder α
inst✝ : Preorder β
e : α ≃o β
a b : β
⊢ ⇑e ⁻¹' Ico a b = Ico ((symm e) a) ((symm e) b)

Next tactic:
simp [← Ici_inter_Iio]
@[simp]
theorem preimage_Ioc (e : α ≃o β) (a b : β) : e ⁻¹' Ioc a b = Ioc (e.symm a) (e.symm b) := by
  

Proof state:
α : Type u_2
β : Type u_1
inst✝¹ : Preorder α
inst✝ : Preorder β
e : α ≃o β
a b : β
⊢ ⇑e ⁻¹' Ioc a b = Ioc ((symm e) a) ((symm e) b)

Next tactic:
simp [← Ioi_inter_Iic]
@[simp]
theorem preimage_Ioo (e : α ≃o β) (a b : β) : e ⁻¹' Ioo a b = Ioo (e.symm a) (e.symm b) := by
  

Proof state:
α : Type u_2
β : Type u_1
inst✝¹ : Preorder α
inst✝ : Preorder β
e : α ≃o β
a b : β
⊢ ⇑e ⁻¹' Ioo a b = Ioo ((symm e) a) ((symm e) b)

Next tactic:
simp [← Ioi_inter_Iio]
@[simp]
theorem image_Iic (e : α ≃o β) (a : α) : e '' Iic a = Iic (e a) := by
  

Proof state:
α : Type u_2
β : Type u_1
inst✝¹ : Preorder α
inst✝ : Preorder β
e : α ≃o β
a : α
⊢ ⇑e '' Iic a = Iic (e a)

Next tactic:
rw [e.image_eq_preimage, e.symm.preimage_Iic, e.symm_symm]
@[simp]
theorem image_Iio (e : α ≃o β) (a : α) : e '' Iio a = Iio (e a) := by
  

Proof state:
α : Type u_2
β : Type u_1
inst✝¹ : Preorder α
inst✝ : Preorder β
e : α ≃o β
a : α
⊢ ⇑e '' Iio a = Iio (e a)

Next tactic:
rw [e.image_eq_preimage, e.symm.preimage_Iio, e.symm_symm]
@[simp]
theorem image_Ioo (e : α ≃o β) (a b : α) : e '' Ioo a b = Ioo (e a) (e b) := by
  

Proof state:
α : Type u_2
β : Type u_1
inst✝¹ : Preorder α
inst✝ : Preorder β
e : α ≃o β
a b : α
⊢ ⇑e '' Ioo a b = Ioo (e a) (e b)

Next tactic:
rw [e.image_eq_preimage, e.symm.preimage_Ioo, e.symm_symm]
@[simp]
theorem image_Ioc (e : α ≃o β) (a b : α) : e '' Ioc a b = Ioc (e a) (e b) := by
  

Proof state:
α : Type u_2
β : Type u_1
inst✝¹ : Preorder α
inst✝ : Preorder β
e : α ≃o β
a b : α
⊢ ⇑e '' Ioc a b = Ioc (e a) (e b)

Next tactic:
rw [e.image_eq_preimage, e.symm.preimage_Ioc, e.symm_symm]
@[simp]
theorem image_Ico (e : α ≃o β) (a b : α) : e '' Ico a b = Ico (e a) (e b) := by
  

Proof state:
α : Type u_2
β : Type u_1
inst✝¹ : Preorder α
inst✝ : Preorder β
e : α ≃o β
a b : α
⊢ ⇑e '' Ico a b = Ico (e a) (e b)

Next tactic:
rw [e.image_eq_preimage, e.symm.preimage_Ico, e.symm_symm]
@[simp]
theorem image_Icc (e : α ≃o β) (a b : α) : e '' Icc a b = Icc (e a) (e b) := by
  

Proof state:
α : Type u_2
β : Type u_1
inst✝¹ : Preorder α
inst✝ : Preorder β
e : α ≃o β
a b : α
⊢ ⇑e '' Icc a b = Icc (e a) (e b)

Next tactic:
rw [e.image_eq_preimage, e.symm.preimage_Icc, e.symm_symm]
/-- Order isomorphism between `Iic (⊤ : α)` and `α` when `α` has a top element -/
def IicTop [Preorder α] [OrderTop α] : Iic (⊤ : α) ≃o α :=
  { @Equiv.subtypeUnivEquiv α (Iic (⊤ : α)) fun x => le_top with
    map_rel_iff' := @fun x y => by 

Proof state:
α : Type ?u.13926
inst✝¹ : Preorder α
inst✝ : OrderTop α
src✝ : Subtype (Iic ⊤) ≃ α := Equiv.subtypeUnivEquiv (_ : ∀ (x : α), x ≤ ⊤)
x y : ↑(Iic ⊤)
⊢ { toFun := src✝.toFun, invFun := src✝.invFun, left_inv := (_ : Function.LeftInverse src✝.invFun src✝.toFun),
          right_inv := (_ : Function.RightInverse src✝.invFun src✝.toFun) }
        x ≤
      { toFun := src✝.toFun, invFun := src✝.invFun, left_inv := (_ : Function.LeftInverse src✝.invFun src✝.toFun),
          right_inv := (_ : Function.RightInverse src✝.invFun src✝.toFun) }
        y ↔
    x ≤ y

Next tactic:
rfl
/-- Order isomorphism between `Ici (⊥ : α)` and `α` when `α` has a bottom element -/
def IciBot [Preorder α] [OrderBot α] : Ici (⊥ : α) ≃o α :=
  { @Equiv.subtypeUnivEquiv α (Ici (⊥ : α)) fun x => bot_le with
    map_rel_iff' := @fun x y => by 

Proof state:
α : Type ?u.14477
inst✝¹ : Preorder α
inst✝ : OrderBot α
src✝ : Subtype (Ici ⊥) ≃ α := Equiv.subtypeUnivEquiv (_ : ∀ (x : α), ⊥ ≤ x)
x y : ↑(Ici ⊥)
⊢ { toFun := src✝.toFun, invFun := src✝.invFun, left_inv := (_ : Function.LeftInverse src✝.invFun src✝.toFun),
          right_inv := (_ : Function.RightInverse src✝.invFun src✝.toFun) }
        x ≤
      { toFun := src✝.toFun, invFun := src✝.invFun, left_inv := (_ : Function.LeftInverse src✝.invFun src✝.toFun),
          right_inv := (_ : Function.RightInverse src✝.invFun src✝.toFun) }
        y ↔
    x ≤ y

Next tactic:
rfl
instance nonUnitalNonAssocSemiring : NonUnitalNonAssocSemiring (MonoidAlgebra k G) :=
  { Finsupp.addCommMonoid with
    -- Porting note: `refine` & `exact` are required because `simp` behaves differently.
    left_distrib := fun f g h => by
      

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝¹ : Semiring k
inst✝ : Mul G
src✝ : AddCommMonoid (G →₀ k) := Finsupp.addCommMonoid
f g h : MonoidAlgebra k G
⊢ f * (g + h) = f * g + f * h

Next tactic:
haveI := Classical.decEq G
instance nonUnitalNonAssocSemiring : NonUnitalNonAssocSemiring (MonoidAlgebra k G) :=
  { Finsupp.addCommMonoid with
    -- Porting note: `refine` & `exact` are required because `simp` behaves differently.
    left_distrib := fun f g h => by
      haveI := Classical.decEq G
      

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝¹ : Semiring k
inst✝ : Mul G
src✝ : AddCommMonoid (G →₀ k) := Finsupp.addCommMonoid
f g h : MonoidAlgebra k G
this : DecidableEq G
⊢ f * (g + h) = f * g + f * h

Next tactic:
simp only [mul_def]
instance nonUnitalNonAssocSemiring : NonUnitalNonAssocSemiring (MonoidAlgebra k G) :=
  { Finsupp.addCommMonoid with
    -- Porting note: `refine` & `exact` are required because `simp` behaves differently.
    left_distrib := fun f g h => by
      haveI := Classical.decEq G
      simp only [mul_def]
      

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝¹ : Semiring k
inst✝ : Mul G
src✝ : AddCommMonoid (G →₀ k) := Finsupp.addCommMonoid
f g h : MonoidAlgebra k G
this : DecidableEq G
⊢ (sum f fun a₁ b₁ => sum (g + h) fun a₂ b₂ => single (a₁ * a₂) (b₁ * b₂)) =
    (sum f fun a₁ b₁ => sum g fun a₂ b₂ => single (a₁ * a₂) (b₁ * b₂)) +
      sum f fun a₁ b₁ => sum h fun a₂ b₂ => single (a₁ * a₂) (b₁ * b₂)

Next tactic:
refine Eq.trans (congr_arg (sum f) (funext₂ fun a₁ b₁ => sum_add_index ?_ ?_)) ?_
instance nonUnitalNonAssocSemiring : NonUnitalNonAssocSemiring (MonoidAlgebra k G) :=
  { Finsupp.addCommMonoid with
    -- Porting note: `refine` & `exact` are required because `simp` behaves differently.
    left_distrib := fun f g h => by
      haveI := Classical.decEq G
      simp only [mul_def]
      refine Eq.trans (congr_arg (sum f) (funext₂ fun a₁ b₁ => sum_add_index ?_ ?_)) ?_ <;>
        

Proof state:
case refine_1
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝¹ : Semiring k
inst✝ : Mul G
src✝ : AddCommMonoid (G →₀ k) := Finsupp.addCommMonoid
f g h : MonoidAlgebra k G
this : DecidableEq G
a₁ : G
b₁ : k
⊢ ∀ a ∈ g.support ∪ h.support, single (a₁ * a) (b₁ * 0) = 0

Next tactic:
simp only [mul_add, mul_zero, single_zero, single_add, forall_true_iff, sum_add]
instance nonUnitalNonAssocSemiring : NonUnitalNonAssocSemiring (MonoidAlgebra k G) :=
  { Finsupp.addCommMonoid with
    -- Porting note: `refine` & `exact` are required because `simp` behaves differently.
    left_distrib := fun f g h => by
      haveI := Classical.decEq G
      simp only [mul_def]
      refine Eq.trans (congr_arg (sum f) (funext₂ fun a₁ b₁ => sum_add_index ?_ ?_)) ?_ <;>
        

Proof state:
case refine_2
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝¹ : Semiring k
inst✝ : Mul G
src✝ : AddCommMonoid (G →₀ k) := Finsupp.addCommMonoid
f g h : MonoidAlgebra k G
this : DecidableEq G
a₁ : G
b₁ : k
⊢ ∀ a ∈ g.support ∪ h.support,
    ∀ (b₁_1 b₂ : k), single (a₁ * a) (b₁ * (b₁_1 + b₂)) = single (a₁ * a) (b₁ * b₁_1) + single (a₁ * a) (b₁ * b₂)

Next tactic:
simp only [mul_add, mul_zero, single_zero, single_add, forall_true_iff, sum_add]
instance nonUnitalNonAssocSemiring : NonUnitalNonAssocSemiring (MonoidAlgebra k G) :=
  { Finsupp.addCommMonoid with
    -- Porting note: `refine` & `exact` are required because `simp` behaves differently.
    left_distrib := fun f g h => by
      haveI := Classical.decEq G
      simp only [mul_def]
      refine Eq.trans (congr_arg (sum f) (funext₂ fun a₁ b₁ => sum_add_index ?_ ?_)) ?_ <;>
        

Proof state:
case refine_3
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝¹ : Semiring k
inst✝ : Mul G
src✝ : AddCommMonoid (G →₀ k) := Finsupp.addCommMonoid
f g h : MonoidAlgebra k G
this : DecidableEq G
⊢ (sum f fun a₁ b₁ => (sum g fun a₂ b₂ => single (a₁ * a₂) (b₁ * b₂)) + sum h fun a₂ b₂ => single (a₁ * a₂) (b₁ * b₂)) =
    (sum f fun a₁ b₁ => sum g fun a₂ b₂ => single (a₁ * a₂) (b₁ * b₂)) +
      sum f fun a₁ b₁ => sum h fun a₂ b₂ => single (a₁ * a₂) (b₁ * b₂)

Next tactic:
simp only [mul_add, mul_zero, single_zero, single_add, forall_true_iff, sum_add]
instance nonUnitalNonAssocSemiring : NonUnitalNonAssocSemiring (MonoidAlgebra k G) :=
  { Finsupp.addCommMonoid with
    -- Porting note: `refine` & `exact` are required because `simp` behaves differently.
    left_distrib := fun f g h => by
      haveI := Classical.decEq G
      simp only [mul_def]
      refine Eq.trans (congr_arg (sum f) (funext₂ fun a₁ b₁ => sum_add_index ?_ ?_)) ?_ <;>
        simp only [mul_add, mul_zero, single_zero, single_add, forall_true_iff, sum_add]
    right_distrib := fun f g h => by
      

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝¹ : Semiring k
inst✝ : Mul G
src✝ : AddCommMonoid (G →₀ k) := Finsupp.addCommMonoid
f g h : MonoidAlgebra k G
⊢ (f + g) * h = f * h + g * h

Next tactic:
haveI := Classical.decEq G
instance nonUnitalNonAssocSemiring : NonUnitalNonAssocSemiring (MonoidAlgebra k G) :=
  { Finsupp.addCommMonoid with
    -- Porting note: `refine` & `exact` are required because `simp` behaves differently.
    left_distrib := fun f g h => by
      haveI := Classical.decEq G
      simp only [mul_def]
      refine Eq.trans (congr_arg (sum f) (funext₂ fun a₁ b₁ => sum_add_index ?_ ?_)) ?_ <;>
        simp only [mul_add, mul_zero, single_zero, single_add, forall_true_iff, sum_add]
    right_distrib := fun f g h => by
      haveI := Classical.decEq G
      

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝¹ : Semiring k
inst✝ : Mul G
src✝ : AddCommMonoid (G →₀ k) := Finsupp.addCommMonoid
f g h : MonoidAlgebra k G
this : DecidableEq G
⊢ (f + g) * h = f * h + g * h

Next tactic:
simp only [mul_def]
instance nonUnitalNonAssocSemiring : NonUnitalNonAssocSemiring (MonoidAlgebra k G) :=
  { Finsupp.addCommMonoid with
    -- Porting note: `refine` & `exact` are required because `simp` behaves differently.
    left_distrib := fun f g h => by
      haveI := Classical.decEq G
      simp only [mul_def]
      refine Eq.trans (congr_arg (sum f) (funext₂ fun a₁ b₁ => sum_add_index ?_ ?_)) ?_ <;>
        simp only [mul_add, mul_zero, single_zero, single_add, forall_true_iff, sum_add]
    right_distrib := fun f g h => by
      haveI := Classical.decEq G
      simp only [mul_def]
      

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝¹ : Semiring k
inst✝ : Mul G
src✝ : AddCommMonoid (G →₀ k) := Finsupp.addCommMonoid
f g h : MonoidAlgebra k G
this : DecidableEq G
⊢ (sum (f + g) fun a₁ b₁ => sum h fun a₂ b₂ => single (a₁ * a₂) (b₁ * b₂)) =
    (sum f fun a₁ b₁ => sum h fun a₂ b₂ => single (a₁ * a₂) (b₁ * b₂)) +
      sum g fun a₁ b₁ => sum h fun a₂ b₂ => single (a₁ * a₂) (b₁ * b₂)

Next tactic:
refine Eq.trans (sum_add_index ?_ ?_) ?_
instance nonUnitalNonAssocSemiring : NonUnitalNonAssocSemiring (MonoidAlgebra k G) :=
  { Finsupp.addCommMonoid with
    -- Porting note: `refine` & `exact` are required because `simp` behaves differently.
    left_distrib := fun f g h => by
      haveI := Classical.decEq G
      simp only [mul_def]
      refine Eq.trans (congr_arg (sum f) (funext₂ fun a₁ b₁ => sum_add_index ?_ ?_)) ?_ <;>
        simp only [mul_add, mul_zero, single_zero, single_add, forall_true_iff, sum_add]
    right_distrib := fun f g h => by
      haveI := Classical.decEq G
      simp only [mul_def]
      refine Eq.trans (sum_add_index ?_ ?_) ?_ <;>
        

Proof state:
case refine_1
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝¹ : Semiring k
inst✝ : Mul G
src✝ : AddCommMonoid (G →₀ k) := Finsupp.addCommMonoid
f g h : MonoidAlgebra k G
this : DecidableEq G
⊢ ∀ a ∈ f.support ∪ g.support, (sum h fun a₂ b₂ => single (a * a₂) (0 * b₂)) = 0

Next tactic:
simp only [add_mul, zero_mul, single_zero, single_add, forall_true_iff, sum_zero, sum_add]
instance nonUnitalNonAssocSemiring : NonUnitalNonAssocSemiring (MonoidAlgebra k G) :=
  { Finsupp.addCommMonoid with
    -- Porting note: `refine` & `exact` are required because `simp` behaves differently.
    left_distrib := fun f g h => by
      haveI := Classical.decEq G
      simp only [mul_def]
      refine Eq.trans (congr_arg (sum f) (funext₂ fun a₁ b₁ => sum_add_index ?_ ?_)) ?_ <;>
        simp only [mul_add, mul_zero, single_zero, single_add, forall_true_iff, sum_add]
    right_distrib := fun f g h => by
      haveI := Classical.decEq G
      simp only [mul_def]
      refine Eq.trans (sum_add_index ?_ ?_) ?_ <;>
        

Proof state:
case refine_2
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝¹ : Semiring k
inst✝ : Mul G
src✝ : AddCommMonoid (G →₀ k) := Finsupp.addCommMonoid
f g h : MonoidAlgebra k G
this : DecidableEq G
⊢ ∀ a ∈ f.support ∪ g.support,
    ∀ (b₁ b₂ : k),
      (sum h fun a₂ b₂_1 => single (a * a₂) ((b₁ + b₂) * b₂_1)) =
        (sum h fun a₂ b₂ => single (a * a₂) (b₁ * b₂)) + sum h fun a₂ b₂_1 => single (a * a₂) (b₂ * b₂_1)

Next tactic:
simp only [add_mul, zero_mul, single_zero, single_add, forall_true_iff, sum_zero, sum_add]
instance nonUnitalNonAssocSemiring : NonUnitalNonAssocSemiring (MonoidAlgebra k G) :=
  { Finsupp.addCommMonoid with
    -- Porting note: `refine` & `exact` are required because `simp` behaves differently.
    left_distrib := fun f g h => by
      haveI := Classical.decEq G
      simp only [mul_def]
      refine Eq.trans (congr_arg (sum f) (funext₂ fun a₁ b₁ => sum_add_index ?_ ?_)) ?_ <;>
        simp only [mul_add, mul_zero, single_zero, single_add, forall_true_iff, sum_add]
    right_distrib := fun f g h => by
      haveI := Classical.decEq G
      simp only [mul_def]
      refine Eq.trans (sum_add_index ?_ ?_) ?_ <;>
        

Proof state:
case refine_3
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝¹ : Semiring k
inst✝ : Mul G
src✝ : AddCommMonoid (G →₀ k) := Finsupp.addCommMonoid
f g h : MonoidAlgebra k G
this : DecidableEq G
⊢ ((sum f fun a₁ b₁ => sum h fun a₂ b₂ => single (a₁ * a₂) (b₁ * b₂)) +
      sum g fun a₁ b₁ => sum h fun a₂ b₂ => single (a₁ * a₂) (b₁ * b₂)) =
    (sum f fun a₁ b₁ => sum h fun a₂ b₂ => single (a₁ * a₂) (b₁ * b₂)) +
      sum g fun a₁ b₁ => sum h fun a₂ b₂ => single (a₁ * a₂) (b₁ * b₂)

Next tactic:
simp only [add_mul, zero_mul, single_zero, single_add, forall_true_iff, sum_zero, sum_add]
instance nonUnitalNonAssocSemiring : NonUnitalNonAssocSemiring (MonoidAlgebra k G) :=
  { Finsupp.addCommMonoid with
    -- Porting note: `refine` & `exact` are required because `simp` behaves differently.
    left_distrib := fun f g h => by
      haveI := Classical.decEq G
      simp only [mul_def]
      refine Eq.trans (congr_arg (sum f) (funext₂ fun a₁ b₁ => sum_add_index ?_ ?_)) ?_ <;>
        simp only [mul_add, mul_zero, single_zero, single_add, forall_true_iff, sum_add]
    right_distrib := fun f g h => by
      haveI := Classical.decEq G
      simp only [mul_def]
      refine Eq.trans (sum_add_index ?_ ?_) ?_ <;>
        simp only [add_mul, zero_mul, single_zero, single_add, forall_true_iff, sum_zero, sum_add]
    zero_mul := fun f => by
      

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝¹ : Semiring k
inst✝ : Mul G
src✝ : AddCommMonoid (G →₀ k) := Finsupp.addCommMonoid
f : MonoidAlgebra k G
⊢ 0 * f = 0

Next tactic:
simp only [mul_def]
instance nonUnitalNonAssocSemiring : NonUnitalNonAssocSemiring (MonoidAlgebra k G) :=
  { Finsupp.addCommMonoid with
    -- Porting note: `refine` & `exact` are required because `simp` behaves differently.
    left_distrib := fun f g h => by
      haveI := Classical.decEq G
      simp only [mul_def]
      refine Eq.trans (congr_arg (sum f) (funext₂ fun a₁ b₁ => sum_add_index ?_ ?_)) ?_ <;>
        simp only [mul_add, mul_zero, single_zero, single_add, forall_true_iff, sum_add]
    right_distrib := fun f g h => by
      haveI := Classical.decEq G
      simp only [mul_def]
      refine Eq.trans (sum_add_index ?_ ?_) ?_ <;>
        simp only [add_mul, zero_mul, single_zero, single_add, forall_true_iff, sum_zero, sum_add]
    zero_mul := fun f => by
      simp only [mul_def]
      

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝¹ : Semiring k
inst✝ : Mul G
src✝ : AddCommMonoid (G →₀ k) := Finsupp.addCommMonoid
f : MonoidAlgebra k G
⊢ (sum 0 fun a₁ b₁ => sum f fun a₂ b₂ => single (a₁ * a₂) (b₁ * b₂)) = 0

Next tactic:
exact sum_zero_index
instance nonUnitalNonAssocSemiring : NonUnitalNonAssocSemiring (MonoidAlgebra k G) :=
  { Finsupp.addCommMonoid with
    -- Porting note: `refine` & `exact` are required because `simp` behaves differently.
    left_distrib := fun f g h => by
      haveI := Classical.decEq G
      simp only [mul_def]
      refine Eq.trans (congr_arg (sum f) (funext₂ fun a₁ b₁ => sum_add_index ?_ ?_)) ?_ <;>
        simp only [mul_add, mul_zero, single_zero, single_add, forall_true_iff, sum_add]
    right_distrib := fun f g h => by
      haveI := Classical.decEq G
      simp only [mul_def]
      refine Eq.trans (sum_add_index ?_ ?_) ?_ <;>
        simp only [add_mul, zero_mul, single_zero, single_add, forall_true_iff, sum_zero, sum_add]
    zero_mul := fun f => by
      simp only [mul_def]
      exact sum_zero_index
    mul_zero := fun f => by
      

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝¹ : Semiring k
inst✝ : Mul G
src✝ : AddCommMonoid (G →₀ k) := Finsupp.addCommMonoid
f : MonoidAlgebra k G
⊢ f * 0 = 0

Next tactic:
simp only [mul_def]
instance nonUnitalNonAssocSemiring : NonUnitalNonAssocSemiring (MonoidAlgebra k G) :=
  { Finsupp.addCommMonoid with
    -- Porting note: `refine` & `exact` are required because `simp` behaves differently.
    left_distrib := fun f g h => by
      haveI := Classical.decEq G
      simp only [mul_def]
      refine Eq.trans (congr_arg (sum f) (funext₂ fun a₁ b₁ => sum_add_index ?_ ?_)) ?_ <;>
        simp only [mul_add, mul_zero, single_zero, single_add, forall_true_iff, sum_add]
    right_distrib := fun f g h => by
      haveI := Classical.decEq G
      simp only [mul_def]
      refine Eq.trans (sum_add_index ?_ ?_) ?_ <;>
        simp only [add_mul, zero_mul, single_zero, single_add, forall_true_iff, sum_zero, sum_add]
    zero_mul := fun f => by
      simp only [mul_def]
      exact sum_zero_index
    mul_zero := fun f => by
      simp only [mul_def]
      

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝¹ : Semiring k
inst✝ : Mul G
src✝ : AddCommMonoid (G →₀ k) := Finsupp.addCommMonoid
f : MonoidAlgebra k G
⊢ (sum f fun a₁ b₁ => sum 0 fun a₂ b₂ => single (a₁ * a₂) (b₁ * b₂)) = 0

Next tactic:
exact Eq.trans (congr_arg (sum f) (funext₂ fun a₁ b₁ => sum_zero_index)) sum_zero
theorem liftNC_mul {g_hom : Type*} [MulHomClass g_hom G R] (f : k →+* R) (g : g_hom)
    (a b : MonoidAlgebra k G) (h_comm : ∀ {x y}, y ∈ a.support → Commute (f (b x)) (g y)) :
    liftNC (f : k →+ R) g (a * b) = liftNC (f : k →+ R) g a * liftNC (f : k →+ R) g b := by
  

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝³ : Semiring k
inst✝² : Mul G
inst✝¹ : Semiring R
g_hom : Type u_3
inst✝ : MulHomClass g_hom G R
f : k →+* R
g : g_hom
a b : MonoidAlgebra k G
h_comm : ∀ {x y : G}, y ∈ a.support → Commute (f (b x)) (g y)
⊢ (liftNC ↑f ⇑g) (a * b) = (liftNC ↑f ⇑g) a * (liftNC ↑f ⇑g) b

Next tactic:
conv_rhs => rw [← sum_single a, ← sum_single b]
theorem liftNC_mul {g_hom : Type*} [MulHomClass g_hom G R] (f : k →+* R) (g : g_hom)
    (a b : MonoidAlgebra k G) (h_comm : ∀ {x y}, y ∈ a.support → Commute (f (b x)) (g y)) :
    liftNC (f : k →+ R) g (a * b) = liftNC (f : k →+ R) g a * liftNC (f : k →+ R) g b := by
  conv_rhs => 

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝³ : Semiring k
inst✝² : Mul G
inst✝¹ : Semiring R
g_hom : Type u_3
inst✝ : MulHomClass g_hom G R
f : k →+* R
g : g_hom
a b : MonoidAlgebra k G
h_comm : ∀ {x y : G}, y ∈ a.support → Commute (f (b x)) (g y)
| (liftNC ↑f ⇑g) a * (liftNC ↑f ⇑g) b

Next tactic:
rw [← sum_single a, ← sum_single b]
theorem liftNC_mul {g_hom : Type*} [MulHomClass g_hom G R] (f : k →+* R) (g : g_hom)
    (a b : MonoidAlgebra k G) (h_comm : ∀ {x y}, y ∈ a.support → Commute (f (b x)) (g y)) :
    liftNC (f : k →+ R) g (a * b) = liftNC (f : k →+ R) g a * liftNC (f : k →+ R) g b := by
  conv_rhs => rw [← sum_single a, ← sum_single b]
  -- Porting note: `(liftNC _ g).map_finsupp_sum` → `map_finsupp_sum`
  

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝³ : Semiring k
inst✝² : Mul G
inst✝¹ : Semiring R
g_hom : Type u_3
inst✝ : MulHomClass g_hom G R
f : k →+* R
g : g_hom
a b : MonoidAlgebra k G
h_comm : ∀ {x y : G}, y ∈ a.support → Commute (f (b x)) (g y)
⊢ (liftNC ↑f ⇑g) (a * b) = (liftNC ↑f ⇑g) (sum a single) * (liftNC ↑f ⇑g) (sum b single)

Next tactic:
simp_rw [mul_def, map_finsupp_sum, liftNC_single, Finsupp.sum_mul, Finsupp.mul_sum]
theorem liftNC_mul {g_hom : Type*} [MulHomClass g_hom G R] (f : k →+* R) (g : g_hom)
    (a b : MonoidAlgebra k G) (h_comm : ∀ {x y}, y ∈ a.support → Commute (f (b x)) (g y)) :
    liftNC (f : k →+ R) g (a * b) = liftNC (f : k →+ R) g a * liftNC (f : k →+ R) g b := by
  conv_rhs => rw [← sum_single a, ← sum_single b]
  -- Porting note: `(liftNC _ g).map_finsupp_sum` → `map_finsupp_sum`
  simp_rw [mul_def, map_finsupp_sum, liftNC_single, Finsupp.sum_mul, Finsupp.mul_sum]
  

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝³ : Semiring k
inst✝² : Mul G
inst✝¹ : Semiring R
g_hom : Type u_3
inst✝ : MulHomClass g_hom G R
f : k →+* R
g : g_hom
a b : MonoidAlgebra k G
h_comm : ∀ {x y : G}, y ∈ a.support → Commute (f (b x)) (g y)
⊢ (sum a fun a b_1 => sum b fun a_1 b => ↑f (b_1 * b) * g (a * a_1)) =
    sum a fun a c => sum b fun a_1 c_1 => ↑f c * g a * (↑f c_1 * g a_1)

Next tactic:
refine Finset.sum_congr rfl fun y hy => Finset.sum_congr rfl fun x _hx => ?_