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

Proof steps:
state_before: a✝ b✝ m n p✝ a b : ℕ
hab : a ∣ b
p : ℕ
⊢ a / p ^ a.factorization p ∣ b / p ^ b.factorization p
state_after: case inl
a✝ b✝ m n p✝ a b : ℕ
hab : a ∣ b
p : ℕ
pp : ¬Prime p
⊢ a / p ^ a.factorization p ∣ b / p ^ b.factorization p

case inr
a✝ b✝ m n p✝ a b : ℕ
hab : a ∣ b
p : ℕ
pp : Prime p
⊢ a / p ^ a.factorization p ∣ b / p ^ b.factorization p
tactic: rcases em' p.Prime with (pp | pp)
state_before: case inr
a✝ b✝ m n p✝ a b : ℕ
hab : a ∣ b
p : ℕ
pp : Prime p
⊢ a / p ^ a.factorization p ∣ b / p ^ b.factorization p
state_after: case inr.inl
a✝ b m n p✝ a p : ℕ
pp : Prime p
hab : a ∣ 0
⊢ a / p ^ a.factorization p ∣ 0 / p ^ (factorization 0) p

case inr.inr
a✝ b✝ m n p✝ a b : ℕ
hab : a ∣ b
p : ℕ
pp : Prime p
hb0 : b ≠ 0
⊢ a / p ^ a.factorization p ∣ b / p ^ b.factorization p
tactic: rcases eq_or_ne b 0 with (rfl | hb0)
state_before: case inr.inr
a✝ b✝ m n p✝ a b : ℕ
hab : a ∣ b
p : ℕ
pp : Prime p
hb0 : b ≠ 0
⊢ a / p ^ a.factorization p ∣ b / p ^ b.factorization p
state_after: case inr.inr.inl
a b✝ m n p✝ b p : ℕ
pp : Prime p
hb0 : b ≠ 0
hab : 0 ∣ b
⊢ 0 / p ^ (factorization 0) p ∣ b / p ^ b.factorization p

case inr.inr.inr
a✝ b✝ m n p✝ a b : ℕ
hab : a ∣ b
p : ℕ
pp : Prime p
hb0 : b ≠ 0
ha0 : a ≠ 0
⊢ a / p ^ a.factorization p ∣ b / p ^ b.factorization p
tactic: rcases eq_or_ne a 0 with (rfl | ha0)
state_before: case inr.inr.inr
a✝ b✝ m n p✝ a b : ℕ
hab : a ∣ b
p : ℕ
pp : Prime p
hb0 : b ≠ 0
ha0 : a ≠ 0
⊢ a / p ^ a.factorization p ∣ b / p ^ b.factorization p
state_after: case inr.inr.inr
a✝ b✝ m n p✝ a b : ℕ
hab : a ∣ b
p : ℕ
pp : Prime p
hb0 : b ≠ 0
ha0 : a ≠ 0
ha : a / p ^ a.factorization p ≠ 0
⊢ a / p ^ a.factorization p ∣ b / p ^ b.factorization p
tactic: have ha := (Nat.div_pos (ord_proj_le p ha0) (ord_proj_pos a p)).ne'
state_before: case inr.inr.inr
a✝ b✝ m n p✝ a b : ℕ
hab : a ∣ b
p : ℕ
pp : Prime p
hb0 : b ≠ 0
ha0 : a ≠ 0
ha : a / p ^ a.factorization p ≠ 0
⊢ a / p ^ a.factorization p ∣ b / p ^ b.factorization p
state_after: case inr.inr.inr
a✝ b✝ m n p✝ a b : ℕ
hab : a ∣ b
p : ℕ
pp : Prime p
hb0 : b ≠ 0
ha0 : a ≠ 0
ha : a / p ^ a.factorization p ≠ 0
hb : b / p ^ b.factorization p ≠ 0
⊢ a / p ^ a.factorization p ∣ b / p ^ b.factorization p
tactic: have hb := (Nat.div_pos (ord_proj_le p hb0) (ord_proj_pos b p)).ne'
state_before: case inr.inr.inr
a✝ b✝ m n p✝ a b : ℕ
hab : a ∣ b
p : ℕ
pp : Prime p
hb0 : b ≠ 0
ha0 : a ≠ 0
ha : a / p ^ a.factorization p ≠ 0
hb : b / p ^ b.factorization p ≠ 0
⊢ a / p ^ a.factorization p ∣ b / p ^ b.factorization p
state_after: case inr.inr.inr
a✝ b✝ m n p✝ a b : ℕ
hab : a ∣ b
p : ℕ
pp : Prime p
hb0 : b ≠ 0
ha0 : a ≠ 0
ha : a / p ^ a.factorization p ≠ 0
hb : b / p ^ b.factorization p ≠ 0
⊢ Finsupp.erase p a.factorization ≤ Finsupp.erase p b.factorization
tactic: rw [← factorization_le_iff_dvd ha hb, factorization_ord_compl a p, factorization_ord_compl b p]
state_before: case inr.inr.inr
a✝ b✝ m n p✝ a b : ℕ
hab : a ∣ b
p : ℕ
pp : Prime p
hb0 : b ≠ 0
ha0 : a ≠ 0
ha : a / p ^ a.factorization p ≠ 0
hb : b / p ^ b.factorization p ≠ 0
⊢ Finsupp.erase p a.factorization ≤ Finsupp.erase p b.factorization
state_after: case inr.inr.inr
a✝ b✝ m n p✝ a b : ℕ
hab : a ∣ b
p : ℕ
pp : Prime p
hb0 : b ≠ 0
ha0 : a ≠ 0
ha : a / p ^ a.factorization p ≠ 0
hb : b / p ^ b.factorization p ≠ 0
q : ℕ
⊢ (Finsupp.erase p a.factorization) q ≤ (Finsupp.erase p b.factorization) q
tactic: intro q
state_before: case inr.inr.inr
a✝ b✝ m n p✝ a b : ℕ
hab : a ∣ b
p : ℕ
pp : Prime p
hb0 : b ≠ 0
ha0 : a ≠ 0
ha : a / p ^ a.factorization p ≠ 0
hb : b / p ^ b.factorization p ≠ 0
q : ℕ
⊢ (Finsupp.erase p a.factorization) q ≤ (Finsupp.erase p b.factorization) q
state_after: case inr.inr.inr.inl
a✝ b✝ m n p a b : ℕ
hab : a ∣ b
hb0 : b ≠ 0
ha0 : a ≠ 0
q : ℕ
pp : Prime q
ha : a / q ^ a.factorization q ≠ 0
hb : b / q ^ b.factorization q ≠ 0
⊢ (Finsupp.erase q a.factorization) q ≤ (Finsupp.erase q b.factorization) q

case inr.inr.inr.inr
a✝ b✝ m n p✝ a b : ℕ
hab : a ∣ b
p : ℕ
pp : Prime p
hb0 : b ≠ 0
ha0 : a ≠ 0
ha : a / p ^ a.factorization p ≠ 0
hb : b / p ^ b.factorization p ≠ 0
q : ℕ
hqp : q ≠ p
⊢ (Finsupp.erase p a.factorization) q ≤ (Finsupp.erase p b.factorization) q
tactic: rcases eq_or_ne q p with (rfl | hqp)
state_before: case inr.inr.inr.inr
a✝ b✝ m n p✝ a b : ℕ
hab : a ∣ b
p : ℕ
pp : Prime p
hb0 : b ≠ 0
ha0 : a ≠ 0
ha : a / p ^ a.factorization p ≠ 0
hb : b / p ^ b.factorization p ≠ 0
q : ℕ
hqp : q ≠ p
⊢ (Finsupp.erase p a.factorization) q ≤ (Finsupp.erase p b.factorization) q
state_after: case inr.inr.inr.inr
a✝ b✝ m n p✝ a b : ℕ
hab : a ∣ b
p : ℕ
pp : Prime p
hb0 : b ≠ 0
ha0 : a ≠ 0
ha : a / p ^ a.factorization p ≠ 0
hb : b / p ^ b.factorization p ≠ 0
q : ℕ
hqp : q ≠ p
⊢ a.factorization q ≤ b.factorization q
tactic: simp_rw [erase_ne hqp]
state_before: case inr.inr.inr.inr
a✝ b✝ m n p✝ a b : ℕ
hab : a ∣ b
p : ℕ
pp : Prime p
hb0 : b ≠ 0
ha0 : a ≠ 0
ha : a / p ^ a.factorization p ≠ 0
hb : b / p ^ b.factorization p ≠ 0
q : ℕ
hqp : q ≠ p
⊢ a.factorization q ≤ b.factorization q
state_after: no goals
tactic: exact (factorization_le_iff_dvd ha0 hb0).2 hab q