α : Type u_1
inst✝³ : CancelCommMonoidWithZero α
inst✝² : DecidableEq α
inst✝¹ : NormalizationMonoid α
inst✝ : UniqueFactorizationMonoid α
a : α
⊢ ∀ (x : α),
    x ∈
        Multiset.map (↑normalize)
          (if h : a = 0 then 0 else Classical.choose (_ : ∃ f, (∀ (b : α), b ∈ f → Prime b) ∧ Multiset.prod f ~ᵤ a)) →
      Prime x
α : Type u_1
inst✝³ : CancelCommMonoidWithZero α
inst✝² : DecidableEq α
inst✝¹ : NormalizationMonoid α
inst✝ : UniqueFactorizationMonoid α
a : α
⊢ ∀ (x : α), x ∈ normalizedFactors a → Prime x
rw [normalizedFactors, factors]
case inl
α : Type u_1
inst✝³ : CancelCommMonoidWithZero α
inst✝² : DecidableEq α
inst✝¹ : NormalizationMonoid α
inst✝ : UniqueFactorizationMonoid α
a : α
ane0 : a = 0
⊢ ∀ (x : α), x ∈ Multiset.map (fun x => ↑normalize x) 0 → Prime x

case inr
α : Type u_1
inst✝³ : CancelCommMonoidWithZero α
inst✝² : DecidableEq α
inst✝¹ : NormalizationMonoid α
inst✝ : UniqueFactorizationMonoid α
a : α
ane0 : ¬a = 0
⊢ ∀ (x : α),
    x ∈
        Multiset.map (fun x => ↑normalize x)
          (Classical.choose (_ : ∃ f, (∀ (b : α), b ∈ f → Prime b) ∧ Multiset.prod f ~ᵤ a)) →
      Prime x
α : Type u_1
inst✝³ : CancelCommMonoidWithZero α
inst✝² : DecidableEq α
inst✝¹ : NormalizationMonoid α
inst✝ : UniqueFactorizationMonoid α
a : α
⊢ ∀ (x : α),
    x ∈
        Multiset.map (↑normalize)
          (if h : a = 0 then 0 else Classical.choose (_ : ∃ f, (∀ (b : α), b ∈ f → Prime b) ∧ Multiset.prod f ~ᵤ a)) →
      Prime x
split_ifs with ane0
case inr
α : Type u_1
inst✝³ : CancelCommMonoidWithZero α
inst✝² : DecidableEq α
inst✝¹ : NormalizationMonoid α
inst✝ : UniqueFactorizationMonoid α
a : α
ane0 : ¬a = 0
x : α
hx :
  x ∈
    Multiset.map (fun x => ↑normalize x)
      (Classical.choose (_ : ∃ f, (∀ (b : α), b ∈ f → Prime b) ∧ Multiset.prod f ~ᵤ a))
⊢ Prime x
case inr
α : Type u_1
inst✝³ : CancelCommMonoidWithZero α
inst✝² : DecidableEq α
inst✝¹ : NormalizationMonoid α
inst✝ : UniqueFactorizationMonoid α
a : α
ane0 : ¬a = 0
⊢ ∀ (x : α),
    x ∈
        Multiset.map (fun x => ↑normalize x)
          (Classical.choose (_ : ∃ f, (∀ (b : α), b ∈ f → Prime b) ∧ Multiset.prod f ~ᵤ a)) →
      Prime x
intro x hx
case inr.intro.intro
α : Type u_1
inst✝³ : CancelCommMonoidWithZero α
inst✝² : DecidableEq α
inst✝¹ : NormalizationMonoid α
inst✝ : UniqueFactorizationMonoid α
a : α
ane0 : ¬a = 0
y : α
hy : y ∈ Classical.choose (_ : ∃ f, (∀ (b : α), b ∈ f → Prime b) ∧ Multiset.prod f ~ᵤ a)
hx :
  ↑normalize y ∈
    Multiset.map (fun x => ↑normalize x)
      (Classical.choose (_ : ∃ f, (∀ (b : α), b ∈ f → Prime b) ∧ Multiset.prod f ~ᵤ a))
⊢ Prime (↑normalize y)
case inr
α : Type u_1
inst✝³ : CancelCommMonoidWithZero α
inst✝² : DecidableEq α
inst✝¹ : NormalizationMonoid α
inst✝ : UniqueFactorizationMonoid α
a : α
ane0 : ¬a = 0
x : α
hx :
  x ∈
    Multiset.map (fun x => ↑normalize x)
      (Classical.choose (_ : ∃ f, (∀ (b : α), b ∈ f → Prime b) ∧ Multiset.prod f ~ᵤ a))
⊢ Prime x
rcases Multiset.mem_map.1 hx with ⟨y, ⟨hy, rfl⟩⟩
case inr.intro.intro
α : Type u_1
inst✝³ : CancelCommMonoidWithZero α
inst✝² : DecidableEq α
inst✝¹ : NormalizationMonoid α
inst✝ : UniqueFactorizationMonoid α
a : α
ane0 : ¬a = 0
y : α
hy : y ∈ Classical.choose (_ : ∃ f, (∀ (b : α), b ∈ f → Prime b) ∧ Multiset.prod f ~ᵤ a)
hx :
  ↑normalize y ∈
    Multiset.map (fun x => ↑normalize x)
      (Classical.choose (_ : ∃ f, (∀ (b : α), b ∈ f → Prime b) ∧ Multiset.prod f ~ᵤ a))
⊢ Prime y
case inr.intro.intro
α : Type u_1
inst✝³ : CancelCommMonoidWithZero α
inst✝² : DecidableEq α
inst✝¹ : NormalizationMonoid α
inst✝ : UniqueFactorizationMonoid α
a : α
ane0 : ¬a = 0
y : α
hy : y ∈ Classical.choose (_ : ∃ f, (∀ (b : α), b ∈ f → Prime b) ∧ Multiset.prod f ~ᵤ a)
hx :
  ↑normalize y ∈
    Multiset.map (fun x => ↑normalize x)
      (Classical.choose (_ : ∃ f, (∀ (b : α), b ∈ f → Prime b) ∧ Multiset.prod f ~ᵤ a))
⊢ Prime (↑normalize y)
rw [(normalize_associated _).prime_iff]
no goals
case inr.intro.intro
α : Type u_1
inst✝³ : CancelCommMonoidWithZero α
inst✝² : DecidableEq α
inst✝¹ : NormalizationMonoid α
inst✝ : UniqueFactorizationMonoid α
a : α
ane0 : ¬a = 0
y : α
hy : y ∈ Classical.choose (_ : ∃ f, (∀ (b : α), b ∈ f → Prime b) ∧ Multiset.prod f ~ᵤ a)
hx :
  ↑normalize y ∈
    Multiset.map (fun x => ↑normalize x)
      (Classical.choose (_ : ∃ f, (∀ (b : α), b ∈ f → Prime b) ∧ Multiset.prod f ~ᵤ a))
⊢ Prime y
exact (Classical.choose_spec (UniqueFactorizationMonoid.exists_prime_factors a ane0)).1 y hy
no goals
case inl
α : Type u_1
inst✝³ : CancelCommMonoidWithZero α
inst✝² : DecidableEq α
inst✝¹ : NormalizationMonoid α
inst✝ : UniqueFactorizationMonoid α
a : α
ane0 : a = 0
⊢ ∀ (x : α), x ∈ Multiset.map (fun x => ↑normalize x) 0 → Prime x
simp