Theorem: Polynomial.integralNormalization_eval₂_eq_zero
File: Mathlib/RingTheory/Polynomial/IntegralNormalization.lean

Proof steps:
state_before: R : Type u
S : Type v
a b : R
m n : ℕ
ι : Type y
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : CommSemiring S
p : R[X]
f : R →+* S
z : S
hz : eval₂ f z p = 0
inj : ∀ (x : R), f x = 0 → x = 0
⊢ eval₂ f (z * f p.leadingCoeff) p.integralNormalization =
    ∑ i ∈ p.support.attach, f (p.integralNormalization.coeff ↑i * p.leadingCoeff ^ ↑i) * z ^ ↑i
state_after: R : Type u
S : Type v
a b : R
m n : ℕ
ι : Type y
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : CommSemiring S
p : R[X]
f : R →+* S
z : S
hz : eval₂ f z p = 0
inj : ∀ (x : R), f x = 0 → x = 0
⊢ ∑ n ∈ p.support, f (p.integralNormalization.coeff n) * (z * f p.leadingCoeff) ^ n =
    ∑ i ∈ p.support.attach, f (p.integralNormalization.coeff ↑i * p.leadingCoeff ^ ↑i) * z ^ ↑i
tactic: rw [eval₂_eq_sum, sum_def, support_integralNormalization]
state_before: R : Type u
S : Type v
a b : R
m n : ℕ
ι : Type y
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : CommSemiring S
p : R[X]
f : R →+* S
z : S
hz : eval₂ f z p = 0
inj : ∀ (x : R), f x = 0 → x = 0
⊢ ∑ n ∈ p.support, f (p.integralNormalization.coeff n) * (z * f p.leadingCoeff) ^ n =
    ∑ i ∈ p.support.attach, f (p.integralNormalization.coeff ↑i * p.leadingCoeff ^ ↑i) * z ^ ↑i
state_after: R : Type u
S : Type v
a b : R
m n : ℕ
ι : Type y
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : CommSemiring S
p : R[X]
f : R →+* S
z : S
hz : eval₂ f z p = 0
inj : ∀ (x : R), f x = 0 → x = 0
⊢ ∑ x ∈ p.support, f (p.integralNormalization.coeff x) * (f p.leadingCoeff ^ x * z ^ x) =
    ∑ x ∈ p.support.attach, f (p.integralNormalization.coeff ↑x) * (f p.leadingCoeff ^ ↑x * z ^ ↑x)
tactic: simp only [mul_comm z, mul_pow, mul_assoc, RingHom.map_pow, RingHom.map_mul]
state_before: R : Type u
S : Type v
a b : R
m n : ℕ
ι : Type y
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : CommSemiring S
p : R[X]
f : R →+* S
z : S
hz : eval₂ f z p = 0
inj : ∀ (x : R), f x = 0 → x = 0
⊢ ∑ x ∈ p.support, f (p.integralNormalization.coeff x) * (f p.leadingCoeff ^ x * z ^ x) =
    ∑ x ∈ p.support.attach, f (p.integralNormalization.coeff ↑x) * (f p.leadingCoeff ^ ↑x * z ^ ↑x)
state_after: no goals
tactic: rw [← Finset.sum_attach]
state_before: R : Type u
S : Type v
a b : R
m n : ℕ
ι : Type y
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : CommSemiring S
p : R[X]
f : R →+* S
z : S
hz : eval₂ f z p = 0
inj : ∀ (x : R), f x = 0 → x = 0
⊢ ∑ i ∈ p.support.attach, f (p.integralNormalization.coeff ↑i * p.leadingCoeff ^ ↑i) * z ^ ↑i =
    ∑ i ∈ p.support.attach, f (p.coeff ↑i * p.leadingCoeff ^ (p.natDegree - 1)) * z ^ ↑i
state_after: case pos
R : Type u
S : Type v
a b : R
m n : ℕ
ι : Type y
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : CommSemiring S
p : R[X]
f : R →+* S
z : S
hz : eval₂ f z p = 0
inj : ∀ (x : R), f x = 0 → x = 0
hp : p = 0
⊢ ∑ i ∈ p.support.attach, f (p.integralNormalization.coeff ↑i * p.leadingCoeff ^ ↑i) * z ^ ↑i =
    ∑ i ∈ p.support.attach, f (p.coeff ↑i * p.leadingCoeff ^ (p.natDegree - 1)) * z ^ ↑i

case neg
R : Type u
S : Type v
a b : R
m n : ℕ
ι : Type y
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : CommSemiring S
p : R[X]
f : R →+* S
z : S
hz : eval₂ f z p = 0
inj : ∀ (x : R), f x = 0 → x = 0
hp : ¬p = 0
⊢ ∑ i ∈ p.support.attach, f (p.integralNormalization.coeff ↑i * p.leadingCoeff ^ ↑i) * z ^ ↑i =
    ∑ i ∈ p.support.attach, f (p.coeff ↑i * p.leadingCoeff ^ (p.natDegree - 1)) * z ^ ↑i
tactic: by_cases hp : p = 0
state_before: case neg
R : Type u
S : Type v
a b : R
m n : ℕ
ι : Type y
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : CommSemiring S
p : R[X]
f : R →+* S
z : S
hz : eval₂ f z p = 0
inj : ∀ (x : R), f x = 0 → x = 0
hp : ¬p = 0
⊢ ∑ i ∈ p.support.attach, f (p.integralNormalization.coeff ↑i * p.leadingCoeff ^ ↑i) * z ^ ↑i =
    ∑ i ∈ p.support.attach, f (p.coeff ↑i * p.leadingCoeff ^ (p.natDegree - 1)) * z ^ ↑i
state_after: case neg
R : Type u
S : Type v
a b : R
m n : ℕ
ι : Type y
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : CommSemiring S
p : R[X]
f : R →+* S
z : S
hz : eval₂ f z p = 0
inj : ∀ (x : R), f x = 0 → x = 0
hp : ¬p = 0
one_le_deg : 1 ≤ p.natDegree
⊢ ∑ i ∈ p.support.attach, f (p.integralNormalization.coeff ↑i * p.leadingCoeff ^ ↑i) * z ^ ↑i =
    ∑ i ∈ p.support.attach, f (p.coeff ↑i * p.leadingCoeff ^ (p.natDegree - 1)) * z ^ ↑i
tactic: have one_le_deg : 1 ≤ natDegree p :=
        Nat.succ_le_of_lt (natDegree_pos_of_eval₂_root hp f hz inj)
state_before: case neg
R : Type u
S : Type v
a b : R
m n : ℕ
ι : Type y
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : CommSemiring S
p : R[X]
f : R →+* S
z : S
hz : eval₂ f z p = 0
inj : ∀ (x : R), f x = 0 → x = 0
hp : ¬p = 0
one_le_deg : 1 ≤ p.natDegree
⊢ ∑ i ∈ p.support.attach, f (p.integralNormalization.coeff ↑i * p.leadingCoeff ^ ↑i) * z ^ ↑i =
    ∑ i ∈ p.support.attach, f (p.coeff ↑i * p.leadingCoeff ^ (p.natDegree - 1)) * z ^ ↑i
state_after: case neg.e_f.h
R : Type u
S : Type v
a b : R
m n : ℕ
ι : Type y
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : CommSemiring S
p : R[X]
f : R →+* S
z : S
hz : eval₂ f z p = 0
inj : ∀ (x : R), f x = 0 → x = 0
hp : ¬p = 0
one_le_deg : 1 ≤ p.natDegree
i : { x // x ∈ p.support }
⊢ f (p.integralNormalization.coeff ↑i * p.leadingCoeff ^ ↑i) * z ^ ↑i =
    f (p.coeff ↑i * p.leadingCoeff ^ (p.natDegree - 1)) * z ^ ↑i
tactic: congr with i
state_before: case neg.e_f.h
R : Type u
S : Type v
a b : R
m n : ℕ
ι : Type y
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : CommSemiring S
p : R[X]
f : R →+* S
z : S
hz : eval₂ f z p = 0
inj : ∀ (x : R), f x = 0 → x = 0
hp : ¬p = 0
one_le_deg : 1 ≤ p.natDegree
i : { x // x ∈ p.support }
⊢ f (p.integralNormalization.coeff ↑i * p.leadingCoeff ^ ↑i) * z ^ ↑i =
    f (p.coeff ↑i * p.leadingCoeff ^ (p.natDegree - 1)) * z ^ ↑i
state_after: case neg.e_f.h.e_a.h.e_6.h
R : Type u
S : Type v
a b : R
m n : ℕ
ι : Type y
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : CommSemiring S
p : R[X]
f : R →+* S
z : S
hz : eval₂ f z p = 0
inj : ∀ (x : R), f x = 0 → x = 0
hp : ¬p = 0
one_le_deg : 1 ≤ p.natDegree
i : { x // x ∈ p.support }
⊢ p.integralNormalization.coeff ↑i * p.leadingCoeff ^ ↑i = p.coeff ↑i * p.leadingCoeff ^ (p.natDegree - 1)
tactic: congr 2
state_before: case neg.e_f.h.e_a.h.e_6.h
R : Type u
S : Type v
a b : R
m n : ℕ
ι : Type y
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : CommSemiring S
p : R[X]
f : R →+* S
z : S
hz : eval₂ f z p = 0
inj : ∀ (x : R), f x = 0 → x = 0
hp : ¬p = 0
one_le_deg : 1 ≤ p.natDegree
i : { x // x ∈ p.support }
⊢ p.integralNormalization.coeff ↑i * p.leadingCoeff ^ ↑i = p.coeff ↑i * p.leadingCoeff ^ (p.natDegree - 1)
state_after: case pos
R : Type u
S : Type v
a b : R
m n : ℕ
ι : Type y
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : CommSemiring S
p : R[X]
f : R →+* S
z : S
hz : eval₂ f z p = 0
inj : ∀ (x : R), f x = 0 → x = 0
hp : ¬p = 0
one_le_deg : 1 ≤ p.natDegree
i : { x // x ∈ p.support }
hi : ↑i = p.natDegree
⊢ p.integralNormalization.coeff ↑i * p.leadingCoeff ^ ↑i = p.coeff ↑i * p.leadingCoeff ^ (p.natDegree - 1)

case neg
R : Type u
S : Type v
a b : R
m n : ℕ
ι : Type y
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : CommSemiring S
p : R[X]
f : R →+* S
z : S
hz : eval₂ f z p = 0
inj : ∀ (x : R), f x = 0 → x = 0
hp : ¬p = 0
one_le_deg : 1 ≤ p.natDegree
i : { x // x ∈ p.support }
hi : ¬↑i = p.natDegree
⊢ p.integralNormalization.coeff ↑i * p.leadingCoeff ^ ↑i = p.coeff ↑i * p.leadingCoeff ^ (p.natDegree - 1)
tactic: by_cases hi : i.1 = natDegree p
state_before: R : Type u
S : Type v
a b : R
m n : ℕ
ι : Type y
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : CommSemiring S
p : R[X]
f : R →+* S
z : S
hz : eval₂ f z p = 0
inj : ∀ (x : R), f x = 0 → x = 0
⊢ ∑ i ∈ p.support.attach, f (p.coeff ↑i * p.leadingCoeff ^ (p.natDegree - 1)) * z ^ ↑i =
    f p.leadingCoeff ^ (p.natDegree - 1) * eval₂ f z p
state_after: R : Type u
S : Type v
a b : R
m n : ℕ
ι : Type y
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : CommSemiring S
p : R[X]
f : R →+* S
z : S
hz : eval₂ f z p = 0
inj : ∀ (x : R), f x = 0 → x = 0
⊢ f p.leadingCoeff ^ (p.natDegree - 1) * ∑ i ∈ p.support.attach, f (p.coeff ↑i) * z ^ ↑i =
    f p.leadingCoeff ^ (p.natDegree - 1) * ∑ n ∈ p.support, f (p.coeff n) * z ^ n
tactic: simp_rw [eval₂_eq_sum, sum_def, fun i => mul_comm (coeff p i), RingHom.map_mul,
               RingHom.map_pow, mul_assoc, ← Finset.mul_sum]
state_before: R : Type u
S : Type v
a b : R
m n : ℕ
ι : Type y
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : CommSemiring S
p : R[X]
f : R →+* S
z : S
hz : eval₂ f z p = 0
inj : ∀ (x : R), f x = 0 → x = 0
⊢ f p.leadingCoeff ^ (p.natDegree - 1) * ∑ i ∈ p.support.attach, f (p.coeff ↑i) * z ^ ↑i =
    f p.leadingCoeff ^ (p.natDegree - 1) * ∑ n ∈ p.support, f (p.coeff n) * z ^ n
state_after: case e_a
R : Type u
S : Type v
a b : R
m n : ℕ
ι : Type y
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : CommSemiring S
p : R[X]
f : R →+* S
z : S
hz : eval₂ f z p = 0
inj : ∀ (x : R), f x = 0 → x = 0
⊢ ∑ i ∈ p.support.attach, f (p.coeff ↑i) * z ^ ↑i = ∑ n ∈ p.support, f (p.coeff n) * z ^ n
tactic: congr 1
state_before: case e_a
R : Type u
S : Type v
a b : R
m n : ℕ
ι : Type y
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : CommSemiring S
p : R[X]
f : R →+* S
z : S
hz : eval₂ f z p = 0
inj : ∀ (x : R), f x = 0 → x = 0
⊢ ∑ i ∈ p.support.attach, f (p.coeff ↑i) * z ^ ↑i = ∑ n ∈ p.support, f (p.coeff n) * z ^ n
state_after: no goals
tactic: exact p.support.sum_attach fun i ↦ f (p.coeff i) * z ^ i
state_before: R : Type u
S : Type v
a b : R
m n : ℕ
ι : Type y
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : CommSemiring S
p : R[X]
f : R →+* S
z : S
hz : eval₂ f z p = 0
inj : ∀ (x : R), f x = 0 → x = 0
⊢ f p.leadingCoeff ^ (p.natDegree - 1) * eval₂ f z p = 0
state_after: no goals
tactic: rw [hz, mul_zero]