Theorem: multiplicity_eq_multiplicity_span
File: Mathlib/RingTheory/DedekindDomain/Ideal.lean

tactic: by_cases h : Finite a b
state_before: R : Type u_1
A : Type ?u.1353425
K : Type ?u.1353428
inst✝⁷ : CommRing R
inst✝⁶ : CommRing A
inst✝⁵ : Field K
inst✝⁴ : IsDomain A
inst✝³ : IsDomain R
inst✝² : IsPrincipalIdealRing R
inst✝¹ : DecidableRel fun x x_1 => x ∣ x_1
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
a b : R
⊢ multiplicity (span {a}) (span {b}) = multiplicity a b

tactic: rw [← PartENat.natCast_get (finite_iff_dom.mp h)]
state_before: case pos
R : Type u_1
A : Type ?u.1353425
K : Type ?u.1353428
inst✝⁷ : CommRing R
inst✝⁶ : CommRing A
inst✝⁵ : Field K
inst✝⁴ : IsDomain A
inst✝³ : IsDomain R
inst✝² : IsPrincipalIdealRing R
inst✝¹ : DecidableRel fun x x_1 => x ∣ x_1
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
a b : R
h : multiplicity.Finite a b
⊢ multiplicity (span {a}) (span {b}) = multiplicity a b

tactic: refine (multiplicity.unique
  (show Ideal.span {a} ^ (multiplicity a b).get h ∣ Ideal.span {b} from ?_) ?_).symm <;>
  rw [Ideal.span_singleton_pow, span_singleton_dvd_span_singleton_iff_dvd]
state_before: case pos
R : Type u_1
A : Type ?u.1353425
K : Type ?u.1353428
inst✝⁷ : CommRing R
inst✝⁶ : CommRing A
inst✝⁵ : Field K
inst✝⁴ : IsDomain A
inst✝³ : IsDomain R
inst✝² : IsPrincipalIdealRing R
inst✝¹ : DecidableRel fun x x_1 => x ∣ x_1
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
a b : R
h : multiplicity.Finite a b
⊢ multiplicity (span {a}) (span {b}) = ↑(Part.get (multiplicity a b) (_ : (multiplicity a b).Dom))

tactic: exact pow_multiplicity_dvd h
state_before: case pos.refine_1
R : Type u_1
A : Type ?u.1353425
K : Type ?u.1353428
inst✝⁷ : CommRing R
inst✝⁶ : CommRing A
inst✝⁵ : Field K
inst✝⁴ : IsDomain A
inst✝³ : IsDomain R
inst✝² : IsPrincipalIdealRing R
inst✝¹ : DecidableRel fun x x_1 => x ∣ x_1
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
a b : R
h : multiplicity.Finite a b
⊢ a ^ Part.get (multiplicity a b) h ∣ b

case pos.refine_2
R : Type u_1
A : Type ?u.1353425
K : Type ?u.1353428
inst✝⁷ : CommRing R
inst✝⁶ : CommRing A
inst✝⁵ : Field K
inst✝⁴ : IsDomain A
inst✝³ : IsDomain R
inst✝² : IsPrincipalIdealRing R
inst✝¹ : DecidableRel fun x x_1 => x ∣ x_1
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
a b : R
h : multiplicity.Finite a b
⊢ ¬a ^ (Part.get (multiplicity a b) h + 1) ∣ b

tactic: exact multiplicity.is_greatest
  ((PartENat.lt_coe_iff _ _).mpr (Exists.intro (finite_iff_dom.mp h) (Nat.lt_succ_self _)))
state_before: case pos.refine_2
R : Type u_1
A : Type ?u.1353425
K : Type ?u.1353428
inst✝⁷ : CommRing R
inst✝⁶ : CommRing A
inst✝⁵ : Field K
inst✝⁴ : IsDomain A
inst✝³ : IsDomain R
inst✝² : IsPrincipalIdealRing R
inst✝¹ : DecidableRel fun x x_1 => x ∣ x_1
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
a b : R
h : multiplicity.Finite a b
⊢ ¬a ^ (Part.get (multiplicity a b) h + 1) ∣ b

tactic: suffices ¬Finite (Ideal.span ({a} : Set R)) (Ideal.span ({b} : Set R)) by
  rw [finite_iff_dom, PartENat.not_dom_iff_eq_top] at h this
  rw [h, this]
state_before: case neg
R : Type u_1
A : Type ?u.1353425
K : Type ?u.1353428
inst✝⁷ : CommRing R
inst✝⁶ : CommRing A
inst✝⁵ : Field K
inst✝⁴ : IsDomain A
inst✝³ : IsDomain R
inst✝² : IsPrincipalIdealRing R
inst✝¹ : DecidableRel fun x x_1 => x ∣ x_1
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
a b : R
h : ¬multiplicity.Finite a b
⊢ multiplicity (span {a}) (span {b}) = multiplicity a b

tactic: exact not_finite_iff_forall.mpr fun n => by
  rw [Ideal.span_singleton_pow, span_singleton_dvd_span_singleton_iff_dvd]
  exact not_finite_iff_forall.mp h n
state_before: case neg
R : Type u_1
A : Type ?u.1353425
K : Type ?u.1353428
inst✝⁷ : CommRing R
inst✝⁶ : CommRing A
inst✝⁵ : Field K
inst✝⁴ : IsDomain A
inst✝³ : IsDomain R
inst✝² : IsPrincipalIdealRing R
inst✝¹ : DecidableRel fun x x_1 => x ∣ x_1
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
a b : R
h : ¬multiplicity.Finite a b
⊢ ¬multiplicity.Finite (span {a}) (span {b})

tactic: rw [finite_iff_dom, PartENat.not_dom_iff_eq_top] at h this
state_before: R : Type u_1
A : Type ?u.1353425
K : Type ?u.1353428
inst✝⁷ : CommRing R
inst✝⁶ : CommRing A
inst✝⁵ : Field K
inst✝⁴ : IsDomain A
inst✝³ : IsDomain R
inst✝² : IsPrincipalIdealRing R
inst✝¹ : DecidableRel fun x x_1 => x ∣ x_1
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
a b : R
h : ¬multiplicity.Finite a b
this : ¬multiplicity.Finite (span {a}) (span {b})
⊢ multiplicity (span {a}) (span {b}) = multiplicity a b

tactic: rw [h, this]
state_before: R : Type u_1
A : Type ?u.1353425
K : Type ?u.1353428
inst✝⁷ : CommRing R
inst✝⁶ : CommRing A
inst✝⁵ : Field K
inst✝⁴ : IsDomain A
inst✝³ : IsDomain R
inst✝² : IsPrincipalIdealRing R
inst✝¹ : DecidableRel fun x x_1 => x ∣ x_1
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
a b : R
h✝ : ¬multiplicity.Finite a b
h : multiplicity a b = ⊤
this✝ : ¬multiplicity.Finite (span {a}) (span {b})
this : multiplicity (span {a}) (span {b}) = ⊤
⊢ multiplicity (span {a}) (span {b}) = multiplicity a b

tactic: rw [Ideal.span_singleton_pow, span_singleton_dvd_span_singleton_iff_dvd]
state_before: R : Type u_1
A : Type ?u.1353425
K : Type ?u.1353428
inst✝⁷ : CommRing R
inst✝⁶ : CommRing A
inst✝⁵ : Field K
inst✝⁴ : IsDomain A
inst✝³ : IsDomain R
inst✝² : IsPrincipalIdealRing R
inst✝¹ : DecidableRel fun x x_1 => x ∣ x_1
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
a b : R
h : ¬multiplicity.Finite a b
n : ℕ
⊢ span {a} ^ n ∣ span {b}

tactic: exact not_finite_iff_forall.mp h n
state_before: R : Type u_1
A : Type ?u.1353425
K : Type ?u.1353428
inst✝⁷ : CommRing R
inst✝⁶ : CommRing A
inst✝⁵ : Field K
inst✝⁴ : IsDomain A
inst✝³ : IsDomain R
inst✝² : IsPrincipalIdealRing R
inst✝¹ : DecidableRel fun x x_1 => x ∣ x_1
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
a b : R
h : ¬multiplicity.Finite a b
n : ℕ
⊢ a ^ n ∣ b