Theorem: multiplicity_factor_dvd_iso_eq_multiplicity_of_mem_normalizedFactors
File: Mathlib/RingTheory/ChainOfDivisors.lean

Proof steps:
state_before: M : Type u_1
inst✝⁷ : CancelCommMonoidWithZero M
N : Type u_2
inst✝⁶ : CancelCommMonoidWithZero N
inst✝⁵ : Unique Mˣ
inst✝⁴ : Unique Nˣ
inst✝³ : UniqueFactorizationMonoid M
inst✝² : UniqueFactorizationMonoid N
inst✝¹ : DecidableRel fun x x_1 => x ∣ x_1
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
m p : M
n : N
hm : m ≠ 0
hn : n ≠ 0
hp : p ∈ normalizedFactors m
d : { l // l ∣ m } ≃ { l // l ∣ n }
hd : ∀ (l l' : { l // l ∣ m }), ↑(d l) ∣ ↑(d l') ↔ ↑l ∣ ↑l'
⊢ multiplicity (↑(d ⟨p, ⋯⟩)) n = multiplicity p m
state_after: case h
M : Type u_1
inst✝⁷ : CancelCommMonoidWithZero M
N : Type u_2
inst✝⁶ : CancelCommMonoidWithZero N
inst✝⁵ : Unique Mˣ
inst✝⁴ : Unique Nˣ
inst✝³ : UniqueFactorizationMonoid M
inst✝² : UniqueFactorizationMonoid N
inst✝¹ : DecidableRel fun x x_1 => x ∣ x_1
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
m p : M
n : N
hm : m ≠ 0
hn : n ≠ 0
hp : p ∈ normalizedFactors m
d : { l // l ∣ m } ≃ { l // l ∣ n }
hd : ∀ (l l' : { l // l ∣ m }), ↑(d l) ∣ ↑(d l') ↔ ↑l ∣ ↑l'
⊢ multiplicity p m = multiplicity (↑(d ⟨p, ⋯⟩)) n
tactic: apply Eq.symm
state_before: case h
M : Type u_1
inst✝⁷ : CancelCommMonoidWithZero M
N : Type u_2
inst✝⁶ : CancelCommMonoidWithZero N
inst✝⁵ : Unique Mˣ
inst✝⁴ : Unique Nˣ
inst✝³ : UniqueFactorizationMonoid M
inst✝² : UniqueFactorizationMonoid N
inst✝¹ : DecidableRel fun x x_1 => x ∣ x_1
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
m p : M
n : N
hm : m ≠ 0
hn : n ≠ 0
hp : p ∈ normalizedFactors m
d : { l // l ∣ m } ≃ { l // l ∣ n }
hd : ∀ (l l' : { l // l ∣ m }), ↑(d l) ∣ ↑(d l') ↔ ↑l ∣ ↑l'
⊢ multiplicity p m = multiplicity (↑(d ⟨p, ⋯⟩)) n
state_after: case h
M : Type u_1
inst✝⁷ : CancelCommMonoidWithZero M
N : Type u_2
inst✝⁶ : CancelCommMonoidWithZero N
inst✝⁵ : Unique Mˣ
inst✝⁴ : Unique Nˣ
inst✝³ : UniqueFactorizationMonoid M
inst✝² : UniqueFactorizationMonoid N
inst✝¹ : DecidableRel fun x x_1 => x ∣ x_1
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
m p : M
n : N
hm : m ≠ 0
hn : n ≠ 0
hp : p ∈ normalizedFactors m
d : { l // l ∣ m } ≃ { l // l ∣ n }
hd : ∀ (l l' : { l // l ∣ m }), ↑(d l) ∣ ↑(d l') ↔ ↑l ∣ ↑l'
⊢ multiplicity (Associates.mk p) (Associates.mk m) =
    multiplicity (Associates.mk ↑(d ⟨associatesEquivOfUniqueUnits (associatesEquivOfUniqueUnits.symm p), ⋯⟩))
      (Associates.mk n)
tactic: suffices multiplicity (Associates.mk p) (Associates.mk m) = multiplicity (Associates.mk
    ↑(d ⟨associatesEquivOfUniqueUnits (associatesEquivOfUniqueUnits.symm p), by
      simp [dvd_of_mem_normalizedFactors hp]⟩)) (Associates.mk n) by
    simpa only [multiplicity_mk_eq_multiplicity, associatesEquivOfUniqueUnits_symm_apply,
      associatesEquivOfUniqueUnits_apply, out_mk, normalize_eq] using this
state_before: case h
M : Type u_1
inst✝⁷ : CancelCommMonoidWithZero M
N : Type u_2
inst✝⁶ : CancelCommMonoidWithZero N
inst✝⁵ : Unique Mˣ
inst✝⁴ : Unique Nˣ
inst✝³ : UniqueFactorizationMonoid M
inst✝² : UniqueFactorizationMonoid N
inst✝¹ : DecidableRel fun x x_1 => x ∣ x_1
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
m p : M
n : N
hm : m ≠ 0
hn : n ≠ 0
hp : p ∈ normalizedFactors m
d : { l // l ∣ m } ≃ { l // l ∣ n }
hd : ∀ (l l' : { l // l ∣ m }), ↑(d l) ∣ ↑(d l') ↔ ↑l ∣ ↑l'
⊢ multiplicity (Associates.mk p) (Associates.mk m) =
    multiplicity (Associates.mk ↑(d ⟨associatesEquivOfUniqueUnits (associatesEquivOfUniqueUnits.symm p), ⋯⟩))
      (Associates.mk n)
state_after: case h
M : Type u_1
inst✝⁷ : CancelCommMonoidWithZero M
N : Type u_2
inst✝⁶ : CancelCommMonoidWithZero N
inst✝⁵ : Unique Mˣ
inst✝⁴ : Unique Nˣ
inst✝³ : UniqueFactorizationMonoid M
inst✝² : UniqueFactorizationMonoid N
inst✝¹ : DecidableRel fun x x_1 => x ∣ x_1
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
m p : M
n : N
hm : m ≠ 0
hn : n ≠ 0
hp : p ∈ normalizedFactors m
d : { l // l ∣ m } ≃ { l // l ∣ n }
hd : ∀ (l l' : { l // l ∣ m }), ↑(d l) ∣ ↑(d l') ↔ ↑l ∣ ↑l'
this :
  Associates.mk ↑(d ⟨associatesEquivOfUniqueUnits (associatesEquivOfUniqueUnits.symm p), ⋯⟩) =
    ↑((mkFactorOrderIsoOfFactorDvdEquiv hd) ⟨associatesEquivOfUniqueUnits.symm p, ⋯⟩)
⊢ multiplicity (Associates.mk p) (Associates.mk m) =
    multiplicity (Associates.mk ↑(d ⟨associatesEquivOfUniqueUnits (associatesEquivOfUniqueUnits.symm p), ⋯⟩))
      (Associates.mk n)
tactic: have : Associates.mk (d ⟨associatesEquivOfUniqueUnits (associatesEquivOfUniqueUnits.symm p), by
    simp only [dvd_of_mem_normalizedFactors hp, associatesEquivOfUniqueUnits_symm_apply,
      associatesEquivOfUniqueUnits_apply, out_mk, normalize_eq]⟩ : N) =
    ↑(mkFactorOrderIsoOfFactorDvdEquiv hd ⟨associatesEquivOfUniqueUnits.symm p, by
      rw [associatesEquivOfUniqueUnits_symm_apply]
      exact mk_le_mk_of_dvd (dvd_of_mem_normalizedFactors hp)⟩) := by
    rw [mkFactorOrderIsoOfFactorDvdEquiv_apply_coe]
state_before: case h
M : Type u_1
inst✝⁷ : CancelCommMonoidWithZero M
N : Type u_2
inst✝⁶ : CancelCommMonoidWithZero N
inst✝⁵ : Unique Mˣ
inst✝⁴ : Unique Nˣ
inst✝³ : UniqueFactorizationMonoid M
inst✝² : UniqueFactorizationMonoid N
inst✝¹ : DecidableRel fun x x_1 => x ∣ x_1
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
m p : M
n : N
hm : m ≠ 0
hn : n ≠ 0
hp : p ∈ normalizedFactors m
d : { l // l ∣ m } ≃ { l // l ∣ n }
hd : ∀ (l l' : { l // l ∣ m }), ↑(d l) ∣ ↑(d l') ↔ ↑l ∣ ↑l'
this :
  Associates.mk ↑(d ⟨associatesEquivOfUniqueUnits (associatesEquivOfUniqueUnits.symm p), ⋯⟩) =
    ↑((mkFactorOrderIsoOfFactorDvdEquiv hd) ⟨associatesEquivOfUniqueUnits.symm p, ⋯⟩)
⊢ multiplicity (Associates.mk p) (Associates.mk m) =
    multiplicity (Associates.mk ↑(d ⟨associatesEquivOfUniqueUnits (associatesEquivOfUniqueUnits.symm p), ⋯⟩))
      (Associates.mk n)
state_after: case h
M : Type u_1
inst✝⁷ : CancelCommMonoidWithZero M
N : Type u_2
inst✝⁶ : CancelCommMonoidWithZero N
inst✝⁵ : Unique Mˣ
inst✝⁴ : Unique Nˣ
inst✝³ : UniqueFactorizationMonoid M
inst✝² : UniqueFactorizationMonoid N
inst✝¹ : DecidableRel fun x x_1 => x ∣ x_1
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
m p : M
n : N
hm : m ≠ 0
hn : n ≠ 0
hp : p ∈ normalizedFactors m
d : { l // l ∣ m } ≃ { l // l ∣ n }
hd : ∀ (l l' : { l // l ∣ m }), ↑(d l) ∣ ↑(d l') ↔ ↑l ∣ ↑l'
this :
  Associates.mk ↑(d ⟨associatesEquivOfUniqueUnits (associatesEquivOfUniqueUnits.symm p), ⋯⟩) =
    ↑((mkFactorOrderIsoOfFactorDvdEquiv hd) ⟨associatesEquivOfUniqueUnits.symm p, ⋯⟩)
⊢ multiplicity (Associates.mk p) (Associates.mk m) =
    multiplicity (↑((mkFactorOrderIsoOfFactorDvdEquiv hd) ⟨associatesEquivOfUniqueUnits.symm p, ⋯⟩)) (Associates.mk n)
tactic: rw [this]
state_before: case h
M : Type u_1
inst✝⁷ : CancelCommMonoidWithZero M
N : Type u_2
inst✝⁶ : CancelCommMonoidWithZero N
inst✝⁵ : Unique Mˣ
inst✝⁴ : Unique Nˣ
inst✝³ : UniqueFactorizationMonoid M
inst✝² : UniqueFactorizationMonoid N
inst✝¹ : DecidableRel fun x x_1 => x ∣ x_1
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
m p : M
n : N
hm : m ≠ 0
hn : n ≠ 0
hp : p ∈ normalizedFactors m
d : { l // l ∣ m } ≃ { l // l ∣ n }
hd : ∀ (l l' : { l // l ∣ m }), ↑(d l) ∣ ↑(d l') ↔ ↑l ∣ ↑l'
this :
  Associates.mk ↑(d ⟨associatesEquivOfUniqueUnits (associatesEquivOfUniqueUnits.symm p), ⋯⟩) =
    ↑((mkFactorOrderIsoOfFactorDvdEquiv hd) ⟨associatesEquivOfUniqueUnits.symm p, ⋯⟩)
⊢ multiplicity (Associates.mk p) (Associates.mk m) =
    multiplicity (↑((mkFactorOrderIsoOfFactorDvdEquiv hd) ⟨associatesEquivOfUniqueUnits.symm p, ⋯⟩)) (Associates.mk n)
state_after: case h
M : Type u_1
inst✝⁷ : CancelCommMonoidWithZero M
N : Type u_2
inst✝⁶ : CancelCommMonoidWithZero N
inst✝⁵ : Unique Mˣ
inst✝⁴ : Unique Nˣ
inst✝³ : UniqueFactorizationMonoid M
inst✝² : UniqueFactorizationMonoid N
inst✝¹ : DecidableRel fun x x_1 => x ∣ x_1
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
m p : M
n : N
hm : m ≠ 0
hn : n ≠ 0
hp : p ∈ normalizedFactors m
d : { l // l ∣ m } ≃ { l // l ∣ n }
hd : ∀ (l l' : { l // l ∣ m }), ↑(d l) ∣ ↑(d l') ↔ ↑l ∣ ↑l'
this :
  Associates.mk ↑(d ⟨associatesEquivOfUniqueUnits (associatesEquivOfUniqueUnits.symm p), ⋯⟩) =
    ↑((mkFactorOrderIsoOfFactorDvdEquiv hd) ⟨associatesEquivOfUniqueUnits.symm p, ⋯⟩)
⊢ Associates.mk p ∈ normalizedFactors (Associates.mk m)
tactic: refine
    multiplicity_prime_eq_multiplicity_image_by_factor_orderIso (mk_ne_zero.mpr hn) ?_
      (mkFactorOrderIsoOfFactorDvdEquiv hd)
state_before: case h
M : Type u_1
inst✝⁷ : CancelCommMonoidWithZero M
N : Type u_2
inst✝⁶ : CancelCommMonoidWithZero N
inst✝⁵ : Unique Mˣ
inst✝⁴ : Unique Nˣ
inst✝³ : UniqueFactorizationMonoid M
inst✝² : UniqueFactorizationMonoid N
inst✝¹ : DecidableRel fun x x_1 => x ∣ x_1
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
m p : M
n : N
hm : m ≠ 0
hn : n ≠ 0
hp : p ∈ normalizedFactors m
d : { l // l ∣ m } ≃ { l // l ∣ n }
hd : ∀ (l l' : { l // l ∣ m }), ↑(d l) ∣ ↑(d l') ↔ ↑l ∣ ↑l'
this :
  Associates.mk ↑(d ⟨associatesEquivOfUniqueUnits (associatesEquivOfUniqueUnits.symm p), ⋯⟩) =
    ↑((mkFactorOrderIsoOfFactorDvdEquiv hd) ⟨associatesEquivOfUniqueUnits.symm p, ⋯⟩)
⊢ Associates.mk p ∈ normalizedFactors (Associates.mk m)
state_after: case h.intro.intro
M : Type u_1
inst✝⁷ : CancelCommMonoidWithZero M
N : Type u_2
inst✝⁶ : CancelCommMonoidWithZero N
inst✝⁵ : Unique Mˣ
inst✝⁴ : Unique Nˣ
inst✝³ : UniqueFactorizationMonoid M
inst✝² : UniqueFactorizationMonoid N
inst✝¹ : DecidableRel fun x x_1 => x ∣ x_1
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
m p : M
n : N
hm : m ≠ 0
hn : n ≠ 0
hp : p ∈ normalizedFactors m
d : { l // l ∣ m } ≃ { l // l ∣ n }
hd : ∀ (l l' : { l // l ∣ m }), ↑(d l) ∣ ↑(d l') ↔ ↑l ∣ ↑l'
this :
  Associates.mk ↑(d ⟨associatesEquivOfUniqueUnits (associatesEquivOfUniqueUnits.symm p), ⋯⟩) =
    ↑((mkFactorOrderIsoOfFactorDvdEquiv hd) ⟨associatesEquivOfUniqueUnits.symm p, ⋯⟩)
q : Associates M
hq : q ∈ normalizedFactors (Associates.mk m)
hq' : Associated (Associates.mk p) q
⊢ Associates.mk p ∈ normalizedFactors (Associates.mk m)
tactic: obtain ⟨q, hq, hq'⟩ :=
    exists_mem_normalizedFactors_of_dvd (mk_ne_zero.mpr hm)
      (prime_mk.mpr (prime_of_normalized_factor p hp)).irreducible
      (mk_le_mk_of_dvd (dvd_of_mem_normalizedFactors hp))
state_before: case h.intro.intro
M : Type u_1
inst✝⁷ : CancelCommMonoidWithZero M
N : Type u_2
inst✝⁶ : CancelCommMonoidWithZero N
inst✝⁵ : Unique Mˣ
inst✝⁴ : Unique Nˣ
inst✝³ : UniqueFactorizationMonoid M
inst✝² : UniqueFactorizationMonoid N
inst✝¹ : DecidableRel fun x x_1 => x ∣ x_1
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
m p : M
n : N
hm : m ≠ 0
hn : n ≠ 0
hp : p ∈ normalizedFactors m
d : { l // l ∣ m } ≃ { l // l ∣ n }
hd : ∀ (l l' : { l // l ∣ m }), ↑(d l) ∣ ↑(d l') ↔ ↑l ∣ ↑l'
this :
  Associates.mk ↑(d ⟨associatesEquivOfUniqueUnits (associatesEquivOfUniqueUnits.symm p), ⋯⟩) =
    ↑((mkFactorOrderIsoOfFactorDvdEquiv hd) ⟨associatesEquivOfUniqueUnits.symm p, ⋯⟩)
q : Associates M
hq : q ∈ normalizedFactors (Associates.mk m)
hq' : Associated (Associates.mk p) q
⊢ Associates.mk p ∈ normalizedFactors (Associates.mk m)
state_after: no goals
tactic: rwa [associated_iff_eq.mp hq']