Theorem: Polynomial.coeff_pow_mul_natDegree
File: Mathlib/Data/Polynomial/Degree/Definitions.lean

tactic: induction' n with i hi
state_before: R : Type u
S : Type v
a b c d : R
n✝ m : ℕ
inst✝ : Semiring R
p✝ q : R[X]
ι : Type ?u.697185
p : R[X]
n : ℕ
⊢ coeff (p ^ n) (n * natDegree p) = leadingCoeff p ^ n

tactic: simp
state_before: case zero
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝ q : R[X]
ι : Type ?u.697185
p : R[X]
⊢ coeff (p ^ Nat.zero) (Nat.zero * natDegree p) = leadingCoeff p ^ Nat.zero

tactic: rw [pow_succ', pow_succ', Nat.succ_mul]
state_before: case succ
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝ q : R[X]
ι : Type ?u.697185
p : R[X]
i : ℕ
hi : coeff (p ^ i) (i * natDegree p) = leadingCoeff p ^ i
⊢ coeff (p ^ Nat.succ i) (Nat.succ i * natDegree p) = leadingCoeff p ^ Nat.succ i

tactic: by_cases hp1 : p.leadingCoeff ^ i = 0
state_before: case succ
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝ q : R[X]
ι : Type ?u.697185
p : R[X]
i : ℕ
hi : coeff (p ^ i) (i * natDegree p) = leadingCoeff p ^ i
⊢ coeff (p ^ i * p) (i * natDegree p + natDegree p) = leadingCoeff p ^ i * leadingCoeff p

tactic: rw [hp1, zero_mul]
state_before: case pos
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝ q : R[X]
ι : Type ?u.697185
p : R[X]
i : ℕ
hi : coeff (p ^ i) (i * natDegree p) = leadingCoeff p ^ i
hp1 : leadingCoeff p ^ i = 0
⊢ coeff (p ^ i * p) (i * natDegree p + natDegree p) = leadingCoeff p ^ i * leadingCoeff p

tactic: by_cases hp2 : p ^ i = 0
state_before: case pos
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝ q : R[X]
ι : Type ?u.697185
p : R[X]
i : ℕ
hi : coeff (p ^ i) (i * natDegree p) = leadingCoeff p ^ i
hp1 : leadingCoeff p ^ i = 0
⊢ coeff (p ^ i * p) (i * natDegree p + natDegree p) = 0

tactic: rw [hp2, zero_mul, coeff_zero]
state_before: case pos
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝ q : R[X]
ι : Type ?u.697185
p : R[X]
i : ℕ
hi : coeff (p ^ i) (i * natDegree p) = leadingCoeff p ^ i
hp1 : leadingCoeff p ^ i = 0
hp2 : p ^ i = 0
⊢ coeff (p ^ i * p) (i * natDegree p + natDegree p) = 0

tactic: apply coeff_eq_zero_of_natDegree_lt
state_before: case neg
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝ q : R[X]
ι : Type ?u.697185
p : R[X]
i : ℕ
hi : coeff (p ^ i) (i * natDegree p) = leadingCoeff p ^ i
hp1 : leadingCoeff p ^ i = 0
hp2 : ¬p ^ i = 0
⊢ coeff (p ^ i * p) (i * natDegree p + natDegree p) = 0

tactic: have h1 : (p ^ i).natDegree < i * p.natDegree := by
  refine lt_of_le_of_ne natDegree_pow_le fun h => hp2 ?_
  rw [← h, hp1] at hi
  exact leadingCoeff_eq_zero.mp hi
state_before: case neg.h
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝ q : R[X]
ι : Type ?u.697185
p : R[X]
i : ℕ
hi : coeff (p ^ i) (i * natDegree p) = leadingCoeff p ^ i
hp1 : leadingCoeff p ^ i = 0
hp2 : ¬p ^ i = 0
⊢ natDegree (p ^ i * p) < i * natDegree p + natDegree p

tactic: calc
  (p ^ i * p).natDegree ≤ (p ^ i).natDegree + p.natDegree := natDegree_mul_le
  _ < i * p.natDegree + p.natDegree := add_lt_add_right h1 _
state_before: case neg.h
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝ q : R[X]
ι : Type ?u.697185
p : R[X]
i : ℕ
hi : coeff (p ^ i) (i * natDegree p) = leadingCoeff p ^ i
hp1 : leadingCoeff p ^ i = 0
hp2 : ¬p ^ i = 0
h1 : natDegree (p ^ i) < i * natDegree p
⊢ natDegree (p ^ i * p) < i * natDegree p + natDegree p

tactic: refine lt_of_le_of_ne natDegree_pow_le fun h => hp2 ?_
state_before: R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝ q : R[X]
ι : Type ?u.697185
p : R[X]
i : ℕ
hi : coeff (p ^ i) (i * natDegree p) = leadingCoeff p ^ i
hp1 : leadingCoeff p ^ i = 0
hp2 : ¬p ^ i = 0
⊢ natDegree (p ^ i) < i * natDegree p

tactic: rw [← h, hp1] at hi
state_before: R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝ q : R[X]
ι : Type ?u.697185
p : R[X]
i : ℕ
hi : coeff (p ^ i) (i * natDegree p) = leadingCoeff p ^ i
hp1 : leadingCoeff p ^ i = 0
hp2 : ¬p ^ i = 0
h : natDegree (p ^ i) = i * natDegree p
⊢ p ^ i = 0

tactic: exact leadingCoeff_eq_zero.mp hi
state_before: R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝ q : R[X]
ι : Type ?u.697185
p : R[X]
i : ℕ
hi : coeff (p ^ i) (natDegree (p ^ i)) = 0
hp1 : leadingCoeff p ^ i = 0
hp2 : ¬p ^ i = 0
h : natDegree (p ^ i) = i * natDegree p
⊢ p ^ i = 0

tactic: rw [← natDegree_pow' hp1, ← leadingCoeff_pow' hp1]
state_before: case neg
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝ q : R[X]
ι : Type ?u.697185
p : R[X]
i : ℕ
hi : coeff (p ^ i) (i * natDegree p) = leadingCoeff p ^ i
hp1 : ¬leadingCoeff p ^ i = 0
⊢ coeff (p ^ i * p) (i * natDegree p + natDegree p) = leadingCoeff p ^ i * leadingCoeff p

tactic: exact coeff_mul_degree_add_degree _ _
state_before: case neg
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝ q : R[X]
ι : Type ?u.697185
p : R[X]
i : ℕ
hi : coeff (p ^ i) (i * natDegree p) = leadingCoeff p ^ i
hp1 : ¬leadingCoeff p ^ i = 0
⊢ coeff (p ^ i * p) (natDegree (p ^ i) + natDegree p) = leadingCoeff (p ^ i) * leadingCoeff p