α : Type u
β : Type v
γ : Type w
s✝ s₁ s₂ : Finset α
a : α
b : β
f✝ g✝ : α → β
inst✝² : CommSemiring β
ι : Type u_1
R : Type u_2
inst✝¹ : CommSemiring R
inst✝ : LinearOrder ι
s : Finset ι
f g : ι → R
⊢ ∀ (a : ι) (s : Finset ι),
    (∀ (x : ι), x ∈ s → x < a) →
      ∏ i in s, (f i + g i) =
          ∏ i in s, f i +
            ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j →
        ∏ i in insert a s, (f i + g i) =
          ∏ i in insert a s, f i +
            ∑ i in insert a s,
              (g i * ∏ j in filter (fun x => x < i) (insert a s), (f j + g j)) *
                ∏ j in filter (fun j => i < j) (insert a s), f j
α : Type u
β : Type v
γ : Type w
s✝ s₁ s₂ : Finset α
a : α
b : β
f✝ g✝ : α → β
inst✝² : CommSemiring β
ι : Type u_1
R : Type u_2
inst✝¹ : CommSemiring R
inst✝ : LinearOrder ι
s : Finset ι
f g : ι → R
⊢ ∏ i in s, (f i + g i) =
    ∏ i in s, f i +
      ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j
refine' Finset.induction_on_max s (by simp) _
α : Type u
β : Type v
γ : Type w
s s₁ s₂ : Finset α
a : α
b : β
f✝ g✝ : α → β
inst✝² : CommSemiring β
ι : Type u_1
R : Type u_2
inst✝¹ : CommSemiring R
inst✝ : LinearOrder ι
f g : ι → R
⊢ ∀ (a : ι) (s : Finset ι),
    (∀ (x : ι), x ∈ s → x < a) →
      ∏ i in s, (f i + g i) =
          ∏ i in s, f i +
            ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j →
        ∏ i in insert a s, (f i + g i) =
          ∏ i in insert a s, f i +
            ∑ i in insert a s,
              (g i * ∏ j in filter (fun x => x < i) (insert a s), (f j + g j)) *
                ∏ j in filter (fun j => i < j) (insert a s), f j
α : Type u
β : Type v
γ : Type w
s✝ s₁ s₂ : Finset α
a : α
b : β
f✝ g✝ : α → β
inst✝² : CommSemiring β
ι : Type u_1
R : Type u_2
inst✝¹ : CommSemiring R
inst✝ : LinearOrder ι
s : Finset ι
f g : ι → R
⊢ ∀ (a : ι) (s : Finset ι),
    (∀ (x : ι), x ∈ s → x < a) →
      ∏ i in s, (f i + g i) =
          ∏ i in s, f i +
            ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j →
        ∏ i in insert a s, (f i + g i) =
          ∏ i in insert a s, f i +
            ∑ i in insert a s,
              (g i * ∏ j in filter (fun x => x < i) (insert a s), (f j + g j)) *
                ∏ j in filter (fun j => i < j) (insert a s), f j
clear s
α : Type u
β : Type v
γ : Type w
s✝ s₁ s₂ : Finset α
a✝ : α
b : β
f✝ g✝ : α → β
inst✝² : CommSemiring β
ι : Type u_1
R : Type u_2
inst✝¹ : CommSemiring R
inst✝ : LinearOrder ι
f g : ι → R
a : ι
s : Finset ι
ha : ∀ (x : ι), x ∈ s → x < a
ihs :
  ∏ i in s, (f i + g i) =
    ∏ i in s, f i +
      ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j
⊢ ∏ i in insert a s, (f i + g i) =
    ∏ i in insert a s, f i +
      ∑ i in insert a s,
        (g i * ∏ j in filter (fun x => x < i) (insert a s), (f j + g j)) *
          ∏ j in filter (fun j => i < j) (insert a s), f j
α : Type u
β : Type v
γ : Type w
s s₁ s₂ : Finset α
a : α
b : β
f✝ g✝ : α → β
inst✝² : CommSemiring β
ι : Type u_1
R : Type u_2
inst✝¹ : CommSemiring R
inst✝ : LinearOrder ι
f g : ι → R
⊢ ∀ (a : ι) (s : Finset ι),
    (∀ (x : ι), x ∈ s → x < a) →
      ∏ i in s, (f i + g i) =
          ∏ i in s, f i +
            ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j →
        ∏ i in insert a s, (f i + g i) =
          ∏ i in insert a s, f i +
            ∑ i in insert a s,
              (g i * ∏ j in filter (fun x => x < i) (insert a s), (f j + g j)) *
                ∏ j in filter (fun j => i < j) (insert a s), f j
intro a s ha ihs
α : Type u
β : Type v
γ : Type w
s✝ s₁ s₂ : Finset α
a✝ : α
b : β
f✝ g✝ : α → β
inst✝² : CommSemiring β
ι : Type u_1
R : Type u_2
inst✝¹ : CommSemiring R
inst✝ : LinearOrder ι
f g : ι → R
a : ι
s : Finset ι
ha : ∀ (x : ι), x ∈ s → x < a
ihs :
  ∏ i in s, (f i + g i) =
    ∏ i in s, f i +
      ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j
ha' : ¬a ∈ s
⊢ ∏ i in insert a s, (f i + g i) =
    ∏ i in insert a s, f i +
      ∑ i in insert a s,
        (g i * ∏ j in filter (fun x => x < i) (insert a s), (f j + g j)) *
          ∏ j in filter (fun j => i < j) (insert a s), f j
α : Type u
β : Type v
γ : Type w
s✝ s₁ s₂ : Finset α
a✝ : α
b : β
f✝ g✝ : α → β
inst✝² : CommSemiring β
ι : Type u_1
R : Type u_2
inst✝¹ : CommSemiring R
inst✝ : LinearOrder ι
f g : ι → R
a : ι
s : Finset ι
ha : ∀ (x : ι), x ∈ s → x < a
ihs :
  ∏ i in s, (f i + g i) =
    ∏ i in s, f i +
      ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j
⊢ ∏ i in insert a s, (f i + g i) =
    ∏ i in insert a s, f i +
      ∑ i in insert a s,
        (g i * ∏ j in filter (fun x => x < i) (insert a s), (f j + g j)) *
          ∏ j in filter (fun j => i < j) (insert a s), f j
have ha' : a ∉ s := fun ha' => lt_irrefl a (ha a ha')
α : Type u
β : Type v
γ : Type w
s✝ s₁ s₂ : Finset α
a✝ : α
b : β
f✝ g✝ : α → β
inst✝² : CommSemiring β
ι : Type u_1
R : Type u_2
inst✝¹ : CommSemiring R
inst✝ : LinearOrder ι
f g : ι → R
a : ι
s : Finset ι
ha : ∀ (x : ι), x ∈ s → x < a
ihs :
  ∏ i in s, (f i + g i) =
    ∏ i in s, f i +
      ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j
ha' : ¬a ∈ s
⊢ f a * ∏ i in s, f i +
      (f a * ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j +
        (g a * ∏ i in s, f i +
          g a *
            ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j)) =
    f a * ∏ x in s, f x +
      ((g a * ∏ i in s, f i +
            g a *
              ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j) *
          ∏ j in filter (fun j => a < j) (insert a s), f j +
        ∑ x in s,
          (g x * ∏ j in filter (fun x_1 => x_1 < x) (insert a s), (f j + g j)) *
            ∏ j in filter (fun j => x < j) (insert a s), f j)
α : Type u
β : Type v
γ : Type w
s✝ s₁ s₂ : Finset α
a✝ : α
b : β
f✝ g✝ : α → β
inst✝² : CommSemiring β
ι : Type u_1
R : Type u_2
inst✝¹ : CommSemiring R
inst✝ : LinearOrder ι
f g : ι → R
a : ι
s : Finset ι
ha : ∀ (x : ι), x ∈ s → x < a
ihs :
  ∏ i in s, (f i + g i) =
    ∏ i in s, f i +
      ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j
ha' : ¬a ∈ s
⊢ ∏ i in insert a s, (f i + g i) =
    ∏ i in insert a s, f i +
      ∑ i in insert a s,
        (g i * ∏ j in filter (fun x => x < i) (insert a s), (f j + g j)) *
          ∏ j in filter (fun j => i < j) (insert a s), f j
rw [prod_insert ha', prod_insert ha', sum_insert ha', filter_insert, if_neg (lt_irrefl a),
  filter_true_of_mem ha, ihs, add_mul, mul_add, mul_add, add_assoc]
case e_a
α : Type u
β : Type v
γ : Type w
s✝ s₁ s₂ : Finset α
a✝ : α
b : β
f✝ g✝ : α → β
inst✝² : CommSemiring β
ι : Type u_1
R : Type u_2
inst✝¹ : CommSemiring R
inst✝ : LinearOrder ι
f g : ι → R
a : ι
s : Finset ι
ha : ∀ (x : ι), x ∈ s → x < a
ihs :
  ∏ i in s, (f i + g i) =
    ∏ i in s, f i +
      ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j
ha' : ¬a ∈ s
⊢ f a * ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j +
      (g a * ∏ i in s, f i +
        g a * ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j) =
    (g a * ∏ i in s, f i +
          g a *
            ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j) *
        ∏ j in filter (fun j => a < j) (insert a s), f j +
      ∑ x in s,
        (g x * ∏ j in filter (fun x_1 => x_1 < x) (insert a s), (f j + g j)) *
          ∏ j in filter (fun j => x < j) (insert a s), f j
α : Type u
β : Type v
γ : Type w
s✝ s₁ s₂ : Finset α
a✝ : α
b : β
f✝ g✝ : α → β
inst✝² : CommSemiring β
ι : Type u_1
R : Type u_2
inst✝¹ : CommSemiring R
inst✝ : LinearOrder ι
f g : ι → R
a : ι
s : Finset ι
ha : ∀ (x : ι), x ∈ s → x < a
ihs :
  ∏ i in s, (f i + g i) =
    ∏ i in s, f i +
      ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j
ha' : ¬a ∈ s
⊢ f a * ∏ i in s, f i +
      (f a * ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j +
        (g a * ∏ i in s, f i +
          g a *
            ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j)) =
    f a * ∏ x in s, f x +
      ((g a * ∏ i in s, f i +
            g a *
              ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j) *
          ∏ j in filter (fun j => a < j) (insert a s), f j +
        ∑ x in s,
          (g x * ∏ j in filter (fun x_1 => x_1 < x) (insert a s), (f j + g j)) *
            ∏ j in filter (fun j => x < j) (insert a s), f j)
congr 1
case e_a
α : Type u
β : Type v
γ : Type w
s✝ s₁ s₂ : Finset α
a✝ : α
b : β
f✝ g✝ : α → β
inst✝² : CommSemiring β
ι : Type u_1
R : Type u_2
inst✝¹ : CommSemiring R
inst✝ : LinearOrder ι
f g : ι → R
a : ι
s : Finset ι
ha : ∀ (x : ι), x ∈ s → x < a
ihs :
  ∏ i in s, (f i + g i) =
    ∏ i in s, f i +
      ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j
ha' : ¬a ∈ s
⊢ g a * ∏ i in s, f i +
        g a * ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j +
      f a * ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j =
    (g a * ∏ i in s, f i +
          g a *
            ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j) *
        ∏ j in filter (fun j => a < j) (insert a s), f j +
      ∑ x in s,
        (g x * ∏ j in filter (fun x_1 => x_1 < x) (insert a s), (f j + g j)) *
          ∏ j in filter (fun j => x < j) (insert a s), f j
case e_a
α : Type u
β : Type v
γ : Type w
s✝ s₁ s₂ : Finset α
a✝ : α
b : β
f✝ g✝ : α → β
inst✝² : CommSemiring β
ι : Type u_1
R : Type u_2
inst✝¹ : CommSemiring R
inst✝ : LinearOrder ι
f g : ι → R
a : ι
s : Finset ι
ha : ∀ (x : ι), x ∈ s → x < a
ihs :
  ∏ i in s, (f i + g i) =
    ∏ i in s, f i +
      ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j
ha' : ¬a ∈ s
⊢ f a * ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j +
      (g a * ∏ i in s, f i +
        g a * ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j) =
    (g a * ∏ i in s, f i +
          g a *
            ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j) *
        ∏ j in filter (fun j => a < j) (insert a s), f j +
      ∑ x in s,
        (g x * ∏ j in filter (fun x_1 => x_1 < x) (insert a s), (f j + g j)) *
          ∏ j in filter (fun j => x < j) (insert a s), f j
rw [add_comm]
case e_a.e_a
α : Type u
β : Type v
γ : Type w
s✝ s₁ s₂ : Finset α
a✝ : α
b : β
f✝ g✝ : α → β
inst✝² : CommSemiring β
ι : Type u_1
R : Type u_2
inst✝¹ : CommSemiring R
inst✝ : LinearOrder ι
f g : ι → R
a : ι
s : Finset ι
ha : ∀ (x : ι), x ∈ s → x < a
ihs :
  ∏ i in s, (f i + g i) =
    ∏ i in s, f i +
      ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j
ha' : ¬a ∈ s
⊢ g a * ∏ i in s, f i +
      g a * ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j =
    (g a * ∏ i in s, f i +
        g a * ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j) *
      ∏ j in filter (fun j => a < j) (insert a s), f j

case e_a.e_a
α : Type u
β : Type v
γ : Type w
s✝ s₁ s₂ : Finset α
a✝ : α
b : β
f✝ g✝ : α → β
inst✝² : CommSemiring β
ι : Type u_1
R : Type u_2
inst✝¹ : CommSemiring R
inst✝ : LinearOrder ι
f g : ι → R
a : ι
s : Finset ι
ha : ∀ (x : ι), x ∈ s → x < a
ihs :
  ∏ i in s, (f i + g i) =
    ∏ i in s, f i +
      ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j
ha' : ¬a ∈ s
⊢ f a * ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j =
    ∑ x in s,
      (g x * ∏ j in filter (fun x_1 => x_1 < x) (insert a s), (f j + g j)) *
        ∏ j in filter (fun j => x < j) (insert a s), f j
case e_a
α : Type u
β : Type v
γ : Type w
s✝ s₁ s₂ : Finset α
a✝ : α
b : β
f✝ g✝ : α → β
inst✝² : CommSemiring β
ι : Type u_1
R : Type u_2
inst✝¹ : CommSemiring R
inst✝ : LinearOrder ι
f g : ι → R
a : ι
s : Finset ι
ha : ∀ (x : ι), x ∈ s → x < a
ihs :
  ∏ i in s, (f i + g i) =
    ∏ i in s, f i +
      ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j
ha' : ¬a ∈ s
⊢ g a * ∏ i in s, f i +
        g a * ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j +
      f a * ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j =
    (g a * ∏ i in s, f i +
          g a *
            ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j) *
        ∏ j in filter (fun j => a < j) (insert a s), f j +
      ∑ x in s,
        (g x * ∏ j in filter (fun x_1 => x_1 < x) (insert a s), (f j + g j)) *
          ∏ j in filter (fun j => x < j) (insert a s), f j
congr 1
no goals
α : Type u
β : Type v
γ : Type w
s✝ s₁ s₂ : Finset α
a : α
b : β
f✝ g✝ : α → β
inst✝² : CommSemiring β
ι : Type u_1
R : Type u_2
inst✝¹ : CommSemiring R
inst✝ : LinearOrder ι
s : Finset ι
f g : ι → R
⊢ ∏ i in ∅, (f i + g i) =
    ∏ i in ∅, f i +
      ∑ i in ∅, (g i * ∏ j in filter (fun x => x < i) ∅, (f j + g j)) * ∏ j in filter (fun j => i < j) ∅, f j
simp
case e_a.e_a
α : Type u
β : Type v
γ : Type w
s✝ s₁ s₂ : Finset α
a✝ : α
b : β
f✝ g✝ : α → β
inst✝² : CommSemiring β
ι : Type u_1
R : Type u_2
inst✝¹ : CommSemiring R
inst✝ : LinearOrder ι
f g : ι → R
a : ι
s : Finset ι
ha : ∀ (x : ι), x ∈ s → x < a
ihs :
  ∏ i in s, (f i + g i) =
    ∏ i in s, f i +
      ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j
ha' : ¬a ∈ s
⊢ ∀ (x : ι), x ∈ insert a s → ¬a < x
case e_a.e_a
α : Type u
β : Type v
γ : Type w
s✝ s₁ s₂ : Finset α
a✝ : α
b : β
f✝ g✝ : α → β
inst✝² : CommSemiring β
ι : Type u_1
R : Type u_2
inst✝¹ : CommSemiring R
inst✝ : LinearOrder ι
f g : ι → R
a : ι
s : Finset ι
ha : ∀ (x : ι), x ∈ s → x < a
ihs :
  ∏ i in s, (f i + g i) =
    ∏ i in s, f i +
      ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j
ha' : ¬a ∈ s
⊢ g a * ∏ i in s, f i +
      g a * ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j =
    (g a * ∏ i in s, f i +
        g a * ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j) *
      ∏ j in filter (fun j => a < j) (insert a s), f j
rw [filter_false_of_mem, prod_empty, mul_one]
no goals
case e_a.e_a
α : Type u
β : Type v
γ : Type w
s✝ s₁ s₂ : Finset α
a✝ : α
b : β
f✝ g✝ : α → β
inst✝² : CommSemiring β
ι : Type u_1
R : Type u_2
inst✝¹ : CommSemiring R
inst✝ : LinearOrder ι
f g : ι → R
a : ι
s : Finset ι
ha : ∀ (x : ι), x ∈ s → x < a
ihs :
  ∏ i in s, (f i + g i) =
    ∏ i in s, f i +
      ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j
ha' : ¬a ∈ s
⊢ ∀ (x : ι), x ∈ insert a s → ¬a < x
exact (forall_mem_insert _ _ _).2 ⟨lt_irrefl a, fun i hi => (ha i hi).not_lt⟩
case e_a.e_a
α : Type u
β : Type v
γ : Type w
s✝ s₁ s₂ : Finset α
a✝ : α
b : β
f✝ g✝ : α → β
inst✝² : CommSemiring β
ι : Type u_1
R : Type u_2
inst✝¹ : CommSemiring R
inst✝ : LinearOrder ι
f g : ι → R
a : ι
s : Finset ι
ha : ∀ (x : ι), x ∈ s → x < a
ihs :
  ∏ i in s, (f i + g i) =
    ∏ i in s, f i +
      ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j
ha' : ¬a ∈ s
⊢ ∑ x in s, f a * ((g x * ∏ j in filter (fun x_1 => x_1 < x) s, (f j + g j)) * ∏ j in filter (fun j => x < j) s, f j) =
    ∑ x in s,
      (g x * ∏ j in filter (fun x_1 => x_1 < x) (insert a s), (f j + g j)) *
        ∏ j in filter (fun j => x < j) (insert a s), f j
case e_a.e_a
α : Type u
β : Type v
γ : Type w
s✝ s₁ s₂ : Finset α
a✝ : α
b : β
f✝ g✝ : α → β
inst✝² : CommSemiring β
ι : Type u_1
R : Type u_2
inst✝¹ : CommSemiring R
inst✝ : LinearOrder ι
f g : ι → R
a : ι
s : Finset ι
ha : ∀ (x : ι), x ∈ s → x < a
ihs :
  ∏ i in s, (f i + g i) =
    ∏ i in s, f i +
      ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j
ha' : ¬a ∈ s
⊢ f a * ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j =
    ∑ x in s,
      (g x * ∏ j in filter (fun x_1 => x_1 < x) (insert a s), (f j + g j)) *
        ∏ j in filter (fun j => x < j) (insert a s), f j
rw [mul_sum]
case e_a.e_a
α : Type u
β : Type v
γ : Type w
s✝ s₁ s₂ : Finset α
a✝ : α
b : β
f✝ g✝ : α → β
inst✝² : CommSemiring β
ι : Type u_1
R : Type u_2
inst✝¹ : CommSemiring R
inst✝ : LinearOrder ι
f g : ι → R
a : ι
s : Finset ι
ha : ∀ (x : ι), x ∈ s → x < a
ihs :
  ∏ i in s, (f i + g i) =
    ∏ i in s, f i +
      ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j
ha' : ¬a ∈ s
i : ι
hi : i ∈ s
⊢ f a * ((g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j) =
    (g i * ∏ j in filter (fun x => x < i) (insert a s), (f j + g j)) * ∏ j in filter (fun j => i < j) (insert a s), f j
case e_a.e_a
α : Type u
β : Type v
γ : Type w
s✝ s₁ s₂ : Finset α
a✝ : α
b : β
f✝ g✝ : α → β
inst✝² : CommSemiring β
ι : Type u_1
R : Type u_2
inst✝¹ : CommSemiring R
inst✝ : LinearOrder ι
f g : ι → R
a : ι
s : Finset ι
ha : ∀ (x : ι), x ∈ s → x < a
ihs :
  ∏ i in s, (f i + g i) =
    ∏ i in s, f i +
      ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j
ha' : ¬a ∈ s
⊢ ∑ x in s, f a * ((g x * ∏ j in filter (fun x_1 => x_1 < x) s, (f j + g j)) * ∏ j in filter (fun j => x < j) s, f j) =
    ∑ x in s,
      (g x * ∏ j in filter (fun x_1 => x_1 < x) (insert a s), (f j + g j)) *
        ∏ j in filter (fun j => x < j) (insert a s), f j
refine' sum_congr rfl fun i hi => _
case e_a.e_a
α : Type u
β : Type v
γ : Type w
s✝ s₁ s₂ : Finset α
a✝ : α
b : β
f✝ g✝ : α → β
inst✝² : CommSemiring β
ι : Type u_1
R : Type u_2
inst✝¹ : CommSemiring R
inst✝ : LinearOrder ι
f g : ι → R
a : ι
s : Finset ι
ha : ∀ (x : ι), x ∈ s → x < a
ihs :
  ∏ i in s, (f i + g i) =
    ∏ i in s, f i +
      ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j
ha' : ¬a ∈ s
i : ι
hi : i ∈ s
⊢ ¬a ∈ filter (fun j => i < j) s
case e_a.e_a
α : Type u
β : Type v
γ : Type w
s✝ s₁ s₂ : Finset α
a✝ : α
b : β
f✝ g✝ : α → β
inst✝² : CommSemiring β
ι : Type u_1
R : Type u_2
inst✝¹ : CommSemiring R
inst✝ : LinearOrder ι
f g : ι → R
a : ι
s : Finset ι
ha : ∀ (x : ι), x ∈ s → x < a
ihs :
  ∏ i in s, (f i + g i) =
    ∏ i in s, f i +
      ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j
ha' : ¬a ∈ s
i : ι
hi : i ∈ s
⊢ f a * ((g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j) =
    (g i * ∏ j in filter (fun x => x < i) (insert a s), (f j + g j)) * ∏ j in filter (fun j => i < j) (insert a s), f j
rw [filter_insert, if_neg (ha i hi).not_lt, filter_insert, if_pos (ha i hi), prod_insert,
  mul_left_comm]
no goals
case e_a.e_a
α : Type u
β : Type v
γ : Type w
s✝ s₁ s₂ : Finset α
a✝ : α
b : β
f✝ g✝ : α → β
inst✝² : CommSemiring β
ι : Type u_1
R : Type u_2
inst✝¹ : CommSemiring R
inst✝ : LinearOrder ι
f g : ι → R
a : ι
s : Finset ι
ha : ∀ (x : ι), x ∈ s → x < a
ihs :
  ∏ i in s, (f i + g i) =
    ∏ i in s, f i +
      ∑ i in s, (g i * ∏ j in filter (fun x => x < i) s, (f j + g j)) * ∏ j in filter (fun j => i < j) s, f j
ha' : ¬a ∈ s
i : ι
hi : i ∈ s
⊢ ¬a ∈ filter (fun j => i < j) s
exact mt (fun ha => (mem_filter.1 ha).1) ha'