@@ -775,6 +775,34 @@ lemma on_finset_prod {s : finset α} {f : α → M} {g : α → M → N}
775
775
(on_finset s f hf).prod g = ∏ a in s, g a (f a) :=
776
776
finset.prod_subset support_on_finset_subset $ by simp [*] { contextual := tt }
777
777
778
+ /-- Taking a product over `f : α →₀ M` is the same as multiplying the value on a single element
779
+ `y ∈ f.support` by the product over `erase y f`. -/
780
+ @[to_additive /-" Taking a sum over over `f : α →₀ M` is the same as adding the value on a
781
+ single element `y ∈ f.support` to the sum over `erase y f`. "-/ ]
782
+ lemma mul_prod_erase (f : α →₀ M) (y : α) (g : α → M → N) (hyf : y ∈ f.support) :
783
+ g y (f y) * (erase y f).prod g = f.prod g :=
784
+ begin
785
+ rw [finsupp.prod, finsupp.prod, ←finset.mul_prod_erase _ _ hyf, finsupp.support_erase,
786
+ finset.prod_congr rfl],
787
+ intros h hx,
788
+ rw finsupp.erase_ne (ne_of_mem_erase hx),
789
+ end
790
+
791
+ /-- Generalization of `finsupp.mul_prod_erase`: if `g` maps a second argument of 0 to 1,
792
+ then its product over `f : α →₀ M` is the same as multiplying the value on any element
793
+ `y : α` by the product over `erase y f`. -/
794
+ @[to_additive /-" Generalization of `finsupp.add_sum_erase`: if `g` maps a second argument of 0
795
+ to 0, then its sum over `f : α →₀ M` is the same as adding the value on any element
796
+ `y : α` to the sum over `erase y f`. "-/ ]
797
+ lemma mul_prod_erase' (f : α →₀ M) (y : α) (g : α → M → N) (hg : ∀ (i : α), g i 0 = 1 ) :
798
+ g y (f y) * (erase y f).prod g = f.prod g :=
799
+ begin
800
+ classical,
801
+ by_cases hyf : y ∈ f.support,
802
+ { exact finsupp.mul_prod_erase f y g hyf },
803
+ { rw [not_mem_support_iff.mp hyf, hg y, erase_of_not_mem_support hyf, one_mul] },
804
+ end
805
+
778
806
@[to_additive]
779
807
lemma _root_.submonoid.finsupp_prod_mem (S : submonoid N) (f : α →₀ M) (g : α → M → N)
780
808
(h : ∀ c, f c ≠ 0 → g c (f c) ∈ S) : f.prod g ∈ S :=
0 commit comments