-- Mathlib/RingTheory/UniqueFactorizationDomain/NormalizedFactors.lean
theorem prime_of_normalized_factor {a : α} : ∀ x : α, x ∈ normalizedFactors a → Prime x

Proof state:
case neg.intro.intro
α : Type u_1
inst✝² : CancelCommMonoidWithZero α
inst✝¹ : NormalizationMonoid α
inst✝ : UniqueFactorizationMonoid α
a : α
ane0 : ¬a = 0
y : α
hy : y ∈ Classical.choose ⋯
hx : normalize y ∈ Multiset.map (fun x => normalize x) (Classical.choose ⋯)
⊢ Prime y

Tactic:
exact (Classical.choose_spec (UniqueFactorizationMonoid.exists_prime_factors a ane0)).1 y hy

Result:
no goals

Proof state:
case neg.intro.intro
α : Type u_1
inst✝² : CancelCommMonoidWithZero α
inst✝¹ : NormalizationMonoid α
inst✝ : UniqueFactorizationMonoid α
a : α
ane0 : ¬a = 0
y : α
hy : y ∈ Classical.choose ⋯
hx : normalize y ∈ Multiset.map (fun x => normalize x) (Classical.choose ⋯)
⊢ Prime (normalize y)

Tactic:
rw [(normalize_associated _).prime_iff]

Result:
case neg.intro.intro
α : Type u_1
inst✝² : CancelCommMonoidWithZero α
inst✝¹ : NormalizationMonoid α
inst✝ : UniqueFactorizationMonoid α
a : α
ane0 : ¬a = 0
y : α
hy : y ∈ Classical.choose ⋯
hx : normalize y ∈ Multiset.map (fun x => normalize x) (Classical.choose ⋯)
⊢ Prime y

Proof state:
α : Type u_1
inst✝² : CancelCommMonoidWithZero α
inst✝¹ : NormalizationMonoid α
inst✝ : UniqueFactorizationMonoid α
a : α
⊢ ∀ x ∈ Multiset.map (⇑normalize) (if h : a = 0 then 0 else Classical.choose ⋯), Prime x

Tactic:
split_ifs with ane0

Result:
case pos
α : Type u_1
inst✝² : CancelCommMonoidWithZero α
inst✝¹ : NormalizationMonoid α
inst✝ : UniqueFactorizationMonoid α
a : α
ane0 : a = 0
⊢ ∀ x ∈ Multiset.map (fun x => normalize x) 0, Prime x

case neg
α : Type u_1
inst✝² : CancelCommMonoidWithZero α
inst✝¹ : NormalizationMonoid α
inst✝ : UniqueFactorizationMonoid α
a : α
ane0 : ¬a = 0
⊢ ∀ x ∈ Multiset.map (fun x => normalize x) (Classical.choose ⋯), Prime x

Proof state:
α : Type u_1
inst✝² : CancelCommMonoidWithZero α
inst✝¹ : NormalizationMonoid α
inst✝ : UniqueFactorizationMonoid α
a : α
⊢ ∀ x ∈ normalizedFactors a, Prime x

Tactic:
rw [normalizedFactors, factors]

Result:
α : Type u_1
inst✝² : CancelCommMonoidWithZero α
inst✝¹ : NormalizationMonoid α
inst✝ : UniqueFactorizationMonoid α
a : α
⊢ ∀ x ∈ Multiset.map (⇑normalize) (if h : a = 0 then 0 else Classical.choose ⋯), Prime x

Proof state:
case neg
α : Type u_1
inst✝² : CancelCommMonoidWithZero α
inst✝¹ : NormalizationMonoid α
inst✝ : UniqueFactorizationMonoid α
a : α
ane0 : ¬a = 0
x : α
hx : x ∈ Multiset.map (fun x => normalize x) (Classical.choose ⋯)
⊢ Prime x

Tactic:
rcases Multiset.mem_map.1 hx with ⟨y, ⟨hy, rfl⟩⟩

Result:
case neg.intro.intro
α : Type u_1
inst✝² : CancelCommMonoidWithZero α
inst✝¹ : NormalizationMonoid α
inst✝ : UniqueFactorizationMonoid α
a : α
ane0 : ¬a = 0
y : α
hy : y ∈ Classical.choose ⋯
hx : normalize y ∈ Multiset.map (fun x => normalize x) (Classical.choose ⋯)
⊢ Prime (normalize y)

Proof state:
case neg
α : Type u_1
inst✝² : CancelCommMonoidWithZero α
inst✝¹ : NormalizationMonoid α
inst✝ : UniqueFactorizationMonoid α
a : α
ane0 : ¬a = 0
⊢ ∀ x ∈ Multiset.map (fun x => normalize x) (Classical.choose ⋯), Prime x

Tactic:
intro x hx

Result:
case neg
α : Type u_1
inst✝² : CancelCommMonoidWithZero α
inst✝¹ : NormalizationMonoid α
inst✝ : UniqueFactorizationMonoid α
a : α
ane0 : ¬a = 0
x : α
hx : x ∈ Multiset.map (fun x => normalize x) (Classical.choose ⋯)
⊢ Prime x

Proof state:
case pos
α : Type u_1
inst✝² : CancelCommMonoidWithZero α
inst✝¹ : NormalizationMonoid α
inst✝ : UniqueFactorizationMonoid α
a : α
ane0 : a = 0
⊢ ∀ x ∈ Multiset.map (fun x => normalize x) 0, Prime x

Tactic:
simp

Result:
no goals