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

tactic: suffices
  Prime (d ⟨associatesEquivOfUniqueUnits (associatesEquivOfUniqueUnits.symm p), by
          simp [dvd_of_mem_normalizedFactors hp]⟩ : N) by
  simp only [associatesEquivOfUniqueUnits_apply, out_mk, normalize_eq,
    associatesEquivOfUniqueUnits_symm_apply] at this
  obtain ⟨q, hq, hq'⟩ :=
    exists_mem_normalizedFactors_of_dvd hn this.irreducible
      (d ⟨p, by apply dvd_of_mem_normalizedFactors; convert hp⟩).prop
  rwa [associated_iff_eq.mp hq']
state_before: M : Type u_2
inst✝⁷ : CancelCommMonoidWithZero M
N : Type u_1
inst✝⁶ : CancelCommMonoidWithZero N
inst✝⁵ : Unique Mˣ
inst✝⁴ : Unique Nˣ
inst✝³ : UniqueFactorizationMonoid M
inst✝² : UniqueFactorizationMonoid N
inst✝¹ : DecidableEq M
inst✝ : DecidableEq N
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'
⊢ ↑(↑d { val := p, property := (_ : p ∣ m) }) ∈ normalizedFactors n

tactic: have :
  Associates.mk
      (d ⟨associatesEquivOfUniqueUnits (associatesEquivOfUniqueUnits.symm p), by
            simp only [dvd_of_mem_normalizedFactors hp, associatesEquivOfUniqueUnits_apply,
              out_mk, normalize_eq, associatesEquivOfUniqueUnits_symm_apply]⟩ : N) =
    ↑(mkFactorOrderIsoOfFactorDvdEquiv hd
        ⟨associatesEquivOfUniqueUnits.symm p, by
          simp only [associatesEquivOfUniqueUnits_symm_apply]
          exact mk_dvd_mk.mpr (dvd_of_mem_normalizedFactors hp)⟩) := by
  rw [mkFactorOrderIsoOfFactorDvdEquiv_apply_coe]
state_before: M : Type u_2
inst✝⁷ : CancelCommMonoidWithZero M
N : Type u_1
inst✝⁶ : CancelCommMonoidWithZero N
inst✝⁵ : Unique Mˣ
inst✝⁴ : Unique Nˣ
inst✝³ : UniqueFactorizationMonoid M
inst✝² : UniqueFactorizationMonoid N
inst✝¹ : DecidableEq M
inst✝ : DecidableEq N
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'
⊢ Prime
    ↑(↑d
        { val := ↑associatesEquivOfUniqueUnits (↑(MulEquiv.symm associatesEquivOfUniqueUnits) p),
          property := (_ : p * 1 ∣ m) })

tactic: rw [← Associates.prime_mk, this]
state_before: M : Type u_2
inst✝⁷ : CancelCommMonoidWithZero M
N : Type u_1
inst✝⁶ : CancelCommMonoidWithZero N
inst✝⁵ : Unique Mˣ
inst✝⁴ : Unique Nˣ
inst✝³ : UniqueFactorizationMonoid M
inst✝² : UniqueFactorizationMonoid N
inst✝¹ : DecidableEq M
inst✝ : DecidableEq N
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
          { val := ↑associatesEquivOfUniqueUnits (↑(MulEquiv.symm associatesEquivOfUniqueUnits) p),
            property := (_ : ↑normalize p ∣ m) }) =
    ↑(↑(mkFactorOrderIsoOfFactorDvdEquiv hd)
        { val := ↑(MulEquiv.symm associatesEquivOfUniqueUnits) p,
          property := (_ : ↑(MulEquiv.symm associatesEquivOfUniqueUnits) p ∈ Set.Iic (Associates.mk m)) })
⊢ Prime
    ↑(↑d
        { val := ↑associatesEquivOfUniqueUnits (↑(MulEquiv.symm associatesEquivOfUniqueUnits) p),
          property := (_ : p * 1 ∣ m) })

tactic: letI := Classical.decEq (Associates M)
state_before: M : Type u_2
inst✝⁷ : CancelCommMonoidWithZero M
N : Type u_1
inst✝⁶ : CancelCommMonoidWithZero N
inst✝⁵ : Unique Mˣ
inst✝⁴ : Unique Nˣ
inst✝³ : UniqueFactorizationMonoid M
inst✝² : UniqueFactorizationMonoid N
inst✝¹ : DecidableEq M
inst✝ : DecidableEq N
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
          { val := ↑associatesEquivOfUniqueUnits (↑(MulEquiv.symm associatesEquivOfUniqueUnits) p),
            property := (_ : ↑normalize p ∣ m) }) =
    ↑(↑(mkFactorOrderIsoOfFactorDvdEquiv hd)
        { val := ↑(MulEquiv.symm associatesEquivOfUniqueUnits) p,
          property := (_ : ↑(MulEquiv.symm associatesEquivOfUniqueUnits) p ∈ Set.Iic (Associates.mk m)) })
⊢ Prime
    ↑(↑(mkFactorOrderIsoOfFactorDvdEquiv hd)
        { val := ↑(MulEquiv.symm associatesEquivOfUniqueUnits) p,
          property := (_ : ↑(MulEquiv.symm associatesEquivOfUniqueUnits) p ∈ Set.Iic (Associates.mk m)) })

tactic: refine' map_prime_of_factor_orderIso (mk_ne_zero.mpr hn) _ _
state_before: M : Type u_2
inst✝⁷ : CancelCommMonoidWithZero M
N : Type u_1
inst✝⁶ : CancelCommMonoidWithZero N
inst✝⁵ : Unique Mˣ
inst✝⁴ : Unique Nˣ
inst✝³ : UniqueFactorizationMonoid M
inst✝² : UniqueFactorizationMonoid N
inst✝¹ : DecidableEq M
inst✝ : DecidableEq N
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
          { val := ↑associatesEquivOfUniqueUnits (↑(MulEquiv.symm associatesEquivOfUniqueUnits) p),
            property := (_ : ↑normalize p ∣ m) }) =
    ↑(↑(mkFactorOrderIsoOfFactorDvdEquiv hd)
        { val := ↑(MulEquiv.symm associatesEquivOfUniqueUnits) p,
          property := (_ : ↑(MulEquiv.symm associatesEquivOfUniqueUnits) p ∈ Set.Iic (Associates.mk m)) })
this : DecidableEq (Associates M) := Classical.decEq (Associates M)
⊢ Prime
    ↑(↑(mkFactorOrderIsoOfFactorDvdEquiv hd)
        { val := ↑(MulEquiv.symm associatesEquivOfUniqueUnits) p,
          property := (_ : ↑(MulEquiv.symm associatesEquivOfUniqueUnits) p ∈ Set.Iic (Associates.mk m)) })

tactic: obtain ⟨q, hq, hq'⟩ :=
  exists_mem_normalizedFactors_of_dvd (mk_ne_zero.mpr hm)
    ((prime_mk p).mpr (prime_of_normalized_factor p (by convert hp))).irreducible
    (mk_le_mk_of_dvd (dvd_of_mem_normalizedFactors hp))
state_before: M : Type u_2
inst✝⁷ : CancelCommMonoidWithZero M
N : Type u_1
inst✝⁶ : CancelCommMonoidWithZero N
inst✝⁵ : Unique Mˣ
inst✝⁴ : Unique Nˣ
inst✝³ : UniqueFactorizationMonoid M
inst✝² : UniqueFactorizationMonoid N
inst✝¹ : DecidableEq M
inst✝ : DecidableEq N
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
          { val := ↑associatesEquivOfUniqueUnits (↑(MulEquiv.symm associatesEquivOfUniqueUnits) p),
            property := (_ : ↑normalize p ∣ m) }) =
    ↑(↑(mkFactorOrderIsoOfFactorDvdEquiv hd)
        { val := ↑(MulEquiv.symm associatesEquivOfUniqueUnits) p,
          property := (_ : ↑(MulEquiv.symm associatesEquivOfUniqueUnits) p ∈ Set.Iic (Associates.mk m)) })
this : DecidableEq (Associates M) := Classical.decEq (Associates M)
⊢ ↑(MulEquiv.symm associatesEquivOfUniqueUnits) p ∈ normalizedFactors (Associates.mk m)

tactic: simpa only [associated_iff_eq.mp hq', associatesEquivOfUniqueUnits_symm_apply] using hq
state_before: case intro.intro
M : Type u_2
inst✝⁷ : CancelCommMonoidWithZero M
N : Type u_1
inst✝⁶ : CancelCommMonoidWithZero N
inst✝⁵ : Unique Mˣ
inst✝⁴ : Unique Nˣ
inst✝³ : UniqueFactorizationMonoid M
inst✝² : UniqueFactorizationMonoid N
inst✝¹ : DecidableEq M
inst✝ : DecidableEq N
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
          { val := ↑associatesEquivOfUniqueUnits (↑(MulEquiv.symm associatesEquivOfUniqueUnits) p),
            property := (_ : ↑normalize p ∣ m) }) =
    ↑(↑(mkFactorOrderIsoOfFactorDvdEquiv hd)
        { val := ↑(MulEquiv.symm associatesEquivOfUniqueUnits) p,
          property := (_ : ↑(MulEquiv.symm associatesEquivOfUniqueUnits) p ∈ Set.Iic (Associates.mk m)) })
this : DecidableEq (Associates M) := Classical.decEq (Associates M)
q : Associates M
hq : q ∈ normalizedFactors (Associates.mk m)
hq' : Associated (Associates.mk p) q
⊢ ↑(MulEquiv.symm associatesEquivOfUniqueUnits) p ∈ normalizedFactors (Associates.mk m)

tactic: simp [dvd_of_mem_normalizedFactors hp]
state_before: M : Type u_2
inst✝⁷ : CancelCommMonoidWithZero M
N : Type u_1
inst✝⁶ : CancelCommMonoidWithZero N
inst✝⁵ : Unique Mˣ
inst✝⁴ : Unique Nˣ
inst✝³ : UniqueFactorizationMonoid M
inst✝² : UniqueFactorizationMonoid N
inst✝¹ : DecidableEq M
inst✝ : DecidableEq N
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'
⊢ ↑associatesEquivOfUniqueUnits (↑(MulEquiv.symm associatesEquivOfUniqueUnits) p) ∣ m

tactic: simp only [associatesEquivOfUniqueUnits_apply, out_mk, normalize_eq,
  associatesEquivOfUniqueUnits_symm_apply] at this
state_before: M : Type u_2
inst✝⁷ : CancelCommMonoidWithZero M
N : Type u_1
inst✝⁶ : CancelCommMonoidWithZero N
inst✝⁵ : Unique Mˣ
inst✝⁴ : Unique Nˣ
inst✝³ : UniqueFactorizationMonoid M
inst✝² : UniqueFactorizationMonoid N
inst✝¹ : DecidableEq M
inst✝ : DecidableEq N
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 :
  Prime
    ↑(↑d
        { val := ↑associatesEquivOfUniqueUnits (↑(MulEquiv.symm associatesEquivOfUniqueUnits) p),
          property := (_ : p * 1 ∣ m) })
⊢ ↑(↑d { val := p, property := (_ : p ∣ m) }) ∈ normalizedFactors n

tactic: obtain ⟨q, hq, hq'⟩ :=
  exists_mem_normalizedFactors_of_dvd hn this.irreducible
    (d ⟨p, by apply dvd_of_mem_normalizedFactors; convert hp⟩).prop
state_before: M : Type u_2
inst✝⁷ : CancelCommMonoidWithZero M
N : Type u_1
inst✝⁶ : CancelCommMonoidWithZero N
inst✝⁵ : Unique Mˣ
inst✝⁴ : Unique Nˣ
inst✝³ : UniqueFactorizationMonoid M
inst✝² : UniqueFactorizationMonoid N
inst✝¹ : DecidableEq M
inst✝ : DecidableEq N
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 : Prime ↑(↑d { val := p, property := (_ : (fun l => l ∣ m) p) })
⊢ ↑(↑d { val := p, property := (_ : p ∣ m) }) ∈ normalizedFactors n

tactic: rwa [associated_iff_eq.mp hq']
state_before: case intro.intro
M : Type u_2
inst✝⁷ : CancelCommMonoidWithZero M
N : Type u_1
inst✝⁶ : CancelCommMonoidWithZero N
inst✝⁵ : Unique Mˣ
inst✝⁴ : Unique Nˣ
inst✝³ : UniqueFactorizationMonoid M
inst✝² : UniqueFactorizationMonoid N
inst✝¹ : DecidableEq M
inst✝ : DecidableEq N
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 : Prime ↑(↑d { val := p, property := (_ : (fun l => l ∣ m) p) })
q : N
hq : q ∈ normalizedFactors n
hq' : Associated (↑(↑d { val := p, property := (_ : (fun l => l ∣ m) p) })) q
⊢ ↑(↑d { val := p, property := (_ : p ∣ m) }) ∈ normalizedFactors n

tactic: apply dvd_of_mem_normalizedFactors
state_before: M : Type u_2
inst✝⁷ : CancelCommMonoidWithZero M
N : Type u_1
inst✝⁶ : CancelCommMonoidWithZero N
inst✝⁵ : Unique Mˣ
inst✝⁴ : Unique Nˣ
inst✝³ : UniqueFactorizationMonoid M
inst✝² : UniqueFactorizationMonoid N
inst✝¹ : DecidableEq M
inst✝ : DecidableEq N
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 : Prime ↑(↑d { val := p, property := (_ : (fun l => l ∣ m) p) })
⊢ p ∣ m

tactic: convert hp
state_before: case H
M : Type u_2
inst✝⁷ : CancelCommMonoidWithZero M
N : Type u_1
inst✝⁶ : CancelCommMonoidWithZero N
inst✝⁵ : Unique Mˣ
inst✝⁴ : Unique Nˣ
inst✝³ : UniqueFactorizationMonoid M
inst✝² : UniqueFactorizationMonoid N
inst✝¹ : DecidableEq M
inst✝ : DecidableEq N
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 : Prime ↑(↑d { val := p, property := (_ : (fun l => l ∣ m) p) })
⊢ p ∈ normalizedFactors m

tactic: simp only [dvd_of_mem_normalizedFactors hp, associatesEquivOfUniqueUnits_apply,
  out_mk, normalize_eq, associatesEquivOfUniqueUnits_symm_apply]
state_before: M : Type u_2
inst✝⁷ : CancelCommMonoidWithZero M
N : Type u_1
inst✝⁶ : CancelCommMonoidWithZero N
inst✝⁵ : Unique Mˣ
inst✝⁴ : Unique Nˣ
inst✝³ : UniqueFactorizationMonoid M
inst✝² : UniqueFactorizationMonoid N
inst✝¹ : DecidableEq M
inst✝ : DecidableEq N
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'
⊢ ↑associatesEquivOfUniqueUnits (↑(MulEquiv.symm associatesEquivOfUniqueUnits) p) ∣ m

tactic: simp only [associatesEquivOfUniqueUnits_symm_apply]
state_before: M : Type u_2
inst✝⁷ : CancelCommMonoidWithZero M
N : Type u_1
inst✝⁶ : CancelCommMonoidWithZero N
inst✝⁵ : Unique Mˣ
inst✝⁴ : Unique Nˣ
inst✝³ : UniqueFactorizationMonoid M
inst✝² : UniqueFactorizationMonoid N
inst✝¹ : DecidableEq M
inst✝ : DecidableEq N
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'
⊢ ↑(MulEquiv.symm associatesEquivOfUniqueUnits) p ∈ Set.Iic (Associates.mk m)

tactic: exact mk_dvd_mk.mpr (dvd_of_mem_normalizedFactors hp)
state_before: M : Type u_2
inst✝⁷ : CancelCommMonoidWithZero M
N : Type u_1
inst✝⁶ : CancelCommMonoidWithZero N
inst✝⁵ : Unique Mˣ
inst✝⁴ : Unique Nˣ
inst✝³ : UniqueFactorizationMonoid M
inst✝² : UniqueFactorizationMonoid N
inst✝¹ : DecidableEq M
inst✝ : DecidableEq N
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'
⊢ Associates.mk p ∈ Set.Iic (Associates.mk m)

tactic: rw [mkFactorOrderIsoOfFactorDvdEquiv_apply_coe]
state_before: M : Type u_2
inst✝⁷ : CancelCommMonoidWithZero M
N : Type u_1
inst✝⁶ : CancelCommMonoidWithZero N
inst✝⁵ : Unique Mˣ
inst✝⁴ : Unique Nˣ
inst✝³ : UniqueFactorizationMonoid M
inst✝² : UniqueFactorizationMonoid N
inst✝¹ : DecidableEq M
inst✝ : DecidableEq N
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'
⊢ Associates.mk
      ↑(↑d
          { val := ↑associatesEquivOfUniqueUnits (↑(MulEquiv.symm associatesEquivOfUniqueUnits) p),
            property := (_ : ↑normalize p ∣ m) }) =
    ↑(↑(mkFactorOrderIsoOfFactorDvdEquiv hd)
        { val := ↑(MulEquiv.symm associatesEquivOfUniqueUnits) p,
          property := (_ : ↑(MulEquiv.symm associatesEquivOfUniqueUnits) p ∈ Set.Iic (Associates.mk m)) })

tactic: convert hp
state_before: M : Type u_2
inst✝⁷ : CancelCommMonoidWithZero M
N : Type u_1
inst✝⁶ : CancelCommMonoidWithZero N
inst✝⁵ : Unique Mˣ
inst✝⁴ : Unique Nˣ
inst✝³ : UniqueFactorizationMonoid M
inst✝² : UniqueFactorizationMonoid N
inst✝¹ : DecidableEq M
inst✝ : DecidableEq N
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
          { val := ↑associatesEquivOfUniqueUnits (↑(MulEquiv.symm associatesEquivOfUniqueUnits) p),
            property := (_ : ↑normalize p ∣ m) }) =
    ↑(↑(mkFactorOrderIsoOfFactorDvdEquiv hd)
        { val := ↑(MulEquiv.symm associatesEquivOfUniqueUnits) p,
          property := (_ : ↑(MulEquiv.symm associatesEquivOfUniqueUnits) p ∈ Set.Iic (Associates.mk m)) })
this : DecidableEq (Associates M) := Classical.decEq (Associates M)
⊢ p ∈ normalizedFactors ?m.1206562