Theorem: MonoidAlgebra.mem_ideal_span_of_image
File: Mathlib/Algebra/MonoidAlgebra/Ideal.lean

tactic: let RHS : Ideal (MonoidAlgebra k G) :=
  { carrier := { p | ∀ m : G, m ∈ p.support → ∃ m' ∈ s, ∃ d, m = d * m' }
    add_mem' := fun {x y} hx hy m hm => by
      classical exact (Finset.mem_union.1 <| Finsupp.support_add hm).elim (hx m) (hy m)
    zero_mem' := fun m hm => by cases hm
    smul_mem' := fun x y hy m hm => by
      classical
      rw [smul_eq_mul, mul_def] at hm
      replace hm := Finset.mem_biUnion.mp (Finsupp.support_sum hm)
      obtain ⟨xm, -, hm⟩ := hm
      replace hm := Finset.mem_biUnion.mp (Finsupp.support_sum hm)
      obtain ⟨ym, hym, hm⟩ := hm
      obtain rfl := Finset.mem_singleton.mp (Finsupp.support_single_subset hm)
      refine (hy _ hym).imp fun sm p => And.imp_right ?_ p
      rintro ⟨d, rfl⟩
      exact ⟨xm * d, (mul_assoc _ _ _).symm⟩ }
state_before: k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
x : MonoidAlgebra k G
⊢ x ∈ Ideal.span (⇑(of k G) '' s) ↔ ∀ m ∈ x.support, ∃ m' ∈ s, ∃ d, m = d * m'
state_after: k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
x : MonoidAlgebra k G
RHS : Ideal (MonoidAlgebra k G) :=
  { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯, smul_mem' := ⋯ }
⊢ x ∈ Ideal.span (⇑(of k G) '' s) ↔ ∀ m ∈ x.support, ∃ m' ∈ s, ∃ d, m = d * m'

tactic: change _ ↔ x ∈ RHS
state_before: k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
x : MonoidAlgebra k G
RHS : Ideal (MonoidAlgebra k G) :=
  { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯, smul_mem' := ⋯ }
⊢ x ∈ Ideal.span (⇑(of k G) '' s) ↔ ∀ m ∈ x.support, ∃ m' ∈ s, ∃ d, m = d * m'
state_after: k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
x : MonoidAlgebra k G
RHS : Ideal (MonoidAlgebra k G) :=
  { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯, smul_mem' := ⋯ }
⊢ x ∈ Ideal.span (⇑(of k G) '' s) ↔ x ∈ RHS

tactic: constructor
state_before: k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
x : MonoidAlgebra k G
RHS : Ideal (MonoidAlgebra k G) :=
  { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯, smul_mem' := ⋯ }
⊢ x ∈ Ideal.span (⇑(of k G) '' s) ↔ x ∈ RHS
state_after: case mp
k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
x : MonoidAlgebra k G
RHS : Ideal (MonoidAlgebra k G) :=
  { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯, smul_mem' := ⋯ }
⊢ x ∈ Ideal.span (⇑(of k G) '' s) → x ∈ RHS

case mpr
k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
x : MonoidAlgebra k G
RHS : Ideal (MonoidAlgebra k G) :=
  { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯, smul_mem' := ⋯ }
⊢ x ∈ RHS → x ∈ Ideal.span (⇑(of k G) '' s)

tactic: classical exact (Finset.mem_union.1 <| Finsupp.support_add hm).elim (hx m) (hy m)
state_before: k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
x✝ x y : MonoidAlgebra k G
hx : x ∈ {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}
hy : y ∈ {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}
m : G
hm : m ∈ (x + y).support
⊢ ∃ m' ∈ s, ∃ d, m = d * m'
state_after: no goals

tactic: exact (Finset.mem_union.1 <| Finsupp.support_add hm).elim (hx m) (hy m)
state_before: k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
x✝ x y : MonoidAlgebra k G
hx : x ∈ {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}
hy : y ∈ {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}
m : G
hm : m ∈ (x + y).support
⊢ ∃ m' ∈ s, ∃ d, m = d * m'
state_after: no goals

tactic: cases hm
state_before: k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
x : MonoidAlgebra k G
m : G
hm : m ∈ Finsupp.support 0
⊢ ∃ m' ∈ s, ∃ d, m = d * m'
state_after: no goals

tactic: classical
rw [smul_eq_mul, mul_def] at hm
replace hm := Finset.mem_biUnion.mp (Finsupp.support_sum hm)
obtain ⟨xm, -, hm⟩ := hm
replace hm := Finset.mem_biUnion.mp (Finsupp.support_sum hm)
obtain ⟨ym, hym, hm⟩ := hm
obtain rfl := Finset.mem_singleton.mp (Finsupp.support_single_subset hm)
refine (hy _ hym).imp fun sm p => And.imp_right ?_ p
rintro ⟨d, rfl⟩
exact ⟨xm * d, (mul_assoc _ _ _).symm⟩
state_before: k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
x✝ x y : MonoidAlgebra k G
hy : y ∈ { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯ }.carrier
m : G
hm : m ∈ (x • y).support
⊢ ∃ m' ∈ s, ∃ d, m = d * m'
state_after: no goals

tactic: rw [smul_eq_mul, mul_def] at hm
state_before: k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
x✝ x y : MonoidAlgebra k G
hy : y ∈ { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯ }.carrier
m : G
hm : m ∈ (x • y).support
⊢ ∃ m' ∈ s, ∃ d, m = d * m'
state_after: k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
x✝ x y : MonoidAlgebra k G
hy : y ∈ { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯ }.carrier
m : G
hm : m ∈ (Finsupp.sum x fun a₁ b₁ => Finsupp.sum y fun a₂ b₂ => single (a₁ * a₂) (b₁ * b₂)).support
⊢ ∃ m' ∈ s, ∃ d, m = d * m'

tactic: replace hm := Finset.mem_biUnion.mp (Finsupp.support_sum hm)
state_before: k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
x✝ x y : MonoidAlgebra k G
hy : y ∈ { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯ }.carrier
m : G
hm : m ∈ (Finsupp.sum x fun a₁ b₁ => Finsupp.sum y fun a₂ b₂ => single (a₁ * a₂) (b₁ * b₂)).support
⊢ ∃ m' ∈ s, ∃ d, m = d * m'
state_after: k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
x✝ x y : MonoidAlgebra k G
hy : y ∈ { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯ }.carrier
m : G
hm : ∃ a ∈ x.support, m ∈ (Finsupp.sum y fun a₂ b₂ => single (a * a₂) (x a * b₂)).support
⊢ ∃ m' ∈ s, ∃ d, m = d * m'

tactic: obtain ⟨xm, -, hm⟩ := hm
state_before: k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
x✝ x y : MonoidAlgebra k G
hy : y ∈ { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯ }.carrier
m : G
hm : ∃ a ∈ x.support, m ∈ (Finsupp.sum y fun a₂ b₂ => single (a * a₂) (x a * b₂)).support
⊢ ∃ m' ∈ s, ∃ d, m = d * m'
state_after: case intro.intro
k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
x✝ x y : MonoidAlgebra k G
hy : y ∈ { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯ }.carrier
m xm : G
hm : m ∈ (Finsupp.sum y fun a₂ b₂ => single (xm * a₂) (x xm * b₂)).support
⊢ ∃ m' ∈ s, ∃ d, m = d * m'

tactic: replace hm := Finset.mem_biUnion.mp (Finsupp.support_sum hm)
state_before: case intro.intro
k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
x✝ x y : MonoidAlgebra k G
hy : y ∈ { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯ }.carrier
m xm : G
hm : m ∈ (Finsupp.sum y fun a₂ b₂ => single (xm * a₂) (x xm * b₂)).support
⊢ ∃ m' ∈ s, ∃ d, m = d * m'
state_after: case intro.intro
k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
x✝ x y : MonoidAlgebra k G
hy : y ∈ { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯ }.carrier
m xm : G
hm : ∃ a ∈ y.support, m ∈ (single (xm * a) (x xm * y a)).support
⊢ ∃ m' ∈ s, ∃ d, m = d * m'

tactic: obtain ⟨ym, hym, hm⟩ := hm
state_before: case intro.intro
k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
x✝ x y : MonoidAlgebra k G
hy : y ∈ { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯ }.carrier
m xm : G
hm : ∃ a ∈ y.support, m ∈ (single (xm * a) (x xm * y a)).support
⊢ ∃ m' ∈ s, ∃ d, m = d * m'
state_after: case intro.intro.intro.intro
k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
x✝ x y : MonoidAlgebra k G
hy : y ∈ { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯ }.carrier
m xm ym : G
hym : ym ∈ y.support
hm : m ∈ (single (xm * ym) (x xm * y ym)).support
⊢ ∃ m' ∈ s, ∃ d, m = d * m'

tactic: obtain rfl := Finset.mem_singleton.mp (Finsupp.support_single_subset hm)
state_before: case intro.intro.intro.intro
k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
x✝ x y : MonoidAlgebra k G
hy : y ∈ { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯ }.carrier
m xm ym : G
hym : ym ∈ y.support
hm : m ∈ (single (xm * ym) (x xm * y ym)).support
⊢ ∃ m' ∈ s, ∃ d, m = d * m'
state_after: case intro.intro.intro.intro
k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
x✝ x y : MonoidAlgebra k G
hy : y ∈ { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯ }.carrier
xm ym : G
hym : ym ∈ y.support
hm : xm * ym ∈ (single (xm * ym) (x xm * y ym)).support
⊢ ∃ m' ∈ s, ∃ d, xm * ym = d * m'

tactic: refine (hy _ hym).imp fun sm p => And.imp_right ?_ p
state_before: case intro.intro.intro.intro
k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
x✝ x y : MonoidAlgebra k G
hy : y ∈ { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯ }.carrier
xm ym : G
hym : ym ∈ y.support
hm : xm * ym ∈ (single (xm * ym) (x xm * y ym)).support
⊢ ∃ m' ∈ s, ∃ d, xm * ym = d * m'
state_after: case intro.intro.intro.intro
k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
x✝ x y : MonoidAlgebra k G
hy : y ∈ { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯ }.carrier
xm ym : G
hym : ym ∈ y.support
hm : xm * ym ∈ (single (xm * ym) (x xm * y ym)).support
sm : G
p : sm ∈ s ∧ ∃ d, ym = d * sm
⊢ (∃ d, ym = d * sm) → ∃ d, xm * ym = d * sm

tactic: rintro ⟨d, rfl⟩
state_before: case intro.intro.intro.intro
k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
x✝ x y : MonoidAlgebra k G
hy : y ∈ { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯ }.carrier
xm ym : G
hym : ym ∈ y.support
hm : xm * ym ∈ (single (xm * ym) (x xm * y ym)).support
sm : G
p : sm ∈ s ∧ ∃ d, ym = d * sm
⊢ (∃ d, ym = d * sm) → ∃ d, xm * ym = d * sm
state_after: case intro.intro.intro.intro.intro
k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
x✝ x y : MonoidAlgebra k G
hy : y ∈ { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯ }.carrier
xm sm d : G
hym : d * sm ∈ y.support
hm : xm * (d * sm) ∈ (single (xm * (d * sm)) (x xm * y (d * sm))).support
p : sm ∈ s ∧ ∃ d_1, d * sm = d_1 * sm
⊢ ∃ d_1, xm * (d * sm) = d_1 * sm

tactic: exact ⟨xm * d, (mul_assoc _ _ _).symm⟩
state_before: case intro.intro.intro.intro.intro
k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
x✝ x y : MonoidAlgebra k G
hy : y ∈ { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯ }.carrier
xm sm d : G
hym : d * sm ∈ y.support
hm : xm * (d * sm) ∈ (single (xm * (d * sm)) (x xm * y (d * sm))).support
p : sm ∈ s ∧ ∃ d_1, d * sm = d_1 * sm
⊢ ∃ d_1, xm * (d * sm) = d_1 * sm
state_after: no goals

tactic: revert x
state_before: case mp
k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
x : MonoidAlgebra k G
RHS : Ideal (MonoidAlgebra k G) :=
  { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯, smul_mem' := ⋯ }
⊢ x ∈ Ideal.span (⇑(of k G) '' s) → x ∈ RHS
state_after: case mp
k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
RHS : Ideal (MonoidAlgebra k G) :=
  { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯, smul_mem' := ⋯ }
⊢ ∀ {x : MonoidAlgebra k G}, x ∈ Ideal.span (⇑(of k G) '' s) → x ∈ RHS

tactic: rw [← SetLike.le_def]
state_before: case mp
k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
RHS : Ideal (MonoidAlgebra k G) :=
  { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯, smul_mem' := ⋯ }
⊢ ∀ {x : MonoidAlgebra k G}, x ∈ Ideal.span (⇑(of k G) '' s) → x ∈ RHS
state_after: case mp
k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
RHS : Ideal (MonoidAlgebra k G) :=
  { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯, smul_mem' := ⋯ }
⊢ Ideal.span (⇑(of k G) '' s) ≤ RHS

tactic: refine Ideal.span_le.2 ?_
state_before: case mp
k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
RHS : Ideal (MonoidAlgebra k G) :=
  { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯, smul_mem' := ⋯ }
⊢ Ideal.span (⇑(of k G) '' s) ≤ RHS
state_after: case mp
k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
RHS : Ideal (MonoidAlgebra k G) :=
  { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯, smul_mem' := ⋯ }
⊢ ⇑(of k G) '' s ⊆ ↑RHS

tactic: rintro _ ⟨i, hi, rfl⟩ m hm
state_before: case mp
k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
RHS : Ideal (MonoidAlgebra k G) :=
  { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯, smul_mem' := ⋯ }
⊢ ⇑(of k G) '' s ⊆ ↑RHS
state_after: case mp.intro.intro
k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
RHS : Ideal (MonoidAlgebra k G) :=
  { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯, smul_mem' := ⋯ }
i : G
hi : i ∈ s
m : G
hm : m ∈ ((of k G) i).support
⊢ ∃ m' ∈ s, ∃ d, m = d * m'

tactic: refine ⟨_, hi, 1, ?_⟩
state_before: case mp.intro.intro
k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
RHS : Ideal (MonoidAlgebra k G) :=
  { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯, smul_mem' := ⋯ }
i : G
hi : i ∈ s
m : G
hm : m ∈ ((of k G) i).support
⊢ ∃ m' ∈ s, ∃ d, m = d * m'
state_after: case mp.intro.intro
k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
RHS : Ideal (MonoidAlgebra k G) :=
  { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯, smul_mem' := ⋯ }
i : G
hi : i ∈ s
m : G
hm : m ∈ ((of k G) i).support
⊢ m = 1 * i

tactic: obtain rfl := Finset.mem_singleton.mp (Finsupp.support_single_subset hm)
state_before: case mp.intro.intro
k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
RHS : Ideal (MonoidAlgebra k G) :=
  { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯, smul_mem' := ⋯ }
i : G
hi : i ∈ s
m : G
hm : m ∈ ((of k G) i).support
⊢ m = 1 * i
state_after: case mp.intro.intro
k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
RHS : Ideal (MonoidAlgebra k G) :=
  { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯, smul_mem' := ⋯ }
m : G
hi : m ∈ s
hm : m ∈ ((of k G) m).support
⊢ m = 1 * m

tactic: exact (one_mul _).symm
state_before: case mp.intro.intro
k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
RHS : Ideal (MonoidAlgebra k G) :=
  { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯, smul_mem' := ⋯ }
m : G
hi : m ∈ s
hm : m ∈ ((of k G) m).support
⊢ m = 1 * m
state_after: no goals

tactic: intro hx
state_before: case mpr
k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
x : MonoidAlgebra k G
RHS : Ideal (MonoidAlgebra k G) :=
  { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯, smul_mem' := ⋯ }
⊢ x ∈ RHS → x ∈ Ideal.span (⇑(of k G) '' s)
state_after: case mpr
k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
x : MonoidAlgebra k G
RHS : Ideal (MonoidAlgebra k G) :=
  { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯, smul_mem' := ⋯ }
hx : x ∈ RHS
⊢ x ∈ Ideal.span (⇑(of k G) '' s)

tactic: rw [← Finsupp.sum_single x]
state_before: case mpr
k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
x : MonoidAlgebra k G
RHS : Ideal (MonoidAlgebra k G) :=
  { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯, smul_mem' := ⋯ }
hx : x ∈ RHS
⊢ x ∈ Ideal.span (⇑(of k G) '' s)
state_after: case mpr
k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
x : MonoidAlgebra k G
RHS : Ideal (MonoidAlgebra k G) :=
  { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯, smul_mem' := ⋯ }
hx : x ∈ RHS
⊢ Finsupp.sum x Finsupp.single ∈ Ideal.span (⇑(of k G) '' s)

tactic: refine Ideal.sum_mem _ fun i hi => ?_
state_before: case mpr
k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
x : MonoidAlgebra k G
RHS : Ideal (MonoidAlgebra k G) :=
  { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯, smul_mem' := ⋯ }
hx : x ∈ RHS
⊢ Finsupp.sum x Finsupp.single ∈ Ideal.span (⇑(of k G) '' s)
state_after: case mpr
k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
x : MonoidAlgebra k G
RHS : Ideal (MonoidAlgebra k G) :=
  { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯, smul_mem' := ⋯ }
hx : x ∈ RHS
i : G
hi : i ∈ x.support
⊢ Finsupp.single i (x i) ∈ Ideal.span (⇑(of k G) '' s)

tactic: obtain ⟨d, hd, d2, rfl⟩ := hx _ hi
state_before: case mpr
k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
x : MonoidAlgebra k G
RHS : Ideal (MonoidAlgebra k G) :=
  { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯, smul_mem' := ⋯ }
hx : x ∈ RHS
i : G
hi : i ∈ x.support
⊢ Finsupp.single i (x i) ∈ Ideal.span (⇑(of k G) '' s)
state_after: case mpr.intro.intro.intro
k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
x : MonoidAlgebra k G
RHS : Ideal (MonoidAlgebra k G) :=
  { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯, smul_mem' := ⋯ }
hx : x ∈ RHS
d : G
hd : d ∈ s
d2 : G
hi : d2 * d ∈ x.support
⊢ Finsupp.single (d2 * d) (x (d2 * d)) ∈ Ideal.span (⇑(of k G) '' s)

tactic: convert Ideal.mul_mem_left _ (id <| Finsupp.single d2 <| x (d2 * d) : MonoidAlgebra k G) _
state_before: case mpr.intro.intro.intro
k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
x : MonoidAlgebra k G
RHS : Ideal (MonoidAlgebra k G) :=
  { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯, smul_mem' := ⋯ }
hx : x ∈ RHS
d : G
hd : d ∈ s
d2 : G
hi : d2 * d ∈ x.support
⊢ Finsupp.single (d2 * d) (x (d2 * d)) ∈ Ideal.span (⇑(of k G) '' s)
state_after: case h.e'_4
k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
x : MonoidAlgebra k G
RHS : Ideal (MonoidAlgebra k G) :=
  { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯, smul_mem' := ⋯ }
hx : x ∈ RHS
d : G
hd : d ∈ s
d2 : G
hi : d2 * d ∈ x.support
⊢ Finsupp.single (d2 * d) (x (d2 * d)) = id (Finsupp.single d2 (x (d2 * d))) * ?mpr.intro.intro.intro.convert_2

case mpr.intro.intro.intro.convert_2
k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
x : MonoidAlgebra k G
RHS : Ideal (MonoidAlgebra k G) :=
  { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯, smul_mem' := ⋯ }
hx : x ∈ RHS
d : G
hd : d ∈ s
d2 : G
hi : d2 * d ∈ x.support
⊢ MonoidAlgebra k G

case mpr.intro.intro.intro.convert_3
k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
x : MonoidAlgebra k G
RHS : Ideal (MonoidAlgebra k G) :=
  { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯, smul_mem' := ⋯ }
hx : x ∈ RHS
d : G
hd : d ∈ s
d2 : G
hi : d2 * d ∈ x.support
⊢ ?mpr.intro.intro.intro.convert_2 ∈ Ideal.span (⇑(of k G) '' s)

tactic: pick_goal 3
state_before: case h.e'_4
k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
x : MonoidAlgebra k G
RHS : Ideal (MonoidAlgebra k G) :=
  { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯, smul_mem' := ⋯ }
hx : x ∈ RHS
d : G
hd : d ∈ s
d2 : G
hi : d2 * d ∈ x.support
⊢ Finsupp.single (d2 * d) (x (d2 * d)) = id (Finsupp.single d2 (x (d2 * d))) * ?mpr.intro.intro.intro.convert_2

case mpr.intro.intro.intro.convert_2
k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
x : MonoidAlgebra k G
RHS : Ideal (MonoidAlgebra k G) :=
  { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯, smul_mem' := ⋯ }
hx : x ∈ RHS
d : G
hd : d ∈ s
d2 : G
hi : d2 * d ∈ x.support
⊢ MonoidAlgebra k G

case mpr.intro.intro.intro.convert_3
k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
x : MonoidAlgebra k G
RHS : Ideal (MonoidAlgebra k G) :=
  { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯, smul_mem' := ⋯ }
hx : x ∈ RHS
d : G
hd : d ∈ s
d2 : G
hi : d2 * d ∈ x.support
⊢ ?mpr.intro.intro.intro.convert_2 ∈ Ideal.span (⇑(of k G) '' s)
state_after: case mpr.intro.intro.intro.convert_3
k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
x : MonoidAlgebra k G
RHS : Ideal (MonoidAlgebra k G) :=
  { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯, smul_mem' := ⋯ }
hx : x ∈ RHS
d : G
hd : d ∈ s
d2 : G
hi : d2 * d ∈ x.support
⊢ ?mpr.intro.intro.intro.convert_2 ∈ Ideal.span (⇑(of k G) '' s)

case h.e'_4
k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
x : MonoidAlgebra k G
RHS : Ideal (MonoidAlgebra k G) :=
  { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯, smul_mem' := ⋯ }
hx : x ∈ RHS
d : G
hd : d ∈ s
d2 : G
hi : d2 * d ∈ x.support
⊢ Finsupp.single (d2 * d) (x (d2 * d)) = id (Finsupp.single d2 (x (d2 * d))) * ?mpr.intro.intro.intro.convert_2

case mpr.intro.intro.intro.convert_2
k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
x : MonoidAlgebra k G
RHS : Ideal (MonoidAlgebra k G) :=
  { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯, smul_mem' := ⋯ }
hx : x ∈ RHS
d : G
hd : d ∈ s
d2 : G
hi : d2 * d ∈ x.support
⊢ MonoidAlgebra k G

tactic: rw [id, MonoidAlgebra.of_apply, MonoidAlgebra.single_mul_single, mul_one]
state_before: case h.e'_4
k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
x : MonoidAlgebra k G
RHS : Ideal (MonoidAlgebra k G) :=
  { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯, smul_mem' := ⋯ }
hx : x ∈ RHS
d : G
hd : d ∈ s
d2 : G
hi : d2 * d ∈ x.support
⊢ Finsupp.single (d2 * d) (x (d2 * d)) = id (Finsupp.single d2 (x (d2 * d))) * (of k G) d
state_after: no goals

tactic: exact Ideal.subset_span ⟨_, hd, rfl⟩
state_before: case mpr.intro.intro.intro.convert_3
k : Type u_1
A : Type u_2
G : Type u_3
inst✝¹ : Monoid G
inst✝ : Semiring k
s : Set G
x : MonoidAlgebra k G
RHS : Ideal (MonoidAlgebra k G) :=
  { carrier := {p | ∀ m ∈ p.support, ∃ m' ∈ s, ∃ d, m = d * m'}, add_mem' := ⋯, zero_mem' := ⋯, smul_mem' := ⋯ }
hx : x ∈ RHS
d : G
hd : d ∈ s
d2 : G
hi : d2 * d ∈ x.support
⊢ ?mpr.intro.intro.intro.convert_2 ∈ Ideal.span (⇑(of k G) '' s)
state_after: no goals