Theorem: Associates.unique'
File: Mathlib/RingTheory/UniqueFactorizationDomain.lean

tactic: apply Multiset.induction_on_multiset_quot p
state_before: α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : UniqueFactorizationMonoid α
p q : Multiset (Associates α)
⊢ (∀ a ∈ p, Irreducible a) → (∀ a ∈ q, Irreducible a) → p.prod = q.prod → p = q
state_after: α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : UniqueFactorizationMonoid α
p q : Multiset (Associates α)
⊢ ∀ (s : Multiset α),
    (∀ a ∈ Multiset.map (Quot.mk Setoid.r) s, Irreducible a) →
      (∀ a ∈ q, Irreducible a) →
        (Multiset.map (Quot.mk Setoid.r) s).prod = q.prod → Multiset.map (Quot.mk Setoid.r) s = q

tactic: apply Multiset.induction_on_multiset_quot q
state_before: α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : UniqueFactorizationMonoid α
p q : Multiset (Associates α)
⊢ ∀ (s : Multiset α),
    (∀ a ∈ Multiset.map (Quot.mk Setoid.r) s, Irreducible a) →
      (∀ a ∈ q, Irreducible a) →
        (Multiset.map (Quot.mk Setoid.r) s).prod = q.prod → Multiset.map (Quot.mk Setoid.r) s = q
state_after: α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : UniqueFactorizationMonoid α
p q : Multiset (Associates α)
⊢ ∀ (s s_1 : Multiset α),
    (∀ a ∈ Multiset.map (Quot.mk Setoid.r) s_1, Irreducible a) →
      (∀ a ∈ Multiset.map (Quot.mk Setoid.r) s, Irreducible a) →
        (Multiset.map (Quot.mk Setoid.r) s_1).prod = (Multiset.map (Quot.mk Setoid.r) s).prod →
          Multiset.map (Quot.mk Setoid.r) s_1 = Multiset.map (Quot.mk Setoid.r) s

tactic: intro s t hs ht eq
state_before: α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : UniqueFactorizationMonoid α
p q : Multiset (Associates α)
⊢ ∀ (s s_1 : Multiset α),
    (∀ a ∈ Multiset.map (Quot.mk Setoid.r) s_1, Irreducible a) →
      (∀ a ∈ Multiset.map (Quot.mk Setoid.r) s, Irreducible a) →
        (Multiset.map (Quot.mk Setoid.r) s_1).prod = (Multiset.map (Quot.mk Setoid.r) s).prod →
          Multiset.map (Quot.mk Setoid.r) s_1 = Multiset.map (Quot.mk Setoid.r) s
state_after: α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : UniqueFactorizationMonoid α
p q : Multiset (Associates α)
s t : Multiset α
hs : ∀ a ∈ Multiset.map (Quot.mk Setoid.r) t, Irreducible a
ht : ∀ a ∈ Multiset.map (Quot.mk Setoid.r) s, Irreducible a
eq : (Multiset.map (Quot.mk Setoid.r) t).prod = (Multiset.map (Quot.mk Setoid.r) s).prod
⊢ Multiset.map (Quot.mk Setoid.r) t = Multiset.map (Quot.mk Setoid.r) s

tactic: refine Multiset.map_mk_eq_map_mk_of_rel (UniqueFactorizationMonoid.factors_unique ?_ ?_ ?_)
state_before: α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : UniqueFactorizationMonoid α
p q : Multiset (Associates α)
s t : Multiset α
hs : ∀ a ∈ Multiset.map (Quot.mk Setoid.r) t, Irreducible a
ht : ∀ a ∈ Multiset.map (Quot.mk Setoid.r) s, Irreducible a
eq : (Multiset.map (Quot.mk Setoid.r) t).prod = (Multiset.map (Quot.mk Setoid.r) s).prod
⊢ Multiset.map (Quot.mk Setoid.r) t = Multiset.map (Quot.mk Setoid.r) s
state_after: case refine_1
α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : UniqueFactorizationMonoid α
p q : Multiset (Associates α)
s t : Multiset α
hs : ∀ a ∈ Multiset.map (Quot.mk Setoid.r) t, Irreducible a
ht : ∀ a ∈ Multiset.map (Quot.mk Setoid.r) s, Irreducible a
eq : (Multiset.map (Quot.mk Setoid.r) t).prod = (Multiset.map (Quot.mk Setoid.r) s).prod
⊢ ∀ x ∈ t, Irreducible x

case refine_2
α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : UniqueFactorizationMonoid α
p q : Multiset (Associates α)
s t : Multiset α
hs : ∀ a ∈ Multiset.map (Quot.mk Setoid.r) t, Irreducible a
ht : ∀ a ∈ Multiset.map (Quot.mk Setoid.r) s, Irreducible a
eq : (Multiset.map (Quot.mk Setoid.r) t).prod = (Multiset.map (Quot.mk Setoid.r) s).prod
⊢ ∀ x ∈ s, Irreducible x

case refine_3
α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : UniqueFactorizationMonoid α
p q : Multiset (Associates α)
s t : Multiset α
hs : ∀ a ∈ Multiset.map (Quot.mk Setoid.r) t, Irreducible a
ht : ∀ a ∈ Multiset.map (Quot.mk Setoid.r) s, Irreducible a
eq : (Multiset.map (Quot.mk Setoid.r) t).prod = (Multiset.map (Quot.mk Setoid.r) s).prod
⊢ t.prod ~ᵤ s.prod

tactic: have eq' : (Quot.mk Setoid.r : α → Associates α) = Associates.mk := funext quot_mk_eq_mk
state_before: case refine_3
α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : UniqueFactorizationMonoid α
p q : Multiset (Associates α)
s t : Multiset α
hs : ∀ a ∈ Multiset.map (Quot.mk Setoid.r) t, Irreducible a
ht : ∀ a ∈ Multiset.map (Quot.mk Setoid.r) s, Irreducible a
eq : (Multiset.map (Quot.mk Setoid.r) t).prod = (Multiset.map (Quot.mk Setoid.r) s).prod
⊢ t.prod ~ᵤ s.prod
state_after: case refine_3
α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : UniqueFactorizationMonoid α
p q : Multiset (Associates α)
s t : Multiset α
hs : ∀ a ∈ Multiset.map (Quot.mk Setoid.r) t, Irreducible a
ht : ∀ a ∈ Multiset.map (Quot.mk Setoid.r) s, Irreducible a
eq : (Multiset.map (Quot.mk Setoid.r) t).prod = (Multiset.map (Quot.mk Setoid.r) s).prod
eq' : Quot.mk Setoid.r = Associates.mk
⊢ t.prod ~ᵤ s.prod

tactic: rwa [eq', prod_mk, prod_mk, mk_eq_mk_iff_associated] at eq
state_before: case refine_3
α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : UniqueFactorizationMonoid α
p q : Multiset (Associates α)
s t : Multiset α
hs : ∀ a ∈ Multiset.map (Quot.mk Setoid.r) t, Irreducible a
ht : ∀ a ∈ Multiset.map (Quot.mk Setoid.r) s, Irreducible a
eq : (Multiset.map (Quot.mk Setoid.r) t).prod = (Multiset.map (Quot.mk Setoid.r) s).prod
eq' : Quot.mk Setoid.r = Associates.mk
⊢ t.prod ~ᵤ s.prod
state_after: no goals

tactic: exact fun a ha => irreducible_mk.1 <| hs _ <| Multiset.mem_map_of_mem _ ha
state_before: case refine_1
α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : UniqueFactorizationMonoid α
p q : Multiset (Associates α)
s t : Multiset α
hs : ∀ a ∈ Multiset.map (Quot.mk Setoid.r) t, Irreducible a
ht : ∀ a ∈ Multiset.map (Quot.mk Setoid.r) s, Irreducible a
eq : (Multiset.map (Quot.mk Setoid.r) t).prod = (Multiset.map (Quot.mk Setoid.r) s).prod
⊢ ∀ x ∈ t, Irreducible x
state_after: no goals

tactic: exact fun a ha => irreducible_mk.1 <| ht _ <| Multiset.mem_map_of_mem _ ha
state_before: case refine_2
α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : UniqueFactorizationMonoid α
p q : Multiset (Associates α)
s t : Multiset α
hs : ∀ a ∈ Multiset.map (Quot.mk Setoid.r) t, Irreducible a
ht : ∀ a ∈ Multiset.map (Quot.mk Setoid.r) s, Irreducible a
eq : (Multiset.map (Quot.mk Setoid.r) t).prod = (Multiset.map (Quot.mk Setoid.r) s).prod
⊢ ∀ x ∈ s, Irreducible x
state_after: no goals