case empty
R : Type u_2
inst✝¹ : CancelCommMonoidWithZero R
α : Type u_1
inst✝ : DecidableEq α
x✝ y✝ a✝ : R
s : Finset α
p : α → R
hp✝ : ∀ (i : α), i ∈ s → Prime (p i)
hx✝ : x✝ * y✝ = a✝ * ∏ i in s, p i
x y a : R
hp : ∀ (i : α), i ∈ ∅ → Prime (p i)
hx : x * y = a * ∏ i in ∅, p i
⊢ ∃ t u b c, t ∪ u = ∅ ∧ Disjoint t u ∧ a = b * c ∧ x = b * ∏ i in t, p i ∧ y = c * ∏ i in u, p i

case insert
R : Type u_2
inst✝¹ : CancelCommMonoidWithZero R
α : Type u_1
inst✝ : DecidableEq α
x✝ y✝ a✝ : R
s✝ : Finset α
p : α → R
hp✝ : ∀ (i : α), i ∈ s✝ → Prime (p i)
hx✝ : x✝ * y✝ = a✝ * ∏ i in s✝, p i
i : α
s : Finset α
his : ¬i ∈ s
ih :
  ∀ {x y a : R},
    (∀ (i : α), i ∈ s → Prime (p i)) →
      x * y = a * ∏ i in s, p i →
        ∃ t u b c, t ∪ u = s ∧ Disjoint t u ∧ a = b * c ∧ x = b * ∏ i in t, p i ∧ y = c * ∏ i in u, p i
x y a : R
hp : ∀ (i_1 : α), i_1 ∈ insert i s → Prime (p i_1)
hx : x * y = a * ∏ i in insert i s, p i
⊢ ∃ t u b c, t ∪ u = insert i s ∧ Disjoint t u ∧ a = b * c ∧ x = b * ∏ i in t, p i ∧ y = c * ∏ i in u, p i
R : Type u_2
inst✝¹ : CancelCommMonoidWithZero R
α : Type u_1
inst✝ : DecidableEq α
x y a : R
s : Finset α
p : α → R
hp : ∀ (i : α), i ∈ s → Prime (p i)
hx : x * y = a * ∏ i in s, p i
⊢ ∃ t u b c, t ∪ u = s ∧ Disjoint t u ∧ a = b * c ∧ x = b * ∏ i in t, p i ∧ y = c * ∏ i in u, p i
induction' s using Finset.induction with i s his ih generalizing x y a
no goals
case empty
R : Type u_2
inst✝¹ : CancelCommMonoidWithZero R
α : Type u_1
inst✝ : DecidableEq α
x✝ y✝ a✝ : R
s : Finset α
p : α → R
hp✝ : ∀ (i : α), i ∈ s → Prime (p i)
hx✝ : x✝ * y✝ = a✝ * ∏ i in s, p i
x y a : R
hp : ∀ (i : α), i ∈ ∅ → Prime (p i)
hx : x * y = a * ∏ i in ∅, p i
⊢ ∃ t u b c, t ∪ u = ∅ ∧ Disjoint t u ∧ a = b * c ∧ x = b * ∏ i in t, p i ∧ y = c * ∏ i in u, p i
exact ⟨∅, ∅, x, y, by simp [hx]⟩
no goals
R : Type u_2
inst✝¹ : CancelCommMonoidWithZero R
α : Type u_1
inst✝ : DecidableEq α
x✝ y✝ a✝ : R
s : Finset α
p : α → R
hp✝ : ∀ (i : α), i ∈ s → Prime (p i)
hx✝ : x✝ * y✝ = a✝ * ∏ i in s, p i
x y a : R
hp : ∀ (i : α), i ∈ ∅ → Prime (p i)
hx : x * y = a * ∏ i in ∅, p i
⊢ ∅ ∪ ∅ = ∅ ∧ Disjoint ∅ ∅ ∧ a = x * y ∧ x = x * ∏ i in ∅, p i ∧ y = y * ∏ i in ∅, p i
simp [hx]
case insert
R : Type u_2
inst✝¹ : CancelCommMonoidWithZero R
α : Type u_1
inst✝ : DecidableEq α
x✝ y✝ a✝ : R
s✝ : Finset α
p : α → R
hp✝ : ∀ (i : α), i ∈ s✝ → Prime (p i)
hx✝ : x✝ * y✝ = a✝ * ∏ i in s✝, p i
i : α
s : Finset α
his : ¬i ∈ s
ih :
  ∀ {x y a : R},
    (∀ (i : α), i ∈ s → Prime (p i)) →
      x * y = a * ∏ i in s, p i →
        ∃ t u b c, t ∪ u = s ∧ Disjoint t u ∧ a = b * c ∧ x = b * ∏ i in t, p i ∧ y = c * ∏ i in u, p i
x y a : R
hp : ∀ (i_1 : α), i_1 ∈ insert i s → Prime (p i_1)
hx : x * y = a * p i * ∏ x in s, p x
⊢ ∃ t u b c, t ∪ u = insert i s ∧ Disjoint t u ∧ a = b * c ∧ x = b * ∏ i in t, p i ∧ y = c * ∏ i in u, p i
case insert
R : Type u_2
inst✝¹ : CancelCommMonoidWithZero R
α : Type u_1
inst✝ : DecidableEq α
x✝ y✝ a✝ : R
s✝ : Finset α
p : α → R
hp✝ : ∀ (i : α), i ∈ s✝ → Prime (p i)
hx✝ : x✝ * y✝ = a✝ * ∏ i in s✝, p i
i : α
s : Finset α
his : ¬i ∈ s
ih :
  ∀ {x y a : R},
    (∀ (i : α), i ∈ s → Prime (p i)) →
      x * y = a * ∏ i in s, p i →
        ∃ t u b c, t ∪ u = s ∧ Disjoint t u ∧ a = b * c ∧ x = b * ∏ i in t, p i ∧ y = c * ∏ i in u, p i
x y a : R
hp : ∀ (i_1 : α), i_1 ∈ insert i s → Prime (p i_1)
hx : x * y = a * ∏ i in insert i s, p i
⊢ ∃ t u b c, t ∪ u = insert i s ∧ Disjoint t u ∧ a = b * c ∧ x = b * ∏ i in t, p i ∧ y = c * ∏ i in u, p i
rw [prod_insert his, ← mul_assoc] at hx
case insert
R : Type u_2
inst✝¹ : CancelCommMonoidWithZero R
α : Type u_1
inst✝ : DecidableEq α
x✝ y✝ a✝ : R
s✝ : Finset α
p : α → R
hp✝ : ∀ (i : α), i ∈ s✝ → Prime (p i)
hx✝ : x✝ * y✝ = a✝ * ∏ i in s✝, p i
i : α
s : Finset α
his : ¬i ∈ s
ih :
  ∀ {x y a : R},
    (∀ (i : α), i ∈ s → Prime (p i)) →
      x * y = a * ∏ i in s, p i →
        ∃ t u b c, t ∪ u = s ∧ Disjoint t u ∧ a = b * c ∧ x = b * ∏ i in t, p i ∧ y = c * ∏ i in u, p i
x y a : R
hp : ∀ (i_1 : α), i_1 ∈ insert i s → Prime (p i_1)
hx : x * y = a * p i * ∏ x in s, p x
hpi : Prime (p i)
⊢ ∃ t u b c, t ∪ u = insert i s ∧ Disjoint t u ∧ a = b * c ∧ x = b * ∏ i in t, p i ∧ y = c * ∏ i in u, p i
case insert
R : Type u_2
inst✝¹ : CancelCommMonoidWithZero R
α : Type u_1
inst✝ : DecidableEq α
x✝ y✝ a✝ : R
s✝ : Finset α
p : α → R
hp✝ : ∀ (i : α), i ∈ s✝ → Prime (p i)
hx✝ : x✝ * y✝ = a✝ * ∏ i in s✝, p i
i : α
s : Finset α
his : ¬i ∈ s
ih :
  ∀ {x y a : R},
    (∀ (i : α), i ∈ s → Prime (p i)) →
      x * y = a * ∏ i in s, p i →
        ∃ t u b c, t ∪ u = s ∧ Disjoint t u ∧ a = b * c ∧ x = b * ∏ i in t, p i ∧ y = c * ∏ i in u, p i
x y a : R
hp : ∀ (i_1 : α), i_1 ∈ insert i s → Prime (p i_1)
hx : x * y = a * p i * ∏ x in s, p x
⊢ ∃ t u b c, t ∪ u = insert i s ∧ Disjoint t u ∧ a = b * c ∧ x = b * ∏ i in t, p i ∧ y = c * ∏ i in u, p i
have hpi : Prime (p i) := hp i (mem_insert_self _ _)
case insert.intro.intro.intro.intro.intro.intro.intro.intro
R : Type u_2
inst✝¹ : CancelCommMonoidWithZero R
α : Type u_1
inst✝ : DecidableEq α
x y a✝ : R
s✝ : Finset α
p : α → R
hp✝ : ∀ (i : α), i ∈ s✝ → Prime (p i)
hx✝ : x * y = a✝ * ∏ i in s✝, p i
i : α
s : Finset α
his : ¬i ∈ s
ih :
  ∀ {x y a : R},
    (∀ (i : α), i ∈ s → Prime (p i)) →
      x * y = a * ∏ i in s, p i →
        ∃ t u b c, t ∪ u = s ∧ Disjoint t u ∧ a = b * c ∧ x = b * ∏ i in t, p i ∧ y = c * ∏ i in u, p i
a : R
hp : ∀ (i_1 : α), i_1 ∈ insert i s → Prime (p i_1)
hpi : Prime (p i)
t u : Finset α
b c : R
htus : t ∪ u = s
htu : Disjoint t u
hbc : a * p i = b * c
hx : (b * ∏ i in t, p i) * (c * ∏ i in u, p i) = a * p i * ∏ x in s, p x
⊢ ∃ t_1 u_1 b_1 c_1,
    t_1 ∪ u_1 = insert i s ∧
      Disjoint t_1 u_1 ∧
        a = b_1 * c_1 ∧ b * ∏ i in t, p i = b_1 * ∏ i in t_1, p i ∧ c * ∏ i in u, p i = c_1 * ∏ i in u_1, p i
case insert
R : Type u_2
inst✝¹ : CancelCommMonoidWithZero R
α : Type u_1
inst✝ : DecidableEq α
x✝ y✝ a✝ : R
s✝ : Finset α
p : α → R
hp✝ : ∀ (i : α), i ∈ s✝ → Prime (p i)
hx✝ : x✝ * y✝ = a✝ * ∏ i in s✝, p i
i : α
s : Finset α
his : ¬i ∈ s
ih :
  ∀ {x y a : R},
    (∀ (i : α), i ∈ s → Prime (p i)) →
      x * y = a * ∏ i in s, p i →
        ∃ t u b c, t ∪ u = s ∧ Disjoint t u ∧ a = b * c ∧ x = b * ∏ i in t, p i ∧ y = c * ∏ i in u, p i
x y a : R
hp : ∀ (i_1 : α), i_1 ∈ insert i s → Prime (p i_1)
hx : x * y = a * p i * ∏ x in s, p x
hpi : Prime (p i)
⊢ ∃ t u b c, t ∪ u = insert i s ∧ Disjoint t u ∧ a = b * c ∧ x = b * ∏ i in t, p i ∧ y = c * ∏ i in u, p i
rcases ih (fun i hi ↦ hp i (mem_insert_of_mem hi)) hx with
  ⟨t, u, b, c, htus, htu, hbc, rfl, rfl⟩
case insert.intro.intro.intro.intro.intro.intro.intro.intro
R : Type u_2
inst✝¹ : CancelCommMonoidWithZero R
α : Type u_1
inst✝ : DecidableEq α
x y a✝ : R
s✝ : Finset α
p : α → R
hp✝ : ∀ (i : α), i ∈ s✝ → Prime (p i)
hx✝ : x * y = a✝ * ∏ i in s✝, p i
i : α
s : Finset α
his : ¬i ∈ s
ih :
  ∀ {x y a : R},
    (∀ (i : α), i ∈ s → Prime (p i)) →
      x * y = a * ∏ i in s, p i →
        ∃ t u b c, t ∪ u = s ∧ Disjoint t u ∧ a = b * c ∧ x = b * ∏ i in t, p i ∧ y = c * ∏ i in u, p i
a : R
hp : ∀ (i_1 : α), i_1 ∈ insert i s → Prime (p i_1)
hpi : Prime (p i)
t u : Finset α
b c : R
htus : t ∪ u = s
htu : Disjoint t u
hbc : a * p i = b * c
hx : (b * ∏ i in t, p i) * (c * ∏ i in u, p i) = a * p i * ∏ x in s, p x
hit : ¬i ∈ t
⊢ ∃ t_1 u_1 b_1 c_1,
    t_1 ∪ u_1 = insert i s ∧
      Disjoint t_1 u_1 ∧
        a = b_1 * c_1 ∧ b * ∏ i in t, p i = b_1 * ∏ i in t_1, p i ∧ c * ∏ i in u, p i = c_1 * ∏ i in u_1, p i
case insert.intro.intro.intro.intro.intro.intro.intro.intro
R : Type u_2
inst✝¹ : CancelCommMonoidWithZero R
α : Type u_1
inst✝ : DecidableEq α
x y a✝ : R
s✝ : Finset α
p : α → R
hp✝ : ∀ (i : α), i ∈ s✝ → Prime (p i)
hx✝ : x * y = a✝ * ∏ i in s✝, p i
i : α
s : Finset α
his : ¬i ∈ s
ih :
  ∀ {x y a : R},
    (∀ (i : α), i ∈ s → Prime (p i)) →
      x * y = a * ∏ i in s, p i →
        ∃ t u b c, t ∪ u = s ∧ Disjoint t u ∧ a = b * c ∧ x = b * ∏ i in t, p i ∧ y = c * ∏ i in u, p i
a : R
hp : ∀ (i_1 : α), i_1 ∈ insert i s → Prime (p i_1)
hpi : Prime (p i)
t u : Finset α
b c : R
htus : t ∪ u = s
htu : Disjoint t u
hbc : a * p i = b * c
hx : (b * ∏ i in t, p i) * (c * ∏ i in u, p i) = a * p i * ∏ x in s, p x
⊢ ∃ t_1 u_1 b_1 c_1,
    t_1 ∪ u_1 = insert i s ∧
      Disjoint t_1 u_1 ∧
        a = b_1 * c_1 ∧ b * ∏ i in t, p i = b_1 * ∏ i in t_1, p i ∧ c * ∏ i in u, p i = c_1 * ∏ i in u_1, p i
have hit : i ∉ t := fun hit ↦ his (htus ▸ mem_union_left _ hit)
case insert.intro.intro.intro.intro.intro.intro.intro.intro
R : Type u_2
inst✝¹ : CancelCommMonoidWithZero R
α : Type u_1
inst✝ : DecidableEq α
x y a✝ : R
s✝ : Finset α
p : α → R
hp✝ : ∀ (i : α), i ∈ s✝ → Prime (p i)
hx✝ : x * y = a✝ * ∏ i in s✝, p i
i : α
s : Finset α
his : ¬i ∈ s
ih :
  ∀ {x y a : R},
    (∀ (i : α), i ∈ s → Prime (p i)) →
      x * y = a * ∏ i in s, p i →
        ∃ t u b c, t ∪ u = s ∧ Disjoint t u ∧ a = b * c ∧ x = b * ∏ i in t, p i ∧ y = c * ∏ i in u, p i
a : R
hp : ∀ (i_1 : α), i_1 ∈ insert i s → Prime (p i_1)
hpi : Prime (p i)
t u : Finset α
b c : R
htus : t ∪ u = s
htu : Disjoint t u
hbc : a * p i = b * c
hx : (b * ∏ i in t, p i) * (c * ∏ i in u, p i) = a * p i * ∏ x in s, p x
hit : ¬i ∈ t
hiu : ¬i ∈ u
⊢ ∃ t_1 u_1 b_1 c_1,
    t_1 ∪ u_1 = insert i s ∧
      Disjoint t_1 u_1 ∧
        a = b_1 * c_1 ∧ b * ∏ i in t, p i = b_1 * ∏ i in t_1, p i ∧ c * ∏ i in u, p i = c_1 * ∏ i in u_1, p i
case insert.intro.intro.intro.intro.intro.intro.intro.intro
R : Type u_2
inst✝¹ : CancelCommMonoidWithZero R
α : Type u_1
inst✝ : DecidableEq α
x y a✝ : R
s✝ : Finset α
p : α → R
hp✝ : ∀ (i : α), i ∈ s✝ → Prime (p i)
hx✝ : x * y = a✝ * ∏ i in s✝, p i
i : α
s : Finset α
his : ¬i ∈ s
ih :
  ∀ {x y a : R},
    (∀ (i : α), i ∈ s → Prime (p i)) →
      x * y = a * ∏ i in s, p i →
        ∃ t u b c, t ∪ u = s ∧ Disjoint t u ∧ a = b * c ∧ x = b * ∏ i in t, p i ∧ y = c * ∏ i in u, p i
a : R
hp : ∀ (i_1 : α), i_1 ∈ insert i s → Prime (p i_1)
hpi : Prime (p i)
t u : Finset α
b c : R
htus : t ∪ u = s
htu : Disjoint t u
hbc : a * p i = b * c
hx : (b * ∏ i in t, p i) * (c * ∏ i in u, p i) = a * p i * ∏ x in s, p x
hit : ¬i ∈ t
⊢ ∃ t_1 u_1 b_1 c_1,
    t_1 ∪ u_1 = insert i s ∧
      Disjoint t_1 u_1 ∧
        a = b_1 * c_1 ∧ b * ∏ i in t, p i = b_1 * ∏ i in t_1, p i ∧ c * ∏ i in u, p i = c_1 * ∏ i in u_1, p i
have hiu : i ∉ u := fun hiu ↦ his (htus ▸ mem_union_right _ hiu)
R : Type u_2
inst✝¹ : CancelCommMonoidWithZero R
α : Type u_1
inst✝ : DecidableEq α
x y a✝ : R
s✝ : Finset α
p : α → R
hp✝ : ∀ (i : α), i ∈ s✝ → Prime (p i)
hx✝ : x * y = a✝ * ∏ i in s✝, p i
i : α
s : Finset α
his : ¬i ∈ s
ih :
  ∀ {x y a : R},
    (∀ (i : α), i ∈ s → Prime (p i)) →
      x * y = a * ∏ i in s, p i →
        ∃ t u b c, t ∪ u = s ∧ Disjoint t u ∧ a = b * c ∧ x = b * ∏ i in t, p i ∧ y = c * ∏ i in u, p i
a : R
hp : ∀ (i_1 : α), i_1 ∈ insert i s → Prime (p i_1)
hpi : Prime (p i)
t u : Finset α
b c : R
htus : t ∪ u = s
htu : Disjoint t u
hbc : a * p i = b * c
hx : (b * ∏ i in t, p i) * (c * ∏ i in u, p i) = a * p i * ∏ x in s, p x
hit : ¬i ∈ t
hiu : ¬i ∈ u
⊢ p i ∣ b ∨ p i ∣ c

case insert.intro.intro.intro.intro.intro.intro.intro.intro.inl.intro
R : Type u_2
inst✝¹ : CancelCommMonoidWithZero R
α : Type u_1
inst✝ : DecidableEq α
x y a✝ : R
s✝ : Finset α
p : α → R
hp✝ : ∀ (i : α), i ∈ s✝ → Prime (p i)
hx✝ : x * y = a✝ * ∏ i in s✝, p i
i : α
s : Finset α
his : ¬i ∈ s
ih :
  ∀ {x y a : R},
    (∀ (i : α), i ∈ s → Prime (p i)) →
      x * y = a * ∏ i in s, p i →
        ∃ t u b c, t ∪ u = s ∧ Disjoint t u ∧ a = b * c ∧ x = b * ∏ i in t, p i ∧ y = c * ∏ i in u, p i
a : R
hp : ∀ (i_1 : α), i_1 ∈ insert i s → Prime (p i_1)
hpi : Prime (p i)
t u : Finset α
c : R
htus : t ∪ u = s
htu : Disjoint t u
hit : ¬i ∈ t
hiu : ¬i ∈ u
d : R
hbc : a * p i = p i * d * c
hx : (p i * d * ∏ i in t, p i) * (c * ∏ i in u, p i) = a * p i * ∏ x in s, p x
⊢ ∃ t_1 u_1 b c_1,
    t_1 ∪ u_1 = insert i s ∧
      Disjoint t_1 u_1 ∧
        a = b * c_1 ∧ p i * d * ∏ i in t, p i = b * ∏ i in t_1, p i ∧ c * ∏ i in u, p i = c_1 * ∏ i in u_1, p i

case insert.intro.intro.intro.intro.intro.intro.intro.intro.inr.intro
R : Type u_2
inst✝¹ : CancelCommMonoidWithZero R
α : Type u_1
inst✝ : DecidableEq α
x y a✝ : R
s✝ : Finset α
p : α → R
hp✝ : ∀ (i : α), i ∈ s✝ → Prime (p i)
hx✝ : x * y = a✝ * ∏ i in s✝, p i
i : α
s : Finset α
his : ¬i ∈ s
ih :
  ∀ {x y a : R},
    (∀ (i : α), i ∈ s → Prime (p i)) →
      x * y = a * ∏ i in s, p i →
        ∃ t u b c, t ∪ u = s ∧ Disjoint t u ∧ a = b * c ∧ x = b * ∏ i in t, p i ∧ y = c * ∏ i in u, p i
a : R
hp : ∀ (i_1 : α), i_1 ∈ insert i s → Prime (p i_1)
hpi : Prime (p i)
t u : Finset α
b : R
htus : t ∪ u = s
htu : Disjoint t u
hit : ¬i ∈ t
hiu : ¬i ∈ u
d : R
hbc : a * p i = b * (p i * d)
hx : (b * ∏ i in t, p i) * (p i * d * ∏ i in u, p i) = a * p i * ∏ x in s, p x
⊢ ∃ t_1 u_1 b_1 c,
    t_1 ∪ u_1 = insert i s ∧
      Disjoint t_1 u_1 ∧
        a = b_1 * c ∧ b * ∏ i in t, p i = b_1 * ∏ i in t_1, p i ∧ p i * d * ∏ i in u, p i = c * ∏ i in u_1, p i
case insert.intro.intro.intro.intro.intro.intro.intro.intro
R : Type u_2
inst✝¹ : CancelCommMonoidWithZero R
α : Type u_1
inst✝ : DecidableEq α
x y a✝ : R
s✝ : Finset α
p : α → R
hp✝ : ∀ (i : α), i ∈ s✝ → Prime (p i)
hx✝ : x * y = a✝ * ∏ i in s✝, p i
i : α
s : Finset α
his : ¬i ∈ s
ih :
  ∀ {x y a : R},
    (∀ (i : α), i ∈ s → Prime (p i)) →
      x * y = a * ∏ i in s, p i →
        ∃ t u b c, t ∪ u = s ∧ Disjoint t u ∧ a = b * c ∧ x = b * ∏ i in t, p i ∧ y = c * ∏ i in u, p i
a : R
hp : ∀ (i_1 : α), i_1 ∈ insert i s → Prime (p i_1)
hpi : Prime (p i)
t u : Finset α
b c : R
htus : t ∪ u = s
htu : Disjoint t u
hbc : a * p i = b * c
hx : (b * ∏ i in t, p i) * (c * ∏ i in u, p i) = a * p i * ∏ x in s, p x
hit : ¬i ∈ t
hiu : ¬i ∈ u
⊢ ∃ t_1 u_1 b_1 c_1,
    t_1 ∪ u_1 = insert i s ∧
      Disjoint t_1 u_1 ∧
        a = b_1 * c_1 ∧ b * ∏ i in t, p i = b_1 * ∏ i in t_1, p i ∧ c * ∏ i in u, p i = c_1 * ∏ i in u_1, p i
obtain ⟨d, rfl⟩ | ⟨d, rfl⟩ : p i ∣ b ∨ p i ∣ c
case insert.intro.intro.intro.intro.intro.intro.intro.intro.inl.intro
R : Type u_2
inst✝¹ : CancelCommMonoidWithZero R
α : Type u_1
inst✝ : DecidableEq α
x y a✝ : R
s✝ : Finset α
p : α → R
hp✝ : ∀ (i : α), i ∈ s✝ → Prime (p i)
hx✝ : x * y = a✝ * ∏ i in s✝, p i
i : α
s : Finset α
his : ¬i ∈ s
ih :
  ∀ {x y a : R},
    (∀ (i : α), i ∈ s → Prime (p i)) →
      x * y = a * ∏ i in s, p i →
        ∃ t u b c, t ∪ u = s ∧ Disjoint t u ∧ a = b * c ∧ x = b * ∏ i in t, p i ∧ y = c * ∏ i in u, p i
a : R
hp : ∀ (i_1 : α), i_1 ∈ insert i s → Prime (p i_1)
hpi : Prime (p i)
t u : Finset α
c : R
htus : t ∪ u = s
htu : Disjoint t u
hit : ¬i ∈ t
hiu : ¬i ∈ u
d : R
hbc : a * p i = p i * d * c
hx : (p i * d * ∏ i in t, p i) * (c * ∏ i in u, p i) = a * p i * ∏ x in s, p x
⊢ ∃ t_1 u_1 b c_1,
    t_1 ∪ u_1 = insert i s ∧
      Disjoint t_1 u_1 ∧
        a = b * c_1 ∧ p i * d * ∏ i in t, p i = b * ∏ i in t_1, p i ∧ c * ∏ i in u, p i = c_1 * ∏ i in u_1, p i

case insert.intro.intro.intro.intro.intro.intro.intro.intro.inr.intro
R : Type u_2
inst✝¹ : CancelCommMonoidWithZero R
α : Type u_1
inst✝ : DecidableEq α
x y a✝ : R
s✝ : Finset α
p : α → R
hp✝ : ∀ (i : α), i ∈ s✝ → Prime (p i)
hx✝ : x * y = a✝ * ∏ i in s✝, p i
i : α
s : Finset α
his : ¬i ∈ s
ih :
  ∀ {x y a : R},
    (∀ (i : α), i ∈ s → Prime (p i)) →
      x * y = a * ∏ i in s, p i →
        ∃ t u b c, t ∪ u = s ∧ Disjoint t u ∧ a = b * c ∧ x = b * ∏ i in t, p i ∧ y = c * ∏ i in u, p i
a : R
hp : ∀ (i_1 : α), i_1 ∈ insert i s → Prime (p i_1)
hpi : Prime (p i)
t u : Finset α
b : R
htus : t ∪ u = s
htu : Disjoint t u
hit : ¬i ∈ t
hiu : ¬i ∈ u
d : R
hbc : a * p i = b * (p i * d)
hx : (b * ∏ i in t, p i) * (p i * d * ∏ i in u, p i) = a * p i * ∏ x in s, p x
⊢ ∃ t_1 u_1 b_1 c,
    t_1 ∪ u_1 = insert i s ∧
      Disjoint t_1 u_1 ∧
        a = b_1 * c ∧ b * ∏ i in t, p i = b_1 * ∏ i in t_1, p i ∧ p i * d * ∏ i in u, p i = c * ∏ i in u_1, p i
R : Type u_2
inst✝¹ : CancelCommMonoidWithZero R
α : Type u_1
inst✝ : DecidableEq α
x y a✝ : R
s✝ : Finset α
p : α → R
hp✝ : ∀ (i : α), i ∈ s✝ → Prime (p i)
hx✝ : x * y = a✝ * ∏ i in s✝, p i
i : α
s : Finset α
his : ¬i ∈ s
ih :
  ∀ {x y a : R},
    (∀ (i : α), i ∈ s → Prime (p i)) →
      x * y = a * ∏ i in s, p i →
        ∃ t u b c, t ∪ u = s ∧ Disjoint t u ∧ a = b * c ∧ x = b * ∏ i in t, p i ∧ y = c * ∏ i in u, p i
a : R
hp : ∀ (i_1 : α), i_1 ∈ insert i s → Prime (p i_1)
hpi : Prime (p i)
t u : Finset α
b c : R
htus : t ∪ u = s
htu : Disjoint t u
hbc : a * p i = b * c
hx : (b * ∏ i in t, p i) * (c * ∏ i in u, p i) = a * p i * ∏ x in s, p x
hit : ¬i ∈ t
hiu : ¬i ∈ u
⊢ p i ∣ b ∨ p i ∣ c

case insert.intro.intro.intro.intro.intro.intro.intro.intro.inl.intro
R : Type u_2
inst✝¹ : CancelCommMonoidWithZero R
α : Type u_1
inst✝ : DecidableEq α
x y a✝ : R
s✝ : Finset α
p : α → R
hp✝ : ∀ (i : α), i ∈ s✝ → Prime (p i)
hx✝ : x * y = a✝ * ∏ i in s✝, p i
i : α
s : Finset α
his : ¬i ∈ s
ih :
  ∀ {x y a : R},
    (∀ (i : α), i ∈ s → Prime (p i)) →
      x * y = a * ∏ i in s, p i →
        ∃ t u b c, t ∪ u = s ∧ Disjoint t u ∧ a = b * c ∧ x = b * ∏ i in t, p i ∧ y = c * ∏ i in u, p i
a : R
hp : ∀ (i_1 : α), i_1 ∈ insert i s → Prime (p i_1)
hpi : Prime (p i)
t u : Finset α
c : R
htus : t ∪ u = s
htu : Disjoint t u
hit : ¬i ∈ t
hiu : ¬i ∈ u
d : R
hbc : a * p i = p i * d * c
hx : (p i * d * ∏ i in t, p i) * (c * ∏ i in u, p i) = a * p i * ∏ x in s, p x
⊢ ∃ t_1 u_1 b c_1,
    t_1 ∪ u_1 = insert i s ∧
      Disjoint t_1 u_1 ∧
        a = b * c_1 ∧ p i * d * ∏ i in t, p i = b * ∏ i in t_1, p i ∧ c * ∏ i in u, p i = c_1 * ∏ i in u_1, p i

case insert.intro.intro.intro.intro.intro.intro.intro.intro.inr.intro
R : Type u_2
inst✝¹ : CancelCommMonoidWithZero R
α : Type u_1
inst✝ : DecidableEq α
x y a✝ : R
s✝ : Finset α
p : α → R
hp✝ : ∀ (i : α), i ∈ s✝ → Prime (p i)
hx✝ : x * y = a✝ * ∏ i in s✝, p i
i : α
s : Finset α
his : ¬i ∈ s
ih :
  ∀ {x y a : R},
    (∀ (i : α), i ∈ s → Prime (p i)) →
      x * y = a * ∏ i in s, p i →
        ∃ t u b c, t ∪ u = s ∧ Disjoint t u ∧ a = b * c ∧ x = b * ∏ i in t, p i ∧ y = c * ∏ i in u, p i
a : R
hp : ∀ (i_1 : α), i_1 ∈ insert i s → Prime (p i_1)
hpi : Prime (p i)
t u : Finset α
b : R
htus : t ∪ u = s
htu : Disjoint t u
hit : ¬i ∈ t
hiu : ¬i ∈ u
d : R
hbc : a * p i = b * (p i * d)
hx : (b * ∏ i in t, p i) * (p i * d * ∏ i in u, p i) = a * p i * ∏ x in s, p x
⊢ ∃ t_1 u_1 b_1 c,
    t_1 ∪ u_1 = insert i s ∧
      Disjoint t_1 u_1 ∧
        a = b_1 * c ∧ b * ∏ i in t, p i = b_1 * ∏ i in t_1, p i ∧ p i * d * ∏ i in u, p i = c * ∏ i in u_1, p i
exact hpi.dvd_or_dvd ⟨a, by rw [← hbc, mul_comm]⟩
no goals
R : Type u_2
inst✝¹ : CancelCommMonoidWithZero R
α : Type u_1
inst✝ : DecidableEq α
x y a✝ : R
s✝ : Finset α
p : α → R
hp✝ : ∀ (i : α), i ∈ s✝ → Prime (p i)
hx✝ : x * y = a✝ * ∏ i in s✝, p i
i : α
s : Finset α
his : ¬i ∈ s
ih :
  ∀ {x y a : R},
    (∀ (i : α), i ∈ s → Prime (p i)) →
      x * y = a * ∏ i in s, p i →
        ∃ t u b c, t ∪ u = s ∧ Disjoint t u ∧ a = b * c ∧ x = b * ∏ i in t, p i ∧ y = c * ∏ i in u, p i
a : R
hp : ∀ (i_1 : α), i_1 ∈ insert i s → Prime (p i_1)
hpi : Prime (p i)
t u : Finset α
b c : R
htus : t ∪ u = s
htu : Disjoint t u
hbc : a * p i = b * c
hx : (b * ∏ i in t, p i) * (c * ∏ i in u, p i) = a * p i * ∏ x in s, p x
hit : ¬i ∈ t
hiu : ¬i ∈ u
⊢ b * c = p i * a
rw [← hbc, mul_comm]
case insert.intro.intro.intro.intro.intro.intro.intro.intro.inl.intro
R : Type u_2
inst✝¹ : CancelCommMonoidWithZero R
α : Type u_1
inst✝ : DecidableEq α
x y a✝ : R
s✝ : Finset α
p : α → R
hp✝ : ∀ (i : α), i ∈ s✝ → Prime (p i)
hx✝ : x * y = a✝ * ∏ i in s✝, p i
i : α
s : Finset α
his : ¬i ∈ s
ih :
  ∀ {x y a : R},
    (∀ (i : α), i ∈ s → Prime (p i)) →
      x * y = a * ∏ i in s, p i →
        ∃ t u b c, t ∪ u = s ∧ Disjoint t u ∧ a = b * c ∧ x = b * ∏ i in t, p i ∧ y = c * ∏ i in u, p i
a : R
hp : ∀ (i_1 : α), i_1 ∈ insert i s → Prime (p i_1)
hpi : Prime (p i)
t u : Finset α
c : R
htus : t ∪ u = s
htu : Disjoint t u
hit : ¬i ∈ t
hiu : ¬i ∈ u
d : R
hbc : a = d * c
hx : (p i * d * ∏ i in t, p i) * (c * ∏ i in u, p i) = a * p i * ∏ x in s, p x
⊢ ∃ t_1 u_1 b c_1,
    t_1 ∪ u_1 = insert i s ∧
      Disjoint t_1 u_1 ∧
        a = b * c_1 ∧ p i * d * ∏ i in t, p i = b * ∏ i in t_1, p i ∧ c * ∏ i in u, p i = c_1 * ∏ i in u_1, p i
case insert.intro.intro.intro.intro.intro.intro.intro.intro.inl.intro
R : Type u_2
inst✝¹ : CancelCommMonoidWithZero R
α : Type u_1
inst✝ : DecidableEq α
x y a✝ : R
s✝ : Finset α
p : α → R
hp✝ : ∀ (i : α), i ∈ s✝ → Prime (p i)
hx✝ : x * y = a✝ * ∏ i in s✝, p i
i : α
s : Finset α
his : ¬i ∈ s
ih :
  ∀ {x y a : R},
    (∀ (i : α), i ∈ s → Prime (p i)) →
      x * y = a * ∏ i in s, p i →
        ∃ t u b c, t ∪ u = s ∧ Disjoint t u ∧ a = b * c ∧ x = b * ∏ i in t, p i ∧ y = c * ∏ i in u, p i
a : R
hp : ∀ (i_1 : α), i_1 ∈ insert i s → Prime (p i_1)
hpi : Prime (p i)
t u : Finset α
c : R
htus : t ∪ u = s
htu : Disjoint t u
hit : ¬i ∈ t
hiu : ¬i ∈ u
d : R
hbc : a * p i = p i * d * c
hx : (p i * d * ∏ i in t, p i) * (c * ∏ i in u, p i) = a * p i * ∏ x in s, p x
⊢ ∃ t_1 u_1 b c_1,
    t_1 ∪ u_1 = insert i s ∧
      Disjoint t_1 u_1 ∧
        a = b * c_1 ∧ p i * d * ∏ i in t, p i = b * ∏ i in t_1, p i ∧ c * ∏ i in u, p i = c_1 * ∏ i in u_1, p i
rw [mul_assoc, mul_comm a, mul_right_inj' hpi.ne_zero] at hbc
no goals
case insert.intro.intro.intro.intro.intro.intro.intro.intro.inl.intro
R : Type u_2
inst✝¹ : CancelCommMonoidWithZero R
α : Type u_1
inst✝ : DecidableEq α
x y a✝ : R
s✝ : Finset α
p : α → R
hp✝ : ∀ (i : α), i ∈ s✝ → Prime (p i)
hx✝ : x * y = a✝ * ∏ i in s✝, p i
i : α
s : Finset α
his : ¬i ∈ s
ih :
  ∀ {x y a : R},
    (∀ (i : α), i ∈ s → Prime (p i)) →
      x * y = a * ∏ i in s, p i →
        ∃ t u b c, t ∪ u = s ∧ Disjoint t u ∧ a = b * c ∧ x = b * ∏ i in t, p i ∧ y = c * ∏ i in u, p i
a : R
hp : ∀ (i_1 : α), i_1 ∈ insert i s → Prime (p i_1)
hpi : Prime (p i)
t u : Finset α
c : R
htus : t ∪ u = s
htu : Disjoint t u
hit : ¬i ∈ t
hiu : ¬i ∈ u
d : R
hbc : a = d * c
hx : (p i * d * ∏ i in t, p i) * (c * ∏ i in u, p i) = a * p i * ∏ x in s, p x
⊢ ∃ t_1 u_1 b c_1,
    t_1 ∪ u_1 = insert i s ∧
      Disjoint t_1 u_1 ∧
        a = b * c_1 ∧ p i * d * ∏ i in t, p i = b * ∏ i in t_1, p i ∧ c * ∏ i in u, p i = c_1 * ∏ i in u_1, p i
exact ⟨insert i t, u, d, c, by rw [insert_union, htus], disjoint_insert_left.2 ⟨hiu, htu⟩, by
    simp [hbc, prod_insert hit, mul_assoc, mul_comm, mul_left_comm]⟩
no goals
R : Type u_2
inst✝¹ : CancelCommMonoidWithZero R
α : Type u_1
inst✝ : DecidableEq α
x y a✝ : R
s✝ : Finset α
p : α → R
hp✝ : ∀ (i : α), i ∈ s✝ → Prime (p i)
hx✝ : x * y = a✝ * ∏ i in s✝, p i
i : α
s : Finset α
his : ¬i ∈ s
ih :
  ∀ {x y a : R},
    (∀ (i : α), i ∈ s → Prime (p i)) →
      x * y = a * ∏ i in s, p i →
        ∃ t u b c, t ∪ u = s ∧ Disjoint t u ∧ a = b * c ∧ x = b * ∏ i in t, p i ∧ y = c * ∏ i in u, p i
a : R
hp : ∀ (i_1 : α), i_1 ∈ insert i s → Prime (p i_1)
hpi : Prime (p i)
t u : Finset α
c : R
htus : t ∪ u = s
htu : Disjoint t u
hit : ¬i ∈ t
hiu : ¬i ∈ u
d : R
hbc : a = d * c
hx : (p i * d * ∏ i in t, p i) * (c * ∏ i in u, p i) = a * p i * ∏ x in s, p x
⊢ insert i t ∪ u = insert i s
rw [insert_union, htus]
no goals
R : Type u_2
inst✝¹ : CancelCommMonoidWithZero R
α : Type u_1
inst✝ : DecidableEq α
x y a✝ : R
s✝ : Finset α
p : α → R
hp✝ : ∀ (i : α), i ∈ s✝ → Prime (p i)
hx✝ : x * y = a✝ * ∏ i in s✝, p i
i : α
s : Finset α
his : ¬i ∈ s
ih :
  ∀ {x y a : R},
    (∀ (i : α), i ∈ s → Prime (p i)) →
      x * y = a * ∏ i in s, p i →
        ∃ t u b c, t ∪ u = s ∧ Disjoint t u ∧ a = b * c ∧ x = b * ∏ i in t, p i ∧ y = c * ∏ i in u, p i
a : R
hp : ∀ (i_1 : α), i_1 ∈ insert i s → Prime (p i_1)
hpi : Prime (p i)
t u : Finset α
c : R
htus : t ∪ u = s
htu : Disjoint t u
hit : ¬i ∈ t
hiu : ¬i ∈ u
d : R
hbc : a = d * c
hx : (p i * d * ∏ i in t, p i) * (c * ∏ i in u, p i) = a * p i * ∏ x in s, p x
⊢ a = d * c ∧ p i * d * ∏ i in t, p i = d * ∏ i in insert i t, p i ∧ c * ∏ i in u, p i = c * ∏ i in u, p i
simp [hbc, prod_insert hit, mul_assoc, mul_comm, mul_left_comm]
case insert.intro.intro.intro.intro.intro.intro.intro.intro.inr.intro
R : Type u_2
inst✝¹ : CancelCommMonoidWithZero R
α : Type u_1
inst✝ : DecidableEq α
x y a✝ : R
s✝ : Finset α
p : α → R
hp✝ : ∀ (i : α), i ∈ s✝ → Prime (p i)
hx✝ : x * y = a✝ * ∏ i in s✝, p i
i : α
s : Finset α
his : ¬i ∈ s
ih :
  ∀ {x y a : R},
    (∀ (i : α), i ∈ s → Prime (p i)) →
      x * y = a * ∏ i in s, p i →
        ∃ t u b c, t ∪ u = s ∧ Disjoint t u ∧ a = b * c ∧ x = b * ∏ i in t, p i ∧ y = c * ∏ i in u, p i
a : R
hp : ∀ (i_1 : α), i_1 ∈ insert i s → Prime (p i_1)
hpi : Prime (p i)
t u : Finset α
b : R
htus : t ∪ u = s
htu : Disjoint t u
hit : ¬i ∈ t
hiu : ¬i ∈ u
d : R
hbc : a = b * d
hx : (b * ∏ i in t, p i) * (p i * d * ∏ i in u, p i) = a * p i * ∏ x in s, p x
⊢ ∃ t_1 u_1 b_1 c,
    t_1 ∪ u_1 = insert i s ∧
      Disjoint t_1 u_1 ∧
        a = b_1 * c ∧ b * ∏ i in t, p i = b_1 * ∏ i in t_1, p i ∧ p i * d * ∏ i in u, p i = c * ∏ i in u_1, p i
case insert.intro.intro.intro.intro.intro.intro.intro.intro.inr.intro
R : Type u_2
inst✝¹ : CancelCommMonoidWithZero R
α : Type u_1
inst✝ : DecidableEq α
x y a✝ : R
s✝ : Finset α
p : α → R
hp✝ : ∀ (i : α), i ∈ s✝ → Prime (p i)
hx✝ : x * y = a✝ * ∏ i in s✝, p i
i : α
s : Finset α
his : ¬i ∈ s
ih :
  ∀ {x y a : R},
    (∀ (i : α), i ∈ s → Prime (p i)) →
      x * y = a * ∏ i in s, p i →
        ∃ t u b c, t ∪ u = s ∧ Disjoint t u ∧ a = b * c ∧ x = b * ∏ i in t, p i ∧ y = c * ∏ i in u, p i
a : R
hp : ∀ (i_1 : α), i_1 ∈ insert i s → Prime (p i_1)
hpi : Prime (p i)
t u : Finset α
b : R
htus : t ∪ u = s
htu : Disjoint t u
hit : ¬i ∈ t
hiu : ¬i ∈ u
d : R
hbc : a * p i = b * (p i * d)
hx : (b * ∏ i in t, p i) * (p i * d * ∏ i in u, p i) = a * p i * ∏ x in s, p x
⊢ ∃ t_1 u_1 b_1 c,
    t_1 ∪ u_1 = insert i s ∧
      Disjoint t_1 u_1 ∧
        a = b_1 * c ∧ b * ∏ i in t, p i = b_1 * ∏ i in t_1, p i ∧ p i * d * ∏ i in u, p i = c * ∏ i in u_1, p i
rw [← mul_assoc, mul_right_comm b, mul_left_inj' hpi.ne_zero] at hbc
no goals
case insert.intro.intro.intro.intro.intro.intro.intro.intro.inr.intro
R : Type u_2
inst✝¹ : CancelCommMonoidWithZero R
α : Type u_1
inst✝ : DecidableEq α
x y a✝ : R
s✝ : Finset α
p : α → R
hp✝ : ∀ (i : α), i ∈ s✝ → Prime (p i)
hx✝ : x * y = a✝ * ∏ i in s✝, p i
i : α
s : Finset α
his : ¬i ∈ s
ih :
  ∀ {x y a : R},
    (∀ (i : α), i ∈ s → Prime (p i)) →
      x * y = a * ∏ i in s, p i →
        ∃ t u b c, t ∪ u = s ∧ Disjoint t u ∧ a = b * c ∧ x = b * ∏ i in t, p i ∧ y = c * ∏ i in u, p i
a : R
hp : ∀ (i_1 : α), i_1 ∈ insert i s → Prime (p i_1)
hpi : Prime (p i)
t u : Finset α
b : R
htus : t ∪ u = s
htu : Disjoint t u
hit : ¬i ∈ t
hiu : ¬i ∈ u
d : R
hbc : a = b * d
hx : (b * ∏ i in t, p i) * (p i * d * ∏ i in u, p i) = a * p i * ∏ x in s, p x
⊢ ∃ t_1 u_1 b_1 c,
    t_1 ∪ u_1 = insert i s ∧
      Disjoint t_1 u_1 ∧
        a = b_1 * c ∧ b * ∏ i in t, p i = b_1 * ∏ i in t_1, p i ∧ p i * d * ∏ i in u, p i = c * ∏ i in u_1, p i
exact ⟨t, insert i u, b, d, by rw [union_insert, htus], disjoint_insert_right.2 ⟨hit, htu⟩, by
    simp [← hbc, prod_insert hiu, mul_assoc, mul_comm, mul_left_comm]⟩
no goals
R : Type u_2
inst✝¹ : CancelCommMonoidWithZero R
α : Type u_1
inst✝ : DecidableEq α
x y a✝ : R
s✝ : Finset α
p : α → R
hp✝ : ∀ (i : α), i ∈ s✝ → Prime (p i)
hx✝ : x * y = a✝ * ∏ i in s✝, p i
i : α
s : Finset α
his : ¬i ∈ s
ih :
  ∀ {x y a : R},
    (∀ (i : α), i ∈ s → Prime (p i)) →
      x * y = a * ∏ i in s, p i →
        ∃ t u b c, t ∪ u = s ∧ Disjoint t u ∧ a = b * c ∧ x = b * ∏ i in t, p i ∧ y = c * ∏ i in u, p i
a : R
hp : ∀ (i_1 : α), i_1 ∈ insert i s → Prime (p i_1)
hpi : Prime (p i)
t u : Finset α
b : R
htus : t ∪ u = s
htu : Disjoint t u
hit : ¬i ∈ t
hiu : ¬i ∈ u
d : R
hbc : a = b * d
hx : (b * ∏ i in t, p i) * (p i * d * ∏ i in u, p i) = a * p i * ∏ x in s, p x
⊢ t ∪ insert i u = insert i s
rw [union_insert, htus]
no goals
R : Type u_2
inst✝¹ : CancelCommMonoidWithZero R
α : Type u_1
inst✝ : DecidableEq α
x y a✝ : R
s✝ : Finset α
p : α → R
hp✝ : ∀ (i : α), i ∈ s✝ → Prime (p i)
hx✝ : x * y = a✝ * ∏ i in s✝, p i
i : α
s : Finset α
his : ¬i ∈ s
ih :
  ∀ {x y a : R},
    (∀ (i : α), i ∈ s → Prime (p i)) →
      x * y = a * ∏ i in s, p i →
        ∃ t u b c, t ∪ u = s ∧ Disjoint t u ∧ a = b * c ∧ x = b * ∏ i in t, p i ∧ y = c * ∏ i in u, p i
a : R
hp : ∀ (i_1 : α), i_1 ∈ insert i s → Prime (p i_1)
hpi : Prime (p i)
t u : Finset α
b : R
htus : t ∪ u = s
htu : Disjoint t u
hit : ¬i ∈ t
hiu : ¬i ∈ u
d : R
hbc : a = b * d
hx : (b * ∏ i in t, p i) * (p i * d * ∏ i in u, p i) = a * p i * ∏ x in s, p x
⊢ a = b * d ∧ b * ∏ i in t, p i = b * ∏ i in t, p i ∧ p i * d * ∏ i in u, p i = d * ∏ i in insert i u, p i
simp [← hbc, prod_insert hiu, mul_assoc, mul_comm, mul_left_comm]