Theorem: Associates.prod_le_prod_iff_le
File: Mathlib/RingTheory/UniqueFactorizationDomain.lean

tactic: rintro ⟨c, eqc⟩
state_before: α : Type u_1
inst✝² : CancelCommMonoidWithZero α
dec_irr : (p : Associates α) → Decidable (Irreducible p)
inst✝¹ : UniqueFactorizationMonoid α
inst✝ : Nontrivial α
p q : Multiset (Associates α)
hp : ∀ (a : Associates α), a ∈ p → Irreducible a
hq : ∀ (a : Associates α), a ∈ q → Irreducible a
⊢ prod p ≤ prod q → p ≤ q

tactic: refine' Multiset.le_iff_exists_add.2 ⟨factors c, unique' hq (fun x hx => _) _⟩
state_before: case intro
α : Type u_1
inst✝² : CancelCommMonoidWithZero α
dec_irr : (p : Associates α) → Decidable (Irreducible p)
inst✝¹ : UniqueFactorizationMonoid α
inst✝ : Nontrivial α
p q : Multiset (Associates α)
hp : ∀ (a : Associates α), a ∈ p → Irreducible a
hq : ∀ (a : Associates α), a ∈ q → Irreducible a
c : Associates α
eqc : prod q = prod p * c
⊢ p ≤ q

tactic: obtain h | h := Multiset.mem_add.1 hx
state_before: case intro.refine'_1
α : Type u_1
inst✝² : CancelCommMonoidWithZero α
dec_irr : (p : Associates α) → Decidable (Irreducible p)
inst✝¹ : UniqueFactorizationMonoid α
inst✝ : Nontrivial α
p q : Multiset (Associates α)
hp : ∀ (a : Associates α), a ∈ p → Irreducible a
hq : ∀ (a : Associates α), a ∈ q → Irreducible a
c : Associates α
eqc : prod q = prod p * c
x : Associates α
hx : x ∈ p + factors c
⊢ Irreducible x

tactic: exact hp x h
state_before: case intro.refine'_1.inl
α : Type u_1
inst✝² : CancelCommMonoidWithZero α
dec_irr : (p : Associates α) → Decidable (Irreducible p)
inst✝¹ : UniqueFactorizationMonoid α
inst✝ : Nontrivial α
p q : Multiset (Associates α)
hp : ∀ (a : Associates α), a ∈ p → Irreducible a
hq : ∀ (a : Associates α), a ∈ q → Irreducible a
c : Associates α
eqc : prod q = prod p * c
x : Associates α
hx : x ∈ p + factors c
h : x ∈ p
⊢ Irreducible x

tactic: exact irreducible_of_factor _ h
state_before: case intro.refine'_1.inr
α : Type u_1
inst✝² : CancelCommMonoidWithZero α
dec_irr : (p : Associates α) → Decidable (Irreducible p)
inst✝¹ : UniqueFactorizationMonoid α
inst✝ : Nontrivial α
p q : Multiset (Associates α)
hp : ∀ (a : Associates α), a ∈ p → Irreducible a
hq : ∀ (a : Associates α), a ∈ q → Irreducible a
c : Associates α
eqc : prod q = prod p * c
x : Associates α
hx : x ∈ p + factors c
h : x ∈ factors c
⊢ Irreducible x

tactic: rw [eqc, Multiset.prod_add]
state_before: case intro.refine'_2
α : Type u_1
inst✝² : CancelCommMonoidWithZero α
dec_irr : (p : Associates α) → Decidable (Irreducible p)
inst✝¹ : UniqueFactorizationMonoid α
inst✝ : Nontrivial α
p q : Multiset (Associates α)
hp : ∀ (a : Associates α), a ∈ p → Irreducible a
hq : ∀ (a : Associates α), a ∈ q → Irreducible a
c : Associates α
eqc : prod q = prod p * c
⊢ prod q = prod (p + factors c)

tactic: congr
state_before: case intro.refine'_2
α : Type u_1
inst✝² : CancelCommMonoidWithZero α
dec_irr : (p : Associates α) → Decidable (Irreducible p)
inst✝¹ : UniqueFactorizationMonoid α
inst✝ : Nontrivial α
p q : Multiset (Associates α)
hp : ∀ (a : Associates α), a ∈ p → Irreducible a
hq : ∀ (a : Associates α), a ∈ q → Irreducible a
c : Associates α
eqc : prod q = prod p * c
⊢ prod p * c = prod p * prod (factors c)

tactic: refine' associated_iff_eq.mp (factors_prod fun hc => _).symm
state_before: case intro.refine'_2.e_a
α : Type u_1
inst✝² : CancelCommMonoidWithZero α
dec_irr : (p : Associates α) → Decidable (Irreducible p)
inst✝¹ : UniqueFactorizationMonoid α
inst✝ : Nontrivial α
p q : Multiset (Associates α)
hp : ∀ (a : Associates α), a ∈ p → Irreducible a
hq : ∀ (a : Associates α), a ∈ q → Irreducible a
c : Associates α
eqc : prod q = prod p * c
⊢ c = prod (factors c)

tactic: refine' not_irreducible_zero (hq _ _)
state_before: case intro.refine'_2.e_a
α : Type u_1
inst✝² : CancelCommMonoidWithZero α
dec_irr : (p : Associates α) → Decidable (Irreducible p)
inst✝¹ : UniqueFactorizationMonoid α
inst✝ : Nontrivial α
p q : Multiset (Associates α)
hp : ∀ (a : Associates α), a ∈ p → Irreducible a
hq : ∀ (a : Associates α), a ∈ q → Irreducible a
c : Associates α
eqc : prod q = prod p * c
hc : c = 0
⊢ False

tactic: rw [← prod_eq_zero_iff, eqc, hc, MulZeroClass.mul_zero]
state_before: case intro.refine'_2.e_a
α : Type u_1
inst✝² : CancelCommMonoidWithZero α
dec_irr : (p : Associates α) → Decidable (Irreducible p)
inst✝¹ : UniqueFactorizationMonoid α
inst✝ : Nontrivial α
p q : Multiset (Associates α)
hp : ∀ (a : Associates α), a ∈ p → Irreducible a
hq : ∀ (a : Associates α), a ∈ q → Irreducible a
c : Associates α
eqc : prod q = prod p * c
hc : c = 0
⊢ 0 ∈ q