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

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
⊢ 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: 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
⊢ ∑ 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: 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
⊢ ∑ 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: by_cases hp : p = 0
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: 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
⊢ ∑ 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: congr with i
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 2
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: by_cases hi : i.1 = natDegree p
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: simp [hp]
state_before: 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
state_after: no goals

tactic: rw [hi, integralNormalization_coeff_degree, one_mul, leadingCoeff, ← pow_succ',
  tsub_add_cancel_of_le one_le_deg]
state_before: 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)
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.degree = ↑p.natDegree

tactic: exact degree_eq_natDegree hp
state_before: 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.degree = ↑p.natDegree
state_after: no goals

tactic: have : i.1 ≤ p.natDegree - 1 :=
  Nat.le_sub_one_of_lt
    (lt_of_le_of_ne (le_natDegree_of_ne_zero (mem_support_iff.mp i.2)) hi)
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 : { x // x ∈ p.support }
hi : ¬↑i = p.natDegree
⊢ p.integralNormalization.coeff ↑i * p.leadingCoeff ^ ↑i = p.coeff ↑i * p.leadingCoeff ^ (p.natDegree - 1)
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 : { x // x ∈ p.support }
hi : ¬↑i = p.natDegree
this : ↑i ≤ p.natDegree - 1
⊢ p.integralNormalization.coeff ↑i * p.leadingCoeff ^ ↑i = p.coeff ↑i * p.leadingCoeff ^ (p.natDegree - 1)

tactic: rw [integralNormalization_coeff_ne_natDegree hi, mul_assoc, ← pow_add,
  tsub_add_cancel_of_le this]
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 : { x // x ∈ p.support }
hi : ¬↑i = p.natDegree
this : ↑i ≤ p.natDegree - 1
⊢ p.integralNormalization.coeff ↑i * p.leadingCoeff ^ ↑i = p.coeff ↑i * p.leadingCoeff ^ (p.natDegree - 1)
state_after: no goals

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
⊢ ∑ 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: congr 1
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: exact p.support.sum_attach fun i ↦ f (p.coeff i) * z ^ i
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: rw [hz, mul_zero]
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