Skip to content

Commit cf581dc

Browse files
committed
feat: (∏ᶠ i, f i) a = ∏ᶠ i, f i a (#20203)
From FLT Co-authored-by: Kevin Buzzard
1 parent bc14fcf commit cf581dc

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

Mathlib/Algebra/BigOperators/Finprod.lean

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Kexing Ying, Kevin Buzzard, Yury Kudryashov
55
-/
66
import Mathlib.Algebra.BigOperators.GroupWithZero.Finset
7+
import Mathlib.Algebra.BigOperators.Pi
78
import Mathlib.Algebra.Group.FiniteSupport
89
import Mathlib.Algebra.NoZeroSMulDivisors.Basic
910
import Mathlib.Algebra.Order.BigOperators.Group.Finset
@@ -319,13 +320,17 @@ theorem finprod_eq_mulIndicator_apply (s : Set α) (f : α → M) (a : α) :
319320
classical convert finprod_eq_if (M := M) (p := a ∈ s) (x := f a)
320321

321322
@[to_additive (attr := simp)]
322-
theorem finprod_mem_mulSupport (f : α → M) (a : α) : ∏ᶠ _ : f a ≠ 1, f a = f a := by
323+
theorem finprod_apply_ne_one (f : α → M) (a : α) : ∏ᶠ _ : f a ≠ 1, f a = f a := by
323324
rw [← mem_mulSupport, finprod_eq_mulIndicator_apply, mulIndicator_mulSupport]
324325

325326
@[to_additive]
326327
theorem finprod_mem_def (s : Set α) (f : α → M) : ∏ᶠ a ∈ s, f a = ∏ᶠ a, mulIndicator s f a :=
327328
finprod_congr <| finprod_eq_mulIndicator_apply s f
328329

330+
@[to_additive]
331+
lemma finprod_mem_mulSupport (f : α → M) : ∏ᶠ a ∈ mulSupport f, f a = ∏ᶠ a, f a := by
332+
rw [finprod_mem_def, mulIndicator_mulSupport]
333+
329334
@[to_additive]
330335
theorem finprod_eq_prod_of_mulSupport_subset (f : α → M) {s : Finset α} (h : mulSupport f ⊆ s) :
331336
∏ᶠ i, f i = ∏ i ∈ s, f i := by
@@ -921,6 +926,16 @@ theorem finprod_mem_sUnion {t : Set (Set α)} (h : t.PairwiseDisjoint id) (ht₀
921926
rw [Set.sUnion_eq_biUnion]
922927
exact finprod_mem_biUnion h ht₀ ht₁
923928

929+
@[to_additive]
930+
lemma finprod_option {f : Option α → M} (hf : (mulSupport (f ∘ some)).Finite) :
931+
∏ᶠ o, f o = f none * ∏ᶠ a, f (some a) := by
932+
replace hf : (mulSupport f).Finite := by simpa [finite_option]
933+
convert finprod_mem_insert' f (show none ∉ Set.range Option.some by aesop)
934+
(hf.subset inter_subset_right)
935+
· aesop
936+
· rw [finprod_mem_range]
937+
exact Option.some_injective _
938+
924939
@[to_additive]
925940
theorem mul_finprod_cond_ne (a : α) (hf : (mulSupport f).Finite) :
926941
(f a * ∏ᶠ (i) (_ : i ≠ a), f i) = ∏ᶠ i, f i := by
@@ -1008,6 +1023,15 @@ theorem finsum_mul {R : Type*} [Semiring R] (f : α → R) (r : R) (h : (support
10081023
(∑ᶠ a : α, f a) * r = ∑ᶠ a : α, f a * r :=
10091024
(AddMonoidHom.mulRight r).map_finsum h
10101025

1026+
@[to_additive (attr := simp)]
1027+
lemma finprod_apply {α ι : Type*} {f : ι → α → N} (hf : (mulSupport f).Finite) (a : α) :
1028+
(∏ᶠ i, f i) a = ∏ᶠ i, f i a := by
1029+
classical
1030+
have hf' : (mulSupport fun i ↦ f i a).Finite := hf.subset (by aesop)
1031+
simp only [finprod_def, dif_pos, hf, hf', Finset.prod_apply]
1032+
symm
1033+
apply Finset.prod_subset <;> aesop
1034+
10111035
@[to_additive]
10121036
theorem Finset.mulSupport_of_fiberwise_prod_subset_image [DecidableEq β] (s : Finset α) (f : α → M)
10131037
(g : α → β) : (mulSupport fun b => (s.filter fun a => g a = b).prod f) ⊆ s.image g := by

0 commit comments

Comments
 (0)