@@ -4,6 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
4
4
Authors: Kexing Ying, Kevin Buzzard, Yury Kudryashov
5
5
-/
6
6
import Mathlib.Algebra.BigOperators.GroupWithZero.Finset
7
+ import Mathlib.Algebra.BigOperators.Pi
7
8
import Mathlib.Algebra.Group.FiniteSupport
8
9
import Mathlib.Algebra.NoZeroSMulDivisors.Basic
9
10
import Mathlib.Algebra.Order.BigOperators.Group.Finset
@@ -319,13 +320,17 @@ theorem finprod_eq_mulIndicator_apply (s : Set α) (f : α → M) (a : α) :
319
320
classical convert finprod_eq_if (M := M) (p := a ∈ s) (x := f a)
320
321
321
322
@[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
323
324
rw [← mem_mulSupport, finprod_eq_mulIndicator_apply, mulIndicator_mulSupport]
324
325
325
326
@[to_additive]
326
327
theorem finprod_mem_def (s : Set α) (f : α → M) : ∏ᶠ a ∈ s, f a = ∏ᶠ a, mulIndicator s f a :=
327
328
finprod_congr <| finprod_eq_mulIndicator_apply s f
328
329
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
+
329
334
@[to_additive]
330
335
theorem finprod_eq_prod_of_mulSupport_subset (f : α → M) {s : Finset α} (h : mulSupport f ⊆ s) :
331
336
∏ᶠ i, f i = ∏ i ∈ s, f i := by
@@ -921,6 +926,16 @@ theorem finprod_mem_sUnion {t : Set (Set α)} (h : t.PairwiseDisjoint id) (ht₀
921
926
rw [Set.sUnion_eq_biUnion]
922
927
exact finprod_mem_biUnion h ht₀ ht₁
923
928
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
+
924
939
@[to_additive]
925
940
theorem mul_finprod_cond_ne (a : α) (hf : (mulSupport f).Finite) :
926
941
(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
1008
1023
(∑ᶠ a : α, f a) * r = ∑ᶠ a : α, f a * r :=
1009
1024
(AddMonoidHom.mulRight r).map_finsum h
1010
1025
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
+
1011
1035
@[to_additive]
1012
1036
theorem Finset.mulSupport_of_fiberwise_prod_subset_image [DecidableEq β] (s : Finset α) (f : α → M)
1013
1037
(g : α → β) : (mulSupport fun b => (s.filter fun a => g a = b).prod f) ⊆ s.image g := by
0 commit comments