Theorem: Multiset.gcd_eq_zero_iff
File: Mathlib/Algebra/GCDMonoid/Multiset.lean

tactic: constructor
state_before: α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : NormalizedGCDMonoid α
s : Multiset α
⊢ s.gcd = 0 ↔ ∀ x ∈ s, x = 0
state_after: case mp
α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : NormalizedGCDMonoid α
s : Multiset α
⊢ s.gcd = 0 → ∀ x ∈ s, x = 0

case mpr
α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : NormalizedGCDMonoid α
s : Multiset α
⊢ (∀ x ∈ s, x = 0) → s.gcd = 0

tactic: intro h x hx
state_before: case mp
α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : NormalizedGCDMonoid α
s : Multiset α
⊢ s.gcd = 0 → ∀ x ∈ s, x = 0
state_after: case mp
α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : NormalizedGCDMonoid α
s : Multiset α
h : s.gcd = 0
x : α
hx : x ∈ s
⊢ x = 0

tactic: apply eq_zero_of_zero_dvd
state_before: case mp
α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : NormalizedGCDMonoid α
s : Multiset α
h : s.gcd = 0
x : α
hx : x ∈ s
⊢ x = 0
state_after: case mp.h
α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : NormalizedGCDMonoid α
s : Multiset α
h : s.gcd = 0
x : α
hx : x ∈ s
⊢ 0 ∣ x

tactic: rw [← h]
state_before: case mp.h
α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : NormalizedGCDMonoid α
s : Multiset α
h : s.gcd = 0
x : α
hx : x ∈ s
⊢ 0 ∣ x
state_after: case mp.h
α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : NormalizedGCDMonoid α
s : Multiset α
h : s.gcd = 0
x : α
hx : x ∈ s
⊢ s.gcd ∣ x

tactic: apply gcd_dvd hx
state_before: case mp.h
α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : NormalizedGCDMonoid α
s : Multiset α
h : s.gcd = 0
x : α
hx : x ∈ s
⊢ s.gcd ∣ x
state_after: no goals

tactic: refine s.induction_on ?_ ?_
state_before: case mpr
α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : NormalizedGCDMonoid α
s : Multiset α
⊢ (∀ x ∈ s, x = 0) → s.gcd = 0
state_after: case mpr.refine_1
α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : NormalizedGCDMonoid α
s : Multiset α
⊢ (∀ x ∈ 0, x = 0) → gcd 0 = 0

case mpr.refine_2
α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : NormalizedGCDMonoid α
s : Multiset α
⊢ ∀ (a : α) (s : Multiset α), ((∀ x ∈ s, x = 0) → s.gcd = 0) → (∀ x ∈ a ::ₘ s, x = 0) → (a ::ₘ s).gcd = 0

tactic: intro a s sgcd h
state_before: case mpr.refine_2
α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : NormalizedGCDMonoid α
s : Multiset α
⊢ ∀ (a : α) (s : Multiset α), ((∀ x ∈ s, x = 0) → s.gcd = 0) → (∀ x ∈ a ::ₘ s, x = 0) → (a ::ₘ s).gcd = 0
state_after: case mpr.refine_2
α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : NormalizedGCDMonoid α
s✝ : Multiset α
a : α
s : Multiset α
sgcd : (∀ x ∈ s, x = 0) → s.gcd = 0
h : ∀ x ∈ a ::ₘ s, x = 0
⊢ (a ::ₘ s).gcd = 0

tactic: simp [h a (mem_cons_self a s), sgcd fun x hx ↦ h x (mem_cons_of_mem hx)]
state_before: case mpr.refine_2
α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : NormalizedGCDMonoid α
s✝ : Multiset α
a : α
s : Multiset α
sgcd : (∀ x ∈ s, x = 0) → s.gcd = 0
h : ∀ x ∈ a ::ₘ s, x = 0
⊢ (a ::ₘ s).gcd = 0
state_after: no goals

tactic: simp
state_before: case mpr.refine_1
α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : NormalizedGCDMonoid α
s : Multiset α
⊢ (∀ x ∈ 0, x = 0) → gcd 0 = 0
state_after: no goals