Theorem: Associates.count_le_count_of_factors_le
File: Mathlib/RingTheory/UniqueFactorizationDomain.lean

tactic: by_cases ha : a = 0
state_before: α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
dec_irr : (p : Associates α) → Decidable (Irreducible p)
inst✝ : UniqueFactorizationMonoid α
dec : DecidableEq α
dec' : DecidableEq (Associates α)
a b p : Associates α
hb : b ≠ 0
hp : Irreducible p
h : factors a ≤ factors b
⊢ count p (factors a) ≤ count p (factors b)

tactic: obtain ⟨sa, h_sa⟩ := factors_eq_some_iff_ne_zero.mpr ha
state_before: case neg
α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
dec_irr : (p : Associates α) → Decidable (Irreducible p)
inst✝ : UniqueFactorizationMonoid α
dec : DecidableEq α
dec' : DecidableEq (Associates α)
a b p : Associates α
hb : b ≠ 0
hp : Irreducible p
h : factors a ≤ factors b
ha : ¬a = 0
⊢ count p (factors a) ≤ count p (factors b)

tactic: obtain ⟨sb, h_sb⟩ := factors_eq_some_iff_ne_zero.mpr hb
state_before: case neg.intro
α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
dec_irr : (p : Associates α) → Decidable (Irreducible p)
inst✝ : UniqueFactorizationMonoid α
dec : DecidableEq α
dec' : DecidableEq (Associates α)
a b p : Associates α
hb : b ≠ 0
hp : Irreducible p
h : factors a ≤ factors b
ha : ¬a = 0
sa : Multiset { p // Irreducible p }
h_sa : factors a = some sa
⊢ count p (factors a) ≤ count p (factors b)

tactic: rw [h_sa, h_sb] at h⊢
state_before: case neg.intro.intro
α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
dec_irr : (p : Associates α) → Decidable (Irreducible p)
inst✝ : UniqueFactorizationMonoid α
dec : DecidableEq α
dec' : DecidableEq (Associates α)
a b p : Associates α
hb : b ≠ 0
hp : Irreducible p
h : factors a ≤ factors b
ha : ¬a = 0
sa : Multiset { p // Irreducible p }
h_sa : factors a = some sa
sb : Multiset { p // Irreducible p }
h_sb : factors b = some sb
⊢ count p (factors a) ≤ count p (factors b)

tactic: rw [count_some hp, count_some hp]
state_before: case neg.intro.intro
α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
dec_irr : (p : Associates α) → Decidable (Irreducible p)
inst✝ : UniqueFactorizationMonoid α
dec : DecidableEq α
dec' : DecidableEq (Associates α)
a b p : Associates α
hb : b ≠ 0
hp : Irreducible p
h✝ : factors a ≤ factors b
ha : ¬a = 0
sa : Multiset { p // Irreducible p }
h_sa : factors a = some sa
sb : Multiset { p // Irreducible p }
h : some sa ≤ some sb
h_sb : factors b = some sb
⊢ count p (some sa) ≤ count p (some sb)

tactic: rw [WithTop.some_le_some] at h
state_before: case neg.intro.intro
α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
dec_irr : (p : Associates α) → Decidable (Irreducible p)
inst✝ : UniqueFactorizationMonoid α
dec : DecidableEq α
dec' : DecidableEq (Associates α)
a b p : Associates α
hb : b ≠ 0
hp : Irreducible p
h✝ : factors a ≤ factors b
ha : ¬a = 0
sa : Multiset { p // Irreducible p }
h_sa : factors a = some sa
sb : Multiset { p // Irreducible p }
h : some sa ≤ some sb
h_sb : factors b = some sb
⊢ Multiset.count { val := p, property := hp } sa ≤ Multiset.count { val := p, property := hp } sb

tactic: exact Multiset.count_le_of_le _ h
state_before: case neg.intro.intro
α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
dec_irr : (p : Associates α) → Decidable (Irreducible p)
inst✝ : UniqueFactorizationMonoid α
dec : DecidableEq α
dec' : DecidableEq (Associates α)
a b p : Associates α
hb : b ≠ 0
hp : Irreducible p
h✝ : factors a ≤ factors b
ha : ¬a = 0
sa : Multiset { p // Irreducible p }
h_sa : factors a = some sa
sb : Multiset { p // Irreducible p }
h : sa ≤ sb
h_sb : factors b = some sb
⊢ Multiset.count { val := p, property := hp } sa ≤ Multiset.count { val := p, property := hp } sb

tactic: simp_all
state_before: case pos
α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
dec_irr : (p : Associates α) → Decidable (Irreducible p)
inst✝ : UniqueFactorizationMonoid α
dec : DecidableEq α
dec' : DecidableEq (Associates α)
a b p : Associates α
hb : b ≠ 0
hp : Irreducible p
h : factors a ≤ factors b
ha : a = 0
⊢ count p (factors a) ≤ count p (factors b)