Theorem: Polynomial.scaleRoots_zero
File: Mathlib/RingTheory/Polynomial/ScaleRoots.lean

tactic: ext n
state_before: R : Type u_1
S : Type u_2
A : Type u_3
K : Type u_4
inst✝¹ : Semiring R
inst✝ : Semiring S
p : R[X]
⊢ p.scaleRoots 0 = p.leadingCoeff • X ^ p.natDegree
state_after: case a
R : Type u_1
S : Type u_2
A : Type u_3
K : Type u_4
inst✝¹ : Semiring R
inst✝ : Semiring S
p : R[X]
n : ℕ
⊢ (p.scaleRoots 0).coeff n = (p.leadingCoeff • X ^ p.natDegree).coeff n

tactic: simp only [coeff_scaleRoots, ge_iff_le, ne_eq, tsub_eq_zero_iff_le, not_le, zero_pow_eq, mul_ite,
  mul_one, mul_zero, coeff_smul, coeff_X_pow, smul_eq_mul]
state_before: case a
R : Type u_1
S : Type u_2
A : Type u_3
K : Type u_4
inst✝¹ : Semiring R
inst✝ : Semiring S
p : R[X]
n : ℕ
⊢ (p.scaleRoots 0).coeff n = (p.leadingCoeff • X ^ p.natDegree).coeff n
state_after: case a
R : Type u_1
S : Type u_2
A : Type u_3
K : Type u_4
inst✝¹ : Semiring R
inst✝ : Semiring S
p : R[X]
n : ℕ
⊢ (if p.natDegree ≤ n then p.coeff n else 0) = if n = p.natDegree then p.leadingCoeff else 0

tactic: split_ifs with h₁ h₂ h₂
state_before: case a
R : Type u_1
S : Type u_2
A : Type u_3
K : Type u_4
inst✝¹ : Semiring R
inst✝ : Semiring S
p : R[X]
n : ℕ
⊢ (if p.natDegree ≤ n then p.coeff n else 0) = if n = p.natDegree then p.leadingCoeff else 0
state_after: case pos
R : Type u_1
S : Type u_2
A : Type u_3
K : Type u_4
inst✝¹ : Semiring R
inst✝ : Semiring S
p : R[X]
n : ℕ
h₁ : p.natDegree ≤ n
h₂ : n = p.natDegree
⊢ p.coeff n = p.leadingCoeff

case neg
R : Type u_1
S : Type u_2
A : Type u_3
K : Type u_4
inst✝¹ : Semiring R
inst✝ : Semiring S
p : R[X]
n : ℕ
h₁ : p.natDegree ≤ n
h₂ : ¬n = p.natDegree
⊢ p.coeff n = 0

case pos
R : Type u_1
S : Type u_2
A : Type u_3
K : Type u_4
inst✝¹ : Semiring R
inst✝ : Semiring S
p : R[X]
n : ℕ
h₁ : ¬p.natDegree ≤ n
h₂ : n = p.natDegree
⊢ 0 = p.leadingCoeff

case neg
R : Type u_1
S : Type u_2
A : Type u_3
K : Type u_4
inst✝¹ : Semiring R
inst✝ : Semiring S
p : R[X]
n : ℕ
h₁ : ¬p.natDegree ≤ n
h₂ : ¬n = p.natDegree
⊢ 0 = 0

tactic: subst h₂
state_before: case pos
R : Type u_1
S : Type u_2
A : Type u_3
K : Type u_4
inst✝¹ : Semiring R
inst✝ : Semiring S
p : R[X]
n : ℕ
h₁ : p.natDegree ≤ n
h₂ : n = p.natDegree
⊢ p.coeff n = p.leadingCoeff
state_after: case pos
R : Type u_1
S : Type u_2
A : Type u_3
K : Type u_4
inst✝¹ : Semiring R
inst✝ : Semiring S
p : R[X]
h₁ : p.natDegree ≤ p.natDegree
⊢ p.coeff p.natDegree = p.leadingCoeff

tactic: rfl
state_before: case pos
R : Type u_1
S : Type u_2
A : Type u_3
K : Type u_4
inst✝¹ : Semiring R
inst✝ : Semiring S
p : R[X]
h₁ : p.natDegree ≤ p.natDegree
⊢ p.coeff p.natDegree = p.leadingCoeff
state_after: no goals

tactic: exact coeff_eq_zero_of_natDegree_lt (lt_of_le_of_ne h₁ (Ne.symm h₂))
state_before: case neg
R : Type u_1
S : Type u_2
A : Type u_3
K : Type u_4
inst✝¹ : Semiring R
inst✝ : Semiring S
p : R[X]
n : ℕ
h₁ : p.natDegree ≤ n
h₂ : ¬n = p.natDegree
⊢ p.coeff n = 0
state_after: no goals

tactic: exact (h₁ h₂.ge).elim
state_before: case pos
R : Type u_1
S : Type u_2
A : Type u_3
K : Type u_4
inst✝¹ : Semiring R
inst✝ : Semiring S
p : R[X]
n : ℕ
h₁ : ¬p.natDegree ≤ n
h₂ : n = p.natDegree
⊢ 0 = p.leadingCoeff
state_after: no goals

tactic: rfl
state_before: case neg
R : Type u_1
S : Type u_2
A : Type u_3
K : Type u_4
inst✝¹ : Semiring R
inst✝ : Semiring S
p : R[X]
n : ℕ
h₁ : ¬p.natDegree ≤ n
h₂ : ¬n = p.natDegree
⊢ 0 = 0
state_after: no goals