Theorem: AddMonoidAlgebra.divOf_add_modOf
File: Mathlib/Algebra/MonoidAlgebra/Division.lean

tactic: refine Finsupp.ext fun g' => ?_
state_before: k : Type u_1
G : Type u_2
inst✝¹ : Semiring k
inst✝ : AddCancelCommMonoid G
x : k[G]
g : G
⊢ of' k G g * (x /ᵒᶠ g) + x %ᵒᶠ g = x
state_after: k : Type u_1
G : Type u_2
inst✝¹ : Semiring k
inst✝ : AddCancelCommMonoid G
x : k[G]
g g' : G
⊢ (of' k G g * (x /ᵒᶠ g) + x %ᵒᶠ g) g' = x g'

tactic: rw [Finsupp.add_apply]
state_before: k : Type u_1
G : Type u_2
inst✝¹ : Semiring k
inst✝ : AddCancelCommMonoid G
x : k[G]
g g' : G
⊢ (of' k G g * (x /ᵒᶠ g) + x %ᵒᶠ g) g' = x g'
state_after: k : Type u_1
G : Type u_2
inst✝¹ : Semiring k
inst✝ : AddCancelCommMonoid G
x : k[G]
g g' : G
⊢ (of' k G g * (x /ᵒᶠ g)) g' + (x %ᵒᶠ g) g' = x g'

tactic: obtain ⟨d, rfl⟩ | h := em (∃ d, g' = g + d)
state_before: k : Type u_1
G : Type u_2
inst✝¹ : Semiring k
inst✝ : AddCancelCommMonoid G
x : k[G]
g g' : G
⊢ (of' k G g * (x /ᵒᶠ g)) g' + (x %ᵒᶠ g) g' = x g'
state_after: case inl.intro
k : Type u_1
G : Type u_2
inst✝¹ : Semiring k
inst✝ : AddCancelCommMonoid G
x : k[G]
g d : G
⊢ (of' k G g * (x /ᵒᶠ g)) (g + d) + (x %ᵒᶠ g) (g + d) = x (g + d)

case inr
k : Type u_1
G : Type u_2
inst✝¹ : Semiring k
inst✝ : AddCancelCommMonoid G
x : k[G]
g g' : G
h : ¬∃ d, g' = g + d
⊢ (of' k G g * (x /ᵒᶠ g)) g' + (x %ᵒᶠ g) g' = x g'

tactic: swap
state_before: case inl.intro
k : Type u_1
G : Type u_2
inst✝¹ : Semiring k
inst✝ : AddCancelCommMonoid G
x : k[G]
g d : G
⊢ (of' k G g * (x /ᵒᶠ g)) (g + d) + (x %ᵒᶠ g) (g + d) = x (g + d)

case inr
k : Type u_1
G : Type u_2
inst✝¹ : Semiring k
inst✝ : AddCancelCommMonoid G
x : k[G]
g g' : G
h : ¬∃ d, g' = g + d
⊢ (of' k G g * (x /ᵒᶠ g)) g' + (x %ᵒᶠ g) g' = x g'
state_after: case inr
k : Type u_1
G : Type u_2
inst✝¹ : Semiring k
inst✝ : AddCancelCommMonoid G
x : k[G]
g g' : G
h : ¬∃ d, g' = g + d
⊢ (of' k G g * (x /ᵒᶠ g)) g' + (x %ᵒᶠ g) g' = x g'

case inl.intro
k : Type u_1
G : Type u_2
inst✝¹ : Semiring k
inst✝ : AddCancelCommMonoid G
x : k[G]
g d : G
⊢ (of' k G g * (x /ᵒᶠ g)) (g + d) + (x %ᵒᶠ g) (g + d) = x (g + d)

tactic: rw [modOf_apply_of_not_exists_add x _ _ h, of'_apply, single_mul_apply_of_not_exists_add _ _ h,
  zero_add]
state_before: case inr
k : Type u_1
G : Type u_2
inst✝¹ : Semiring k
inst✝ : AddCancelCommMonoid G
x : k[G]
g g' : G
h : ¬∃ d, g' = g + d
⊢ (of' k G g * (x /ᵒᶠ g)) g' + (x %ᵒᶠ g) g' = x g'
state_after: no goals

tactic: rw [modOf_apply_self_add, add_zero]
state_before: case inl.intro
k : Type u_1
G : Type u_2
inst✝¹ : Semiring k
inst✝ : AddCancelCommMonoid G
x : k[G]
g d : G
⊢ (of' k G g * (x /ᵒᶠ g)) (g + d) + (x %ᵒᶠ g) (g + d) = x (g + d)
state_after: case inl.intro
k : Type u_1
G : Type u_2
inst✝¹ : Semiring k
inst✝ : AddCancelCommMonoid G
x : k[G]
g d : G
⊢ (of' k G g * (x /ᵒᶠ g)) (g + d) = x (g + d)

tactic: rw [of'_apply, single_mul_apply_aux _ _ _, one_mul, divOf_apply]
state_before: case inl.intro
k : Type u_1
G : Type u_2
inst✝¹ : Semiring k
inst✝ : AddCancelCommMonoid G
x : k[G]
g d : G
⊢ (of' k G g * (x /ᵒᶠ g)) (g + d) = x (g + d)
state_after: case inl.intro.H
k : Type u_1
G : Type u_2
inst✝¹ : Semiring k
inst✝ : AddCancelCommMonoid G
x : k[G]
g d : G
⊢ ∀ (a : G), g + a = g + d ↔ a = d

tactic: intro a
state_before: case inl.intro.H
k : Type u_1
G : Type u_2
inst✝¹ : Semiring k
inst✝ : AddCancelCommMonoid G
x : k[G]
g d : G
⊢ ∀ (a : G), g + a = g + d ↔ a = d
state_after: case inl.intro.H
k : Type u_1
G : Type u_2
inst✝¹ : Semiring k
inst✝ : AddCancelCommMonoid G
x : k[G]
g d a : G
⊢ g + a = g + d ↔ a = d

tactic: exact add_right_inj _
state_before: case inl.intro.H
k : Type u_1
G : Type u_2
inst✝¹ : Semiring k
inst✝ : AddCancelCommMonoid G
x : k[G]
g d a : G
⊢ g + a = g + d ↔ a = d
state_after: no goals