Theorem: Nat.factorizationLCMRight_dvd_right
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.factorizationLCMRight b ∣ b
state_after: case inl
b m n p : ℕ
⊢ factorizationLCMRight 0 b ∣ b

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

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

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

tactic: nth_rewrite 2 [← factorization_prod_pow_eq_self hb]
state_before: case inr.inr
a b m n p : ℕ
ha : a ≠ 0
hb : b ≠ 0
⊢ a.factorizationLCMRight b ∣ b
state_after: case inr.inr
a b m n p : ℕ
ha : a ≠ 0
hb : b ≠ 0
⊢ a.factorizationLCMRight b ∣ b.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.factorizationLCMRight b ∣ b.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.factorizationLCMRight b ∣ ∏ x ∈ (a.lcm b).factorization.support, x ^ b.factorization x

case inr.inr.hs
a b m n p : ℕ
ha : a ≠ 0
hb : b ≠ 0
⊢ b.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 [factorizationLCMRight]
state_before: case inl
b m n p : ℕ
⊢ factorizationLCMRight 0 b ∣ b
state_after: no goals

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

tactic: apply Finset.prod_dvd_prod_of_dvd
state_before: case inr.inr
a b m n p : ℕ
ha : a ≠ 0
hb : b ≠ 0
⊢ a.factorizationLCMRight b ∣ ∏ x ∈ (a.lcm b).factorization.support, x ^ b.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 1 else p ^ n) a_1 ((a.lcm b).factorization a_1) ∣
      a_1 ^ b.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 1 else p ^ n) a_1 ((a.lcm b).factorization a_1) ∣
      a_1 ^ b.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 1 else p ^ n) p ((a.lcm b).factorization p) ∣
    p ^ b.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 1 else p ^ n) p ((a.lcm b).factorization p) ∣
    p ^ b.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 1 else p ^ (a.lcm b).factorization p) ∣ p ^ b.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 1 else p ^ (a.lcm b).factorization p) ∣ p ^ b.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
⊢ 1 ∣ p ^ b.factorization p

case neg
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 ^ b.factorization p

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

tactic: rw [factorization_lcm ha hb]
state_before: case neg
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 ^ b.factorization p
state_after: case neg
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 ^ b.factorization p

tactic: apply pow_dvd_pow
state_before: case neg
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 ^ b.factorization p
state_after: case neg.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 ≤ b.factorization p

tactic: exact sup_le (not_le.1 le).le le_rfl
state_before: case neg.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 ≤ b.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
⊢ b.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 ∈ b.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 ∈ b.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 : b.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 : b.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 : b.factorization p ≠ 0
⊢ (a.factorization ⊔ b.factorization) p ≠ 0

tactic: exact (lt_sup_iff.mpr <| .inr <| 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 : b.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