Theorem: Polynomial.multiplicity_finite_of_degree_pos_of_monic
File: Mathlib/Data/Polynomial/Div.lean

tactic: have hp0 : p ≠ 0 := fun hp0 => by simp [hp0] at hp
state_before: R : Type u
S : Type v
T : Type w
A : Type z
a b : R
n : ℕ
inst✝ : CommSemiring R
p q : R[X]
hp : 0 < degree p
hmp : Monic p
hq : q ≠ 0
zn0 : 0 ≠ 1
x✝ : p ^ (natDegree q + 1) ∣ q
r : R[X]
hr : q = p ^ (natDegree q + 1) * r
⊢ False

tactic: have hr0 : r ≠ 0 := fun hr0 => by subst hr0; simp [hq] at hr
state_before: R : Type u
S : Type v
T : Type w
A : Type z
a b : R
n : ℕ
inst✝ : CommSemiring R
p q : R[X]
hp : 0 < degree p
hmp : Monic p
hq : q ≠ 0
zn0 : 0 ≠ 1
x✝ : p ^ (natDegree q + 1) ∣ q
r : R[X]
hr : q = p ^ (natDegree q + 1) * r
hp0 : p ≠ 0
⊢ False

tactic: have hpn1 : leadingCoeff p ^ (natDegree q + 1) = 1 := by simp [show _ = _ from hmp]
state_before: R : Type u
S : Type v
T : Type w
A : Type z
a b : R
n : ℕ
inst✝ : CommSemiring R
p q : R[X]
hp : 0 < degree p
hmp : Monic p
hq : q ≠ 0
zn0 : 0 ≠ 1
x✝ : p ^ (natDegree q + 1) ∣ q
r : R[X]
hr : q = p ^ (natDegree q + 1) * r
hp0 : p ≠ 0
hr0 : r ≠ 0
⊢ False

tactic: have hpn0' : leadingCoeff p ^ (natDegree q + 1) ≠ 0 := hpn1.symm ▸ zn0.symm
state_before: R : Type u
S : Type v
T : Type w
A : Type z
a b : R
n : ℕ
inst✝ : CommSemiring R
p q : R[X]
hp : 0 < degree p
hmp : Monic p
hq : q ≠ 0
zn0 : 0 ≠ 1
x✝ : p ^ (natDegree q + 1) ∣ q
r : R[X]
hr : q = p ^ (natDegree q + 1) * r
hp0 : p ≠ 0
hr0 : r ≠ 0
hpn1 : leadingCoeff p ^ (natDegree q + 1) = 1
⊢ False

tactic: have hpnr0 : leadingCoeff (p ^ (natDegree q + 1)) * leadingCoeff r ≠ 0 := by
  simp only [leadingCoeff_pow' hpn0', leadingCoeff_eq_zero, hpn1, one_pow, one_mul, Ne.def,
      hr0]
state_before: R : Type u
S : Type v
T : Type w
A : Type z
a b : R
n : ℕ
inst✝ : CommSemiring R
p q : R[X]
hp : 0 < degree p
hmp : Monic p
hq : q ≠ 0
zn0 : 0 ≠ 1
x✝ : p ^ (natDegree q + 1) ∣ q
r : R[X]
hr : q = p ^ (natDegree q + 1) * r
hp0 : p ≠ 0
hr0 : r ≠ 0
hpn1 : leadingCoeff p ^ (natDegree q + 1) = 1
hpn0' : leadingCoeff p ^ (natDegree q + 1) ≠ 0
⊢ False

tactic: have hnp : 0 < natDegree p := by
  rw [← WithBot.coe_lt_coe, ← Nat.cast_withBot, ← Nat.cast_withBot,
    ← degree_eq_natDegree hp0]; exact hp
state_before: R : Type u
S : Type v
T : Type w
A : Type z
a b : R
n : ℕ
inst✝ : CommSemiring R
p q : R[X]
hp : 0 < degree p
hmp : Monic p
hq : q ≠ 0
zn0 : 0 ≠ 1
x✝ : p ^ (natDegree q + 1) ∣ q
r : R[X]
hr : q = p ^ (natDegree q + 1) * r
hp0 : p ≠ 0
hr0 : r ≠ 0
hpn1 : leadingCoeff p ^ (natDegree q + 1) = 1
hpn0' : leadingCoeff p ^ (natDegree q + 1) ≠ 0
hpnr0 : leadingCoeff (p ^ (natDegree q + 1)) * leadingCoeff r ≠ 0
⊢ False

tactic: have := congr_arg natDegree hr
state_before: R : Type u
S : Type v
T : Type w
A : Type z
a b : R
n : ℕ
inst✝ : CommSemiring R
p q : R[X]
hp : 0 < degree p
hmp : Monic p
hq : q ≠ 0
zn0 : 0 ≠ 1
x✝ : p ^ (natDegree q + 1) ∣ q
r : R[X]
hr : q = p ^ (natDegree q + 1) * r
hp0 : p ≠ 0
hr0 : r ≠ 0
hpn1 : leadingCoeff p ^ (natDegree q + 1) = 1
hpn0' : leadingCoeff p ^ (natDegree q + 1) ≠ 0
hpnr0 : leadingCoeff (p ^ (natDegree q + 1)) * leadingCoeff r ≠ 0
hnp : 0 < natDegree p
⊢ False

tactic: rw [natDegree_mul' hpnr0, natDegree_pow' hpn0', add_mul, add_assoc] at this
state_before: R : Type u
S : Type v
T : Type w
A : Type z
a b : R
n : ℕ
inst✝ : CommSemiring R
p q : R[X]
hp : 0 < degree p
hmp : Monic p
hq : q ≠ 0
zn0 : 0 ≠ 1
x✝ : p ^ (natDegree q + 1) ∣ q
r : R[X]
hr : q = p ^ (natDegree q + 1) * r
hp0 : p ≠ 0
hr0 : r ≠ 0
hpn1 : leadingCoeff p ^ (natDegree q + 1) = 1
hpn0' : leadingCoeff p ^ (natDegree q + 1) ≠ 0
hpnr0 : leadingCoeff (p ^ (natDegree q + 1)) * leadingCoeff r ≠ 0
hnp : 0 < natDegree p
this : natDegree q = natDegree (p ^ (natDegree q + 1) * r)
⊢ False

tactic: exact
  ne_of_lt
    (lt_add_of_le_of_pos (le_mul_of_one_le_right (Nat.zero_le _) hnp)
      (add_pos_of_pos_of_nonneg (by rwa [one_mul]) (Nat.zero_le _)))
    this
state_before: R : Type u
S : Type v
T : Type w
A : Type z
a b : R
n : ℕ
inst✝ : CommSemiring R
p q : R[X]
hp : 0 < degree p
hmp : Monic p
hq : q ≠ 0
zn0 : 0 ≠ 1
x✝ : p ^ (natDegree q + 1) ∣ q
r : R[X]
hr : q = p ^ (natDegree q + 1) * r
hp0 : p ≠ 0
hr0 : r ≠ 0
hpn1 : leadingCoeff p ^ (natDegree q + 1) = 1
hpn0' : leadingCoeff p ^ (natDegree q + 1) ≠ 0
hpnr0 : leadingCoeff (p ^ (natDegree q + 1)) * leadingCoeff r ≠ 0
hnp : 0 < natDegree p
this : natDegree q = natDegree q * natDegree p + (1 * natDegree p + natDegree r)
⊢ False

tactic: simp [hp0] at hp
state_before: R : Type u
S : Type v
T : Type w
A : Type z
a b : R
n : ℕ
inst✝ : CommSemiring R
p q : R[X]
hp : 0 < degree p
hmp : Monic p
hq : q ≠ 0
zn0 : 0 ≠ 1
x✝ : p ^ (natDegree q + 1) ∣ q
r : R[X]
hr : q = p ^ (natDegree q + 1) * r
hp0 : p = 0
⊢ False

tactic: subst hr0
state_before: R : Type u
S : Type v
T : Type w
A : Type z
a b : R
n : ℕ
inst✝ : CommSemiring R
p q : R[X]
hp : 0 < degree p
hmp : Monic p
hq : q ≠ 0
zn0 : 0 ≠ 1
x✝ : p ^ (natDegree q + 1) ∣ q
r : R[X]
hr : q = p ^ (natDegree q + 1) * r
hp0 : p ≠ 0
hr0 : r = 0
⊢ False

tactic: simp [hq] at hr
state_before: R : Type u
S : Type v
T : Type w
A : Type z
a b : R
n : ℕ
inst✝ : CommSemiring R
p q : R[X]
hp : 0 < degree p
hmp : Monic p
hq : q ≠ 0
zn0 : 0 ≠ 1
x✝ : p ^ (natDegree q + 1) ∣ q
hp0 : p ≠ 0
hr : q = p ^ (natDegree q + 1) * 0
⊢ False

tactic: simp [show _ = _ from hmp]
state_before: R : Type u
S : Type v
T : Type w
A : Type z
a b : R
n : ℕ
inst✝ : CommSemiring R
p q : R[X]
hp : 0 < degree p
hmp : Monic p
hq : q ≠ 0
zn0 : 0 ≠ 1
x✝ : p ^ (natDegree q + 1) ∣ q
r : R[X]
hr : q = p ^ (natDegree q + 1) * r
hp0 : p ≠ 0
hr0 : r ≠ 0
⊢ leadingCoeff p ^ (natDegree q + 1) = 1

tactic: simp only [leadingCoeff_pow' hpn0', leadingCoeff_eq_zero, hpn1, one_pow, one_mul, Ne.def,
    hr0]
state_before: R : Type u
S : Type v
T : Type w
A : Type z
a b : R
n : ℕ
inst✝ : CommSemiring R
p q : R[X]
hp : 0 < degree p
hmp : Monic p
hq : q ≠ 0
zn0 : 0 ≠ 1
x✝ : p ^ (natDegree q + 1) ∣ q
r : R[X]
hr : q = p ^ (natDegree q + 1) * r
hp0 : p ≠ 0
hr0 : r ≠ 0
hpn1 : leadingCoeff p ^ (natDegree q + 1) = 1
hpn0' : leadingCoeff p ^ (natDegree q + 1) ≠ 0
⊢ leadingCoeff (p ^ (natDegree q + 1)) * leadingCoeff r ≠ 0

tactic: rw [← WithBot.coe_lt_coe, ← Nat.cast_withBot, ← Nat.cast_withBot,
  ← degree_eq_natDegree hp0]
state_before: R : Type u
S : Type v
T : Type w
A : Type z
a b : R
n : ℕ
inst✝ : CommSemiring R
p q : R[X]
hp : 0 < degree p
hmp : Monic p
hq : q ≠ 0
zn0 : 0 ≠ 1
x✝ : p ^ (natDegree q + 1) ∣ q
r : R[X]
hr : q = p ^ (natDegree q + 1) * r
hp0 : p ≠ 0
hr0 : r ≠ 0
hpn1 : leadingCoeff p ^ (natDegree q + 1) = 1
hpn0' : leadingCoeff p ^ (natDegree q + 1) ≠ 0
hpnr0 : leadingCoeff (p ^ (natDegree q + 1)) * leadingCoeff r ≠ 0
⊢ 0 < natDegree p

tactic: exact hp
state_before: R : Type u
S : Type v
T : Type w
A : Type z
a b : R
n : ℕ
inst✝ : CommSemiring R
p q : R[X]
hp : 0 < degree p
hmp : Monic p
hq : q ≠ 0
zn0 : 0 ≠ 1
x✝ : p ^ (natDegree q + 1) ∣ q
r : R[X]
hr : q = p ^ (natDegree q + 1) * r
hp0 : p ≠ 0
hr0 : r ≠ 0
hpn1 : leadingCoeff p ^ (natDegree q + 1) = 1
hpn0' : leadingCoeff p ^ (natDegree q + 1) ≠ 0
hpnr0 : leadingCoeff (p ^ (natDegree q + 1)) * leadingCoeff r ≠ 0
⊢ ↑0 < degree p

tactic: rwa [one_mul]
state_before: R : Type u
S : Type v
T : Type w
A : Type z
a b : R
n : ℕ
inst✝ : CommSemiring R
p q : R[X]
hp : 0 < degree p
hmp : Monic p
hq : q ≠ 0
zn0 : 0 ≠ 1
x✝ : p ^ (natDegree q + 1) ∣ q
r : R[X]
hr : q = p ^ (natDegree q + 1) * r
hp0 : p ≠ 0
hr0 : r ≠ 0
hpn1 : leadingCoeff p ^ (natDegree q + 1) = 1
hpn0' : leadingCoeff p ^ (natDegree q + 1) ≠ 0
hpnr0 : leadingCoeff (p ^ (natDegree q + 1)) * leadingCoeff r ≠ 0
hnp : 0 < natDegree p
this : natDegree q = natDegree q * natDegree p + (1 * natDegree p + natDegree r)
⊢ 0 < 1 * natDegree p