no goals
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
f : R[X]
P : Ideal R
hP : Ideal.IsPrime P
hfl : ¬leadingCoeff f ∈ P
hfP : ∀ (n : ℕ), ↑n < degree f → coeff f n ∈ P
hfd0 : 0 < degree f
h0 : ¬coeff f 0 ∈ P ^ 2
hu : IsPrimitive f
x✝ : f = 0
⊢ False
simp_all only [not_true, Submodule.zero_mem, coeff_zero]
no goals
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
f : R[X]
P : Ideal R
hP : Ideal.IsPrime P
hfl : ¬leadingCoeff f ∈ P
hfP : ∀ (n : ℕ), ↑n < degree f → coeff f n ∈ P
hfd0✝ : 0 < degree f
h0 : ¬coeff f 0 ∈ P ^ 2
hu : IsPrimitive f
hf0 : f ≠ 0
hf : map (mk P) f = ↑C (↑(mk P) (leadingCoeff f)) * X ^ natDegree f
hfd0 : 0 < natDegree f
h : degree f = 0
⊢ False
simp_all only [lt_irrefl]
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) (p * q) = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
⊢ IsUnit p ∨ IsUnit q
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
f : R[X]
P : Ideal R
hP : Ideal.IsPrime P
hfl : ¬leadingCoeff f ∈ P
hfP : ∀ (n : ℕ), ↑n < degree f → coeff f n ∈ P
hfd0✝ : 0 < degree f
h0 : ¬coeff f 0 ∈ P ^ 2
hu : IsPrimitive f
hf0 : f ≠ 0
hf : map (mk P) f = ↑C (↑(mk P) (leadingCoeff f)) * X ^ natDegree f
hfd0 : 0 < natDegree f
⊢ ∀ (a b : R[X]), f = a * b → IsUnit a ∨ IsUnit b
rintro p q rfl
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) p * map (mk P) q = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
⊢ IsUnit p ∨ IsUnit q
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) (p * q) = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
⊢ IsUnit p ∨ IsUnit q
rw [Polynomial.map_mul] at hf
case intro.intro.intro.intro.intro.intro.intro
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) p * map (mk P) q = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
m n : ℕ
b c : (R ⧸ P)[X]
hmnd : m + n = natDegree (p * q)
hbc : ↑C (↑(mk P) (leadingCoeff (p * q))) = b * c
hp : map (mk P) p = b * X ^ m
hq : map (mk P) q = c * X ^ n
⊢ IsUnit p ∨ IsUnit q
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) p * map (mk P) q = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
⊢ IsUnit p ∨ IsUnit q
rcases mul_eq_mul_prime_pow
    (show Prime (X : Polynomial (R ⧸ P)) from monic_X.prime_of_degree_eq_one degree_X) hf with
  ⟨m, n, b, c, hmnd, hbc, hp, hq⟩
case intro.intro.intro.intro.intro.intro.intro
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) p * map (mk P) q = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
m n : ℕ
b c : (R ⧸ P)[X]
hmnd : m + n = natDegree (p * q)
hbc : ↑C (↑(mk P) (leadingCoeff (p * q))) = b * c
hp : map (mk P) p = b * X ^ m
hq : map (mk P) q = c * X ^ n
hmn : 0 < m → 0 < n → False
⊢ IsUnit p ∨ IsUnit q
case intro.intro.intro.intro.intro.intro.intro
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) p * map (mk P) q = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
m n : ℕ
b c : (R ⧸ P)[X]
hmnd : m + n = natDegree (p * q)
hbc : ↑C (↑(mk P) (leadingCoeff (p * q))) = b * c
hp : map (mk P) p = b * X ^ m
hq : map (mk P) q = c * X ^ n
⊢ IsUnit p ∨ IsUnit q
have hmn : 0 < m → 0 < n → False := by
  intro hm0 hn0
  refine' h0 _
  rw [coeff_zero_eq_eval_zero, eval_mul, sq]
  exact
    Ideal.mul_mem_mul (eval_zero_mem_ideal_of_eq_mul_X_pow hp hm0)
      (eval_zero_mem_ideal_of_eq_mul_X_pow hq hn0)
case intro.intro.intro.intro.intro.intro.intro
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) p * map (mk P) q = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
m n : ℕ
b c : (R ⧸ P)[X]
hmnd : m + n = natDegree (p * q)
hbc : ↑C (↑(mk P) (leadingCoeff (p * q))) = b * c
hp : map (mk P) p = b * X ^ m
hq : map (mk P) q = c * X ^ n
hmn : 0 < m → 0 < n → False
hpql0 : ↑(mk P) (leadingCoeff (p * q)) ≠ 0
⊢ IsUnit p ∨ IsUnit q
case intro.intro.intro.intro.intro.intro.intro
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) p * map (mk P) q = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
m n : ℕ
b c : (R ⧸ P)[X]
hmnd : m + n = natDegree (p * q)
hbc : ↑C (↑(mk P) (leadingCoeff (p * q))) = b * c
hp : map (mk P) p = b * X ^ m
hq : map (mk P) q = c * X ^ n
hmn : 0 < m → 0 < n → False
⊢ IsUnit p ∨ IsUnit q
have hpql0 : (mk P) (p * q).leadingCoeff ≠ 0 := by rwa [Ne.def, eq_zero_iff_mem]
case intro.intro.intro.intro.intro.intro.intro
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) p * map (mk P) q = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
m n : ℕ
b c : (R ⧸ P)[X]
hmnd : m + n = natDegree (p * q)
hbc : ↑C (↑(mk P) (leadingCoeff (p * q))) = b * c
hp : map (mk P) p = b * X ^ m
hq : map (mk P) q = c * X ^ n
hmn : 0 < m → 0 < n → False
hpql0 : ↑(mk P) (leadingCoeff (p * q)) ≠ 0
hp0 : p ≠ 0
⊢ IsUnit p ∨ IsUnit q
case intro.intro.intro.intro.intro.intro.intro
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) p * map (mk P) q = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
m n : ℕ
b c : (R ⧸ P)[X]
hmnd : m + n = natDegree (p * q)
hbc : ↑C (↑(mk P) (leadingCoeff (p * q))) = b * c
hp : map (mk P) p = b * X ^ m
hq : map (mk P) q = c * X ^ n
hmn : 0 < m → 0 < n → False
hpql0 : ↑(mk P) (leadingCoeff (p * q)) ≠ 0
⊢ IsUnit p ∨ IsUnit q
have hp0 : p ≠ 0 := fun h => by
  simp_all only [MulZeroClass.zero_mul, eq_self_iff_true, not_true, Ne.def]
case intro.intro.intro.intro.intro.intro.intro
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) p * map (mk P) q = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
m n : ℕ
b c : (R ⧸ P)[X]
hmnd : m + n = natDegree (p * q)
hbc : ↑C (↑(mk P) (leadingCoeff (p * q))) = b * c
hp : map (mk P) p = b * X ^ m
hq : map (mk P) q = c * X ^ n
hmn : 0 < m → 0 < n → False
hpql0 : ↑(mk P) (leadingCoeff (p * q)) ≠ 0
hp0 : p ≠ 0
hq0 : q ≠ 0
⊢ IsUnit p ∨ IsUnit q
case intro.intro.intro.intro.intro.intro.intro
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) p * map (mk P) q = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
m n : ℕ
b c : (R ⧸ P)[X]
hmnd : m + n = natDegree (p * q)
hbc : ↑C (↑(mk P) (leadingCoeff (p * q))) = b * c
hp : map (mk P) p = b * X ^ m
hq : map (mk P) q = c * X ^ n
hmn : 0 < m → 0 < n → False
hpql0 : ↑(mk P) (leadingCoeff (p * q)) ≠ 0
hp0 : p ≠ 0
⊢ IsUnit p ∨ IsUnit q
have hq0 : q ≠ 0 := fun h => by
  simp_all only [eq_self_iff_true, not_true, Ne.def, MulZeroClass.mul_zero]
case intro.intro.intro.intro.intro.intro.intro
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) p * map (mk P) q = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
m n : ℕ
b c : (R ⧸ P)[X]
hmnd : m + n = natDegree (p * q)
hbc : ↑C (↑(mk P) (leadingCoeff (p * q))) = b * c
hp : map (mk P) p = b * X ^ m
hq : map (mk P) q = c * X ^ n
hmn : 0 < m → 0 < n → False
hpql0 : ↑(mk P) (leadingCoeff (p * q)) ≠ 0
hp0 : p ≠ 0
hq0 : q ≠ 0
hbc0 : degree b = 0 ∧ degree c = 0
⊢ IsUnit p ∨ IsUnit q
case intro.intro.intro.intro.intro.intro.intro
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) p * map (mk P) q = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
m n : ℕ
b c : (R ⧸ P)[X]
hmnd : m + n = natDegree (p * q)
hbc : ↑C (↑(mk P) (leadingCoeff (p * q))) = b * c
hp : map (mk P) p = b * X ^ m
hq : map (mk P) q = c * X ^ n
hmn : 0 < m → 0 < n → False
hpql0 : ↑(mk P) (leadingCoeff (p * q)) ≠ 0
hp0 : p ≠ 0
hq0 : q ≠ 0
⊢ IsUnit p ∨ IsUnit q
have hbc0 : degree b = 0 ∧ degree c = 0 := by
  apply_fun degree  at hbc
  rwa [degree_C hpql0, degree_mul, eq_comm, Nat.WithBot.add_eq_zero_iff] at hbc
case intro.intro.intro.intro.intro.intro.intro
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) p * map (mk P) q = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
m n : ℕ
b c : (R ⧸ P)[X]
hmnd : m + n = natDegree (p * q)
hbc : ↑C (↑(mk P) (leadingCoeff (p * q))) = b * c
hp : map (mk P) p = b * X ^ m
hq : map (mk P) q = c * X ^ n
hmn : 0 < m → 0 < n → False
hpql0 : ↑(mk P) (leadingCoeff (p * q)) ≠ 0
hp0 : p ≠ 0
hq0 : q ≠ 0
hbc0 : degree b = 0 ∧ degree c = 0
hmp : m ≤ natDegree p
⊢ IsUnit p ∨ IsUnit q
case intro.intro.intro.intro.intro.intro.intro
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) p * map (mk P) q = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
m n : ℕ
b c : (R ⧸ P)[X]
hmnd : m + n = natDegree (p * q)
hbc : ↑C (↑(mk P) (leadingCoeff (p * q))) = b * c
hp : map (mk P) p = b * X ^ m
hq : map (mk P) q = c * X ^ n
hmn : 0 < m → 0 < n → False
hpql0 : ↑(mk P) (leadingCoeff (p * q)) ≠ 0
hp0 : p ≠ 0
hq0 : q ≠ 0
hbc0 : degree b = 0 ∧ degree c = 0
⊢ IsUnit p ∨ IsUnit q
have hmp : m ≤ natDegree p := le_natDegree_of_map_eq_mul_X_pow hP hp hbc0.1
case intro.intro.intro.intro.intro.intro.intro
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) p * map (mk P) q = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
m n : ℕ
b c : (R ⧸ P)[X]
hmnd : m + n = natDegree (p * q)
hbc : ↑C (↑(mk P) (leadingCoeff (p * q))) = b * c
hp : map (mk P) p = b * X ^ m
hq : map (mk P) q = c * X ^ n
hmn : 0 < m → 0 < n → False
hpql0 : ↑(mk P) (leadingCoeff (p * q)) ≠ 0
hp0 : p ≠ 0
hq0 : q ≠ 0
hbc0 : degree b = 0 ∧ degree c = 0
hmp : m ≤ natDegree p
hnq : n ≤ natDegree q
⊢ IsUnit p ∨ IsUnit q
case intro.intro.intro.intro.intro.intro.intro
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) p * map (mk P) q = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
m n : ℕ
b c : (R ⧸ P)[X]
hmnd : m + n = natDegree (p * q)
hbc : ↑C (↑(mk P) (leadingCoeff (p * q))) = b * c
hp : map (mk P) p = b * X ^ m
hq : map (mk P) q = c * X ^ n
hmn : 0 < m → 0 < n → False
hpql0 : ↑(mk P) (leadingCoeff (p * q)) ≠ 0
hp0 : p ≠ 0
hq0 : q ≠ 0
hbc0 : degree b = 0 ∧ degree c = 0
hmp : m ≤ natDegree p
⊢ IsUnit p ∨ IsUnit q
have hnq : n ≤ natDegree q := le_natDegree_of_map_eq_mul_X_pow hP hq hbc0.2
case intro.intro.intro.intro.intro.intro.intro.inl
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) p * map (mk P) q = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
n : ℕ
b c : (R ⧸ P)[X]
hbc : ↑C (↑(mk P) (leadingCoeff (p * q))) = b * c
hq : map (mk P) q = c * X ^ n
hpql0 : ↑(mk P) (leadingCoeff (p * q)) ≠ 0
hp0 : p ≠ 0
hq0 : q ≠ 0
hbc0 : degree b = 0 ∧ degree c = 0
hnq : n ≤ natDegree q
hmnd : 0 + n = natDegree (p * q)
hp : map (mk P) p = b * X ^ 0
hmn : 0 < 0 → 0 < n → False
hmp : 0 ≤ natDegree p
hpmqn : natDegree p = 0 ∧ natDegree q = n
⊢ IsUnit p ∨ IsUnit q

case intro.intro.intro.intro.intro.intro.intro.inr
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) p * map (mk P) q = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
m : ℕ
b c : (R ⧸ P)[X]
hbc : ↑C (↑(mk P) (leadingCoeff (p * q))) = b * c
hp : map (mk P) p = b * X ^ m
hpql0 : ↑(mk P) (leadingCoeff (p * q)) ≠ 0
hp0 : p ≠ 0
hq0 : q ≠ 0
hbc0 : degree b = 0 ∧ degree c = 0
hmp : m ≤ natDegree p
hmnd : m + 0 = natDegree (p * q)
hq : map (mk P) q = c * X ^ 0
hmn : 0 < m → 0 < 0 → False
hnq : 0 ≤ natDegree q
hpmqn : natDegree p = m ∧ natDegree q = 0
⊢ IsUnit p ∨ IsUnit q
case intro.intro.intro.intro.intro.intro.intro
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) p * map (mk P) q = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
m n : ℕ
b c : (R ⧸ P)[X]
hmnd : m + n = natDegree (p * q)
hbc : ↑C (↑(mk P) (leadingCoeff (p * q))) = b * c
hp : map (mk P) p = b * X ^ m
hq : map (mk P) q = c * X ^ n
hmn : 0 < m → 0 < n → False
hpql0 : ↑(mk P) (leadingCoeff (p * q)) ≠ 0
hp0 : p ≠ 0
hq0 : q ≠ 0
hbc0 : degree b = 0 ∧ degree c = 0
hmp : m ≤ natDegree p
hnq : n ≤ natDegree q
hpmqn : natDegree p = m ∧ natDegree q = n
⊢ IsUnit p ∨ IsUnit q
obtain rfl | rfl : m = 0 ∨ n = 0 := by
  rwa [pos_iff_ne_zero, pos_iff_ne_zero, imp_false, Classical.not_not, ← or_iff_not_imp_left]
    at hmn
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) p * map (mk P) q = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
m n : ℕ
b c : (R ⧸ P)[X]
hmnd : m + n = natDegree (p * q)
hbc : ↑C (↑(mk P) (leadingCoeff (p * q))) = b * c
hp : map (mk P) p = b * X ^ m
hq : map (mk P) q = c * X ^ n
hm0 : 0 < m
hn0 : 0 < n
⊢ False
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) p * map (mk P) q = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
m n : ℕ
b c : (R ⧸ P)[X]
hmnd : m + n = natDegree (p * q)
hbc : ↑C (↑(mk P) (leadingCoeff (p * q))) = b * c
hp : map (mk P) p = b * X ^ m
hq : map (mk P) q = c * X ^ n
⊢ 0 < m → 0 < n → False
intro hm0 hn0
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) p * map (mk P) q = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
m n : ℕ
b c : (R ⧸ P)[X]
hmnd : m + n = natDegree (p * q)
hbc : ↑C (↑(mk P) (leadingCoeff (p * q))) = b * c
hp : map (mk P) p = b * X ^ m
hq : map (mk P) q = c * X ^ n
hm0 : 0 < m
hn0 : 0 < n
⊢ coeff (p * q) 0 ∈ P ^ 2
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) p * map (mk P) q = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
m n : ℕ
b c : (R ⧸ P)[X]
hmnd : m + n = natDegree (p * q)
hbc : ↑C (↑(mk P) (leadingCoeff (p * q))) = b * c
hp : map (mk P) p = b * X ^ m
hq : map (mk P) q = c * X ^ n
hm0 : 0 < m
hn0 : 0 < n
⊢ False
refine' h0 _
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) p * map (mk P) q = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
m n : ℕ
b c : (R ⧸ P)[X]
hmnd : m + n = natDegree (p * q)
hbc : ↑C (↑(mk P) (leadingCoeff (p * q))) = b * c
hp : map (mk P) p = b * X ^ m
hq : map (mk P) q = c * X ^ n
hm0 : 0 < m
hn0 : 0 < n
⊢ eval 0 p * eval 0 q ∈ P * P
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) p * map (mk P) q = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
m n : ℕ
b c : (R ⧸ P)[X]
hmnd : m + n = natDegree (p * q)
hbc : ↑C (↑(mk P) (leadingCoeff (p * q))) = b * c
hp : map (mk P) p = b * X ^ m
hq : map (mk P) q = c * X ^ n
hm0 : 0 < m
hn0 : 0 < n
⊢ coeff (p * q) 0 ∈ P ^ 2
rw [coeff_zero_eq_eval_zero, eval_mul, sq]
no goals
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) p * map (mk P) q = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
m n : ℕ
b c : (R ⧸ P)[X]
hmnd : m + n = natDegree (p * q)
hbc : ↑C (↑(mk P) (leadingCoeff (p * q))) = b * c
hp : map (mk P) p = b * X ^ m
hq : map (mk P) q = c * X ^ n
hm0 : 0 < m
hn0 : 0 < n
⊢ eval 0 p * eval 0 q ∈ P * P
exact
  Ideal.mul_mem_mul (eval_zero_mem_ideal_of_eq_mul_X_pow hp hm0)
    (eval_zero_mem_ideal_of_eq_mul_X_pow hq hn0)
no goals
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) p * map (mk P) q = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
m n : ℕ
b c : (R ⧸ P)[X]
hmnd : m + n = natDegree (p * q)
hbc : ↑C (↑(mk P) (leadingCoeff (p * q))) = b * c
hp : map (mk P) p = b * X ^ m
hq : map (mk P) q = c * X ^ n
hmn : 0 < m → 0 < n → False
⊢ ↑(mk P) (leadingCoeff (p * q)) ≠ 0
rwa [Ne.def, eq_zero_iff_mem]
no goals
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) p * map (mk P) q = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
m n : ℕ
b c : (R ⧸ P)[X]
hmnd : m + n = natDegree (p * q)
hbc : ↑C (↑(mk P) (leadingCoeff (p * q))) = b * c
hp : map (mk P) p = b * X ^ m
hq : map (mk P) q = c * X ^ n
hmn : 0 < m → 0 < n → False
hpql0 : ↑(mk P) (leadingCoeff (p * q)) ≠ 0
h : p = 0
⊢ False
simp_all only [MulZeroClass.zero_mul, eq_self_iff_true, not_true, Ne.def]
no goals
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) p * map (mk P) q = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
m n : ℕ
b c : (R ⧸ P)[X]
hmnd : m + n = natDegree (p * q)
hbc : ↑C (↑(mk P) (leadingCoeff (p * q))) = b * c
hp : map (mk P) p = b * X ^ m
hq : map (mk P) q = c * X ^ n
hmn : 0 < m → 0 < n → False
hpql0 : ↑(mk P) (leadingCoeff (p * q)) ≠ 0
hp0 : p ≠ 0
h : q = 0
⊢ False
simp_all only [eq_self_iff_true, not_true, Ne.def, MulZeroClass.mul_zero]
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) p * map (mk P) q = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
m n : ℕ
b c : (R ⧸ P)[X]
hmnd : m + n = natDegree (p * q)
hp : map (mk P) p = b * X ^ m
hq : map (mk P) q = c * X ^ n
hmn : 0 < m → 0 < n → False
hpql0 : ↑(mk P) (leadingCoeff (p * q)) ≠ 0
hp0 : p ≠ 0
hq0 : q ≠ 0
hbc : degree (↑C (↑(mk P) (leadingCoeff (p * q)))) = degree (b * c)
⊢ degree b = 0 ∧ degree c = 0
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) p * map (mk P) q = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
m n : ℕ
b c : (R ⧸ P)[X]
hmnd : m + n = natDegree (p * q)
hbc : ↑C (↑(mk P) (leadingCoeff (p * q))) = b * c
hp : map (mk P) p = b * X ^ m
hq : map (mk P) q = c * X ^ n
hmn : 0 < m → 0 < n → False
hpql0 : ↑(mk P) (leadingCoeff (p * q)) ≠ 0
hp0 : p ≠ 0
hq0 : q ≠ 0
⊢ degree b = 0 ∧ degree c = 0
apply_fun degree  at hbc
no goals
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) p * map (mk P) q = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
m n : ℕ
b c : (R ⧸ P)[X]
hmnd : m + n = natDegree (p * q)
hp : map (mk P) p = b * X ^ m
hq : map (mk P) q = c * X ^ n
hmn : 0 < m → 0 < n → False
hpql0 : ↑(mk P) (leadingCoeff (p * q)) ≠ 0
hp0 : p ≠ 0
hq0 : q ≠ 0
hbc : degree (↑C (↑(mk P) (leadingCoeff (p * q)))) = degree (b * c)
⊢ degree b = 0 ∧ degree c = 0
rwa [degree_C hpql0, degree_mul, eq_comm, Nat.WithBot.add_eq_zero_iff] at hbc
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) p * map (mk P) q = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
m n : ℕ
b c : (R ⧸ P)[X]
hmnd : m + n = natDegree p + natDegree q
hbc : ↑C (↑(mk P) (leadingCoeff (p * q))) = b * c
hp : map (mk P) p = b * X ^ m
hq : map (mk P) q = c * X ^ n
hmn : 0 < m → 0 < n → False
hpql0 : ↑(mk P) (leadingCoeff (p * q)) ≠ 0
hp0 : p ≠ 0
hq0 : q ≠ 0
hbc0 : degree b = 0 ∧ degree c = 0
hmp : m ≤ natDegree p
hnq : n ≤ natDegree q
⊢ natDegree p = m ∧ natDegree q = n
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) p * map (mk P) q = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
m n : ℕ
b c : (R ⧸ P)[X]
hmnd : m + n = natDegree (p * q)
hbc : ↑C (↑(mk P) (leadingCoeff (p * q))) = b * c
hp : map (mk P) p = b * X ^ m
hq : map (mk P) q = c * X ^ n
hmn : 0 < m → 0 < n → False
hpql0 : ↑(mk P) (leadingCoeff (p * q)) ≠ 0
hp0 : p ≠ 0
hq0 : q ≠ 0
hbc0 : degree b = 0 ∧ degree c = 0
hmp : m ≤ natDegree p
hnq : n ≤ natDegree q
⊢ natDegree p = m ∧ natDegree q = n
rw [natDegree_mul hp0 hq0] at hmnd
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) p * map (mk P) q = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
m n : ℕ
b c : (R ⧸ P)[X]
hbc : ↑C (↑(mk P) (leadingCoeff (p * q))) = b * c
hp : map (mk P) p = b * X ^ m
hq : map (mk P) q = c * X ^ n
hmn : 0 < m → 0 < n → False
hpql0 : ↑(mk P) (leadingCoeff (p * q)) ≠ 0
hp0 : p ≠ 0
hq0 : q ≠ 0
hbc0 : degree b = 0 ∧ degree c = 0
hmp : m ≤ natDegree p
hnq : n ≤ natDegree q
hmnd : ¬(natDegree p = m ∧ natDegree q = n)
⊢ ¬m + n = natDegree p + natDegree q
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) p * map (mk P) q = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
m n : ℕ
b c : (R ⧸ P)[X]
hmnd : m + n = natDegree p + natDegree q
hbc : ↑C (↑(mk P) (leadingCoeff (p * q))) = b * c
hp : map (mk P) p = b * X ^ m
hq : map (mk P) q = c * X ^ n
hmn : 0 < m → 0 < n → False
hpql0 : ↑(mk P) (leadingCoeff (p * q)) ≠ 0
hp0 : p ≠ 0
hq0 : q ≠ 0
hbc0 : degree b = 0 ∧ degree c = 0
hmp : m ≤ natDegree p
hnq : n ≤ natDegree q
⊢ natDegree p = m ∧ natDegree q = n
contrapose hmnd
case h
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) p * map (mk P) q = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
m n : ℕ
b c : (R ⧸ P)[X]
hbc : ↑C (↑(mk P) (leadingCoeff (p * q))) = b * c
hp : map (mk P) p = b * X ^ m
hq : map (mk P) q = c * X ^ n
hmn : 0 < m → 0 < n → False
hpql0 : ↑(mk P) (leadingCoeff (p * q)) ≠ 0
hp0 : p ≠ 0
hq0 : q ≠ 0
hbc0 : degree b = 0 ∧ degree c = 0
hmp : m ≤ natDegree p
hnq : n ≤ natDegree q
hmnd : ¬(natDegree p = m ∧ natDegree q = n)
⊢ m + n < natDegree p + natDegree q
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) p * map (mk P) q = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
m n : ℕ
b c : (R ⧸ P)[X]
hbc : ↑C (↑(mk P) (leadingCoeff (p * q))) = b * c
hp : map (mk P) p = b * X ^ m
hq : map (mk P) q = c * X ^ n
hmn : 0 < m → 0 < n → False
hpql0 : ↑(mk P) (leadingCoeff (p * q)) ≠ 0
hp0 : p ≠ 0
hq0 : q ≠ 0
hbc0 : degree b = 0 ∧ degree c = 0
hmp : m ≤ natDegree p
hnq : n ≤ natDegree q
hmnd : ¬(natDegree p = m ∧ natDegree q = n)
⊢ ¬m + n = natDegree p + natDegree q
apply ne_of_lt
case h
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) p * map (mk P) q = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
m n : ℕ
b c : (R ⧸ P)[X]
hbc : ↑C (↑(mk P) (leadingCoeff (p * q))) = b * c
hp : map (mk P) p = b * X ^ m
hq : map (mk P) q = c * X ^ n
hmn : 0 < m → 0 < n → False
hpql0 : ↑(mk P) (leadingCoeff (p * q)) ≠ 0
hp0 : p ≠ 0
hq0 : q ≠ 0
hbc0 : degree b = 0 ∧ degree c = 0
hmp : m ≤ natDegree p
hnq : n ≤ natDegree q
hmnd : ¬natDegree p = m ∨ ¬natDegree q = n
⊢ m + n < natDegree p + natDegree q
case h
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) p * map (mk P) q = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
m n : ℕ
b c : (R ⧸ P)[X]
hbc : ↑C (↑(mk P) (leadingCoeff (p * q))) = b * c
hp : map (mk P) p = b * X ^ m
hq : map (mk P) q = c * X ^ n
hmn : 0 < m → 0 < n → False
hpql0 : ↑(mk P) (leadingCoeff (p * q)) ≠ 0
hp0 : p ≠ 0
hq0 : q ≠ 0
hbc0 : degree b = 0 ∧ degree c = 0
hmp : m ≤ natDegree p
hnq : n ≤ natDegree q
hmnd : ¬(natDegree p = m ∧ natDegree q = n)
⊢ m + n < natDegree p + natDegree q
rw [not_and_or] at hmnd
case h.inl
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) p * map (mk P) q = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
m n : ℕ
b c : (R ⧸ P)[X]
hbc : ↑C (↑(mk P) (leadingCoeff (p * q))) = b * c
hp : map (mk P) p = b * X ^ m
hq : map (mk P) q = c * X ^ n
hmn : 0 < m → 0 < n → False
hpql0 : ↑(mk P) (leadingCoeff (p * q)) ≠ 0
hp0 : p ≠ 0
hq0 : q ≠ 0
hbc0 : degree b = 0 ∧ degree c = 0
hmp : m ≤ natDegree p
hnq : n ≤ natDegree q
hmnd : ¬natDegree p = m
⊢ m + n < natDegree p + natDegree q

case h.inr
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) p * map (mk P) q = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
m n : ℕ
b c : (R ⧸ P)[X]
hbc : ↑C (↑(mk P) (leadingCoeff (p * q))) = b * c
hp : map (mk P) p = b * X ^ m
hq : map (mk P) q = c * X ^ n
hmn : 0 < m → 0 < n → False
hpql0 : ↑(mk P) (leadingCoeff (p * q)) ≠ 0
hp0 : p ≠ 0
hq0 : q ≠ 0
hbc0 : degree b = 0 ∧ degree c = 0
hmp : m ≤ natDegree p
hnq : n ≤ natDegree q
hmnd : ¬natDegree q = n
⊢ m + n < natDegree p + natDegree q
case h
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) p * map (mk P) q = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
m n : ℕ
b c : (R ⧸ P)[X]
hbc : ↑C (↑(mk P) (leadingCoeff (p * q))) = b * c
hp : map (mk P) p = b * X ^ m
hq : map (mk P) q = c * X ^ n
hmn : 0 < m → 0 < n → False
hpql0 : ↑(mk P) (leadingCoeff (p * q)) ≠ 0
hp0 : p ≠ 0
hq0 : q ≠ 0
hbc0 : degree b = 0 ∧ degree c = 0
hmp : m ≤ natDegree p
hnq : n ≤ natDegree q
hmnd : ¬natDegree p = m ∨ ¬natDegree q = n
⊢ m + n < natDegree p + natDegree q
cases' hmnd with hmnd hmnd
no goals
case h.inl
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) p * map (mk P) q = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
m n : ℕ
b c : (R ⧸ P)[X]
hbc : ↑C (↑(mk P) (leadingCoeff (p * q))) = b * c
hp : map (mk P) p = b * X ^ m
hq : map (mk P) q = c * X ^ n
hmn : 0 < m → 0 < n → False
hpql0 : ↑(mk P) (leadingCoeff (p * q)) ≠ 0
hp0 : p ≠ 0
hq0 : q ≠ 0
hbc0 : degree b = 0 ∧ degree c = 0
hmp : m ≤ natDegree p
hnq : n ≤ natDegree q
hmnd : ¬natDegree p = m
⊢ m + n < natDegree p + natDegree q
exact add_lt_add_of_lt_of_le (lt_of_le_of_ne hmp (Ne.symm hmnd)) hnq
no goals
case h.inr
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) p * map (mk P) q = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
m n : ℕ
b c : (R ⧸ P)[X]
hbc : ↑C (↑(mk P) (leadingCoeff (p * q))) = b * c
hp : map (mk P) p = b * X ^ m
hq : map (mk P) q = c * X ^ n
hmn : 0 < m → 0 < n → False
hpql0 : ↑(mk P) (leadingCoeff (p * q)) ≠ 0
hp0 : p ≠ 0
hq0 : q ≠ 0
hbc0 : degree b = 0 ∧ degree c = 0
hmp : m ≤ natDegree p
hnq : n ≤ natDegree q
hmnd : ¬natDegree q = n
⊢ m + n < natDegree p + natDegree q
exact add_lt_add_of_le_of_lt hmp (lt_of_le_of_ne hnq (Ne.symm hmnd))
no goals
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) p * map (mk P) q = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
m n : ℕ
b c : (R ⧸ P)[X]
hmnd : m + n = natDegree (p * q)
hbc : ↑C (↑(mk P) (leadingCoeff (p * q))) = b * c
hp : map (mk P) p = b * X ^ m
hq : map (mk P) q = c * X ^ n
hmn : 0 < m → 0 < n → False
hpql0 : ↑(mk P) (leadingCoeff (p * q)) ≠ 0
hp0 : p ≠ 0
hq0 : q ≠ 0
hbc0 : degree b = 0 ∧ degree c = 0
hmp : m ≤ natDegree p
hnq : n ≤ natDegree q
hpmqn : natDegree p = m ∧ natDegree q = n
⊢ m = 0 ∨ n = 0
rwa [pos_iff_ne_zero, pos_iff_ne_zero, imp_false, Classical.not_not, ← or_iff_not_imp_left]
  at hmn
no goals
case intro.intro.intro.intro.intro.intro.intro.inl
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) p * map (mk P) q = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
n : ℕ
b c : (R ⧸ P)[X]
hbc : ↑C (↑(mk P) (leadingCoeff (p * q))) = b * c
hq : map (mk P) q = c * X ^ n
hpql0 : ↑(mk P) (leadingCoeff (p * q)) ≠ 0
hp0 : p ≠ 0
hq0 : q ≠ 0
hbc0 : degree b = 0 ∧ degree c = 0
hnq : n ≤ natDegree q
hmnd : 0 + n = natDegree (p * q)
hp : map (mk P) p = b * X ^ 0
hmn : 0 < 0 → 0 < n → False
hmp : 0 ≤ natDegree p
hpmqn : natDegree p = 0 ∧ natDegree q = n
⊢ IsUnit p ∨ IsUnit q
exact Or.inl (isUnit_of_natDegree_eq_zero_of_isPrimitive hu hpmqn.1)
no goals
case intro.intro.intro.intro.intro.intro.intro.inr
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) p * map (mk P) q = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
m : ℕ
b c : (R ⧸ P)[X]
hbc : ↑C (↑(mk P) (leadingCoeff (p * q))) = b * c
hp : map (mk P) p = b * X ^ m
hpql0 : ↑(mk P) (leadingCoeff (p * q)) ≠ 0
hp0 : p ≠ 0
hq0 : q ≠ 0
hbc0 : degree b = 0 ∧ degree c = 0
hmp : m ≤ natDegree p
hmnd : m + 0 = natDegree (p * q)
hq : map (mk P) q = c * X ^ 0
hmn : 0 < m → 0 < 0 → False
hnq : 0 ≤ natDegree q
hpmqn : natDegree p = m ∧ natDegree q = 0
⊢ IsUnit p ∨ IsUnit q
exact Or.inr
    (isUnit_of_natDegree_eq_zero_of_isPrimitive
      (show IsPrimitive (q * p) by simpa [mul_comm] using hu)
      hpmqn.2)
no goals
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
P : Ideal R
hP : Ideal.IsPrime P
p q : R[X]
hfl : ¬leadingCoeff (p * q) ∈ P
hfP : ∀ (n : ℕ), ↑n < degree (p * q) → coeff (p * q) n ∈ P
hfd0✝ : 0 < degree (p * q)
h0 : ¬coeff (p * q) 0 ∈ P ^ 2
hu : IsPrimitive (p * q)
hf0 : p * q ≠ 0
hf : map (mk P) p * map (mk P) q = ↑C (↑(mk P) (leadingCoeff (p * q))) * X ^ natDegree (p * q)
hfd0 : 0 < natDegree (p * q)
m : ℕ
b c : (R ⧸ P)[X]
hbc : ↑C (↑(mk P) (leadingCoeff (p * q))) = b * c
hp : map (mk P) p = b * X ^ m
hpql0 : ↑(mk P) (leadingCoeff (p * q)) ≠ 0
hp0 : p ≠ 0
hq0 : q ≠ 0
hbc0 : degree b = 0 ∧ degree c = 0
hmp : m ≤ natDegree p
hmnd : m + 0 = natDegree (p * q)
hq : map (mk P) q = c * X ^ 0
hmn : 0 < m → 0 < 0 → False
hnq : 0 ≤ natDegree q
hpmqn : natDegree p = m ∧ natDegree q = 0
⊢ IsPrimitive (q * p)
simpa [mul_comm] using hu