-- Mathlib/RingTheory/Polynomial/Content.lean
theorem content_mul {p q : R[X]} : (p * q).content = p.content * q.content

Proof state:
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : NormalizedGCDMonoid R
p q : R[X]
h : ∀ (n : ℕ) (p q : R[X]), (p * q).degree < ↑n → (p * q).content = p.content * q.content
⊢ (p * q).content = p.content * q.content

Tactic:
apply h

Result:
case a
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : NormalizedGCDMonoid R
p q : R[X]
h : ∀ (n : ℕ) (p q : R[X]), (p * q).degree < ↑n → (p * q).content = p.content * q.content
⊢ (p * q).degree < ↑?n

case n
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : NormalizedGCDMonoid R
p q : R[X]
h : ∀ (n : ℕ) (p q : R[X]), (p * q).degree < ↑n → (p * q).content = p.content * q.content
⊢ ℕ

Proof state:
case zero
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : NormalizedGCDMonoid R
p✝ q✝ p q : R[X]
hpq : (p * q).degree < ↑0
⊢ (p * q).content = p.content * q.content

Tactic:
rw [Nat.cast_zero,
  Nat.WithBot.lt_zero_iff, degree_eq_bot, mul_eq_zero] at hpq

Result:
case zero
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : NormalizedGCDMonoid R
p✝ q✝ p q : R[X]
hpq : p = 0 ∨ q = 0
⊢ (p * q).content = p.content * q.content

Proof state:
case neg.inr.a
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : NormalizedGCDMonoid R
p✝ q✝ : R[X]
n : ℕ
ih : ∀ (p q : R[X]), (p * q).degree < ↑n → (p * q).content = p.content * q.content
p q : R[X]
p0 : ¬p = 0
q0 : ¬q = 0
heq : p.primPart.degree + q.primPart.degree = ↑n
⊢ ¬p.primPart = 0

Tactic:
apply p.primPart_ne_zero

Result:
no goals

Proof state:
case neg.inr
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : NormalizedGCDMonoid R
p✝ q✝ : R[X]
n : ℕ
ih : ∀ (p q : R[X]), (p * q).degree < ↑n → (p * q).content = p.content * q.content
p q : R[X]
p0 : ¬p = 0
q0 : ¬q = 0
heq : p.primPart.degree + q.primPart.degree = ↑n
⊢ gcd (q.primPart * p.primPart).eraseLead.content (q.primPart.leadingCoeff * p.primPart.leadingCoeff) ∣ 1

Tactic:
apply (gcd_mul_dvd_mul_gcd _ _ _).trans

Result:
case neg.inr
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : NormalizedGCDMonoid R
p✝ q✝ : R[X]
n : ℕ
ih : ∀ (p q : R[X]), (p * q).degree < ↑n → (p * q).content = p.content * q.content
p q : R[X]
p0 : ¬p = 0
q0 : ¬q = 0
heq : p.primPart.degree + q.primPart.degree = ↑n
⊢ gcd (q.primPart * p.primPart).eraseLead.content q.primPart.leadingCoeff *
      gcd (q.primPart * p.primPart).eraseLead.content p.primPart.leadingCoeff ∣
    1

Proof state:
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : NormalizedGCDMonoid R
p✝ q✝ : R[X]
n : ℕ
ih : ∀ (p q : R[X]), (p * q).degree < ↑n → (p * q).content = p.content * q.content
p q : R[X]
p0 : ¬p = 0
q0 : ¬q = 0
heq : p.primPart.degree + q.primPart.degree = ↑n
h : (q.primPart * p.primPart).content = 1
⊢ (C p.content * p.primPart * (C q.content * q.primPart)).content =
    (C p.content * p.primPart).content * (C q.content * q.primPart).content

Tactic:
rw [mul_assoc, content_C_mul, content_C_mul, mul_comm p.primPart, mul_assoc, content_C_mul,
  content_C_mul, h, mul_one, content_primPart, content_primPart, mul_one, mul_one]

Result:
no goals

Proof state:
case neg
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : NormalizedGCDMonoid R
p✝ q✝ : R[X]
n : ℕ
ih : ∀ (p q : R[X]), (p * q).degree < ↑n → (p * q).content = p.content * q.content
p q : R[X]
hpq : (p * q).degree < ↑(n + 1)
p0 : ¬p = 0
⊢ (p * q).content = p.content * q.content

Tactic:
by_cases q0 : q = 0

Result:
case pos
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : NormalizedGCDMonoid R
p✝ q✝ : R[X]
n : ℕ
ih : ∀ (p q : R[X]), (p * q).degree < ↑n → (p * q).content = p.content * q.content
p q : R[X]
hpq : (p * q).degree < ↑(n + 1)
p0 : ¬p = 0
q0 : q = 0
⊢ (p * q).content = p.content * q.content

case neg
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : NormalizedGCDMonoid R
p✝ q✝ : R[X]
n : ℕ
ih : ∀ (p q : R[X]), (p * q).degree < ↑n → (p * q).content = p.content * q.content
p q : R[X]
hpq : (p * q).degree < ↑(n + 1)
p0 : ¬p = 0
q0 : ¬q = 0
⊢ (p * q).content = p.content * q.content

Proof state:
case succ
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : NormalizedGCDMonoid R
p✝ q✝ : R[X]
n : ℕ
ih : ∀ (p q : R[X]), (p * q).degree < ↑n → (p * q).content = p.content * q.content
p q : R[X]
hpq : (p * q).degree < ↑(n + 1)
⊢ (p * q).content = p.content * q.content

Tactic:
by_cases p0 : p = 0

Result:
case pos
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : NormalizedGCDMonoid R
p✝ q✝ : R[X]
n : ℕ
ih : ∀ (p q : R[X]), (p * q).degree < ↑n → (p * q).content = p.content * q.content
p q : R[X]
hpq : (p * q).degree < ↑(n + 1)
p0 : p = 0
⊢ (p * q).content = p.content * q.content

case neg
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : NormalizedGCDMonoid R
p✝ q✝ : R[X]
n : ℕ
ih : ∀ (p q : R[X]), (p * q).degree < ↑n → (p * q).content = p.content * q.content
p q : R[X]
hpq : (p * q).degree < ↑(n + 1)
p0 : ¬p = 0
⊢ (p * q).content = p.content * q.content

Proof state:
case zero
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : NormalizedGCDMonoid R
p✝ q✝ p q : R[X]
hpq : p = 0 ∨ q = 0
⊢ (p * q).content = p.content * q.content

Tactic:
rcases hpq with (rfl | rfl) <;> simp

Result:
no goals

Proof state:
case neg.inr
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : NormalizedGCDMonoid R
p✝ q✝ : R[X]
n : ℕ
ih : ∀ (p q : R[X]), (p * q).degree < ↑n → (p * q).content = p.content * q.content
p q : R[X]
p0 : ¬p = 0
q0 : ¬q = 0
heq : p.primPart.degree + q.primPart.degree = ↑n
⊢ gcd (q.primPart * p.primPart).eraseLead.content q.primPart.leadingCoeff *
      gcd (q.primPart * p.primPart).eraseLead.content p.primPart.leadingCoeff ∣
    1

Tactic:
rw [content_mul_aux, ih, content_primPart, mul_one, gcd_comm, ←
  content_eq_gcd_leadingCoeff_content_eraseLead, content_primPart, one_mul,
  mul_comm q.primPart, content_mul_aux, ih, content_primPart, mul_one, gcd_comm, ←
  content_eq_gcd_leadingCoeff_content_eraseLead, content_primPart]

Result:
case neg.inr.a
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : NormalizedGCDMonoid R
p✝ q✝ : R[X]
n : ℕ
ih : ∀ (p q : R[X]), (p * q).degree < ↑n → (p * q).content = p.content * q.content
p q : R[X]
p0 : ¬p = 0
q0 : ¬q = 0
heq : p.primPart.degree + q.primPart.degree = ↑n
⊢ (p.primPart.eraseLead * q.primPart).degree < ↑n

case neg.inr.a
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : NormalizedGCDMonoid R
p✝ q✝ : R[X]
n : ℕ
ih : ∀ (p q : R[X]), (p * q).degree < ↑n → (p * q).content = p.content * q.content
p q : R[X]
p0 : ¬p = 0
q0 : ¬q = 0
heq : p.primPart.degree + q.primPart.degree = ↑n
⊢ (q.primPart.eraseLead * p.primPart).degree < ↑n