-- Mathlib/Data/Nat/Factorization/PrimePow.lean
theorem Nat.Coprime.isPrimePow_dvd_mul {n a b : ℕ} (hab : Nat.Coprime a b) (hn : IsPrimePow n) :
    n ∣ a * b ↔ n ∣ a ∨ n ∣ b

Proof state:
a b : ℕ
hab : a.Coprime b
ha : a ≠ 0
hb : b ≠ 0
p k : ℕ
hp : Prime p
left✝ : 0 < k
hn : IsPrimePow (p ^ k)
⊢ a.factorization p = 0 ∨ b.factorization p = 0

Tactic:
rw [← Finsupp.not_mem_support_iff, ← Finsupp.not_mem_support_iff, ← not_and_or, ←
  Finset.mem_inter]

Result:
a b : ℕ
hab : a.Coprime b
ha : a ≠ 0
hb : b ≠ 0
p k : ℕ
hp : Prime p
left✝ : 0 < k
hn : IsPrimePow (p ^ k)
⊢ p ∉ a.factorization.support ∩ b.factorization.support

Proof state:
case inr.inr.intro.intro.intro.intro
a b : ℕ
hab : a.Coprime b
ha : a ≠ 0
hb : b ≠ 0
p k : ℕ
hp : Prime p
left✝ : 0 < k
hn : IsPrimePow (p ^ k)
this : a.factorization p = 0 ∨ b.factorization p = 0
⊢ k ≤ a.factorization p + b.factorization p → k ≤ a.factorization p ∨ k ≤ b.factorization p

Tactic:
rcases this with h | h <;> simp [h, imp_or]

Result:
no goals

Proof state:
a b : ℕ
hab : a.Coprime b
ha : a ≠ 0
hb : b ≠ 0
p k : ℕ
hp : Prime p
left✝ : 0 < k
hn : IsPrimePow (p ^ k)
t : p ∈ a.factorization.support ∩ b.factorization.support
⊢ False

Tactic:
simpa using hab.disjoint_primeFactors.le_bot t

Result:
no goals

Proof state:
a b : ℕ
hab : a.Coprime b
ha : a ≠ 0
hb : b ≠ 0
p k : ℕ
hp : Prime p
left✝ : 0 < k
hn : IsPrimePow (p ^ k)
⊢ p ∉ a.factorization.support ∩ b.factorization.support

Tactic:
intro t

Result:
a b : ℕ
hab : a.Coprime b
ha : a ≠ 0
hb : b ≠ 0
p k : ℕ
hp : Prime p
left✝ : 0 < k
hn : IsPrimePow (p ^ k)
t : p ∈ a.factorization.support ∩ b.factorization.support
⊢ False

Proof state:
case inl
n b : ℕ
hn : IsPrimePow n
hab : b = 1
⊢ n ∣ 0 * b ↔ n ∣ 0 ∨ n ∣ b

Tactic:
simp [hab, Finset.filter_singleton, not_isPrimePow_one]

Result:
no goals

Proof state:
case inr.inr
n a b : ℕ
hab : a.Coprime b
hn : IsPrimePow n
ha : a ≠ 0
hb : b ≠ 0
⊢ n ∣ a * b ↔ n ∣ a ∨ n ∣ b

Tactic:
refine
  ⟨?_, fun h =>
    Or.elim h (fun i => i.trans ((@dvd_mul_right a b a hab).mpr (dvd_refl a)))
        fun i => i.trans ((@dvd_mul_left a b b hab.symm).mpr (dvd_refl b))⟩

Result:
case inr.inr
n a b : ℕ
hab : a.Coprime b
hn : IsPrimePow n
ha : a ≠ 0
hb : b ≠ 0
⊢ n ∣ a * b → n ∣ a ∨ n ∣ b

Proof state:
case inr.inl
n a : ℕ
hn : IsPrimePow n
ha : a ≠ 0
hab : a = 1
⊢ n ∣ a * 0 ↔ n ∣ a ∨ n ∣ 0

Tactic:
simp [hab, Finset.filter_singleton, not_isPrimePow_one]

Result:
no goals

Proof state:
case inr.inr.intro.intro.intro.intro
a b : ℕ
hab : a.Coprime b
ha : a ≠ 0
hb : b ≠ 0
p k : ℕ
hp : Prime p
left✝ : 0 < k
hn : IsPrimePow (p ^ k)
⊢ k ≤ a.factorization p + b.factorization p → k ≤ a.factorization p ∨ k ≤ b.factorization p

Tactic:
have : a.factorization p = 0 ∨ b.factorization p = 0 := by
  rw [← Finsupp.not_mem_support_iff, ← Finsupp.not_mem_support_iff, ← not_and_or, ←
    Finset.mem_inter]
  intro t simpa using hab.disjoint_primeFactors.le_bot t

Result:
case inr.inr.intro.intro.intro.intro
a b : ℕ
hab : a.Coprime b
ha : a ≠ 0
hb : b ≠ 0
p k : ℕ
hp : Prime p
left✝ : 0 < k
hn : IsPrimePow (p ^ k)
this : a.factorization p = 0 ∨ b.factorization p = 0
⊢ k ≤ a.factorization p + b.factorization p → k ≤ a.factorization p ∨ k ≤ b.factorization p

Proof state:
n a b : ℕ
hab : a.Coprime b
hn : IsPrimePow n
⊢ n ∣ a * b ↔ n ∣ a ∨ n ∣ b

Tactic:
rcases eq_or_ne a 0 with (rfl | ha)

Result:
case inl
n b : ℕ
hn : IsPrimePow n
hab : Coprime 0 b
⊢ n ∣ 0 * b ↔ n ∣ 0 ∨ n ∣ b

case inr
n a b : ℕ
hab : a.Coprime b
hn : IsPrimePow n
ha : a ≠ 0
⊢ n ∣ a * b ↔ n ∣ a ∨ n ∣ b

Proof state:
case inl
n b : ℕ
hn : IsPrimePow n
hab : Coprime 0 b
⊢ n ∣ 0 * b ↔ n ∣ 0 ∨ n ∣ b

Tactic:
simp only [Nat.coprime_zero_left] at hab

Result:
case inl
n b : ℕ
hn : IsPrimePow n
hab : b = 1
⊢ n ∣ 0 * b ↔ n ∣ 0 ∨ n ∣ b

Proof state:
case inr.inl
n a : ℕ
hn : IsPrimePow n
ha : a ≠ 0
hab : a.Coprime 0
⊢ n ∣ a * 0 ↔ n ∣ a ∨ n ∣ 0

Tactic:
simp only [Nat.coprime_zero_right] at hab

Result:
case inr.inl
n a : ℕ
hn : IsPrimePow n
ha : a ≠ 0
hab : a = 1
⊢ n ∣ a * 0 ↔ n ∣ a ∨ n ∣ 0

Proof state:
case inr.inr
n a b : ℕ
hab : a.Coprime b
hn : IsPrimePow n
ha : a ≠ 0
hb : b ≠ 0
⊢ n ∣ a * b → n ∣ a ∨ n ∣ b

Tactic:
obtain ⟨p, k, hp, _, rfl⟩ := (isPrimePow_nat_iff _).1 hn

Result:
case inr.inr.intro.intro.intro.intro
a b : ℕ
hab : a.Coprime b
ha : a ≠ 0
hb : b ≠ 0
p k : ℕ
hp : Prime p
left✝ : 0 < k
hn : IsPrimePow (p ^ k)
⊢ p ^ k ∣ a * b → p ^ k ∣ a ∨ p ^ k ∣ b

Proof state:
case inr.inr.intro.intro.intro.intro
a b : ℕ
hab : a.Coprime b
ha : a ≠ 0
hb : b ≠ 0
p k : ℕ
hp : Prime p
left✝ : 0 < k
hn : IsPrimePow (p ^ k)
⊢ p ^ k ∣ a * b → p ^ k ∣ a ∨ p ^ k ∣ b

Tactic:
simp only [hp.pow_dvd_iff_le_factorization (mul_ne_zero ha hb), Nat.factorization_mul ha hb,
  hp.pow_dvd_iff_le_factorization ha, hp.pow_dvd_iff_le_factorization hb, Pi.add_apply,
  Finsupp.coe_add]

Result:
case inr.inr.intro.intro.intro.intro
a b : ℕ
hab : a.Coprime b
ha : a ≠ 0
hb : b ≠ 0
p k : ℕ
hp : Prime p
left✝ : 0 < k
hn : IsPrimePow (p ^ k)
⊢ k ≤ a.factorization p + b.factorization p → k ≤ a.factorization p ∨ k ≤ b.factorization p

Proof state:
case inr
n a b : ℕ
hab : a.Coprime b
hn : IsPrimePow n
ha : a ≠ 0
⊢ n ∣ a * b ↔ n ∣ a ∨ n ∣ b

Tactic:
rcases eq_or_ne b 0 with (rfl | hb)

Result:
case inr.inl
n a : ℕ
hn : IsPrimePow n
ha : a ≠ 0
hab : a.Coprime 0
⊢ n ∣ a * 0 ↔ n ∣ a ∨ n ∣ 0

case inr.inr
n a b : ℕ
hab : a.Coprime b
hn : IsPrimePow n
ha : a ≠ 0
hb : b ≠ 0
⊢ n ∣ a * b ↔ n ∣ a ∨ n ∣ b