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.17290
γ : Type ?u.17293
δ : Type ?u.17296
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : (a : α) → DecidablePred (Associated a)
s : Multiset α
n : α
h : ∀ (a : α), a ∈ s → Prime a
div : ∀ (a : α), a ∈ s → a ∣ n
uniq : ∀ (a : α), countp (Associated a) s ≤ 1
⊢ prod s ∣ n

tactic: simp only [Multiset.prod_zero, one_dvd]
state_before: case empty
α : Type u_1
β : Type ?u.17290
γ : Type ?u.17293
δ : Type ?u.17296
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : (a : α) → DecidablePred (Associated a)
s : Multiset α
n✝ : α
h✝ : ∀ (a : α), a ∈ s → Prime a
div✝ : ∀ (a : α), a ∈ s → a ∣ n✝
uniq✝ : ∀ (a : α), countp (Associated a) s ≤ 1
n : α
h : ∀ (a : α), a ∈ 0 → Prime a
div : ∀ (a : α), a ∈ 0 → a ∣ n
uniq : ∀ (a : α), countp (Associated a) 0 ≤ 1
⊢ prod 0 ∣ n

tactic: rw [Multiset.prod_cons]
state_before: case cons
α : Type u_1
β : Type ?u.17290
γ : Type ?u.17293
δ : Type ?u.17296
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : (a : α) → DecidablePred (Associated a)
s✝ : Multiset α
n✝ : α
h✝ : ∀ (a : α), a ∈ s✝ → Prime a
div✝ : ∀ (a : α), a ∈ s✝ → a ∣ n✝
uniq✝ : ∀ (a : α), countp (Associated a) s✝ ≤ 1
a : α
s : Multiset α
induct :
  ∀ (n : α),
    (∀ (a : α), a ∈ s → Prime a) → (∀ (a : α), a ∈ s → a ∣ n) → (∀ (a : α), countp (Associated a) s ≤ 1) → prod s ∣ n
n : α
h : ∀ (a_1 : α), a_1 ∈ a ::ₘ s → Prime a_1
div : ∀ (a_1 : α), a_1 ∈ a ::ₘ s → a_1 ∣ n
uniq : ∀ (a_1 : α), countp (Associated a_1) (a ::ₘ s) ≤ 1
⊢ prod (a ::ₘ s) ∣ n

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

tactic: apply mul_dvd_mul_left a
state_before: case cons.intro
α : Type u_1
β : Type ?u.17290
γ : Type ?u.17293
δ : Type ?u.17296
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : (a : α) → DecidablePred (Associated a)
s✝ : Multiset α
n : α
h✝ : ∀ (a : α), a ∈ s✝ → Prime a
div✝ : ∀ (a : α), a ∈ s✝ → a ∣ n
uniq✝ : ∀ (a : α), countp (Associated a) s✝ ≤ 1
a : α
s : Multiset α
induct :
  ∀ (n : α),
    (∀ (a : α), a ∈ s → Prime a) → (∀ (a : α), a ∈ s → a ∣ n) → (∀ (a : α), countp (Associated a) s ≤ 1) → prod s ∣ n
h : ∀ (a_1 : α), a_1 ∈ a ::ₘ s → Prime a_1
uniq : ∀ (a_1 : α), countp (Associated a_1) (a ::ₘ s) ≤ 1
k : α
div : ∀ (a_1 : α), a_1 ∈ a ::ₘ s → a_1 ∣ a * k
⊢ a * prod s ∣ a * 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.17290
γ : Type ?u.17293
δ : Type ?u.17296
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : (a : α) → DecidablePred (Associated a)
s✝ : Multiset α
n : α
h✝ : ∀ (a : α), a ∈ s✝ → Prime a
div✝ : ∀ (a : α), a ∈ s✝ → a ∣ n
uniq✝ : ∀ (a : α), countp (Associated a) s✝ ≤ 1
a : α
s : Multiset α
induct :
  ∀ (n : α),
    (∀ (a : α), a ∈ s → Prime a) → (∀ (a : α), a ∈ s → a ∣ n) → (∀ (a : α), countp (Associated a) s ≤ 1) → prod s ∣ n
h : ∀ (a_1 : α), a_1 ∈ a ::ₘ s → Prime a_1
uniq : ∀ (a_1 : α), countp (Associated a_1) (a ::ₘ s) ≤ 1
k : α
div : ∀ (a_1 : α), a_1 ∈ a ::ₘ s → a_1 ∣ a * k
⊢ prod s ∣ 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.17290
γ : Type ?u.17293
δ : Type ?u.17296
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : (a : α) → DecidablePred (Associated a)
s✝ : Multiset α
n : α
h✝ : ∀ (a : α), a ∈ s✝ → Prime a
div✝ : ∀ (a : α), a ∈ s✝ → a ∣ n
uniq✝ : ∀ (a : α), countp (Associated a) s✝ ≤ 1
a : α
s : Multiset α
induct :
  ∀ (n : α),
    (∀ (a : α), a ∈ s → Prime a) → (∀ (a : α), a ∈ s → a ∣ n) → (∀ (a : α), countp (Associated a) s ≤ 1) → prod s ∣ n
h : ∀ (a_1 : α), a_1 ∈ a ::ₘ s → Prime a_1
uniq : ∀ (a_1 : α), countp (Associated a_1) (a ::ₘ s) ≤ 1
k : α
div : ∀ (a_1 : α), a_1 ∈ a ::ₘ s → a_1 ∣ a * k
b : α
b_in_s : b ∈ s
⊢ b ∣ k

tactic: have a_prime := h a (Multiset.mem_cons_self a s)
state_before: case cons.intro
α : Type u_1
β : Type ?u.17290
γ : Type ?u.17293
δ : Type ?u.17296
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : (a : α) → DecidablePred (Associated a)
s✝ : Multiset α
n : α
h✝ : ∀ (a : α), a ∈ s✝ → Prime a
div✝ : ∀ (a : α), a ∈ s✝ → a ∣ n
uniq✝ : ∀ (a : α), countp (Associated a) s✝ ≤ 1
a : α
s : Multiset α
induct :
  ∀ (n : α),
    (∀ (a : α), a ∈ s → Prime a) → (∀ (a : α), a ∈ s → a ∣ n) → (∀ (a : α), countp (Associated a) s ≤ 1) → prod s ∣ n
h : ∀ (a_1 : α), a_1 ∈ a ::ₘ s → Prime a_1
uniq : ∀ (a_1 : α), countp (Associated a_1) (a ::ₘ s) ≤ 1
k : α
div : ∀ (a_1 : α), a_1 ∈ a ::ₘ s → a_1 ∣ a * k
b : α
b_in_s : b ∈ s
b_div_n : b ∣ a * k
⊢ 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.17290
γ : Type ?u.17293
δ : Type ?u.17296
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : (a : α) → DecidablePred (Associated a)
s✝ : Multiset α
n : α
h✝ : ∀ (a : α), a ∈ s✝ → Prime a
div✝ : ∀ (a : α), a ∈ s✝ → a ∣ n
uniq✝ : ∀ (a : α), countp (Associated a) s✝ ≤ 1
a : α
s : Multiset α
induct :
  ∀ (n : α),
    (∀ (a : α), a ∈ s → Prime a) → (∀ (a : α), a ∈ s → a ∣ n) → (∀ (a : α), countp (Associated a) s ≤ 1) → prod s ∣ n
h : ∀ (a_1 : α), a_1 ∈ a ::ₘ s → Prime a_1
uniq : ∀ (a_1 : α), countp (Associated a_1) (a ::ₘ s) ≤ 1
k : α
div : ∀ (a_1 : α), 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: 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.17290
γ : Type ?u.17293
δ : Type ?u.17296
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : (a : α) → DecidablePred (Associated a)
s✝ : Multiset α
n : α
h✝ : ∀ (a : α), a ∈ s✝ → Prime a
div✝ : ∀ (a : α), a ∈ s✝ → a ∣ n
uniq✝ : ∀ (a : α), countp (Associated a) s✝ ≤ 1
a : α
s : Multiset α
induct :
  ∀ (n : α),
    (∀ (a : α), a ∈ s → Prime a) → (∀ (a : α), a ∈ s → a ∣ n) → (∀ (a : α), countp (Associated a) s ≤ 1) → prod s ∣ n
h : ∀ (a_1 : α), a_1 ∈ a ::ₘ s → Prime a_1
uniq : ∀ (a_1 : α), countp (Associated a_1) (a ::ₘ s) ≤ 1
k : α
div : ∀ (a_1 : α), 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: have assoc := b_prime.associated_of_dvd a_prime b_div_a
state_before: case cons.intro
α : Type u_1
β : Type ?u.17290
γ : Type ?u.17293
δ : Type ?u.17296
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : (a : α) → DecidablePred (Associated a)
s✝ : Multiset α
n : α
h✝ : ∀ (a : α), a ∈ s✝ → Prime a
div✝ : ∀ (a : α), a ∈ s✝ → a ∣ n
uniq✝ : ∀ (a : α), countp (Associated a) s✝ ≤ 1
a : α
s : Multiset α
induct :
  ∀ (n : α),
    (∀ (a : α), a ∈ s → Prime a) → (∀ (a : α), a ∈ s → a ∣ n) → (∀ (a : α), countp (Associated a) s ≤ 1) → prod s ∣ n
h : ∀ (a_1 : α), a_1 ∈ a ::ₘ s → Prime a_1
uniq : ∀ (a_1 : α), countp (Associated a_1) (a ::ₘ s) ≤ 1
k : α
div : ∀ (a_1 : α), 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 := uniq a
state_before: case cons.intro
α : Type u_1
β : Type ?u.17290
γ : Type ?u.17293
δ : Type ?u.17296
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : (a : α) → DecidablePred (Associated a)
s✝ : Multiset α
n : α
h✝ : ∀ (a : α), a ∈ s✝ → Prime a
div✝ : ∀ (a : α), a ∈ s✝ → a ∣ n
uniq✝ : ∀ (a : α), countp (Associated a) s✝ ≤ 1
a : α
s : Multiset α
induct :
  ∀ (n : α),
    (∀ (a : α), a ∈ s → Prime a) → (∀ (a : α), a ∈ s → a ∣ n) → (∀ (a : α), countp (Associated a) s ≤ 1) → prod s ∣ n
h : ∀ (a_1 : α), a_1 ∈ a ::ₘ s → Prime a_1
uniq : ∀ (a_1 : α), countp (Associated a_1) (a ::ₘ s) ≤ 1
k : α
div : ∀ (a_1 : α), 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: 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.17290
γ : Type ?u.17293
δ : Type ?u.17296
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : (a : α) → DecidablePred (Associated a)
s✝ : Multiset α
n : α
h✝ : ∀ (a : α), a ∈ s✝ → Prime a
div✝ : ∀ (a : α), a ∈ s✝ → a ∣ n
uniq✝ : ∀ (a : α), countp (Associated a) s✝ ≤ 1
a : α
s : Multiset α
induct :
  ∀ (n : α),
    (∀ (a : α), a ∈ s → Prime a) → (∀ (a : α), a ∈ s → a ∣ n) → (∀ (a : α), countp (Associated a) s ≤ 1) → prod s ∣ n
h : ∀ (a_1 : α), a_1 ∈ a ::ₘ s → Prime a_1
uniq : ∀ (a_1 : α), countp (Associated a_1) (a ::ₘ s) ≤ 1
k : α
div : ∀ (a_1 : α), 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: exact this ⟨b, b_in_s, assoc.symm⟩
state_before: case cons.intro
α : Type u_1
β : Type ?u.17290
γ : Type ?u.17293
δ : Type ?u.17296
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : (a : α) → DecidablePred (Associated a)
s✝ : Multiset α
n : α
h✝ : ∀ (a : α), a ∈ s✝ → Prime a
div✝ : ∀ (a : α), a ∈ s✝ → a ∣ n
uniq✝ : ∀ (a : α), countp (Associated a) s✝ ≤ 1
a : α
s : Multiset α
induct :
  ∀ (n : α),
    (∀ (a : α), a ∈ s → Prime a) → (∀ (a : α), a ∈ s → a ∣ n) → (∀ (a : α), countp (Associated a) s ≤ 1) → prod s ∣ n
h : ∀ (a_1 : α), a_1 ∈ a ::ₘ s → Prime a_1
uniq : ∀ (a_1 : α), countp (Associated a_1) (a ::ₘ s) ≤ 1
k : α
div : ∀ (a_1 : α), 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, a_1 ∈ s ∧ a ~ᵤ a_1
⊢ False