Theorem: UniqueFactorizationMonoid.normalizedFactors_prod_eq
File: Mathlib/RingTheory/UniqueFactorizationDomain.lean

tactic: induction' s using Multiset.induction with a s ih
state_before: α : Type u_1
inst✝³ : CancelCommMonoidWithZero α
inst✝² : DecidableEq α
inst✝¹ : NormalizationMonoid α
inst✝ : UniqueFactorizationMonoid α
s : Multiset α
hs : ∀ (a : α), a ∈ s → Irreducible a
⊢ normalizedFactors (Multiset.prod s) = Multiset.map (↑normalize) s

tactic: rw [Multiset.prod_zero, normalizedFactors_one, Multiset.map_zero]
state_before: case empty
α : Type u_1
inst✝³ : CancelCommMonoidWithZero α
inst✝² : DecidableEq α
inst✝¹ : NormalizationMonoid α
inst✝ : UniqueFactorizationMonoid α
s : Multiset α
hs✝ : ∀ (a : α), a ∈ s → Irreducible a
hs : ∀ (a : α), a ∈ 0 → Irreducible a
⊢ normalizedFactors (Multiset.prod 0) = Multiset.map (↑normalize) 0

tactic: have ia := hs a (Multiset.mem_cons_self a _)
state_before: case cons
α : Type u_1
inst✝³ : CancelCommMonoidWithZero α
inst✝² : DecidableEq α
inst✝¹ : NormalizationMonoid α
inst✝ : UniqueFactorizationMonoid α
s✝ : Multiset α
hs✝ : ∀ (a : α), a ∈ s✝ → Irreducible a
a : α
s : Multiset α
ih : (∀ (a : α), a ∈ s → Irreducible a) → normalizedFactors (Multiset.prod s) = Multiset.map (↑normalize) s
hs : ∀ (a_1 : α), a_1 ∈ a ::ₘ s → Irreducible a_1
⊢ normalizedFactors (Multiset.prod (a ::ₘ s)) = Multiset.map (↑normalize) (a ::ₘ s)

tactic: have ib := fun b h => hs b (Multiset.mem_cons_of_mem h)
state_before: case cons
α : Type u_1
inst✝³ : CancelCommMonoidWithZero α
inst✝² : DecidableEq α
inst✝¹ : NormalizationMonoid α
inst✝ : UniqueFactorizationMonoid α
s✝ : Multiset α
hs✝ : ∀ (a : α), a ∈ s✝ → Irreducible a
a : α
s : Multiset α
ih : (∀ (a : α), a ∈ s → Irreducible a) → normalizedFactors (Multiset.prod s) = Multiset.map (↑normalize) s
hs : ∀ (a_1 : α), a_1 ∈ a ::ₘ s → Irreducible a_1
ia : Irreducible a
⊢ normalizedFactors (Multiset.prod (a ::ₘ s)) = Multiset.map (↑normalize) (a ::ₘ s)

tactic: obtain rfl | ⟨b, hb⟩ := s.empty_or_exists_mem
state_before: case cons
α : Type u_1
inst✝³ : CancelCommMonoidWithZero α
inst✝² : DecidableEq α
inst✝¹ : NormalizationMonoid α
inst✝ : UniqueFactorizationMonoid α
s✝ : Multiset α
hs✝ : ∀ (a : α), a ∈ s✝ → Irreducible a
a : α
s : Multiset α
ih : (∀ (a : α), a ∈ s → Irreducible a) → normalizedFactors (Multiset.prod s) = Multiset.map (↑normalize) s
hs : ∀ (a_1 : α), a_1 ∈ a ::ₘ s → Irreducible a_1
ia : Irreducible a
ib : ∀ (b : α), b ∈ s → Irreducible b
⊢ normalizedFactors (Multiset.prod (a ::ₘ s)) = Multiset.map (↑normalize) (a ::ₘ s)

tactic: haveI := nontrivial_of_ne b 0 (ib b hb).ne_zero
state_before: case cons.inr.intro
α : Type u_1
inst✝³ : CancelCommMonoidWithZero α
inst✝² : DecidableEq α
inst✝¹ : NormalizationMonoid α
inst✝ : UniqueFactorizationMonoid α
s✝ : Multiset α
hs✝ : ∀ (a : α), a ∈ s✝ → Irreducible a
a : α
s : Multiset α
ih : (∀ (a : α), a ∈ s → Irreducible a) → normalizedFactors (Multiset.prod s) = Multiset.map (↑normalize) s
hs : ∀ (a_1 : α), a_1 ∈ a ::ₘ s → Irreducible a_1
ia : Irreducible a
ib : ∀ (b : α), b ∈ s → Irreducible b
b : α
hb : b ∈ s
⊢ normalizedFactors (Multiset.prod (a ::ₘ s)) = Multiset.map (↑normalize) (a ::ₘ s)

tactic: rw [Multiset.prod_cons, Multiset.map_cons,
  normalizedFactors_mul ia.ne_zero (Multiset.prod_ne_zero fun h => (ib 0 h).ne_zero rfl),
  normalizedFactors_irreducible ia, ih ib, Multiset.singleton_add]
state_before: case cons.inr.intro
α : Type u_1
inst✝³ : CancelCommMonoidWithZero α
inst✝² : DecidableEq α
inst✝¹ : NormalizationMonoid α
inst✝ : UniqueFactorizationMonoid α
s✝ : Multiset α
hs✝ : ∀ (a : α), a ∈ s✝ → Irreducible a
a : α
s : Multiset α
ih : (∀ (a : α), a ∈ s → Irreducible a) → normalizedFactors (Multiset.prod s) = Multiset.map (↑normalize) s
hs : ∀ (a_1 : α), a_1 ∈ a ::ₘ s → Irreducible a_1
ia : Irreducible a
ib : ∀ (b : α), b ∈ s → Irreducible b
b : α
hb : b ∈ s
this : Nontrivial α
⊢ normalizedFactors (Multiset.prod (a ::ₘ s)) = Multiset.map (↑normalize) (a ::ₘ s)

tactic: rw [Multiset.cons_zero, Multiset.prod_singleton, Multiset.map_singleton,
  normalizedFactors_irreducible ia]
state_before: case cons.inl
α : Type u_1
inst✝³ : CancelCommMonoidWithZero α
inst✝² : DecidableEq α
inst✝¹ : NormalizationMonoid α
inst✝ : UniqueFactorizationMonoid α
s : Multiset α
hs✝ : ∀ (a : α), a ∈ s → Irreducible a
a : α
ia : Irreducible a
ih : (∀ (a : α), a ∈ 0 → Irreducible a) → normalizedFactors (Multiset.prod 0) = Multiset.map (↑normalize) 0
hs : ∀ (a_1 : α), a_1 ∈ a ::ₘ 0 → Irreducible a_1
ib : ∀ (b : α), b ∈ 0 → Irreducible b
⊢ normalizedFactors (Multiset.prod (a ::ₘ 0)) = Multiset.map (↑normalize) (a ::ₘ 0)