-- Mathlib/RingTheory/Polynomial/GaussLemma.lean
theorem IsPrimitive.dvd_of_fraction_map_dvd_fraction_map {p q : R[X]} (hp : p.IsPrimitive)
    (hq : q.IsPrimitive) (h_dvd : p.map (algebraMap R K) ∣ q.map (algebraMap R K)) : p ∣ q

Proof state:
case intro.intro.mk
R : Type u_1
inst✝⁵ : CommRing R
K : Type u_2
inst✝⁴ : Field K
inst✝³ : Algebra R K
inst✝² : IsFractionRing R K
inst✝¹ : IsDomain R
inst✝ : NormalizedGCDMonoid R
p q : R[X]
hp : p.IsPrimitive
hq : q.IsPrimitive
r : K[X]
hr : map (algebraMap R K) q = map (algebraMap R K) p * r
s : R
s0 : s ∈ R⁰
hs : map (algebraMap R K) (integerNormalization R⁰ r) = C ((algebraMap R K) s) * r
h : p ∣ (q * C s).primPart
⊢ q * C s ≠ 0

case intro.intro.mk
R : Type u_1
inst✝⁵ : CommRing R
K : Type u_2
inst✝⁴ : Field K
inst✝³ : Algebra R K
inst✝² : IsFractionRing R K
inst✝¹ : IsDomain R
inst✝ : NormalizedGCDMonoid R
p q : R[X]
hp : p.IsPrimitive
hq : q.IsPrimitive
r : K[X]
hr : map (algebraMap R K) q = map (algebraMap R K) p * r
s : R
s0 : s ∈ R⁰
hs : map (algebraMap R K) (integerNormalization R⁰ r) = C ((algebraMap R K) s) * r
h : p ∣ q * C s
⊢ q * C s ≠ 0

Tactic:
iterate 2
  apply mul_ne_zero hq.ne_zero
  rw [Ne, C_eq_zero]
  contrapose! s0
  simp [s0, mem_nonZeroDivisors_iff_ne_zero]

Result:
no goals

Proof state:
case intro.intro.mk
R : Type u_1
inst✝⁵ : CommRing R
K : Type u_2
inst✝⁴ : Field K
inst✝³ : Algebra R K
inst✝² : IsFractionRing R K
inst✝¹ : IsDomain R
inst✝ : NormalizedGCDMonoid R
p q : R[X]
hp : p.IsPrimitive
hq : q.IsPrimitive
r : K[X]
hr : map (algebraMap R K) q = map (algebraMap R K) p * r
s : R
s0 : s ∈ R⁰
hs : map (algebraMap R K) (integerNormalization R⁰ r) = C ((algebraMap R K) s) * r
h✝ : p ∣ q * (C s).primPart
h : p ∣ ?m.82819
⊢ p ∣ q

Tactic:
exact h

Result:
no goals

Proof state:
case h
R : Type u_1
inst✝⁵ : CommRing R
K : Type u_2
inst✝⁴ : Field K
inst✝³ : Algebra R K
inst✝² : IsFractionRing R K
inst✝¹ : IsDomain R
inst✝ : NormalizedGCDMonoid R
p q : R[X]
hp : p.IsPrimitive
hq : q.IsPrimitive
r : K[X]
hr : map (algebraMap R K) q = map (algebraMap R K) p * r
s : R
s0 : s ∈ R⁰
hs : map (algebraMap R K) (integerNormalization R⁰ r) = C ((algebraMap R K) s) * r
h : p ∣ q * (C s).primPart
u : R[X]ˣ
hu : ↑u = (C s).primPart
⊢ q * ↑u = q * (C s).primPart

Tactic:
rw [hu]

Result:
no goals

Proof state:
R : Type u_1
inst✝⁵ : CommRing R
K : Type u_2
inst✝⁴ : Field K
inst✝³ : Algebra R K
inst✝² : IsFractionRing R K
inst✝¹ : IsDomain R
inst✝ : NormalizedGCDMonoid R
p q : R[X]
hp : p.IsPrimitive
hq : q.IsPrimitive
r : K[X]
hr : map (algebraMap R K) q = map (algebraMap R K) p * r
s : R
s0 : s ∈ R⁰
hs : map (algebraMap R K) (integerNormalization R⁰ r) = C ((algebraMap R K) s) * r
⊢ p ∣ q * C s

Tactic:
use integerNormalization R⁰ r

Result:
case h
R : Type u_1
inst✝⁵ : CommRing R
K : Type u_2
inst✝⁴ : Field K
inst✝³ : Algebra R K
inst✝² : IsFractionRing R K
inst✝¹ : IsDomain R
inst✝ : NormalizedGCDMonoid R
p q : R[X]
hp : p.IsPrimitive
hq : q.IsPrimitive
r : K[X]
hr : map (algebraMap R K) q = map (algebraMap R K) p * r
s : R
s0 : s ∈ R⁰
hs : map (algebraMap R K) (integerNormalization R⁰ r) = C ((algebraMap R K) s) * r
⊢ q * C s = p * integerNormalization R⁰ r

Proof state:
case intro.intro.mk
R : Type u_1
inst✝⁵ : CommRing R
K : Type u_2
inst✝⁴ : Field K
inst✝³ : Algebra R K
inst✝² : IsFractionRing R K
inst✝¹ : IsDomain R
inst✝ : NormalizedGCDMonoid R
p q : R[X]
hp : p.IsPrimitive
hq : q.IsPrimitive
r : K[X]
hr : map (algebraMap R K) q = map (algebraMap R K) p * r
s : R
s0 : s ∈ R⁰
hs : map (algebraMap R K) (integerNormalization R⁰ r) = C ((algebraMap R K) s) * r
h : p ∣ q * C s
⊢ q * C s ≠ 0

Tactic:
apply mul_ne_zero hq.ne_zero

Result:
case intro.intro.mk
R : Type u_1
inst✝⁵ : CommRing R
K : Type u_2
inst✝⁴ : Field K
inst✝³ : Algebra R K
inst✝² : IsFractionRing R K
inst✝¹ : IsDomain R
inst✝ : NormalizedGCDMonoid R
p q : R[X]
hp : p.IsPrimitive
hq : q.IsPrimitive
r : K[X]
hr : map (algebraMap R K) q = map (algebraMap R K) p * r
s : R
s0 : s ∈ R⁰
hs : map (algebraMap R K) (integerNormalization R⁰ r) = C ((algebraMap R K) s) * r
h : p ∣ q * C s
⊢ C s ≠ 0