English
Let α be a commutative monoid, s a finite set of indices, and f: ι → α. Then the product over all i of (if i ∈ s then f(i) else 1) equals the product over i ∈ s of f(i).
Русский
Пусть α — коммутативный моноид, s — конечное множество индексов, и f: ι → α. Тогда произведение по всем i отывается как произведение по i ∈ s.
LaTeX
$$$\\prod_{i} \\bigl(\\text{if } i \\in s \\text{ then } f(i) \\text{ else } 1\\bigr) = \\prod_{i \\in s} f(i)$$$
Lean4
@[to_additive]
theorem prod_extend_by_one [CommMonoid α] (s : Finset ι) (f : ι → α) : ∏ i, (if i ∈ s then f i else 1) = ∏ i ∈ s, f i :=
by rw [← prod_filter, filter_mem_eq_inter, univ_inter]