The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V03. Sets, finite structures and big operators

Mathlib.Algebra.BigOperators.Group.Finset.Piecewise

82 declarations and 4 deprecated aliases. Mathlib docs · Source

Interaction of big operators with piecewise functions

This file proves lemmas on the sum and product of piecewise functions, including ite and dite.

theorem Finset.prod_apply_dite E1 #

∀ {ι : Type u_1} {M : Type u_2} {γ : Type u_3} {s : Finset ι} [inst : CommMonoid M] {p : ι → Prop}
  [inst_1 : DecidablePred p] [inst_2 : DecidablePred fun x ↦ ¬p x] (f : (x : ι) → p x → γ) (g : (x : ι) → ¬p x → γ)
  (h : γ → M), ∏ x ∈ s, h (if hx : p x then f x hx else g x hx) = (∏ x, h (f ↑x ⋯)) * ∏ x, h (g ↑x ⋯)

theorem Finset.sum_apply_dite E1 #

∀ {ι : Type u_1} {M : Type u_2} {γ : Type u_3} {s : Finset ι} [inst : AddCommMonoid M] {p : ι → Prop}
  [inst_1 : DecidablePred p] [inst_2 : DecidablePred fun x ↦ ¬p x] (f : (x : ι) → p x → γ) (g : (x : ι) → ¬p x → γ)
  (h : γ → M), ∑ x ∈ s, h (if hx : p x then f x hx else g x hx) = ∑ x, h (f ↑x ⋯) + ∑ x, h (g ↑x ⋯)

theorem Finset.prod_apply_ite E1 #

∀ {ι : Type u_1} {M : Type u_2} {γ : Type u_3} [inst : CommMonoid M] {s : Finset ι} {p : ι → Prop}
  [inst_1 : DecidablePred p] (f g : ι → γ) (h : γ → M),
  ∏ x ∈ s, h (if p x then f x else g x) = (∏ x ∈ s with p x, h (f x)) * ∏ x ∈ s with ¬p x, h (g x)

theorem Finset.sum_apply_ite E1 #

∀ {ι : Type u_1} {M : Type u_2} {γ : Type u_3} [inst : AddCommMonoid M] {s : Finset ι} {p : ι → Prop}
  [inst_1 : DecidablePred p] (f g : ι → γ) (h : γ → M),
  ∑ x ∈ s, h (if p x then f x else g x) = ∑ x ∈ s with p x, h (f x) + ∑ x ∈ s with ¬p x, h (g x)

theorem Finset.prod_dite E1 #

∀ {ι : Type u_1} {M : Type u_2} [inst : CommMonoid M] {s : Finset ι} {p : ι → Prop} [inst_1 : DecidablePred p]
  (f : (x : ι) → p x → M) (g : (x : ι) → ¬p x → M),
  (∏ x ∈ s, if hx : p x then f x hx else g x hx) = (∏ x, f ↑x ⋯) * ∏ x, g ↑x ⋯

theorem Finset.sum_dite E1 #

∀ {ι : Type u_1} {M : Type u_2} [inst : AddCommMonoid M] {s : Finset ι} {p : ι → Prop} [inst_1 : DecidablePred p]
  (f : (x : ι) → p x → M) (g : (x : ι) → ¬p x → M),
  (∑ x ∈ s, if hx : p x then f x hx else g x hx) = ∑ x, f ↑x ⋯ + ∑ x, g ↑x ⋯

theorem Finset.prod_ite E1 #

∀ {ι : Type u_1} {M : Type u_2} [inst : CommMonoid M] {s : Finset ι} {p : ι → Prop} [inst_1 : DecidablePred p]
  (f g : ι → M), (∏ x ∈ s, if p x then f x else g x) = (∏ x ∈ s with p x, f x) * ∏ x ∈ s with ¬p x, g x

theorem Finset.sum_ite E1 #

∀ {ι : Type u_1} {M : Type u_2} [inst : AddCommMonoid M] {s : Finset ι} {p : ι → Prop} [inst_1 : DecidablePred p]
  (f g : ι → M), (∑ x ∈ s, if p x then f x else g x) = ∑ x ∈ s with p x, f x + ∑ x ∈ s with ¬p x, g x

theorem Finset.prod_dite_of_false E1 #

∀ {ι : Type u_1} {M : Type u_2} {s : Finset ι} [inst : CommMonoid M] {p : ι → Prop} [inst_1 : DecidablePred p]
  (h : ∀ i ∈ s, ¬p i) (f : (i : ι) → p i → M) (g : (i : ι) → ¬p i → M),
  (∏ i ∈ s, if hi : p i then f i hi else g i hi) = ∏ i, g ↑i ⋯

theorem Finset.sum_dite_of_false E1 #

∀ {ι : Type u_1} {M : Type u_2} {s : Finset ι} [inst : AddCommMonoid M] {p : ι → Prop} [inst_1 : DecidablePred p]
  (h : ∀ i ∈ s, ¬p i) (f : (i : ι) → p i → M) (g : (i : ι) → ¬p i → M),
  (∑ i ∈ s, if hi : p i then f i hi else g i hi) = ∑ i, g ↑i ⋯

theorem Finset.sum_ite_of_false E1 #

∀ {ι : Type u_1} {M : Type u_2} {s : Finset ι} [inst : AddCommMonoid M] {p : ι → Prop} [inst_1 : DecidablePred p],
  (∀ x ∈ s, ¬p x) → ∀ (f g : ι → M), (∑ x ∈ s, if p x then f x else g x) = ∑ x ∈ s, g x

theorem Finset.prod_ite_of_false E1 #

∀ {ι : Type u_1} {M : Type u_2} {s : Finset ι} [inst : CommMonoid M] {p : ι → Prop} [inst_1 : DecidablePred p],
  (∀ x ∈ s, ¬p x) → ∀ (f g : ι → M), (∏ x ∈ s, if p x then f x else g x) = ∏ x ∈ s, g x

theorem Finset.sum_dite_of_true E1 #

∀ {ι : Type u_1} {M : Type u_2} {s : Finset ι} [inst : AddCommMonoid M] {p : ι → Prop} [inst_1 : DecidablePred p]
  (h : ∀ i ∈ s, p i) (f : (i : ι) → p i → M) (g : (i : ι) → ¬p i → M),
  (∑ i ∈ s, if hi : p i then f i hi else g i hi) = ∑ i, f ↑i ⋯

theorem Finset.prod_dite_of_true E1 #

∀ {ι : Type u_1} {M : Type u_2} {s : Finset ι} [inst : CommMonoid M] {p : ι → Prop} [inst_1 : DecidablePred p]
  (h : ∀ i ∈ s, p i) (f : (i : ι) → p i → M) (g : (i : ι) → ¬p i → M),
  (∏ i ∈ s, if hi : p i then f i hi else g i hi) = ∏ i, f ↑i ⋯

theorem Finset.prod_ite_of_true E1 #

∀ {ι : Type u_1} {M : Type u_2} {s : Finset ι} [inst : CommMonoid M] {p : ι → Prop} [inst_1 : DecidablePred p],
  (∀ x ∈ s, p x) → ∀ (f g : ι → M), (∏ x ∈ s, if p x then f x else g x) = ∏ x ∈ s, f x

theorem Finset.sum_ite_of_true E1 #

∀ {ι : Type u_1} {M : Type u_2} {s : Finset ι} [inst : AddCommMonoid M] {p : ι → Prop} [inst_1 : DecidablePred p],
  (∀ x ∈ s, p x) → ∀ (f g : ι → M), (∑ x ∈ s, if p x then f x else g x) = ∑ x ∈ s, f x

theorem Finset.prod_apply_ite_of_false E1 #

∀ {ι : Type u_1} {M : Type u_2} {γ : Type u_3} {s : Finset ι} [inst : CommMonoid M] {p : ι → Prop}
  [inst_1 : DecidablePred p] (f g : ι → γ) (k : γ → M),
  (∀ x ∈ s, ¬p x) → ∏ x ∈ s, k (if p x then f x else g x) = ∏ x ∈ s, k (g x)

theorem Finset.sum_apply_ite_of_false E1 #

∀ {ι : Type u_1} {M : Type u_2} {γ : Type u_3} {s : Finset ι} [inst : AddCommMonoid M] {p : ι → Prop}
  [inst_1 : DecidablePred p] (f g : ι → γ) (k : γ → M),
  (∀ x ∈ s, ¬p x) → ∑ x ∈ s, k (if p x then f x else g x) = ∑ x ∈ s, k (g x)

theorem Finset.sum_apply_ite_of_true E1 #

∀ {ι : Type u_1} {M : Type u_2} {γ : Type u_3} {s : Finset ι} [inst : AddCommMonoid M] {p : ι → Prop}
  [inst_1 : DecidablePred p] (f g : ι → γ) (k : γ → M),
  (∀ x ∈ s, p x) → ∑ x ∈ s, k (if p x then f x else g x) = ∑ x ∈ s, k (f x)

theorem Finset.prod_apply_ite_of_true E1 #

∀ {ι : Type u_1} {M : Type u_2} {γ : Type u_3} {s : Finset ι} [inst : CommMonoid M] {p : ι → Prop}
  [inst_1 : DecidablePred p] (f g : ι → γ) (k : γ → M),
  (∀ x ∈ s, p x) → ∏ x ∈ s, k (if p x then f x else g x) = ∏ x ∈ s, k (f x)

theorem Finset.sum_ite_mem E0 #

∀ {ι : Type u_1} {M : Type u_2} [inst : AddCommMonoid M] [inst_1 : DecidableEq ι] (s t : Finset ι) (f : ι → M),
  (∑ i ∈ s, if i ∈ t then f i else 0) = ∑ i ∈ s ∩ t, f i

theorem Finset.prod_ite_mem E0 #

∀ {ι : Type u_1} {M : Type u_2} [inst : CommMonoid M] [inst_1 : DecidableEq ι] (s t : Finset ι) (f : ι → M),
  (∏ i ∈ s, if i ∈ t then f i else 1) = ∏ i ∈ s ∩ t, f i

theorem Finset.sum_attach_eq_sum_dite E1 #

∀ {ι : Type u_1} {M : Type u_2} [inst : AddCommMonoid M] [inst_1 : Fintype ι] (s : Finset ι) (f : ↥s → M)
  [inst_2 : DecidablePred fun x ↦ x ∈ s], ∑ i ∈ s.attach, f i = ∑ i, if h : i ∈ s then f ⟨i, h⟩ else 0

theorem Finset.prod_attach_eq_prod_dite E1 #

∀ {ι : Type u_1} {M : Type u_2} [inst : CommMonoid M] [inst_1 : Fintype ι] (s : Finset ι) (f : ↥s → M)
  [inst_2 : DecidablePred fun x ↦ x ∈ s], ∏ i ∈ s.attach, f i = ∏ i, if h : i ∈ s then f ⟨i, h⟩ else 1

theorem Finset.prod_dite_eq E0 #

∀ {ι : Type u_1} {M : Type u_2} [inst : CommMonoid M] [inst_1 : DecidableEq ι] (s : Finset ι) (a : ι)
  (b : (x : ι) → a = x → M), (∏ x ∈ s, if h : a = x then b x h else 1) = if a ∈ s then b a ⋯ else 1

theorem Finset.sum_dite_eq E0 #

∀ {ι : Type u_1} {M : Type u_2} [inst : AddCommMonoid M] [inst_1 : DecidableEq ι] (s : Finset ι) (a : ι)
  (b : (x : ι) → a = x → M), (∑ x ∈ s, if h : a = x then b x h else 0) = if a ∈ s then b a ⋯ else 0

theorem Finset.sum_dite_eq' E0 #

∀ {ι : Type u_1} {M : Type u_2} [inst : AddCommMonoid M] [inst_1 : DecidableEq ι] (s : Finset ι) (a : ι)
  (b : (x : ι) → x = a → M), (∑ x ∈ s, if h : x = a then b x h else 0) = if a ∈ s then b a ⋯ else 0

theorem Finset.prod_dite_eq' E0 #

∀ {ι : Type u_1} {M : Type u_2} [inst : CommMonoid M] [inst_1 : DecidableEq ι] (s : Finset ι) (a : ι)
  (b : (x : ι) → x = a → M), (∏ x ∈ s, if h : x = a then b x h else 1) = if a ∈ s then b a ⋯ else 1

theorem Finset.prod_ite_eq E0 #

∀ {ι : Type u_1} {M : Type u_2} [inst : CommMonoid M] [inst_1 : DecidableEq ι] (s : Finset ι) (a : ι) (b : ι → M),
  (∏ x ∈ s, if a = x then b x else 1) = if a ∈ s then b a else 1

theorem Finset.sum_ite_eq E0 #

∀ {ι : Type u_1} {M : Type u_2} [inst : AddCommMonoid M] [inst_1 : DecidableEq ι] (s : Finset ι) (a : ι) (b : ι → M),
  (∑ x ∈ s, if a = x then b x else 0) = if a ∈ s then b a else 0

theorem Finset.prod_ite_eq' E0 #

∀ {ι : Type u_1} {M : Type u_2} [inst : CommMonoid M] [inst_1 : DecidableEq ι] (s : Finset ι) (a : ι) (b : ι → M),
  (∏ x ∈ s, if x = a then b x else 1) = if a ∈ s then b a else 1

A product taken over a conditional whose condition is an equality test on the index and whose alternative is 1 has value either the term at that index or 1.

The difference with Finset.prod_ite_eq is that the arguments to Eq are swapped.

theorem Finset.sum_ite_eq' E0 #

∀ {ι : Type u_1} {M : Type u_2} [inst : AddCommMonoid M] [inst_1 : DecidableEq ι] (s : Finset ι) (a : ι) (b : ι → M),
  (∑ x ∈ s, if x = a then b x else 0) = if a ∈ s then b a else 0

A sum taken over a conditional whose condition is an equality test on the index and whose alternative is 0 has value either the term at that index or 0.

The difference with Finset.sum_ite_eq is that the arguments to Eq are swapped.

theorem Finset.sum_ite_eq_of_mem E1 #

∀ {ι : Type u_1} {M : Type u_2} [inst : AddCommMonoid M] [inst_1 : DecidableEq ι] (s : Finset ι) (a : ι) (b : ι → M),
  a ∈ s → (∑ x ∈ s, if a = x then b x else 0) = b a

theorem Finset.prod_ite_eq_of_mem E1 #

∀ {ι : Type u_1} {M : Type u_2} [inst : CommMonoid M] [inst_1 : DecidableEq ι] (s : Finset ι) (a : ι) (b : ι → M),
  a ∈ s → (∏ x ∈ s, if a = x then b x else 1) = b a

theorem Finset.prod_ite_eq_of_mem' E1 #

∀ {ι : Type u_1} {M : Type u_2} [inst : CommMonoid M] [inst_1 : DecidableEq ι] (s : Finset ι) (a : ι) (b : ι → M),
  a ∈ s → (∏ x ∈ s, if x = a then b x else 1) = b a

The difference with Finset.prod_ite_eq_of_mem is that the arguments to Eq are swapped.

theorem Finset.sum_ite_eq_of_mem' E1 #

∀ {ι : Type u_1} {M : Type u_2} [inst : AddCommMonoid M] [inst_1 : DecidableEq ι] (s : Finset ι) (a : ι) (b : ι → M),
  a ∈ s → (∑ x ∈ s, if x = a then b x else 0) = b a

theorem Finset.prod_pi_mulSingle' E0 #

∀ {ι : Type u_1} {M : Type u_2} [inst : CommMonoid M] [inst_1 : DecidableEq ι] (a : ι) (x : M) (s : Finset ι),
  ∏ a' ∈ s, Pi.mulSingle a x a' = if a ∈ s then x else 1

theorem Finset.sum_pi_single' E0 #

∀ {ι : Type u_1} {M : Type u_2} [inst : AddCommMonoid M] [inst_1 : DecidableEq ι] (a : ι) (x : M) (s : Finset ι),
  ∑ a' ∈ s, Pi.single a x a' = if a ∈ s then x else 0

theorem Finset.prod_pi_mulSingle E0 #

∀ {ι : Type u_1} {M : ι → Type u_4} [inst : DecidableEq ι] [inst_1 : (a : ι) → CommMonoid (M a)] (a : ι)
  (f : (a : ι) → M a) (s : Finset ι), ∏ a' ∈ s, Pi.mulSingle a' (f a') a = if a ∈ s then f a else 1

theorem Finset.sum_pi_single E0 #

∀ {ι : Type u_1} {M : ι → Type u_4} [inst : DecidableEq ι] [inst_1 : (a : ι) → AddCommMonoid (M a)] (a : ι)
  (f : (a : ι) → M a) (s : Finset ι), ∑ a' ∈ s, Pi.single a' (f a') a = if a ∈ s then f a else 0

theorem Finset.sum_piecewise E1 #

∀ {ι : Type u_1} {M : Type u_2} [inst : AddCommMonoid M] [inst_1 : DecidableEq ι] (s t : Finset ι) (f g : ι → M),
  ∑ x ∈ s, t.piecewise f g x = ∑ x ∈ s ∩ t, f x + ∑ x ∈ s \ t, g x

theorem Finset.prod_piecewise E1 #

∀ {ι : Type u_1} {M : Type u_2} [inst : CommMonoid M] [inst_1 : DecidableEq ι] (s t : Finset ι) (f g : ι → M),
  ∏ x ∈ s, t.piecewise f g x = (∏ x ∈ s ∩ t, f x) * ∏ x ∈ s \ t, g x

theorem Finset.sum_inter_add_sum_sdiff E1 #

∀ {ι : Type u_1} {M : Type u_2} [inst : AddCommMonoid M] [inst_1 : DecidableEq ι] (s t : Finset ι) (f : ι → M),
  ∑ x ∈ s ∩ t, f x + ∑ x ∈ s \ t, f x = ∑ x ∈ s, f x

theorem Finset.prod_inter_mul_prod_sdiff E1 #

∀ {ι : Type u_1} {M : Type u_2} [inst : CommMonoid M] [inst_1 : DecidableEq ι] (s t : Finset ι) (f : ι → M),
  (∏ x ∈ s ∩ t, f x) * ∏ x ∈ s \ t, f x = ∏ x ∈ s, f x

theorem Finset.prod_eq_mul_prod_sdiff_singleton E1 #

∀ {ι : Type u_1} {M : Type u_2} [inst : CommMonoid M] [inst_1 : DecidableEq ι] {s : Finset ι} (i : ι) (f : ι → M),
  (i ∉ s → f i = 1) → ∏ x ∈ s, f x = f i * ∏ x ∈ s \ {i}, f x

theorem Finset.sum_eq_add_sum_sdiff_singleton E1 #

∀ {ι : Type u_1} {M : Type u_2} [inst : AddCommMonoid M] [inst_1 : DecidableEq ι] {s : Finset ι} (i : ι) (f : ι → M),
  (i ∉ s → f i = 0) → ∑ x ∈ s, f x = f i + ∑ x ∈ s \ {i}, f x

theorem Finset.sum_eq_add_sum_sdiff_singleton_of_mem E1 #

∀ {ι : Type u_1} {M : Type u_2} [inst : AddCommMonoid M] [inst_1 : DecidableEq ι] {s : Finset ι} {i : ι},
  i ∈ s → ∀ (f : ι → M), ∑ x ∈ s, f x = f i + ∑ x ∈ s \ {i}, f x

theorem Finset.prod_eq_mul_prod_sdiff_singleton_of_mem E1 #

∀ {ι : Type u_1} {M : Type u_2} [inst : CommMonoid M] [inst_1 : DecidableEq ι] {s : Finset ι} {i : ι},
  i ∈ s → ∀ (f : ι → M), ∏ x ∈ s, f x = f i * ∏ x ∈ s \ {i}, f x

theorem Finset.prod_eq_prod_sdiff_singleton_mul E1 #

∀ {ι : Type u_1} {M : Type u_2} [inst : CommMonoid M] [inst_1 : DecidableEq ι] {s : Finset ι} {i : ι},
  i ∈ s → ∀ (f : ι → M), ∏ x ∈ s, f x = (∏ x ∈ s \ {i}, f x) * f i

theorem Finset.sum_eq_sum_sdiff_singleton_add E1 #

∀ {ι : Type u_1} {M : Type u_2} [inst : AddCommMonoid M] [inst_1 : DecidableEq ι] {s : Finset ι} {i : ι},
  i ∈ s → ∀ (f : ι → M), ∑ x ∈ s, f x = ∑ x ∈ s \ {i}, f x + f i

theorem Fintype.prod_eq_mul_prod_compl E1 #

∀ {ι : Type u_1} {M : Type u_2} [inst : CommMonoid M] [inst_1 : DecidableEq ι] [inst_2 : Fintype ι] (a : ι) (f : ι → M),
  ∏ i, f i = f a * ∏ i ∈ {a}ᶜ, f i

theorem Fintype.sum_eq_add_sum_compl E1 #

∀ {ι : Type u_1} {M : Type u_2} [inst : AddCommMonoid M] [inst_1 : DecidableEq ι] [inst_2 : Fintype ι] (a : ι)
  (f : ι → M), ∑ i, f i = f a + ∑ i ∈ {a}ᶜ, f i

theorem Fintype.prod_eq_prod_compl_mul E1 #

∀ {ι : Type u_1} {M : Type u_2} [inst : CommMonoid M] [inst_1 : DecidableEq ι] [inst_2 : Fintype ι] (a : ι) (f : ι → M),
  ∏ i, f i = (∏ i ∈ {a}ᶜ, f i) * f a

theorem Fintype.sum_eq_sum_compl_add E1 #

∀ {ι : Type u_1} {M : Type u_2} [inst : AddCommMonoid M] [inst_1 : DecidableEq ι] [inst_2 : Fintype ι] (a : ι)
  (f : ι → M), ∑ i, f i = ∑ i ∈ {a}ᶜ, f i + f a

theorem Finset.dvd_prod_of_mem E1 #

∀ {ι : Type u_1} {M : Type u_2} [inst : CommMonoid M] (f : ι → M) {a : ι} {s : Finset ι}, a ∈ s → f a ∣ ∏ i ∈ s, f i

theorem Finset.prod_update_of_notMem E1 #

∀ {ι : Type u_1} {M : Type u_2} [inst : CommMonoid M] [inst_1 : DecidableEq ι] {s : Finset ι} {i : ι},
  i ∉ s → ∀ (f : ι → M) (b : M), ∏ x ∈ s, Function.update f i b x = ∏ x ∈ s, f x

theorem Finset.sum_update_of_notMem E1 #

∀ {ι : Type u_1} {M : Type u_2} [inst : AddCommMonoid M] [inst_1 : DecidableEq ι] {s : Finset ι} {i : ι},
  i ∉ s → ∀ (f : ι → M) (b : M), ∑ x ∈ s, Function.update f i b x = ∑ x ∈ s, f x

theorem Finset.sum_update_of_mem E1 #

∀ {ι : Type u_1} {M : Type u_2} [inst : AddCommMonoid M] [inst_1 : DecidableEq ι] {s : Finset ι} {i : ι},
  i ∈ s → ∀ (f : ι → M) (b : M), ∑ x ∈ s, Function.update f i b x = b + ∑ x ∈ s \ {i}, f x

theorem Finset.prod_update_of_mem E1 #

∀ {ι : Type u_1} {M : Type u_2} [inst : CommMonoid M] [inst_1 : DecidableEq ι] {s : Finset ι} {i : ι},
  i ∈ s → ∀ (f : ι → M) (b : M), ∏ x ∈ s, Function.update f i b x = b * ∏ x ∈ s \ {i}, f x

theorem Finset.prod_ite_one E1 #

∀ {ι : Type u_1} {M : Type u_2} [inst : CommMonoid M] (s : Finset ι) (p : ι → Prop) [inst_1 : DecidablePred p],
  (∀ i ∈ s, ∀ j ∈ s, p i → p j → i = j) → ∀ (a : M), (∏ i ∈ s, if p i then a else 1) = if ∃ i ∈ s, p i then a else 1

See also Finset.prod_ite_zero.

theorem Finset.sum_ite_zero E1 #

∀ {ι : Type u_1} {M : Type u_2} [inst : AddCommMonoid M] (s : Finset ι) (p : ι → Prop) [inst_1 : DecidablePred p],
  (∀ i ∈ s, ∀ j ∈ s, p i → p j → i = j) → ∀ (a : M), (∑ i ∈ s, if p i then a else 0) = if ∃ i ∈ s, p i then a else 0

See also Finset.sum_boole.

theorem Finset.prod_pow_boole E1 #

∀ {ι : Type u_1} {M : Type u_2} [inst : CommMonoid M] [inst_1 : DecidableEq ι] (s : Finset ι) (f : ι → M) (a : ι),
  (∏ x ∈ s, f x ^ if a = x then 1 else 0) = if a ∈ s then f a else 1

theorem Finset.sum_boole_nsmul E1 #

∀ {ι : Type u_1} {M : Type u_2} [inst : AddCommMonoid M] [inst_1 : DecidableEq ι] (s : Finset ι) (f : ι → M) (a : ι),
  ∑ x ∈ s, (if a = x then 1 else 0) • f x = if a ∈ s then f a else 0

theorem Finset.sum_eq_sum_iff_single E1 #

∀ {ι : Type u_1} {M : Type u_2} {s : Finset ι} [inst : AddCommMonoid M] [IsRightCancelAdd M] {f g : ι → M} {i : ι},
  i ∈ s → (∀ j ∈ s, j ≠ i → f j = g j) → (∑ j ∈ s, f j = ∑ j ∈ s, g j ↔ f i = g i)

theorem Finset.prod_eq_prod_iff_single E1 #

∀ {ι : Type u_1} {M : Type u_2} {s : Finset ι} [inst : CommMonoid M] [IsRightCancelMul M] {f g : ι → M} {i : ι},
  i ∈ s → (∀ j ∈ s, j ≠ i → f j = g j) → (∏ j ∈ s, f j = ∏ j ∈ s, g j ↔ f i = g i)

theorem Finset.card_filter E1 #

∀ {ι : Type u_1} (p : ι → Prop) [inst : DecidablePred p] (s : Finset ι),
  {i ∈ s | p i}.card = ∑ i ∈ s, if p i then 1 else 0

theorem Fintype.sum_ite_eq_ite_exists E1 #

∀ {ι : Type u_1} {M : Type u_2} [inst : AddCommMonoid M] [inst_1 : Fintype ι] (p : ι → Prop) [inst_2 : DecidablePred p],
  (∀ (i j : ι), p i → p j → i = j) → ∀ (a : M), (∑ i, if p i then a else 0) = if ∃ i, p i then a else 0

theorem Fintype.prod_ite_eq_ite_exists E1 #

∀ {ι : Type u_1} {M : Type u_2} [inst : CommMonoid M] [inst_1 : Fintype ι] (p : ι → Prop) [inst_2 : DecidablePred p],
  (∀ (i j : ι), p i → p j → i = j) → ∀ (a : M), (∏ i, if p i then a else 1) = if ∃ i, p i then a else 1

theorem Fintype.prod_ite_mem E1 #

∀ {ι : Type u_1} {M : Type u_2} [inst : CommMonoid M] [inst_1 : Fintype ι] [inst_2 : DecidableEq ι] (s : Finset ι)
  (f : ι → M), (∏ i, if i ∈ s then f i else 1) = ∏ i ∈ s, f i

theorem Fintype.sum_ite_mem E1 #

∀ {ι : Type u_1} {M : Type u_2} [inst : AddCommMonoid M] [inst_1 : Fintype ι] [inst_2 : DecidableEq ι] (s : Finset ι)
  (f : ι → M), (∑ i, if i ∈ s then f i else 0) = ∑ i ∈ s, f i

theorem Fintype.prod_dite_eq E0 #

∀ {ι : Type u_1} {M : Type u_2} [inst : CommMonoid M] [inst_1 : Fintype ι] [inst_2 : DecidableEq ι] (i : ι)
  (f : (j : ι) → i = j → M), (∏ j, if h : i = j then f j h else 1) = f i ⋯

See also Finset.prod_dite_eq.

theorem Fintype.sum_dite_eq E0 #

∀ {ι : Type u_1} {M : Type u_2} [inst : AddCommMonoid M] [inst_1 : Fintype ι] [inst_2 : DecidableEq ι] (i : ι)
  (f : (j : ι) → i = j → M), (∑ j, if h : i = j then f j h else 0) = f i ⋯

See also Finset.sum_dite_eq.

theorem Fintype.prod_dite_eq' E1 #

∀ {ι : Type u_1} {M : Type u_2} [inst : CommMonoid M] [inst_1 : Fintype ι] [inst_2 : DecidableEq ι] (i : ι)
  (f : (j : ι) → j = i → M), (∏ j, if h : j = i then f j h else 1) = f i ⋯

See also Finset.prod_dite_eq'.

theorem Fintype.sum_dite_eq' E1 #

∀ {ι : Type u_1} {M : Type u_2} [inst : AddCommMonoid M] [inst_1 : Fintype ι] [inst_2 : DecidableEq ι] (i : ι)
  (f : (j : ι) → j = i → M), (∑ j, if h : j = i then f j h else 0) = f i ⋯

See also Finset.sum_dite_eq'.

theorem Fintype.prod_ite_eq E0 #

∀ {ι : Type u_1} {M : Type u_2} [inst : CommMonoid M] [inst_1 : Fintype ι] [inst_2 : DecidableEq ι] (i : ι) (f : ι → M),
  (∏ j, if i = j then f j else 1) = f i

See also Finset.prod_ite_eq.

theorem Fintype.sum_ite_eq E0 #

∀ {ι : Type u_1} {M : Type u_2} [inst : AddCommMonoid M] [inst_1 : Fintype ι] [inst_2 : DecidableEq ι] (i : ι)
  (f : ι → M), (∑ j, if i = j then f j else 0) = f i

See also Finset.sum_ite_eq.

theorem Fintype.prod_ite_eq' E1 #

∀ {ι : Type u_1} {M : Type u_2} [inst : CommMonoid M] [inst_1 : Fintype ι] [inst_2 : DecidableEq ι] (i : ι) (f : ι → M),
  (∏ j, if j = i then f j else 1) = f i

See also Finset.prod_ite_eq'.

theorem Fintype.sum_ite_eq' E1 #

∀ {ι : Type u_1} {M : Type u_2} [inst : AddCommMonoid M] [inst_1 : Fintype ι] [inst_2 : DecidableEq ι] (i : ι)
  (f : ι → M), (∑ j, if j = i then f j else 0) = f i

See also Finset.sum_ite_eq'.

theorem Fintype.prod_pi_mulSingle E1 #

∀ {ι : Type u_1} [inst : Fintype ι] [inst_1 : DecidableEq ι] {M : ι → Type u_4} [inst_2 : (i : ι) → CommMonoid (M i)]
  (i : ι) (f : (i : ι) → M i), ∏ j, Pi.mulSingle j (f j) i = f i

See also Finset.prod_pi_mulSingle.

theorem Fintype.sum_pi_single E1 #

∀ {ι : Type u_1} [inst : Fintype ι] [inst_1 : DecidableEq ι] {M : ι → Type u_4} [inst_2 : (i : ι) → AddCommMonoid (M i)]
  (i : ι) (f : (i : ι) → M i), ∑ j, Pi.single j (f j) i = f i

See also Finset.sum_pi_single.

theorem Fintype.prod_pi_mulSingle' E1 #

∀ {ι : Type u_1} {M : Type u_2} [inst : CommMonoid M] [inst_1 : Fintype ι] [inst_2 : DecidableEq ι] (i : ι) (a : M),
  ∏ j, Pi.mulSingle i a j = a

See also Finset.prod_pi_mulSingle'.

theorem Fintype.sum_pi_single' E1 #

∀ {ι : Type u_1} {M : Type u_2} [inst : AddCommMonoid M] [inst_1 : Fintype ι] [inst_2 : DecidableEq ι] (i : ι) (a : M),
  ∑ j, Pi.single i a j = a

See also Finset.sum_pi_single'.

Deprecated aliases

NameNew nameSince
Finset.prod_eq_mul_prod_diff_singletonFinset.prod_eq_mul_prod_sdiff_singleton2026-06-03
Finset.prod_eq_mul_prod_diff_singleton_of_memFinset.prod_eq_mul_prod_sdiff_singleton_of_mem2026-06-03
Finset.prod_eq_prod_diff_singleton_mulFinset.prod_eq_prod_sdiff_singleton_mul2026-06-03
Finset.prod_inter_mul_prod_diffFinset.prod_inter_mul_prod_sdiff2026-06-03