Theorem: Nat.Coprime.isPrimePow_dvd_mul
File: Mathlib/Data/Nat/Factorization/PrimePow.lean

Proof steps:
state_before: R : Type u_1
inst✝ : CommMonoidWithZero R
n✝ p : R
k n a b : ℕ
hab : a.Coprime b
hn : IsPrimePow n
⊢ n ∣ a * b ↔ n ∣ a ∨ n ∣ b
state_after: case inl
R : Type u_1
inst✝ : CommMonoidWithZero R
n✝ p : R
k n b : ℕ
hn : IsPrimePow n
hab : Coprime 0 b
⊢ n ∣ 0 * b ↔ n ∣ 0 ∨ n ∣ b

case inr
R : Type u_1
inst✝ : CommMonoidWithZero R
n✝ p : R
k 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 a 0 with (rfl | ha)
state_before: case inr
R : Type u_1
inst✝ : CommMonoidWithZero R
n✝ p : R
k n a b : ℕ
hab : a.Coprime b
hn : IsPrimePow n
ha : a ≠ 0
⊢ n ∣ a * b ↔ n ∣ a ∨ n ∣ b
state_after: case inr.inl
R : Type u_1
inst✝ : CommMonoidWithZero R
n✝ p : R
k n a : ℕ
hn : IsPrimePow n
ha : a ≠ 0
hab : a.Coprime 0
⊢ n ∣ a * 0 ↔ n ∣ a ∨ n ∣ 0

case inr.inr
R : Type u_1
inst✝ : CommMonoidWithZero R
n✝ p : R
k n a b : ℕ
hab : a.Coprime b
hn : IsPrimePow n
ha : a ≠ 0
hb : b ≠ 0
⊢ n ∣ a * b ↔ n ∣ a ∨ n ∣ b
tactic: rcases eq_or_ne b 0 with (rfl | hb)
state_before: case inr.inr
R : Type u_1
inst✝ : CommMonoidWithZero R
n✝ p : R
k n a b : ℕ
hab : a.Coprime b
hn : IsPrimePow n
ha : a ≠ 0
hb : b ≠ 0
⊢ n ∣ a * b ↔ n ∣ a ∨ n ∣ b
state_after: case inr.inr
R : Type u_1
inst✝ : CommMonoidWithZero R
n✝ p : R
k 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))⟩
state_before: case inr.inr
R : Type u_1
inst✝ : CommMonoidWithZero R
n✝ p : R
k n a b : ℕ
hab : a.Coprime b
hn : IsPrimePow n
ha : a ≠ 0
hb : b ≠ 0
⊢ n ∣ a * b → n ∣ a ∨ n ∣ b
state_after: case inr.inr.intro.intro.intro.intro
R : Type u_1
inst✝ : CommMonoidWithZero R
n p✝ : R
k✝ 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: obtain ⟨p, k, hp, _, rfl⟩ := (isPrimePow_nat_iff _).1 hn
state_before: case inr.inr.intro.intro.intro.intro
R : Type u_1
inst✝ : CommMonoidWithZero R
n p✝ : R
k✝ 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
state_after: case inr.inr.intro.intro.intro.intro
R : Type u_1
inst✝ : CommMonoidWithZero R
n p✝ : R
k✝ 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: 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]
state_before: case inr.inr.intro.intro.intro.intro
R : Type u_1
inst✝ : CommMonoidWithZero R
n p✝ : R
k✝ 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
state_after: case inr.inr.intro.intro.intro.intro
R : Type u_1
inst✝ : CommMonoidWithZero R
n p✝ : R
k✝ 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: 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 -- Porting note: used to be `exact` below, but the definition of `∈` has changed.
    simpa using hab.disjoint_primeFactors.le_bot t
state_before: case inr.inr.intro.intro.intro.intro
R : Type u_1
inst✝ : CommMonoidWithZero R
n p✝ : R
k✝ 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
state_after: no goals
tactic: cases' this with h h <;> simp [h, imp_or]