R : Type u
S : Type v
T : Type w
A : Type z
a b : R
n : ℕ
inst✝ : CommRing R
p q : R[X]
hq : Monic q
h : degree q ≤ degree p
✝ : Nontrivial R
⊢ degree q + degree (p /ₘ q) = degree p
R : Type u
S : Type v
T : Type w
A : Type z
a b : R
n : ℕ
inst✝ : CommRing R
p q : R[X]
hq : Monic q
h : degree q ≤ degree p
⊢ degree q + degree (p /ₘ q) = degree p
nontriviality R
R : Type u
S : Type v
T : Type w
A : Type z
a b : R
n : ℕ
inst✝ : CommRing R
p q : R[X]
hq : Monic q
h : degree q ≤ degree p
✝ : Nontrivial R
hdiv0 : p /ₘ q ≠ 0
⊢ degree q + degree (p /ₘ q) = degree p
R : Type u
S : Type v
T : Type w
A : Type z
a b : R
n : ℕ
inst✝ : CommRing R
p q : R[X]
hq : Monic q
h : degree q ≤ degree p
✝ : Nontrivial R
⊢ degree q + degree (p /ₘ q) = degree p
have hdiv0 : p /ₘ q ≠ 0 := by rwa [Ne.def, divByMonic_eq_zero_iff hq, not_lt]
R : Type u
S : Type v
T : Type w
A : Type z
a b : R
n : ℕ
inst✝ : CommRing R
p q : R[X]
hq : Monic q
h : degree q ≤ degree p
✝ : Nontrivial R
hdiv0 : p /ₘ q ≠ 0
hlc : leadingCoeff q * leadingCoeff (p /ₘ q) ≠ 0
⊢ degree q + degree (p /ₘ q) = degree p
R : Type u
S : Type v
T : Type w
A : Type z
a b : R
n : ℕ
inst✝ : CommRing R
p q : R[X]
hq : Monic q
h : degree q ≤ degree p
✝ : Nontrivial R
hdiv0 : p /ₘ q ≠ 0
⊢ degree q + degree (p /ₘ q) = degree p
have hlc : leadingCoeff q * leadingCoeff (p /ₘ q) ≠ 0 := by
  rwa [Monic.def.1 hq, one_mul, Ne.def, leadingCoeff_eq_zero]
R : Type u
S : Type v
T : Type w
A : Type z
a b : R
n : ℕ
inst✝ : CommRing R
p q : R[X]
hq : Monic q
h : degree q ≤ degree p
✝ : Nontrivial R
hdiv0 : p /ₘ q ≠ 0
hlc : leadingCoeff q * leadingCoeff (p /ₘ q) ≠ 0
hmod : degree (p %ₘ q) < degree (q * (p /ₘ q))
⊢ degree q + degree (p /ₘ q) = degree p
R : Type u
S : Type v
T : Type w
A : Type z
a b : R
n : ℕ
inst✝ : CommRing R
p q : R[X]
hq : Monic q
h : degree q ≤ degree p
✝ : Nontrivial R
hdiv0 : p /ₘ q ≠ 0
hlc : leadingCoeff q * leadingCoeff (p /ₘ q) ≠ 0
⊢ degree q + degree (p /ₘ q) = degree p
have hmod : degree (p %ₘ q) < degree (q * (p /ₘ q)) :=
  calc
    degree (p %ₘ q) < degree q := degree_modByMonic_lt _ hq
    _ ≤ _ := by
      rw [degree_mul' hlc, degree_eq_natDegree hq.ne_zero, degree_eq_natDegree hdiv0, ←
          Nat.cast_add, Nat.cast_withBot, Nat.cast_withBot, WithBot.coe_le_coe]
      exact Nat.le_add_right _ _
no goals
R : Type u
S : Type v
T : Type w
A : Type z
a b : R
n : ℕ
inst✝ : CommRing R
p q : R[X]
hq : Monic q
h : degree q ≤ degree p
✝ : Nontrivial R
hdiv0 : p /ₘ q ≠ 0
hlc : leadingCoeff q * leadingCoeff (p /ₘ q) ≠ 0
hmod : degree (p %ₘ q) < degree (q * (p /ₘ q))
⊢ degree q + degree (p /ₘ q) = degree p
calc
  degree q + degree (p /ₘ q) = degree (q * (p /ₘ q)) := Eq.symm (degree_mul' hlc)
  _ = degree (p %ₘ q + q * (p /ₘ q)) := (degree_add_eq_right_of_degree_lt hmod).symm
  _ = _ := congr_arg _ (modByMonic_add_div _ hq)
no goals
R : Type u
S : Type v
T : Type w
A : Type z
a b : R
n : ℕ
inst✝ : CommRing R
p q : R[X]
hq : Monic q
h : degree q ≤ degree p
✝ : Nontrivial R
⊢ p /ₘ q ≠ 0
rwa [Ne.def, divByMonic_eq_zero_iff hq, not_lt]
no goals
R : Type u
S : Type v
T : Type w
A : Type z
a b : R
n : ℕ
inst✝ : CommRing R
p q : R[X]
hq : Monic q
h : degree q ≤ degree p
✝ : Nontrivial R
hdiv0 : p /ₘ q ≠ 0
⊢ leadingCoeff q * leadingCoeff (p /ₘ q) ≠ 0
rwa [Monic.def.1 hq, one_mul, Ne.def, leadingCoeff_eq_zero]
R : Type u
S : Type v
T : Type w
A : Type z
a b : R
n : ℕ
inst✝ : CommRing R
p q : R[X]
hq : Monic q
h : degree q ≤ degree p
✝ : Nontrivial R
hdiv0 : p /ₘ q ≠ 0
hlc : leadingCoeff q * leadingCoeff (p /ₘ q) ≠ 0
⊢ natDegree q ≤ natDegree q + natDegree (p /ₘ q)
R : Type u
S : Type v
T : Type w
A : Type z
a b : R
n : ℕ
inst✝ : CommRing R
p q : R[X]
hq : Monic q
h : degree q ≤ degree p
✝ : Nontrivial R
hdiv0 : p /ₘ q ≠ 0
hlc : leadingCoeff q * leadingCoeff (p /ₘ q) ≠ 0
⊢ degree q ≤ degree (q * (p /ₘ q))
rw [degree_mul' hlc, degree_eq_natDegree hq.ne_zero, degree_eq_natDegree hdiv0, ←
    Nat.cast_add, Nat.cast_withBot, Nat.cast_withBot, WithBot.coe_le_coe]
no goals
R : Type u
S : Type v
T : Type w
A : Type z
a b : R
n : ℕ
inst✝ : CommRing R
p q : R[X]
hq : Monic q
h : degree q ≤ degree p
✝ : Nontrivial R
hdiv0 : p /ₘ q ≠ 0
hlc : leadingCoeff q * leadingCoeff (p /ₘ q) ≠ 0
⊢ natDegree q ≤ natDegree q + natDegree (p /ₘ q)
exact Nat.le_add_right _ _