Theorem: Multiset.prod_primes_dvd
File: Mathlib/Algebra/BigOperators/Associated.lean

tactic: induction' s using Multiset.induction_on with a s induct n primes divs generalizing n
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : (a : α) → DecidablePred (Associated a)
s : Multiset α
n : α
h : ∀ a ∈ s, Prime a
div : ∀ a ∈ s, a ∣ n
uniq : ∀ (a : α), countP (Associated a) s ≤ 1
⊢ s.prod ∣ n
state_after: case empty
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : (a : α) → DecidablePred (Associated a)
n : α
h : ∀ a ∈ 0, Prime a
div : ∀ a ∈ 0, a ∣ n
uniq : ∀ (a : α), countP (Associated a) 0 ≤ 1
⊢ prod 0 ∣ n

case cons
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : (a : α) → DecidablePred (Associated a)
a : α
s : Multiset α
induct : ∀ (n : α), (∀ a ∈ s, Prime a) → (∀ a ∈ s, a ∣ n) → (∀ (a : α), countP (Associated a) s ≤ 1) → s.prod ∣ n
n : α
h : ∀ a_1 ∈ a ::ₘ s, Prime a_1
div : ∀ a_1 ∈ a ::ₘ s, a_1 ∣ n
uniq : ∀ (a_1 : α), countP (Associated a_1) (a ::ₘ s) ≤ 1
⊢ (a ::ₘ s).prod ∣ n

tactic: simp only [Multiset.prod_zero, one_dvd]
state_before: case empty
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : (a : α) → DecidablePred (Associated a)
n : α
h : ∀ a ∈ 0, Prime a
div : ∀ a ∈ 0, a ∣ n
uniq : ∀ (a : α), countP (Associated a) 0 ≤ 1
⊢ prod 0 ∣ n
state_after: no goals

tactic: rw [Multiset.prod_cons]
state_before: case cons
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : (a : α) → DecidablePred (Associated a)
a : α
s : Multiset α
induct : ∀ (n : α), (∀ a ∈ s, Prime a) → (∀ a ∈ s, a ∣ n) → (∀ (a : α), countP (Associated a) s ≤ 1) → s.prod ∣ n
n : α
h : ∀ a_1 ∈ a ::ₘ s, Prime a_1
div : ∀ a_1 ∈ a ::ₘ s, a_1 ∣ n
uniq : ∀ (a_1 : α), countP (Associated a_1) (a ::ₘ s) ≤ 1
⊢ (a ::ₘ s).prod ∣ n
state_after: case cons
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : (a : α) → DecidablePred (Associated a)
a : α
s : Multiset α
induct : ∀ (n : α), (∀ a ∈ s, Prime a) → (∀ a ∈ s, a ∣ n) → (∀ (a : α), countP (Associated a) s ≤ 1) → s.prod ∣ n
n : α
h : ∀ a_1 ∈ a ::ₘ s, Prime a_1
div : ∀ a_1 ∈ a ::ₘ s, a_1 ∣ n
uniq : ∀ (a_1 : α), countP (Associated a_1) (a ::ₘ s) ≤ 1
⊢ a * s.prod ∣ n

tactic: obtain ⟨k, rfl⟩ : a ∣ n := div a (Multiset.mem_cons_self a s)
state_before: case cons
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : (a : α) → DecidablePred (Associated a)
a : α
s : Multiset α
induct : ∀ (n : α), (∀ a ∈ s, Prime a) → (∀ a ∈ s, a ∣ n) → (∀ (a : α), countP (Associated a) s ≤ 1) → s.prod ∣ n
n : α
h : ∀ a_1 ∈ a ::ₘ s, Prime a_1
div : ∀ a_1 ∈ a ::ₘ s, a_1 ∣ n
uniq : ∀ (a_1 : α), countP (Associated a_1) (a ::ₘ s) ≤ 1
⊢ a * s.prod ∣ n
state_after: case cons.intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : (a : α) → DecidablePred (Associated a)
a : α
s : Multiset α
induct : ∀ (n : α), (∀ a ∈ s, Prime a) → (∀ a ∈ s, a ∣ n) → (∀ (a : α), countP (Associated a) s ≤ 1) → s.prod ∣ n
h : ∀ a_1 ∈ a ::ₘ s, Prime a_1
uniq : ∀ (a_1 : α), countP (Associated a_1) (a ::ₘ s) ≤ 1
k : α
div : ∀ a_1 ∈ a ::ₘ s, a_1 ∣ a * k
⊢ a * s.prod ∣ a * k

tactic: apply mul_dvd_mul_left a
state_before: case cons.intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : (a : α) → DecidablePred (Associated a)
a : α
s : Multiset α
induct : ∀ (n : α), (∀ a ∈ s, Prime a) → (∀ a ∈ s, a ∣ n) → (∀ (a : α), countP (Associated a) s ≤ 1) → s.prod ∣ n
h : ∀ a_1 ∈ a ::ₘ s, Prime a_1
uniq : ∀ (a_1 : α), countP (Associated a_1) (a ::ₘ s) ≤ 1
k : α
div : ∀ a_1 ∈ a ::ₘ s, a_1 ∣ a * k
⊢ a * s.prod ∣ a * k
state_after: case cons.intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : (a : α) → DecidablePred (Associated a)
a : α
s : Multiset α
induct : ∀ (n : α), (∀ a ∈ s, Prime a) → (∀ a ∈ s, a ∣ n) → (∀ (a : α), countP (Associated a) s ≤ 1) → s.prod ∣ n
h : ∀ a_1 ∈ a ::ₘ s, Prime a_1
uniq : ∀ (a_1 : α), countP (Associated a_1) (a ::ₘ s) ≤ 1
k : α
div : ∀ a_1 ∈ a ::ₘ s, a_1 ∣ a * k
⊢ s.prod ∣ k

tactic: refine induct _ (fun a ha => h a (Multiset.mem_cons_of_mem ha)) (fun b b_in_s => ?_)
  fun a => (Multiset.countP_le_of_le _ (Multiset.le_cons_self _ _)).trans (uniq a)
state_before: case cons.intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : (a : α) → DecidablePred (Associated a)
a : α
s : Multiset α
induct : ∀ (n : α), (∀ a ∈ s, Prime a) → (∀ a ∈ s, a ∣ n) → (∀ (a : α), countP (Associated a) s ≤ 1) → s.prod ∣ n
h : ∀ a_1 ∈ a ::ₘ s, Prime a_1
uniq : ∀ (a_1 : α), countP (Associated a_1) (a ::ₘ s) ≤ 1
k : α
div : ∀ a_1 ∈ a ::ₘ s, a_1 ∣ a * k
⊢ s.prod ∣ k
state_after: case cons.intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : (a : α) → DecidablePred (Associated a)
a : α
s : Multiset α
induct : ∀ (n : α), (∀ a ∈ s, Prime a) → (∀ a ∈ s, a ∣ n) → (∀ (a : α), countP (Associated a) s ≤ 1) → s.prod ∣ n
h : ∀ a_1 ∈ a ::ₘ s, Prime a_1
uniq : ∀ (a_1 : α), countP (Associated a_1) (a ::ₘ s) ≤ 1
k : α
div : ∀ a_1 ∈ a ::ₘ s, a_1 ∣ a * k
b : α
b_in_s : b ∈ s
⊢ b ∣ k

tactic: have b_div_n := div b (Multiset.mem_cons_of_mem b_in_s)
state_before: case cons.intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : (a : α) → DecidablePred (Associated a)
a : α
s : Multiset α
induct : ∀ (n : α), (∀ a ∈ s, Prime a) → (∀ a ∈ s, a ∣ n) → (∀ (a : α), countP (Associated a) s ≤ 1) → s.prod ∣ n
h : ∀ a_1 ∈ a ::ₘ s, Prime a_1
uniq : ∀ (a_1 : α), countP (Associated a_1) (a ::ₘ s) ≤ 1
k : α
div : ∀ a_1 ∈ a ::ₘ s, a_1 ∣ a * k
b : α
b_in_s : b ∈ s
⊢ b ∣ k
state_after: case cons.intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : (a : α) → DecidablePred (Associated a)
a : α
s : Multiset α
induct : ∀ (n : α), (∀ a ∈ s, Prime a) → (∀ a ∈ s, a ∣ n) → (∀ (a : α), countP (Associated a) s ≤ 1) → s.prod ∣ n
h : ∀ a_1 ∈ a ::ₘ s, Prime a_1
uniq : ∀ (a_1 : α), countP (Associated a_1) (a ::ₘ s) ≤ 1
k : α
div : ∀ a_1 ∈ a ::ₘ s, a_1 ∣ a * k
b : α
b_in_s : b ∈ s
b_div_n : b ∣ a * k
⊢ b ∣ k

tactic: have a_prime := h a (Multiset.mem_cons_self a s)
state_before: case cons.intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : (a : α) → DecidablePred (Associated a)
a : α
s : Multiset α
induct : ∀ (n : α), (∀ a ∈ s, Prime a) → (∀ a ∈ s, a ∣ n) → (∀ (a : α), countP (Associated a) s ≤ 1) → s.prod ∣ n
h : ∀ a_1 ∈ a ::ₘ s, Prime a_1
uniq : ∀ (a_1 : α), countP (Associated a_1) (a ::ₘ s) ≤ 1
k : α
div : ∀ a_1 ∈ a ::ₘ s, a_1 ∣ a * k
b : α
b_in_s : b ∈ s
b_div_n : b ∣ a * k
⊢ b ∣ k
state_after: case cons.intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : (a : α) → DecidablePred (Associated a)
a : α
s : Multiset α
induct : ∀ (n : α), (∀ a ∈ s, Prime a) → (∀ a ∈ s, a ∣ n) → (∀ (a : α), countP (Associated a) s ≤ 1) → s.prod ∣ n
h : ∀ a_1 ∈ a ::ₘ s, Prime a_1
uniq : ∀ (a_1 : α), countP (Associated a_1) (a ::ₘ s) ≤ 1
k : α
div : ∀ a_1 ∈ a ::ₘ s, a_1 ∣ a * k
b : α
b_in_s : b ∈ s
b_div_n : b ∣ a * k
a_prime : Prime a
⊢ b ∣ k

tactic: have b_prime := h b (Multiset.mem_cons_of_mem b_in_s)
state_before: case cons.intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : (a : α) → DecidablePred (Associated a)
a : α
s : Multiset α
induct : ∀ (n : α), (∀ a ∈ s, Prime a) → (∀ a ∈ s, a ∣ n) → (∀ (a : α), countP (Associated a) s ≤ 1) → s.prod ∣ n
h : ∀ a_1 ∈ a ::ₘ s, Prime a_1
uniq : ∀ (a_1 : α), countP (Associated a_1) (a ::ₘ s) ≤ 1
k : α
div : ∀ a_1 ∈ a ::ₘ s, a_1 ∣ a * k
b : α
b_in_s : b ∈ s
b_div_n : b ∣ a * k
a_prime : Prime a
⊢ b ∣ k
state_after: case cons.intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : (a : α) → DecidablePred (Associated a)
a : α
s : Multiset α
induct : ∀ (n : α), (∀ a ∈ s, Prime a) → (∀ a ∈ s, a ∣ n) → (∀ (a : α), countP (Associated a) s ≤ 1) → s.prod ∣ n
h : ∀ a_1 ∈ a ::ₘ s, Prime a_1
uniq : ∀ (a_1 : α), countP (Associated a_1) (a ::ₘ s) ≤ 1
k : α
div : ∀ a_1 ∈ a ::ₘ s, a_1 ∣ a * k
b : α
b_in_s : b ∈ s
b_div_n : b ∣ a * k
a_prime : Prime a
b_prime : Prime b
⊢ b ∣ k

tactic: refine (b_prime.dvd_or_dvd b_div_n).resolve_left fun b_div_a => ?_
state_before: case cons.intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : (a : α) → DecidablePred (Associated a)
a : α
s : Multiset α
induct : ∀ (n : α), (∀ a ∈ s, Prime a) → (∀ a ∈ s, a ∣ n) → (∀ (a : α), countP (Associated a) s ≤ 1) → s.prod ∣ n
h : ∀ a_1 ∈ a ::ₘ s, Prime a_1
uniq : ∀ (a_1 : α), countP (Associated a_1) (a ::ₘ s) ≤ 1
k : α
div : ∀ a_1 ∈ a ::ₘ s, a_1 ∣ a * k
b : α
b_in_s : b ∈ s
b_div_n : b ∣ a * k
a_prime : Prime a
b_prime : Prime b
⊢ b ∣ k
state_after: case cons.intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : (a : α) → DecidablePred (Associated a)
a : α
s : Multiset α
induct : ∀ (n : α), (∀ a ∈ s, Prime a) → (∀ a ∈ s, a ∣ n) → (∀ (a : α), countP (Associated a) s ≤ 1) → s.prod ∣ n
h : ∀ a_1 ∈ a ::ₘ s, Prime a_1
uniq : ∀ (a_1 : α), countP (Associated a_1) (a ::ₘ s) ≤ 1
k : α
div : ∀ a_1 ∈ a ::ₘ s, a_1 ∣ a * k
b : α
b_in_s : b ∈ s
b_div_n : b ∣ a * k
a_prime : Prime a
b_prime : Prime b
b_div_a : b ∣ a
⊢ False

tactic: have assoc := b_prime.associated_of_dvd a_prime b_div_a
state_before: case cons.intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : (a : α) → DecidablePred (Associated a)
a : α
s : Multiset α
induct : ∀ (n : α), (∀ a ∈ s, Prime a) → (∀ a ∈ s, a ∣ n) → (∀ (a : α), countP (Associated a) s ≤ 1) → s.prod ∣ n
h : ∀ a_1 ∈ a ::ₘ s, Prime a_1
uniq : ∀ (a_1 : α), countP (Associated a_1) (a ::ₘ s) ≤ 1
k : α
div : ∀ a_1 ∈ a ::ₘ s, a_1 ∣ a * k
b : α
b_in_s : b ∈ s
b_div_n : b ∣ a * k
a_prime : Prime a
b_prime : Prime b
b_div_a : b ∣ a
⊢ False
state_after: case cons.intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : (a : α) → DecidablePred (Associated a)
a : α
s : Multiset α
induct : ∀ (n : α), (∀ a ∈ s, Prime a) → (∀ a ∈ s, a ∣ n) → (∀ (a : α), countP (Associated a) s ≤ 1) → s.prod ∣ n
h : ∀ a_1 ∈ a ::ₘ s, Prime a_1
uniq : ∀ (a_1 : α), countP (Associated a_1) (a ::ₘ s) ≤ 1
k : α
div : ∀ a_1 ∈ a ::ₘ s, a_1 ∣ a * k
b : α
b_in_s : b ∈ s
b_div_n : b ∣ a * k
a_prime : Prime a
b_prime : Prime b
b_div_a : b ∣ a
assoc : b ~ᵤ a
⊢ False

tactic: have := uniq a
state_before: case cons.intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : (a : α) → DecidablePred (Associated a)
a : α
s : Multiset α
induct : ∀ (n : α), (∀ a ∈ s, Prime a) → (∀ a ∈ s, a ∣ n) → (∀ (a : α), countP (Associated a) s ≤ 1) → s.prod ∣ n
h : ∀ a_1 ∈ a ::ₘ s, Prime a_1
uniq : ∀ (a_1 : α), countP (Associated a_1) (a ::ₘ s) ≤ 1
k : α
div : ∀ a_1 ∈ a ::ₘ s, a_1 ∣ a * k
b : α
b_in_s : b ∈ s
b_div_n : b ∣ a * k
a_prime : Prime a
b_prime : Prime b
b_div_a : b ∣ a
assoc : b ~ᵤ a
⊢ False
state_after: case cons.intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : (a : α) → DecidablePred (Associated a)
a : α
s : Multiset α
induct : ∀ (n : α), (∀ a ∈ s, Prime a) → (∀ a ∈ s, a ∣ n) → (∀ (a : α), countP (Associated a) s ≤ 1) → s.prod ∣ n
h : ∀ a_1 ∈ a ::ₘ s, Prime a_1
uniq : ∀ (a_1 : α), countP (Associated a_1) (a ::ₘ s) ≤ 1
k : α
div : ∀ a_1 ∈ a ::ₘ s, a_1 ∣ a * k
b : α
b_in_s : b ∈ s
b_div_n : b ∣ a * k
a_prime : Prime a
b_prime : Prime b
b_div_a : b ∣ a
assoc : b ~ᵤ a
this : countP (Associated a) (a ::ₘ s) ≤ 1
⊢ False

tactic: rw [Multiset.countP_cons_of_pos _ (Associated.refl _), Nat.succ_le_succ_iff, ← not_lt,
  Multiset.countP_pos] at this
state_before: case cons.intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : (a : α) → DecidablePred (Associated a)
a : α
s : Multiset α
induct : ∀ (n : α), (∀ a ∈ s, Prime a) → (∀ a ∈ s, a ∣ n) → (∀ (a : α), countP (Associated a) s ≤ 1) → s.prod ∣ n
h : ∀ a_1 ∈ a ::ₘ s, Prime a_1
uniq : ∀ (a_1 : α), countP (Associated a_1) (a ::ₘ s) ≤ 1
k : α
div : ∀ a_1 ∈ a ::ₘ s, a_1 ∣ a * k
b : α
b_in_s : b ∈ s
b_div_n : b ∣ a * k
a_prime : Prime a
b_prime : Prime b
b_div_a : b ∣ a
assoc : b ~ᵤ a
this : countP (Associated a) (a ::ₘ s) ≤ 1
⊢ False
state_after: case cons.intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : (a : α) → DecidablePred (Associated a)
a : α
s : Multiset α
induct : ∀ (n : α), (∀ a ∈ s, Prime a) → (∀ a ∈ s, a ∣ n) → (∀ (a : α), countP (Associated a) s ≤ 1) → s.prod ∣ n
h : ∀ a_1 ∈ a ::ₘ s, Prime a_1
uniq : ∀ (a_1 : α), countP (Associated a_1) (a ::ₘ s) ≤ 1
k : α
div : ∀ a_1 ∈ a ::ₘ s, a_1 ∣ a * k
b : α
b_in_s : b ∈ s
b_div_n : b ∣ a * k
a_prime : Prime a
b_prime : Prime b
b_div_a : b ∣ a
assoc : b ~ᵤ a
this : ¬∃ a_1 ∈ s, a ~ᵤ a_1
⊢ False

tactic: exact this ⟨b, b_in_s, assoc.symm⟩
state_before: case cons.intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : (a : α) → DecidablePred (Associated a)
a : α
s : Multiset α
induct : ∀ (n : α), (∀ a ∈ s, Prime a) → (∀ a ∈ s, a ∣ n) → (∀ (a : α), countP (Associated a) s ≤ 1) → s.prod ∣ n
h : ∀ a_1 ∈ a ::ₘ s, Prime a_1
uniq : ∀ (a_1 : α), countP (Associated a_1) (a ::ₘ s) ≤ 1
k : α
div : ∀ a_1 ∈ a ::ₘ s, a_1 ∣ a * k
b : α
b_in_s : b ∈ s
b_div_n : b ∣ a * k
a_prime : Prime a
b_prime : Prime b
b_div_a : b ∣ a
assoc : b ~ᵤ a
this : ¬∃ a_1 ∈ s, a ~ᵤ a_1
⊢ False
state_after: no goals