-- Mathlib/RingTheory/UniqueFactorizationDomain/Basic.lean
theorem MulEquiv.uniqueFactorizationMonoid (e : α ≃* β) (hα : UniqueFactorizationMonoid α) :
    UniqueFactorizationMonoid β

Proof state:
α : 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

Tactic:
convert← map_zero e

Result:
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

Proof state:
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]

Result:
no goals

Proof state:
α : 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

Result:
α : 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

Proof state:
α : 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

Tactic:
rw [Multiset.prod_hom, toMonoidHom_eq_coe, Units.coe_map, MonoidHom.coe_coe, ← map_mul e, h,
  apply_symm_apply]

Result:
no goals

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : CancelCommMonoidWithZero β
e : α ≃* β
hα : UniqueFactorizationMonoid α
⊢ UniqueFactorizationMonoid β

Tactic:
rw [UniqueFactorizationMonoid.iff_exists_prime_factors] at hα ⊢

Result:
α : 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

Proof state:
α : 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]

Result:
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

Proof state:
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.2 (hp c hc),
      Units.map e.toMonoidHom u,
    by
      rw [Multiset.prod_hom, toMonoidHom_eq_coe, Units.coe_map, MonoidHom.coe_coe, ← map_mul e, h,
        apply_symm_apply]⟩

Result:
no goals