Theorem: Ideal.eval₂_C_mk_eq_zero
File: Mathlib/RingTheory/Polynomial/Quotient.lean

tactic: intro a ha
state_before: R : Type u_1
inst✝ : CommRing R
I : Ideal R
⊢ ∀ f ∈ map C I, (eval₂RingHom (C.comp (Quotient.mk I)) X) f = 0
state_after: R : Type u_1
inst✝ : CommRing R
I : Ideal R
a : R[X]
ha : a ∈ map C I
⊢ (eval₂RingHom (C.comp (Quotient.mk I)) X) a = 0

tactic: rw [← sum_monomial_eq a]
state_before: R : Type u_1
inst✝ : CommRing R
I : Ideal R
a : R[X]
ha : a ∈ map C I
⊢ (eval₂RingHom (C.comp (Quotient.mk I)) X) a = 0
state_after: R : Type u_1
inst✝ : CommRing R
I : Ideal R
a : R[X]
ha : a ∈ map C I
⊢ (eval₂RingHom (C.comp (Quotient.mk I)) X) (a.sum fun n a => (monomial n) a) = 0

tactic: dsimp
state_before: R : Type u_1
inst✝ : CommRing R
I : Ideal R
a : R[X]
ha : a ∈ map C I
⊢ (eval₂RingHom (C.comp (Quotient.mk I)) X) (a.sum fun n a => (monomial n) a) = 0
state_after: R : Type u_1
inst✝ : CommRing R
I : Ideal R
a : R[X]
ha : a ∈ map C I
⊢ eval₂ (C.comp (Quotient.mk I)) X (a.sum fun n a => (monomial n) a) = 0

tactic: rw [eval₂_sum]
state_before: R : Type u_1
inst✝ : CommRing R
I : Ideal R
a : R[X]
ha : a ∈ map C I
⊢ eval₂ (C.comp (Quotient.mk I)) X (a.sum fun n a => (monomial n) a) = 0
state_after: R : Type u_1
inst✝ : CommRing R
I : Ideal R
a : R[X]
ha : a ∈ map C I
⊢ (a.sum fun n a => eval₂ (C.comp (Quotient.mk I)) X ((monomial n) a)) = 0

tactic: refine Finset.sum_eq_zero fun n _ => ?_
state_before: R : Type u_1
inst✝ : CommRing R
I : Ideal R
a : R[X]
ha : a ∈ map C I
⊢ (a.sum fun n a => eval₂ (C.comp (Quotient.mk I)) X ((monomial n) a)) = 0
state_after: R : Type u_1
inst✝ : CommRing R
I : Ideal R
a : R[X]
ha : a ∈ map C I
n : ℕ
x✝ : n ∈ a.support
⊢ (fun n a => eval₂ (C.comp (Quotient.mk I)) X ((monomial n) a)) n (a.coeff n) = 0

tactic: dsimp
state_before: R : Type u_1
inst✝ : CommRing R
I : Ideal R
a : R[X]
ha : a ∈ map C I
n : ℕ
x✝ : n ∈ a.support
⊢ (fun n a => eval₂ (C.comp (Quotient.mk I)) X ((monomial n) a)) n (a.coeff n) = 0
state_after: R : Type u_1
inst✝ : CommRing R
I : Ideal R
a : R[X]
ha : a ∈ map C I
n : ℕ
x✝ : n ∈ a.support
⊢ eval₂ (C.comp (Quotient.mk I)) X ((monomial n) (a.coeff n)) = 0

tactic: rw [eval₂_monomial (C.comp (Quotient.mk I)) X]
state_before: R : Type u_1
inst✝ : CommRing R
I : Ideal R
a : R[X]
ha : a ∈ map C I
n : ℕ
x✝ : n ∈ a.support
⊢ eval₂ (C.comp (Quotient.mk I)) X ((monomial n) (a.coeff n)) = 0
state_after: R : Type u_1
inst✝ : CommRing R
I : Ideal R
a : R[X]
ha : a ∈ map C I
n : ℕ
x✝ : n ∈ a.support
⊢ (C.comp (Quotient.mk I)) (a.coeff n) * X ^ n = 0

tactic: refine mul_eq_zero_of_left (Polynomial.ext fun m => ?_) (X ^ n)
state_before: R : Type u_1
inst✝ : CommRing R
I : Ideal R
a : R[X]
ha : a ∈ map C I
n : ℕ
x✝ : n ∈ a.support
⊢ (C.comp (Quotient.mk I)) (a.coeff n) * X ^ n = 0
state_after: R : Type u_1
inst✝ : CommRing R
I : Ideal R
a : R[X]
ha : a ∈ map C I
n : ℕ
x✝ : n ∈ a.support
m : ℕ
⊢ ((C.comp (Quotient.mk I)) (a.coeff n)).coeff m = coeff 0 m

tactic: erw [coeff_C]
state_before: R : Type u_1
inst✝ : CommRing R
I : Ideal R
a : R[X]
ha : a ∈ map C I
n : ℕ
x✝ : n ∈ a.support
m : ℕ
⊢ ((C.comp (Quotient.mk I)) (a.coeff n)).coeff m = coeff 0 m
state_after: R : Type u_1
inst✝ : CommRing R
I : Ideal R
a : R[X]
ha : a ∈ map C I
n : ℕ
x✝ : n ∈ a.support
m : ℕ
⊢ (if m = 0 then (Quotient.mk I) (a.coeff n) else 0) = coeff 0 m

tactic: by_cases h : m = 0
state_before: R : Type u_1
inst✝ : CommRing R
I : Ideal R
a : R[X]
ha : a ∈ map C I
n : ℕ
x✝ : n ∈ a.support
m : ℕ
⊢ (if m = 0 then (Quotient.mk I) (a.coeff n) else 0) = coeff 0 m
state_after: case pos
R : Type u_1
inst✝ : CommRing R
I : Ideal R
a : R[X]
ha : a ∈ map C I
n : ℕ
x✝ : n ∈ a.support
m : ℕ
h : m = 0
⊢ (if m = 0 then (Quotient.mk I) (a.coeff n) else 0) = coeff 0 m

case neg
R : Type u_1
inst✝ : CommRing R
I : Ideal R
a : R[X]
ha : a ∈ map C I
n : ℕ
x✝ : n ∈ a.support
m : ℕ
h : ¬m = 0
⊢ (if m = 0 then (Quotient.mk I) (a.coeff n) else 0) = coeff 0 m

tactic: simpa [h] using Quotient.eq_zero_iff_mem.2 ((mem_map_C_iff.1 ha) n)
state_before: case pos
R : Type u_1
inst✝ : CommRing R
I : Ideal R
a : R[X]
ha : a ∈ map C I
n : ℕ
x✝ : n ∈ a.support
m : ℕ
h : m = 0
⊢ (if m = 0 then (Quotient.mk I) (a.coeff n) else 0) = coeff 0 m
state_after: no goals

tactic: simp [h]
state_before: case neg
R : Type u_1
inst✝ : CommRing R
I : Ideal R
a : R[X]
ha : a ∈ map C I
n : ℕ
x✝ : n ∈ a.support
m : ℕ
h : ¬m = 0
⊢ (if m = 0 then (Quotient.mk I) (a.coeff n) else 0) = coeff 0 m
state_after: no goals