Theorem: Nat.factorizationLCMLeft_dvd_left
File: Mathlib/Data/Nat/Factorization/Basic.lean

tactic: rcases eq_or_ne a 0 with rfl | ha
state_before: a b m n p : ℕ
⊢ a.factorizationLCMLeft b ∣ a
state_after: case inl
b m n p : ℕ
⊢ factorizationLCMLeft 0 b ∣ 0

case inr
a b m n p : ℕ
ha : a ≠ 0
⊢ a.factorizationLCMLeft b ∣ a

tactic: rcases eq_or_ne b 0 with rfl | hb
state_before: case inr
a b m n p : ℕ
ha : a ≠ 0
⊢ a.factorizationLCMLeft b ∣ a
state_after: case inr.inl
a m n p : ℕ
ha : a ≠ 0
⊢ a.factorizationLCMLeft 0 ∣ a

case inr.inr
a b m n p : ℕ
ha : a ≠ 0
hb : b ≠ 0
⊢ a.factorizationLCMLeft b ∣ a

tactic: nth_rewrite 2 [← factorization_prod_pow_eq_self ha]
state_before: case inr.inr
a b m n p : ℕ
ha : a ≠ 0
hb : b ≠ 0
⊢ a.factorizationLCMLeft b ∣ a
state_after: case inr.inr
a b m n p : ℕ
ha : a ≠ 0
hb : b ≠ 0
⊢ a.factorizationLCMLeft b ∣ a.factorization.prod fun x x_1 => x ^ x_1

tactic: rw [prod_of_support_subset (s := (lcm a b).factorization.support)]
state_before: case inr.inr
a b m n p : ℕ
ha : a ≠ 0
hb : b ≠ 0
⊢ a.factorizationLCMLeft b ∣ a.factorization.prod fun x x_1 => x ^ x_1
state_after: case inr.inr
a b m n p : ℕ
ha : a ≠ 0
hb : b ≠ 0
⊢ a.factorizationLCMLeft b ∣ ∏ x ∈ (a.lcm b).factorization.support, x ^ a.factorization x

case inr.inr.hs
a b m n p : ℕ
ha : a ≠ 0
hb : b ≠ 0
⊢ a.factorization.support ⊆ (a.lcm b).factorization.support

case inr.inr.h
a b m n p : ℕ
ha : a ≠ 0
hb : b ≠ 0
⊢ ∀ i ∈ (a.lcm b).factorization.support, i ^ 0 = 1

tactic: simp only [dvd_zero]
state_before: case inl
b m n p : ℕ
⊢ factorizationLCMLeft 0 b ∣ 0
state_after: no goals

tactic: simp [factorizationLCMLeft]
state_before: case inr.inl
a m n p : ℕ
ha : a ≠ 0
⊢ a.factorizationLCMLeft 0 ∣ a
state_after: no goals

tactic: apply prod_dvd_prod_of_dvd
state_before: case inr.inr
a b m n p : ℕ
ha : a ≠ 0
hb : b ≠ 0
⊢ a.factorizationLCMLeft b ∣ ∏ x ∈ (a.lcm b).factorization.support, x ^ a.factorization x
state_after: case inr.inr.h
a b m n p : ℕ
ha : a ≠ 0
hb : b ≠ 0
⊢ ∀ a_1 ∈ (a.lcm b).factorization.support,
    (fun p n => if b.factorization p ≤ a.factorization p then p ^ n else 1) a_1 ((a.lcm b).factorization a_1) ∣
      a_1 ^ a.factorization a_1

tactic: rintro p -
state_before: case inr.inr.h
a b m n p : ℕ
ha : a ≠ 0
hb : b ≠ 0
⊢ ∀ a_1 ∈ (a.lcm b).factorization.support,
    (fun p n => if b.factorization p ≤ a.factorization p then p ^ n else 1) a_1 ((a.lcm b).factorization a_1) ∣
      a_1 ^ a.factorization a_1
state_after: case inr.inr.h
a b m n p✝ : ℕ
ha : a ≠ 0
hb : b ≠ 0
p : ℕ
⊢ (fun p n => if b.factorization p ≤ a.factorization p then p ^ n else 1) p ((a.lcm b).factorization p) ∣
    p ^ a.factorization p

tactic: dsimp only
state_before: case inr.inr.h
a b m n p✝ : ℕ
ha : a ≠ 0
hb : b ≠ 0
p : ℕ
⊢ (fun p n => if b.factorization p ≤ a.factorization p then p ^ n else 1) p ((a.lcm b).factorization p) ∣
    p ^ a.factorization p
state_after: case inr.inr.h
a b m n p✝ : ℕ
ha : a ≠ 0
hb : b ≠ 0
p : ℕ
⊢ (if b.factorization p ≤ a.factorization p then p ^ (a.lcm b).factorization p else 1) ∣ p ^ a.factorization p

tactic: split_ifs with le
state_before: case inr.inr.h
a b m n p✝ : ℕ
ha : a ≠ 0
hb : b ≠ 0
p : ℕ
⊢ (if b.factorization p ≤ a.factorization p then p ^ (a.lcm b).factorization p else 1) ∣ p ^ a.factorization p
state_after: case pos
a b m n p✝ : ℕ
ha : a ≠ 0
hb : b ≠ 0
p : ℕ
le : b.factorization p ≤ a.factorization p
⊢ p ^ (a.lcm b).factorization p ∣ p ^ a.factorization p

case neg
a b m n p✝ : ℕ
ha : a ≠ 0
hb : b ≠ 0
p : ℕ
le : ¬b.factorization p ≤ a.factorization p
⊢ 1 ∣ p ^ a.factorization p

tactic: rw [factorization_lcm ha hb]
state_before: case pos
a b m n p✝ : ℕ
ha : a ≠ 0
hb : b ≠ 0
p : ℕ
le : b.factorization p ≤ a.factorization p
⊢ p ^ (a.lcm b).factorization p ∣ p ^ a.factorization p
state_after: case pos
a b m n p✝ : ℕ
ha : a ≠ 0
hb : b ≠ 0
p : ℕ
le : b.factorization p ≤ a.factorization p
⊢ p ^ (a.factorization ⊔ b.factorization) p ∣ p ^ a.factorization p

tactic: apply pow_dvd_pow
state_before: case pos
a b m n p✝ : ℕ
ha : a ≠ 0
hb : b ≠ 0
p : ℕ
le : b.factorization p ≤ a.factorization p
⊢ p ^ (a.factorization ⊔ b.factorization) p ∣ p ^ a.factorization p
state_after: case pos.h
a b m n p✝ : ℕ
ha : a ≠ 0
hb : b ≠ 0
p : ℕ
le : b.factorization p ≤ a.factorization p
⊢ (a.factorization ⊔ b.factorization) p ≤ a.factorization p

tactic: exact sup_le le_rfl le
state_before: case pos.h
a b m n p✝ : ℕ
ha : a ≠ 0
hb : b ≠ 0
p : ℕ
le : b.factorization p ≤ a.factorization p
⊢ (a.factorization ⊔ b.factorization) p ≤ a.factorization p
state_after: no goals

tactic: apply one_dvd
state_before: case neg
a b m n p✝ : ℕ
ha : a ≠ 0
hb : b ≠ 0
p : ℕ
le : ¬b.factorization p ≤ a.factorization p
⊢ 1 ∣ p ^ a.factorization p
state_after: no goals

tactic: intro p hp
state_before: case inr.inr.hs
a b m n p : ℕ
ha : a ≠ 0
hb : b ≠ 0
⊢ a.factorization.support ⊆ (a.lcm b).factorization.support
state_after: case inr.inr.hs
a b m n p✝ : ℕ
ha : a ≠ 0
hb : b ≠ 0
p : ℕ
hp : p ∈ a.factorization.support
⊢ p ∈ (a.lcm b).factorization.support

tactic: rw [mem_support_iff] at hp ⊢
state_before: case inr.inr.hs
a b m n p✝ : ℕ
ha : a ≠ 0
hb : b ≠ 0
p : ℕ
hp : p ∈ a.factorization.support
⊢ p ∈ (a.lcm b).factorization.support
state_after: case inr.inr.hs
a b m n p✝ : ℕ
ha : a ≠ 0
hb : b ≠ 0
p : ℕ
hp : a.factorization p ≠ 0
⊢ (a.lcm b).factorization p ≠ 0

tactic: rw [factorization_lcm ha hb]
state_before: case inr.inr.hs
a b m n p✝ : ℕ
ha : a ≠ 0
hb : b ≠ 0
p : ℕ
hp : a.factorization p ≠ 0
⊢ (a.lcm b).factorization p ≠ 0
state_after: case inr.inr.hs
a b m n p✝ : ℕ
ha : a ≠ 0
hb : b ≠ 0
p : ℕ
hp : a.factorization p ≠ 0
⊢ (a.factorization ⊔ b.factorization) p ≠ 0

tactic: exact (lt_sup_iff.mpr <| .inl <| Nat.pos_of_ne_zero hp).ne'
state_before: case inr.inr.hs
a b m n p✝ : ℕ
ha : a ≠ 0
hb : b ≠ 0
p : ℕ
hp : a.factorization p ≠ 0
⊢ (a.factorization ⊔ b.factorization) p ≠ 0
state_after: no goals

tactic: intros
state_before: case inr.inr.h
a b m n p : ℕ
ha : a ≠ 0
hb : b ≠ 0
⊢ ∀ i ∈ (a.lcm b).factorization.support, i ^ 0 = 1
state_after: case inr.inr.h
a b m n p : ℕ
ha : a ≠ 0
hb : b ≠ 0
i✝ : ℕ
a✝ : i✝ ∈ (a.lcm b).factorization.support
⊢ i✝ ^ 0 = 1

tactic: rw [pow_zero]
state_before: case inr.inr.h
a b m n p : ℕ
ha : a ≠ 0
hb : b ≠ 0
i✝ : ℕ
a✝ : i✝ ∈ (a.lcm b).factorization.support
⊢ i✝ ^ 0 = 1
state_after: no goals