-- Mathlib/Algebra/MonoidAlgebra/Defs.lean
theorem mul_single_apply_of_not_exists_mul [Mul G] (r : k) {g g' : G} (x : MonoidAlgebra k G)
    (h : ¬∃ d, g' = d * g) : (x * single g r) g' = 0

Proof state:
case h
k : Type u₁
G : Type u₂
inst✝¹ : Semiring k
inst✝ : Mul G
r : k
g : G
x : MonoidAlgebra k G
g'' : G
_hg'' : g'' ∈ x.support
h : ¬∃ d, g'' * g = d * g
⊢ x g'' * r = 0

Tactic:
exfalso

Result:
case h
k : Type u₁
G : Type u₂
inst✝¹ : Semiring k
inst✝ : Mul G
r : k
g : G
x : MonoidAlgebra k G
g'' : G
_hg'' : g'' ∈ x.support
h : ¬∃ d, g'' * g = d * g
⊢ False

Proof state:
case h
k : Type u₁
G : Type u₂
inst✝¹ : Semiring k
inst✝ : Mul G
r : k
g : G
x : MonoidAlgebra k G
g'' : G
_hg'' : g'' ∈ x.support
h : ¬∃ d, g'' * g = d * g
⊢ False

Tactic:
exact h ⟨_, rfl⟩

Result:
no goals

Proof state:
k : Type u₁
G : Type u₂
inst✝¹ : Semiring k
inst✝ : Mul G
r : k
g g' : G
x : MonoidAlgebra k G
h : ¬∃ d, g' = d * g
⊢ (sum x fun x v => if x * g = g' then v * r else 0) = 0

Tactic:
apply Finset.sum_eq_zero

Result:
case h
k : Type u₁
G : Type u₂
inst✝¹ : Semiring k
inst✝ : Mul G
r : k
g g' : G
x : MonoidAlgebra k G
h : ¬∃ d, g' = d * g
⊢ ∀ x_1 ∈ x.support, (fun x v => if x * g = g' then v * r else 0) x_1 (x x_1) = 0

Proof state:
k : Type u₁
G : Type u₂
inst✝¹ : Semiring k
inst✝ : Mul G
r : k
g g' : G
x : MonoidAlgebra k G
h : ¬∃ d, g' = d * g
⊢ (sum x fun x v => if x * g = g' then v * 0 else 0) = 0

Tactic:
simp_rw [Finsupp.sum, mul_zero, ite_self, Finset.sum_const_zero]

Result:
no goals

Proof state:
k : Type u₁
G : Type u₂
inst✝¹ : Semiring k
inst✝ : Mul G
r : k
g g' : G
x : MonoidAlgebra k G
h : ¬∃ d, g' = d * g
⊢ (x * single g r) g' = 0

Tactic:
rw [mul_apply, Finsupp.sum_comm, Finsupp.sum_single_index]

Result:
k : Type u₁
G : Type u₂
inst✝¹ : Semiring k
inst✝ : Mul G
r : k
g g' : G
x : MonoidAlgebra k G
h : ¬∃ d, g' = d * g
⊢ (sum x fun x v => if x * g = g' then v * r else 0) = 0

k : Type u₁
G : Type u₂
inst✝¹ : Semiring k
inst✝ : Mul G
r : k
g g' : G
x : MonoidAlgebra k G
h : ¬∃ d, g' = d * g
⊢ (sum x fun x v => if x * g = g' then v * 0 else 0) = 0

Proof state:
k : Type u₁
G : Type u₂
inst✝¹ : Semiring k
inst✝ : Mul G
r : k
g g' : G
x : MonoidAlgebra k G
h : ¬∃ d, g' = d * g
⊢ (sum x fun x v => if x * g = g' then v * r else 0) = 0

k : Type u₁
G : Type u₂
inst✝¹ : Semiring k
inst✝ : Mul G
r : k
g g' : G
x : MonoidAlgebra k G
h : ¬∃ d, g' = d * g
⊢ (sum x fun x v => if x * g = g' then v * 0 else 0) = 0

Tactic:
swap

Result:
k : Type u₁
G : Type u₂
inst✝¹ : Semiring k
inst✝ : Mul G
r : k
g g' : G
x : MonoidAlgebra k G
h : ¬∃ d, g' = d * g
⊢ (sum x fun x v => if x * g = g' then v * 0 else 0) = 0

k : Type u₁
G : Type u₂
inst✝¹ : Semiring k
inst✝ : Mul G
r : k
g g' : G
x : MonoidAlgebra k G
h : ¬∃ d, g' = d * g
⊢ (sum x fun x v => if x * g = g' then v * r else 0) = 0

Proof state:
case h
k : Type u₁
G : Type u₂
inst✝¹ : Semiring k
inst✝ : Mul G
r : k
g g' : G
x : MonoidAlgebra k G
h : ¬∃ d, g' = d * g
⊢ ∀ x_1 ∈ x.support, (fun x v => if x * g = g' then v * r else 0) x_1 (x x_1) = 0

Tactic:
simp_rw [ite_eq_right_iff]

Result:
case h
k : Type u₁
G : Type u₂
inst✝¹ : Semiring k
inst✝ : Mul G
r : k
g g' : G
x : MonoidAlgebra k G
h : ¬∃ d, g' = d * g
⊢ ∀ x_1 ∈ x.support, x_1 * g = g' → x x_1 * r = 0

Proof state:
case h
k : Type u₁
G : Type u₂
inst✝¹ : Semiring k
inst✝ : Mul G
r : k
g g' : G
x : MonoidAlgebra k G
h : ¬∃ d, g' = d * g
⊢ ∀ x_1 ∈ x.support, x_1 * g = g' → x x_1 * r = 0

Tactic:
rintro g'' _hg'' rfl

Result:
case h
k : Type u₁
G : Type u₂
inst✝¹ : Semiring k
inst✝ : Mul G
r : k
g : G
x : MonoidAlgebra k G
g'' : G
_hg'' : g'' ∈ x.support
h : ¬∃ d, g'' * g = d * g
⊢ x g'' * r = 0