rw [hr, Nat.gcd_mul_left, eq_comm, mul_eq_left₀ (by rintro rfl; simp at hk ⊢)] at h
case mp.right.intro
s : SelbergSieve
k m d : ℕ
hk : k ∈ P.divisors
hm : m ∈ P.divisors
h : k * m ∣ P ∧ k = d.gcd (k * m) ∧ (↑k * ↑m) ^ 2 ≤ y
r : ℕ
hr : d = k * r
⊢ m.Coprime d
case mp.right.intro
s : SelbergSieve
k m d : ℕ
hk : k ∈ P.divisors
hm : m ∈ P.divisors
r : ℕ
h : k * m ∣ P ∧ r.gcd m = 1 ∧ (↑k * ↑m) ^ 2 ≤ y
hr : d = k * r
⊢ m.Coprime d