α : 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)) →
      ↑normalize x = x
α : Type u_1
inst✝³ : CancelCommMonoidWithZero α
inst✝² : DecidableEq α
inst✝¹ : NormalizationMonoid α
inst✝ : UniqueFactorizationMonoid α
a : α
⊢ ∀ (x : α), x ∈ normalizedFactors a → ↑normalize x = x
rw [normalizedFactors, factors]
case inl
α : Type u_1
inst✝³ : CancelCommMonoidWithZero α
inst✝² : DecidableEq α
inst✝¹ : NormalizationMonoid α
inst✝ : UniqueFactorizationMonoid α
a : α
h : a = 0
⊢ ∀ (x : α), x ∈ Multiset.map (fun x => ↑normalize x) 0 → ↑normalize x = x

case inr
α : Type u_1
inst✝³ : CancelCommMonoidWithZero α
inst✝² : DecidableEq α
inst✝¹ : NormalizationMonoid α
inst✝ : UniqueFactorizationMonoid α
a : α
h : ¬a = 0
⊢ ∀ (x : α),
    x ∈
        Multiset.map (fun x => ↑normalize x)
          (Classical.choose (_ : ∃ f, (∀ (b : α), b ∈ f → Prime b) ∧ Multiset.prod f ~ᵤ a)) →
      ↑normalize x = 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)) →
      ↑normalize x = x
split_ifs with h
case inr
α : Type u_1
inst✝³ : CancelCommMonoidWithZero α
inst✝² : DecidableEq α
inst✝¹ : NormalizationMonoid α
inst✝ : UniqueFactorizationMonoid α
a : α
h : ¬a = 0
x : α
hx :
  x ∈
    Multiset.map (fun x => ↑normalize x)
      (Classical.choose (_ : ∃ f, (∀ (b : α), b ∈ f → Prime b) ∧ Multiset.prod f ~ᵤ a))
⊢ ↑normalize x = x
case inr
α : Type u_1
inst✝³ : CancelCommMonoidWithZero α
inst✝² : DecidableEq α
inst✝¹ : NormalizationMonoid α
inst✝ : UniqueFactorizationMonoid α
a : α
h : ¬a = 0
⊢ ∀ (x : α),
    x ∈
        Multiset.map (fun x => ↑normalize x)
          (Classical.choose (_ : ∃ f, (∀ (b : α), b ∈ f → Prime b) ∧ Multiset.prod f ~ᵤ a)) →
      ↑normalize x = x
intro x hx
case inr.intro.intro
α : Type u_1
inst✝³ : CancelCommMonoidWithZero α
inst✝² : DecidableEq α
inst✝¹ : NormalizationMonoid α
inst✝ : UniqueFactorizationMonoid α
a : α
h : ¬a = 0
y : α
left✝ : 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))
⊢ ↑normalize (↑normalize y) = ↑normalize y
case inr
α : Type u_1
inst✝³ : CancelCommMonoidWithZero α
inst✝² : DecidableEq α
inst✝¹ : NormalizationMonoid α
inst✝ : UniqueFactorizationMonoid α
a : α
h : ¬a = 0
x : α
hx :
  x ∈
    Multiset.map (fun x => ↑normalize x)
      (Classical.choose (_ : ∃ f, (∀ (b : α), b ∈ f → Prime b) ∧ Multiset.prod f ~ᵤ a))
⊢ ↑normalize x = x
obtain ⟨y, _, rfl⟩ := Multiset.mem_map.1 hx
no goals
case inr.intro.intro
α : Type u_1
inst✝³ : CancelCommMonoidWithZero α
inst✝² : DecidableEq α
inst✝¹ : NormalizationMonoid α
inst✝ : UniqueFactorizationMonoid α
a : α
h : ¬a = 0
y : α
left✝ : 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))
⊢ ↑normalize (↑normalize y) = ↑normalize y
apply normalize_idem
no goals
case inl
α : Type u_1
inst✝³ : CancelCommMonoidWithZero α
inst✝² : DecidableEq α
inst✝¹ : NormalizationMonoid α
inst✝ : UniqueFactorizationMonoid α
a : α
h : a = 0
⊢ ∀ (x : α), x ∈ Multiset.map (fun x => ↑normalize x) 0 → ↑normalize x = x
simp