Theorem: multiplicity.multiplicity_mk_eq_multiplicity
File: Mathlib/RingTheory/Multiplicity.lean

tactic: by_cases h : Finite a b
state_before: α : Type u_1
inst✝² : CommMonoidWithZero α
inst✝¹ : DecidableRel fun x x_1 => x ∣ x_1
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
a b : α
⊢ multiplicity (Associates.mk a) (Associates.mk b) = multiplicity a b

tactic: rw [← PartENat.natCast_get (finite_iff_dom.mp h)]
state_before: case pos
α : Type u_1
inst✝² : CommMonoidWithZero α
inst✝¹ : DecidableRel fun x x_1 => x ∣ x_1
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
a b : α
h : Finite a b
⊢ multiplicity (Associates.mk a) (Associates.mk b) = multiplicity a b

tactic: refine'
    (multiplicity.unique
        (show Associates.mk a ^ (multiplicity a b).get h ∣ Associates.mk b from _) _).symm <;>
  rw [← Associates.mk_pow, Associates.mk_dvd_mk]
state_before: case pos
α : Type u_1
inst✝² : CommMonoidWithZero α
inst✝¹ : DecidableRel fun x x_1 => x ∣ x_1
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
a b : α
h : Finite a b
⊢ multiplicity (Associates.mk a) (Associates.mk b) = ↑(Part.get (multiplicity a b) (_ : (multiplicity a b).Dom))

tactic: exact pow_multiplicity_dvd h
state_before: case pos.refine'_1
α : Type u_1
inst✝² : CommMonoidWithZero α
inst✝¹ : DecidableRel fun x x_1 => x ∣ x_1
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
a b : α
h : Finite a b
⊢ a ^ Part.get (multiplicity a b) h ∣ b

tactic: exact is_greatest
    ((PartENat.lt_coe_iff _ _).mpr (Exists.intro (finite_iff_dom.mp h) (Nat.lt_succ_self _)))
state_before: case pos.refine'_2
α : Type u_1
inst✝² : CommMonoidWithZero α
inst✝¹ : DecidableRel fun x x_1 => x ∣ x_1
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
a b : α
h : Finite a b
⊢ ¬a ^ (Part.get (multiplicity a b) h + 1) ∣ b

tactic: suffices ¬Finite (Associates.mk a) (Associates.mk b) by
  rw [finite_iff_dom, PartENat.not_dom_iff_eq_top] at h this
  rw [h, this]
state_before: case neg
α : Type u_1
inst✝² : CommMonoidWithZero α
inst✝¹ : DecidableRel fun x x_1 => x ∣ x_1
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
a b : α
h : ¬Finite a b
⊢ multiplicity (Associates.mk a) (Associates.mk b) = multiplicity a b

tactic: refine'
  not_finite_iff_forall.mpr fun n => by
    rw [← Associates.mk_pow, Associates.mk_dvd_mk]
    exact not_finite_iff_forall.mp h n
state_before: case neg
α : Type u_1
inst✝² : CommMonoidWithZero α
inst✝¹ : DecidableRel fun x x_1 => x ∣ x_1
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
a b : α
h : ¬Finite a b
⊢ ¬Finite (Associates.mk a) (Associates.mk b)

tactic: rw [finite_iff_dom, PartENat.not_dom_iff_eq_top] at h this
state_before: α : Type u_1
inst✝² : CommMonoidWithZero α
inst✝¹ : DecidableRel fun x x_1 => x ∣ x_1
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
a b : α
h : ¬Finite a b
this : ¬Finite (Associates.mk a) (Associates.mk b)
⊢ multiplicity (Associates.mk a) (Associates.mk b) = multiplicity a b

tactic: rw [h, this]
state_before: α : Type u_1
inst✝² : CommMonoidWithZero α
inst✝¹ : DecidableRel fun x x_1 => x ∣ x_1
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
a b : α
h✝ : ¬Finite a b
h : multiplicity a b = ⊤
this✝ : ¬Finite (Associates.mk a) (Associates.mk b)
this : multiplicity (Associates.mk a) (Associates.mk b) = ⊤
⊢ multiplicity (Associates.mk a) (Associates.mk b) = multiplicity a b

tactic: rw [← Associates.mk_pow, Associates.mk_dvd_mk]
state_before: α : Type u_1
inst✝² : CommMonoidWithZero α
inst✝¹ : DecidableRel fun x x_1 => x ∣ x_1
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
a b : α
h : ¬Finite a b
n : ℕ
⊢ Associates.mk a ^ n ∣ Associates.mk b

tactic: exact not_finite_iff_forall.mp h n
state_before: α : Type u_1
inst✝² : CommMonoidWithZero α
inst✝¹ : DecidableRel fun x x_1 => x ∣ x_1
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
a b : α
h : ¬Finite a b
n : ℕ
⊢ a ^ n ∣ b