Theorem: MulEquiv.uniqueFactorizationMonoid
File: Mathlib/RingTheory/UniqueFactorizationDomain.lean

tactic: rw [UniqueFactorizationMonoid.iff_exists_prime_factors] at hα ⊢
state_before: α : Type u_1
β : Type u_2
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : CancelCommMonoidWithZero β
e : α ≃* β
hα : UniqueFactorizationMonoid α
⊢ UniqueFactorizationMonoid β
state_after: α : Type u_1
β : Type u_2
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : CancelCommMonoidWithZero β
e : α ≃* β
hα : ∀ (a : α), a ≠ 0 → ∃ f, (∀ b ∈ f, Prime b) ∧ f.prod ~ᵤ a
⊢ ∀ (a : β), a ≠ 0 → ∃ f, (∀ b ∈ f, Prime b) ∧ f.prod ~ᵤ a

tactic: intro a ha
state_before: α : Type u_1
β : Type u_2
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : CancelCommMonoidWithZero β
e : α ≃* β
hα : ∀ (a : α), a ≠ 0 → ∃ f, (∀ b ∈ f, Prime b) ∧ f.prod ~ᵤ a
⊢ ∀ (a : β), a ≠ 0 → ∃ f, (∀ b ∈ f, Prime b) ∧ f.prod ~ᵤ a
state_after: α : Type u_1
β : Type u_2
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : CancelCommMonoidWithZero β
e : α ≃* β
hα : ∀ (a : α), a ≠ 0 → ∃ f, (∀ b ∈ f, Prime b) ∧ f.prod ~ᵤ a
a : β
ha : a ≠ 0
⊢ ∃ f, (∀ b ∈ f, Prime b) ∧ f.prod ~ᵤ a

tactic: obtain ⟨w, hp, u, h⟩ :=
  hα (e.symm a) fun h =>
    ha <| by
      convert← map_zero e
      simp [← h]
state_before: α : Type u_1
β : Type u_2
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : CancelCommMonoidWithZero β
e : α ≃* β
hα : ∀ (a : α), a ≠ 0 → ∃ f, (∀ b ∈ f, Prime b) ∧ f.prod ~ᵤ a
a : β
ha : a ≠ 0
⊢ ∃ f, (∀ b ∈ f, Prime b) ∧ f.prod ~ᵤ a
state_after: case intro.intro.intro
α : Type u_1
β : Type u_2
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : CancelCommMonoidWithZero β
e : α ≃* β
hα : ∀ (a : α), a ≠ 0 → ∃ f, (∀ b ∈ f, Prime b) ∧ f.prod ~ᵤ a
a : β
ha : a ≠ 0
w : Multiset α
hp : ∀ b ∈ w, Prime b
u : αˣ
h : w.prod * ↑u = e.symm a
⊢ ∃ f, (∀ b ∈ f, Prime b) ∧ f.prod ~ᵤ a

tactic: exact
  ⟨w.map e, fun b hb =>
      let ⟨c, hc, he⟩ := Multiset.mem_map.1 hb
      he ▸ e.prime_iff.1 (hp c hc),
      Units.map e.toMonoidHom u,
    by
      erw [Multiset.prod_hom, ← e.map_mul, h]
      simp⟩
state_before: case intro.intro.intro
α : Type u_1
β : Type u_2
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : CancelCommMonoidWithZero β
e : α ≃* β
hα : ∀ (a : α), a ≠ 0 → ∃ f, (∀ b ∈ f, Prime b) ∧ f.prod ~ᵤ a
a : β
ha : a ≠ 0
w : Multiset α
hp : ∀ b ∈ w, Prime b
u : αˣ
h : w.prod * ↑u = e.symm a
⊢ ∃ f, (∀ b ∈ f, Prime b) ∧ f.prod ~ᵤ a
state_after: no goals

tactic: convert← map_zero e
state_before: α : Type u_1
β : Type u_2
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : CancelCommMonoidWithZero β
e : α ≃* β
hα : ∀ (a : α), a ≠ 0 → ∃ f, (∀ b ∈ f, Prime b) ∧ f.prod ~ᵤ a
a : β
ha : a ≠ 0
h : e.symm a = 0
⊢ a = 0
state_after: case h.e'_2
α : Type u_1
β : Type u_2
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : CancelCommMonoidWithZero β
e : α ≃* β
hα : ∀ (a : α), a ≠ 0 → ∃ f, (∀ b ∈ f, Prime b) ∧ f.prod ~ᵤ a
a : β
ha : a ≠ 0
h : e.symm a = 0
⊢ e 0 = a

tactic: simp [← h]
state_before: case h.e'_2
α : Type u_1
β : Type u_2
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : CancelCommMonoidWithZero β
e : α ≃* β
hα : ∀ (a : α), a ≠ 0 → ∃ f, (∀ b ∈ f, Prime b) ∧ f.prod ~ᵤ a
a : β
ha : a ≠ 0
h : e.symm a = 0
⊢ e 0 = a
state_after: no goals

tactic: erw [Multiset.prod_hom, ← e.map_mul, h]
state_before: α : Type u_1
β : Type u_2
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : CancelCommMonoidWithZero β
e : α ≃* β
hα : ∀ (a : α), a ≠ 0 → ∃ f, (∀ b ∈ f, Prime b) ∧ f.prod ~ᵤ a
a : β
ha : a ≠ 0
w : Multiset α
hp : ∀ b ∈ w, Prime b
u : αˣ
h : w.prod * ↑u = e.symm a
⊢ (Multiset.map (⇑e) w).prod * ↑((Units.map e.toMonoidHom) u) = a
state_after: α : Type u_1
β : Type u_2
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : CancelCommMonoidWithZero β
e : α ≃* β
hα : ∀ (a : α), a ≠ 0 → ∃ f, (∀ b ∈ f, Prime b) ∧ f.prod ~ᵤ a
a : β
ha : a ≠ 0
w : Multiset α
hp : ∀ b ∈ w, Prime b
u : αˣ
h : w.prod * ↑u = e.symm a
⊢ e (e.symm a) = a

tactic: simp
state_before: α : Type u_1
β : Type u_2
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : CancelCommMonoidWithZero β
e : α ≃* β
hα : ∀ (a : α), a ≠ 0 → ∃ f, (∀ b ∈ f, Prime b) ∧ f.prod ~ᵤ a
a : β
ha : a ≠ 0
w : Multiset α
hp : ∀ b ∈ w, Prime b
u : αˣ
h : w.prod * ↑u = e.symm a
⊢ e (e.symm a) = a
state_after: no goals