statement
stringlengths
1
2.88k
proof
stringlengths
0
13.9k
type
stringclasses
10 values
symbolic_name
stringlengths
1
131
library
stringclasses
417 values
filename
stringlengths
17
80
imports
listlengths
0
16
deps
listlengths
0
64
docstring
stringlengths
0
10.2k
source_url
stringclasses
1 value
commit
stringclasses
1 value
prod_add_index [decidable_eq α] [add_zero_class M] [comm_monoid N] {f g : α →₀ M} {h : α → M → N} (h_zero : ∀ a ∈ f.support ∪ g.support, h a 0 = 1) (h_add : ∀ (a ∈ f.support ∪ g.support) b₁ b₂, h a (b₁ + b₂) = h a b₁ * h a b₂) : (f + g).prod h = f.prod h * g.prod h
begin rw [finsupp.prod_of_support_subset f (subset_union_left _ g.support) h h_zero, finsupp.prod_of_support_subset g (subset_union_right f.support _) h h_zero, ←finset.prod_mul_distrib, finsupp.prod_of_support_subset (f + g) finsupp.support_add h h_zero], exact finset.prod_congr rfl (λ x hx, (by ...
lemma
finsupp.prod_add_index
algebra.big_operators
src/algebra/big_operators/finsupp.lean
[ "data.finsupp.indicator", "algebra.big_operators.pi", "algebra.big_operators.ring", "algebra.big_operators.order", "group_theory.submonoid.membership" ]
[ "add_zero_class", "comm_monoid", "finset.prod_congr", "finsupp.prod_of_support_subset", "finsupp.support_add" ]
Taking the product under `h` is an additive-to-multiplicative homomorphism of finsupps, if `h` is an additive-to-multiplicative homomorphism on the support. This is a more general version of `finsupp.prod_add_index'`; the latter has simpler hypotheses.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
prod_add_index' [add_zero_class M] [comm_monoid N] {f g : α →₀ M} {h : α → M → N} (h_zero : ∀a, h a 0 = 1) (h_add : ∀a b₁ b₂, h a (b₁ + b₂) = h a b₁ * h a b₂) : (f + g).prod h = f.prod h * g.prod h
by classical; exact prod_add_index (λ a ha, h_zero a) (λ a ha, h_add a)
lemma
finsupp.prod_add_index'
algebra.big_operators
src/algebra/big_operators/finsupp.lean
[ "data.finsupp.indicator", "algebra.big_operators.pi", "algebra.big_operators.ring", "algebra.big_operators.order", "group_theory.submonoid.membership" ]
[ "add_zero_class", "comm_monoid" ]
Taking the product under `h` is an additive-to-multiplicative homomorphism of finsupps, if `h` is an additive-to-multiplicative homomorphism. This is a more specialized version of `finsupp.prod_add_index` with simpler hypotheses.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
sum_hom_add_index [add_zero_class M] [add_comm_monoid N] {f g : α →₀ M} (h : α → M →+ N) : (f + g).sum (λ x, h x) = f.sum (λ x, h x) + g.sum (λ x, h x)
sum_add_index' (λ a, (h a).map_zero) (λ a, (h a).map_add)
lemma
finsupp.sum_hom_add_index
algebra.big_operators
src/algebra/big_operators/finsupp.lean
[ "data.finsupp.indicator", "algebra.big_operators.pi", "algebra.big_operators.ring", "algebra.big_operators.order", "group_theory.submonoid.membership" ]
[ "add_comm_monoid", "add_zero_class" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
prod_hom_add_index [add_zero_class M] [comm_monoid N] {f g : α →₀ M} (h : α → multiplicative M →* N) : (f + g).prod (λ a b, h a (multiplicative.of_add b)) = f.prod (λ a b, h a (multiplicative.of_add b)) * g.prod (λ a b, h a (multiplicative.of_add b))
prod_add_index' (λ a, (h a).map_one) (λ a, (h a).map_mul)
lemma
finsupp.prod_hom_add_index
algebra.big_operators
src/algebra/big_operators/finsupp.lean
[ "data.finsupp.indicator", "algebra.big_operators.pi", "algebra.big_operators.ring", "algebra.big_operators.order", "group_theory.submonoid.membership" ]
[ "add_zero_class", "comm_monoid", "map_mul", "map_one", "multiplicative", "multiplicative.of_add" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
lift_add_hom [add_zero_class M] [add_comm_monoid N] : (α → M →+ N) ≃+ ((α →₀ M) →+ N)
{ to_fun := λ F, { to_fun := λ f, f.sum (λ x, F x), map_zero' := finset.sum_empty, map_add' := λ _ _, sum_add_index' (λ x, (F x).map_zero) (λ x, (F x).map_add) }, inv_fun := λ F x, F.comp $ single_add_hom x, left_inv := λ F, by { ext, simp }, right_inv := λ F, by { ext, simp }, map_add' := λ F G, by {...
def
finsupp.lift_add_hom
algebra.big_operators
src/algebra/big_operators/finsupp.lean
[ "data.finsupp.indicator", "algebra.big_operators.pi", "algebra.big_operators.ring", "algebra.big_operators.order", "group_theory.submonoid.membership" ]
[ "add_comm_monoid", "add_zero_class", "inv_fun" ]
The canonical isomorphism between families of additive monoid homomorphisms `α → (M →+ N)` and monoid homomorphisms `(α →₀ M) →+ N`.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
lift_add_hom_apply [add_comm_monoid M] [add_comm_monoid N] (F : α → M →+ N) (f : α →₀ M) : lift_add_hom F f = f.sum (λ x, F x)
rfl
lemma
finsupp.lift_add_hom_apply
algebra.big_operators
src/algebra/big_operators/finsupp.lean
[ "data.finsupp.indicator", "algebra.big_operators.pi", "algebra.big_operators.ring", "algebra.big_operators.order", "group_theory.submonoid.membership" ]
[ "add_comm_monoid" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
lift_add_hom_symm_apply [add_comm_monoid M] [add_comm_monoid N] (F : (α →₀ M) →+ N) (x : α) : lift_add_hom.symm F x = F.comp (single_add_hom x)
rfl
lemma
finsupp.lift_add_hom_symm_apply
algebra.big_operators
src/algebra/big_operators/finsupp.lean
[ "data.finsupp.indicator", "algebra.big_operators.pi", "algebra.big_operators.ring", "algebra.big_operators.order", "group_theory.submonoid.membership" ]
[ "add_comm_monoid" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
lift_add_hom_symm_apply_apply [add_comm_monoid M] [add_comm_monoid N] (F : (α →₀ M) →+ N) (x : α) (y : M) : lift_add_hom.symm F x y = F (single x y)
rfl
lemma
finsupp.lift_add_hom_symm_apply_apply
algebra.big_operators
src/algebra/big_operators/finsupp.lean
[ "data.finsupp.indicator", "algebra.big_operators.pi", "algebra.big_operators.ring", "algebra.big_operators.order", "group_theory.submonoid.membership" ]
[ "add_comm_monoid" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
lift_add_hom_single_add_hom [add_comm_monoid M] : lift_add_hom (single_add_hom : α → M →+ α →₀ M) = add_monoid_hom.id _
lift_add_hom.to_equiv.apply_eq_iff_eq_symm_apply.2 rfl
lemma
finsupp.lift_add_hom_single_add_hom
algebra.big_operators
src/algebra/big_operators/finsupp.lean
[ "data.finsupp.indicator", "algebra.big_operators.pi", "algebra.big_operators.ring", "algebra.big_operators.order", "group_theory.submonoid.membership" ]
[ "add_comm_monoid" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
sum_single [add_comm_monoid M] (f : α →₀ M) : f.sum single = f
add_monoid_hom.congr_fun lift_add_hom_single_add_hom f
lemma
finsupp.sum_single
algebra.big_operators
src/algebra/big_operators/finsupp.lean
[ "data.finsupp.indicator", "algebra.big_operators.pi", "algebra.big_operators.ring", "algebra.big_operators.order", "group_theory.submonoid.membership" ]
[ "add_comm_monoid" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
sum_univ_single [add_comm_monoid M] [fintype α] (i : α) (m : M) : ∑ (j : α), (single i m) j = m
by simp [single]
lemma
finsupp.sum_univ_single
algebra.big_operators
src/algebra/big_operators/finsupp.lean
[ "data.finsupp.indicator", "algebra.big_operators.pi", "algebra.big_operators.ring", "algebra.big_operators.order", "group_theory.submonoid.membership" ]
[ "add_comm_monoid", "fintype" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
sum_univ_single' [add_comm_monoid M] [fintype α] (i : α) (m : M) : ∑ (j : α), (single j m) i = m
by simp [single]
lemma
finsupp.sum_univ_single'
algebra.big_operators
src/algebra/big_operators/finsupp.lean
[ "data.finsupp.indicator", "algebra.big_operators.pi", "algebra.big_operators.ring", "algebra.big_operators.order", "group_theory.submonoid.membership" ]
[ "add_comm_monoid", "fintype" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
lift_add_hom_apply_single [add_comm_monoid M] [add_comm_monoid N] (f : α → M →+ N) (a : α) (b : M) : lift_add_hom f (single a b) = f a b
sum_single_index (f a).map_zero
lemma
finsupp.lift_add_hom_apply_single
algebra.big_operators
src/algebra/big_operators/finsupp.lean
[ "data.finsupp.indicator", "algebra.big_operators.pi", "algebra.big_operators.ring", "algebra.big_operators.order", "group_theory.submonoid.membership" ]
[ "add_comm_monoid" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
lift_add_hom_comp_single [add_comm_monoid M] [add_comm_monoid N] (f : α → M →+ N) (a : α) : (lift_add_hom f).comp (single_add_hom a) = f a
add_monoid_hom.ext $ λ b, lift_add_hom_apply_single f a b
lemma
finsupp.lift_add_hom_comp_single
algebra.big_operators
src/algebra/big_operators/finsupp.lean
[ "data.finsupp.indicator", "algebra.big_operators.pi", "algebra.big_operators.ring", "algebra.big_operators.order", "group_theory.submonoid.membership" ]
[ "add_comm_monoid" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
comp_lift_add_hom [add_comm_monoid M] [add_comm_monoid N] [add_comm_monoid P] (g : N →+ P) (f : α → M →+ N) : g.comp (lift_add_hom f) = lift_add_hom (λ a, g.comp (f a))
lift_add_hom.symm_apply_eq.1 $ funext $ λ a, by rw [lift_add_hom_symm_apply, add_monoid_hom.comp_assoc, lift_add_hom_comp_single]
lemma
finsupp.comp_lift_add_hom
algebra.big_operators
src/algebra/big_operators/finsupp.lean
[ "data.finsupp.indicator", "algebra.big_operators.pi", "algebra.big_operators.ring", "algebra.big_operators.order", "group_theory.submonoid.membership" ]
[ "add_comm_monoid" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
sum_sub_index [add_comm_group β] [add_comm_group γ] {f g : α →₀ β} {h : α → β → γ} (h_sub : ∀a b₁ b₂, h a (b₁ - b₂) = h a b₁ - h a b₂) : (f - g).sum h = f.sum h - g.sum h
(lift_add_hom (λ a, add_monoid_hom.of_map_sub (h a) (h_sub a))).map_sub f g
lemma
finsupp.sum_sub_index
algebra.big_operators
src/algebra/big_operators/finsupp.lean
[ "data.finsupp.indicator", "algebra.big_operators.pi", "algebra.big_operators.ring", "algebra.big_operators.order", "group_theory.submonoid.membership" ]
[ "add_comm_group" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
prod_emb_domain [has_zero M] [comm_monoid N] {v : α →₀ M} {f : α ↪ β} {g : β → M → N} : (v.emb_domain f).prod g = v.prod (λ a b, g (f a) b)
begin rw [prod, prod, support_emb_domain, finset.prod_map], simp_rw emb_domain_apply, end
lemma
finsupp.prod_emb_domain
algebra.big_operators
src/algebra/big_operators/finsupp.lean
[ "data.finsupp.indicator", "algebra.big_operators.pi", "algebra.big_operators.ring", "algebra.big_operators.order", "group_theory.submonoid.membership" ]
[ "comm_monoid", "finset.prod_map" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
prod_finset_sum_index [add_comm_monoid M] [comm_monoid N] {s : finset ι} {g : ι → α →₀ M} {h : α → M → N} (h_zero : ∀a, h a 0 = 1) (h_add : ∀a b₁ b₂, h a (b₁ + b₂) = h a b₁ * h a b₂) : ∏ i in s, (g i).prod h = (∑ i in s, g i).prod h
finset.cons_induction_on s rfl $ λ a s has ih, by rw [prod_cons, ih, sum_cons, prod_add_index' h_zero h_add]
lemma
finsupp.prod_finset_sum_index
algebra.big_operators
src/algebra/big_operators/finsupp.lean
[ "data.finsupp.indicator", "algebra.big_operators.pi", "algebra.big_operators.ring", "algebra.big_operators.order", "group_theory.submonoid.membership" ]
[ "add_comm_monoid", "comm_monoid", "finset", "finset.cons_induction_on", "ih" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
prod_sum_index [add_comm_monoid M] [add_comm_monoid N] [comm_monoid P] {f : α →₀ M} {g : α → M → β →₀ N} {h : β → N → P} (h_zero : ∀a, h a 0 = 1) (h_add : ∀a b₁ b₂, h a (b₁ + b₂) = h a b₁ * h a b₂) : (f.sum g).prod h = f.prod (λa b, (g a b).prod h)
(prod_finset_sum_index h_zero h_add).symm
lemma
finsupp.prod_sum_index
algebra.big_operators
src/algebra/big_operators/finsupp.lean
[ "data.finsupp.indicator", "algebra.big_operators.pi", "algebra.big_operators.ring", "algebra.big_operators.order", "group_theory.submonoid.membership" ]
[ "add_comm_monoid", "comm_monoid" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
multiset_sum_sum_index [add_comm_monoid M] [add_comm_monoid N] (f : multiset (α →₀ M)) (h : α → M → N) (h₀ : ∀a, h a 0 = 0) (h₁ : ∀ (a : α) (b₁ b₂ : M), h a (b₁ + b₂) = h a b₁ + h a b₂) : (f.sum.sum h) = (f.map $ λg:α →₀ M, g.sum h).sum
multiset.induction_on f rfl $ assume a s ih, by rw [multiset.sum_cons, multiset.map_cons, multiset.sum_cons, sum_add_index' h₀ h₁, ih]
lemma
finsupp.multiset_sum_sum_index
algebra.big_operators
src/algebra/big_operators/finsupp.lean
[ "data.finsupp.indicator", "algebra.big_operators.pi", "algebra.big_operators.ring", "algebra.big_operators.order", "group_theory.submonoid.membership" ]
[ "add_comm_monoid", "ih", "multiset", "multiset.induction_on", "multiset.map_cons" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
support_sum_eq_bUnion {α : Type*} {ι : Type*} {M : Type*} [decidable_eq α] [add_comm_monoid M] {g : ι → α →₀ M} (s : finset ι) (h : ∀ i₁ i₂, i₁ ≠ i₂ → disjoint (g i₁).support (g i₂).support) : (∑ i in s, g i).support = s.bUnion (λ i, (g i).support)
begin classical, apply finset.induction_on s, { simp }, { intros i s hi, simp only [hi, sum_insert, not_false_iff, bUnion_insert], intro hs, rw [finsupp.support_add_eq, hs], rw [hs, finset.disjoint_bUnion_right], intros j hj, refine h _ _ (ne_of_mem_of_not_mem hj hi).symm } end
lemma
finsupp.support_sum_eq_bUnion
algebra.big_operators
src/algebra/big_operators/finsupp.lean
[ "data.finsupp.indicator", "algebra.big_operators.pi", "algebra.big_operators.ring", "algebra.big_operators.order", "group_theory.submonoid.membership" ]
[ "add_comm_monoid", "disjoint", "finset", "finset.disjoint_bUnion_right", "finset.induction_on", "finsupp.support_add_eq", "ne_of_mem_of_not_mem" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
multiset_map_sum [has_zero M] {f : α →₀ M} {m : β → γ} {h : α → M → multiset β} : multiset.map m (f.sum h) = f.sum (λa b, (h a b).map m)
(multiset.map_add_monoid_hom m).map_sum _ f.support
lemma
finsupp.multiset_map_sum
algebra.big_operators
src/algebra/big_operators/finsupp.lean
[ "data.finsupp.indicator", "algebra.big_operators.pi", "algebra.big_operators.ring", "algebra.big_operators.order", "group_theory.submonoid.membership" ]
[ "multiset", "multiset.map", "multiset.map_add_monoid_hom" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
multiset_sum_sum [has_zero M] [add_comm_monoid N] {f : α →₀ M} {h : α → M → multiset N} : multiset.sum (f.sum h) = f.sum (λa b, multiset.sum (h a b))
(multiset.sum_add_monoid_hom : multiset N →+ N).map_sum _ f.support
lemma
finsupp.multiset_sum_sum
algebra.big_operators
src/algebra/big_operators/finsupp.lean
[ "data.finsupp.indicator", "algebra.big_operators.pi", "algebra.big_operators.ring", "algebra.big_operators.order", "group_theory.submonoid.membership" ]
[ "add_comm_monoid", "multiset", "multiset.sum_add_monoid_hom" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
prod_add_index_of_disjoint [add_comm_monoid M] {f1 f2 : α →₀ M} (hd : disjoint f1.support f2.support) {β : Type*} [comm_monoid β] (g : α → M → β) : (f1 + f2).prod g = f1.prod g * f2.prod g
have ∀ {f1 f2 : α →₀ M}, disjoint f1.support f2.support → ∏ x in f1.support, g x (f1 x + f2 x) = f1.prod g := λ f1 f2 hd, finset.prod_congr rfl (λ x hx, by simp only [not_mem_support_iff.mp (disjoint_left.mp hd hx), add_zero]), begin classical, simp_rw [← this hd, ← this hd.symm, add_comm (f2 _), finsup...
lemma
finsupp.prod_add_index_of_disjoint
algebra.big_operators
src/algebra/big_operators/finsupp.lean
[ "data.finsupp.indicator", "algebra.big_operators.pi", "algebra.big_operators.ring", "algebra.big_operators.order", "group_theory.submonoid.membership" ]
[ "add_comm_monoid", "comm_monoid", "disjoint", "finset.prod_congr", "finsupp.prod" ]
For disjoint `f1` and `f2`, and function `g`, the product of the products of `g` over `f1` and `f2` equals the product of `g` over `f1 + f2`
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
prod_dvd_prod_of_subset_of_dvd [add_comm_monoid M] [comm_monoid N] {f1 f2 : α →₀ M} {g1 g2 : α → M → N} (h1 : f1.support ⊆ f2.support) (h2 : ∀ (a : α), a ∈ f1.support → g1 a (f1 a) ∣ g2 a (f2 a)) : f1.prod g1 ∣ f2.prod g2
begin classical, simp only [finsupp.prod, finsupp.prod_mul], rw [←sdiff_union_of_subset h1, prod_union sdiff_disjoint], apply dvd_mul_of_dvd_right, apply prod_dvd_prod_of_dvd, exact h2, end
lemma
finsupp.prod_dvd_prod_of_subset_of_dvd
algebra.big_operators
src/algebra/big_operators/finsupp.lean
[ "data.finsupp.indicator", "algebra.big_operators.pi", "algebra.big_operators.ring", "algebra.big_operators.order", "group_theory.submonoid.membership" ]
[ "add_comm_monoid", "comm_monoid", "dvd_mul_of_dvd_right", "finsupp.prod", "finsupp.prod_mul" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
indicator_eq_sum_single [add_comm_monoid M] (s : finset α) (f : Π a ∈ s, M) : indicator s f = ∑ x in s.attach, single x (f x x.2)
begin rw [← sum_single (indicator s f), sum, sum_subset (support_indicator_subset _ _), ← sum_attach], { refine finset.sum_congr rfl (λ x hx, _), rw [indicator_of_mem], }, intros i _ hi, rw [not_mem_support_iff.mp hi, single_zero], end
lemma
finsupp.indicator_eq_sum_single
algebra.big_operators
src/algebra/big_operators/finsupp.lean
[ "data.finsupp.indicator", "algebra.big_operators.pi", "algebra.big_operators.ring", "algebra.big_operators.order", "group_theory.submonoid.membership" ]
[ "add_comm_monoid", "finset" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
prod_indicator_index [has_zero M] [comm_monoid N] {s : finset α} (f : Π a ∈ s, M) {h : α → M → N} (h_zero : ∀ a ∈ s, h a 0 = 1) : (indicator s f).prod h = ∏ x in s.attach, h x (f x x.2)
begin rw [prod_of_support_subset _ (support_indicator_subset _ _) h h_zero, ← prod_attach], refine finset.prod_congr rfl (λ x hx, _), rw [indicator_of_mem], end
lemma
finsupp.prod_indicator_index
algebra.big_operators
src/algebra/big_operators/finsupp.lean
[ "data.finsupp.indicator", "algebra.big_operators.pi", "algebra.big_operators.ring", "algebra.big_operators.order", "group_theory.submonoid.membership" ]
[ "comm_monoid", "finset", "finset.prod_congr" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
finset.sum_apply' : (∑ k in s, f k) i = ∑ k in s, f k i
(finsupp.apply_add_hom i : (ι →₀ A) →+ A).map_sum f s
theorem
finset.sum_apply'
algebra.big_operators
src/algebra/big_operators/finsupp.lean
[ "data.finsupp.indicator", "algebra.big_operators.pi", "algebra.big_operators.ring", "algebra.big_operators.order", "group_theory.submonoid.membership" ]
[ "finsupp.apply_add_hom" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
finsupp.sum_apply' : g.sum k x = g.sum (λ i b, k i b x)
finset.sum_apply _ _ _
theorem
finsupp.sum_apply'
algebra.big_operators
src/algebra/big_operators/finsupp.lean
[ "data.finsupp.indicator", "algebra.big_operators.pi", "algebra.big_operators.ring", "algebra.big_operators.order", "group_theory.submonoid.membership" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
finsupp.sum_sum_index' : (∑ x in s, f x).sum t = ∑ x in s, (f x).sum t
finset.induction_on s rfl $ λ a s has ih, by simp_rw [finset.sum_insert has, finsupp.sum_add_index' h0 h1, ih]
theorem
finsupp.sum_sum_index'
algebra.big_operators
src/algebra/big_operators/finsupp.lean
[ "data.finsupp.indicator", "algebra.big_operators.pi", "algebra.big_operators.ring", "algebra.big_operators.order", "group_theory.submonoid.membership" ]
[ "finset.induction_on", "ih" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
finsupp.sum_mul (b : S) (s : α →₀ R) {f : α → R → S} : (s.sum f) * b = s.sum (λ a c, (f a c) * b)
by simp only [finsupp.sum, finset.sum_mul]
lemma
finsupp.sum_mul
algebra.big_operators
src/algebra/big_operators/finsupp.lean
[ "data.finsupp.indicator", "algebra.big_operators.pi", "algebra.big_operators.ring", "algebra.big_operators.order", "group_theory.submonoid.membership" ]
[ "finset.sum_mul" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
finsupp.mul_sum (b : S) (s : α →₀ R) {f : α → R → S} : b * (s.sum f) = s.sum (λ a c, b * (f a c))
by simp only [finsupp.sum, finset.mul_sum]
lemma
finsupp.mul_sum
algebra.big_operators
src/algebra/big_operators/finsupp.lean
[ "data.finsupp.indicator", "algebra.big_operators.pi", "algebra.big_operators.ring", "algebra.big_operators.order", "group_theory.submonoid.membership" ]
[ "finset.mul_sum" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
prod_pow_pos_of_zero_not_mem_support {f : ℕ →₀ ℕ} (hf : 0 ∉ f.support) : 0 < f.prod pow
finset.prod_pos (λ a ha, pos_iff_ne_zero.mpr (pow_ne_zero _ (λ H, by {subst H, exact hf ha})))
lemma
nat.prod_pow_pos_of_zero_not_mem_support
algebra.big_operators
src/algebra/big_operators/finsupp.lean
[ "data.finsupp.indicator", "algebra.big_operators.pi", "algebra.big_operators.ring", "algebra.big_operators.order", "group_theory.submonoid.membership" ]
[ "finset.prod_pos", "pow_ne_zero" ]
If `0 : ℕ` is not in the support of `f : ℕ →₀ ℕ` then `0 < ∏ x in f.support, x ^ (f x)`.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
prod_Ico_add' [ordered_cancel_add_comm_monoid α] [has_exists_add_of_le α] [locally_finite_order α] (f : α → β) (a b c : α) : (∏ x in Ico a b, f (x + c)) = (∏ x in Ico (a + c) (b + c), f x)
by { rw [← map_add_right_Ico, prod_map], refl }
lemma
finset.prod_Ico_add'
algebra.big_operators
src/algebra/big_operators/intervals.lean
[ "algebra.big_operators.basic", "algebra.module.basic", "data.nat.interval", "tactic.linarith" ]
[ "has_exists_add_of_le", "locally_finite_order", "ordered_cancel_add_comm_monoid", "prod_map" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
prod_Ico_add [ordered_cancel_add_comm_monoid α] [has_exists_add_of_le α] [locally_finite_order α] (f : α → β) (a b c : α) : (∏ x in Ico a b, f (c + x)) = (∏ x in Ico (a + c) (b + c), f x)
begin convert prod_Ico_add' f a b c, simp_rw add_comm, end
lemma
finset.prod_Ico_add
algebra.big_operators
src/algebra/big_operators/intervals.lean
[ "algebra.big_operators.basic", "algebra.module.basic", "data.nat.interval", "tactic.linarith" ]
[ "has_exists_add_of_le", "locally_finite_order", "ordered_cancel_add_comm_monoid" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
sum_Ico_succ_top {δ : Type*} [add_comm_monoid δ] {a b : ℕ} (hab : a ≤ b) (f : ℕ → δ) : (∑ k in Ico a (b + 1), f k) = (∑ k in Ico a b, f k) + f b
by rw [nat.Ico_succ_right_eq_insert_Ico hab, sum_insert right_not_mem_Ico, add_comm]
lemma
finset.sum_Ico_succ_top
algebra.big_operators
src/algebra/big_operators/intervals.lean
[ "algebra.big_operators.basic", "algebra.module.basic", "data.nat.interval", "tactic.linarith" ]
[ "add_comm_monoid", "nat.Ico_succ_right_eq_insert_Ico" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
prod_Ico_succ_top {a b : ℕ} (hab : a ≤ b) (f : ℕ → β) : (∏ k in Ico a (b + 1), f k) = (∏ k in Ico a b, f k) * f b
@sum_Ico_succ_top (additive β) _ _ _ hab _
lemma
finset.prod_Ico_succ_top
algebra.big_operators
src/algebra/big_operators/intervals.lean
[ "algebra.big_operators.basic", "algebra.module.basic", "data.nat.interval", "tactic.linarith" ]
[ "additive" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
sum_eq_sum_Ico_succ_bot {δ : Type*} [add_comm_monoid δ] {a b : ℕ} (hab : a < b) (f : ℕ → δ) : (∑ k in Ico a b, f k) = f a + (∑ k in Ico (a + 1) b, f k)
have ha : a ∉ Ico (a + 1) b, by simp, by rw [← sum_insert ha, nat.Ico_insert_succ_left hab]
lemma
finset.sum_eq_sum_Ico_succ_bot
algebra.big_operators
src/algebra/big_operators/intervals.lean
[ "algebra.big_operators.basic", "algebra.module.basic", "data.nat.interval", "tactic.linarith" ]
[ "add_comm_monoid", "nat.Ico_insert_succ_left" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
prod_eq_prod_Ico_succ_bot {a b : ℕ} (hab : a < b) (f : ℕ → β) : (∏ k in Ico a b, f k) = f a * (∏ k in Ico (a + 1) b, f k)
@sum_eq_sum_Ico_succ_bot (additive β) _ _ _ hab _
lemma
finset.prod_eq_prod_Ico_succ_bot
algebra.big_operators
src/algebra/big_operators/intervals.lean
[ "algebra.big_operators.basic", "algebra.module.basic", "data.nat.interval", "tactic.linarith" ]
[ "additive" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
prod_Ico_consecutive (f : ℕ → β) {m n k : ℕ} (hmn : m ≤ n) (hnk : n ≤ k) : (∏ i in Ico m n, f i) * (∏ i in Ico n k, f i) = (∏ i in Ico m k, f i)
Ico_union_Ico_eq_Ico hmn hnk ▸ eq.symm $ prod_union $ Ico_disjoint_Ico_consecutive m n k
lemma
finset.prod_Ico_consecutive
algebra.big_operators
src/algebra/big_operators/intervals.lean
[ "algebra.big_operators.basic", "algebra.module.basic", "data.nat.interval", "tactic.linarith" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
prod_Ioc_consecutive (f : ℕ → β) {m n k : ℕ} (hmn : m ≤ n) (hnk : n ≤ k) : (∏ i in Ioc m n, f i) * (∏ i in Ioc n k, f i) = (∏ i in Ioc m k, f i)
begin rw [← Ioc_union_Ioc_eq_Ioc hmn hnk, prod_union], apply disjoint_left.2 (λ x hx h'x, _), exact lt_irrefl _ ((mem_Ioc.1 h'x).1.trans_le (mem_Ioc.1 hx).2), end
lemma
finset.prod_Ioc_consecutive
algebra.big_operators
src/algebra/big_operators/intervals.lean
[ "algebra.big_operators.basic", "algebra.module.basic", "data.nat.interval", "tactic.linarith" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
prod_Ioc_succ_top {a b : ℕ} (hab : a ≤ b) (f : ℕ → β) : (∏ k in Ioc a (b + 1), f k) = (∏ k in Ioc a b, f k) * f (b + 1)
by rw [← prod_Ioc_consecutive _ hab (nat.le_succ b), nat.Ioc_succ_singleton, prod_singleton]
lemma
finset.prod_Ioc_succ_top
algebra.big_operators
src/algebra/big_operators/intervals.lean
[ "algebra.big_operators.basic", "algebra.module.basic", "data.nat.interval", "tactic.linarith" ]
[ "nat.Ioc_succ_singleton" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
prod_range_mul_prod_Ico (f : ℕ → β) {m n : ℕ} (h : m ≤ n) : (∏ k in range m, f k) * (∏ k in Ico m n, f k) = (∏ k in range n, f k)
nat.Ico_zero_eq_range ▸ nat.Ico_zero_eq_range ▸ prod_Ico_consecutive f m.zero_le h
lemma
finset.prod_range_mul_prod_Ico
algebra.big_operators
src/algebra/big_operators/intervals.lean
[ "algebra.big_operators.basic", "algebra.module.basic", "data.nat.interval", "tactic.linarith" ]
[ "nat.Ico_zero_eq_range" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
prod_Ico_eq_mul_inv {δ : Type*} [comm_group δ] (f : ℕ → δ) {m n : ℕ} (h : m ≤ n) : (∏ k in Ico m n, f k) = (∏ k in range n, f k) * (∏ k in range m, f k)⁻¹
eq_mul_inv_iff_mul_eq.2 $ by rw [mul_comm]; exact prod_range_mul_prod_Ico f h
lemma
finset.prod_Ico_eq_mul_inv
algebra.big_operators
src/algebra/big_operators/intervals.lean
[ "algebra.big_operators.basic", "algebra.module.basic", "data.nat.interval", "tactic.linarith" ]
[ "comm_group", "mul_comm" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
prod_Ico_eq_div {δ : Type*} [comm_group δ] (f : ℕ → δ) {m n : ℕ} (h : m ≤ n) : (∏ k in Ico m n, f k) = (∏ k in range n, f k) / (∏ k in range m, f k)
by simpa only [div_eq_mul_inv] using prod_Ico_eq_mul_inv f h
lemma
finset.prod_Ico_eq_div
algebra.big_operators
src/algebra/big_operators/intervals.lean
[ "algebra.big_operators.basic", "algebra.module.basic", "data.nat.interval", "tactic.linarith" ]
[ "comm_group", "div_eq_mul_inv" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
prod_range_sub_prod_range {α : Type*} [comm_group α] {f : ℕ → α} {n m : ℕ} (hnm : n ≤ m) : (∏ k in range m, f k) / (∏ k in range n, f k) = ∏ k in (range m).filter (λ k, n ≤ k), f k
begin rw [← prod_Ico_eq_div f hnm], congr, apply finset.ext, simp only [mem_Ico, mem_filter, mem_range, *], tauto, end
lemma
finset.prod_range_sub_prod_range
algebra.big_operators
src/algebra/big_operators/intervals.lean
[ "algebra.big_operators.basic", "algebra.module.basic", "data.nat.interval", "tactic.linarith" ]
[ "comm_group", "filter", "finset.ext" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
sum_Ico_Ico_comm {M : Type*} [add_comm_monoid M] (a b : ℕ) (f : ℕ → ℕ → M) : ∑ i in finset.Ico a b, ∑ j in finset.Ico i b, f i j = ∑ j in finset.Ico a b, ∑ i in finset.Ico a (j+1), f i j
begin rw [finset.sum_sigma', finset.sum_sigma'], refine finset.sum_bij' (λ (x : Σ (i : ℕ), ℕ) _, (⟨x.2, x.1⟩ : Σ (i : ℕ), ℕ)) _ (λ _ _, rfl) (λ (x : Σ (i : ℕ), ℕ) _, (⟨x.2, x.1⟩ : Σ (i : ℕ), ℕ)) _ (by rintro ⟨⟩ _; refl) (by rintro ⟨⟩ _; refl); simp only [finset.mem_Ico, sigma.forall, finset.mem_sigma]...
lemma
finset.sum_Ico_Ico_comm
algebra.big_operators
src/algebra/big_operators/intervals.lean
[ "algebra.big_operators.basic", "algebra.module.basic", "data.nat.interval", "tactic.linarith" ]
[ "add_comm_monoid", "finset.Ico", "finset.mem_Ico", "finset.mem_sigma" ]
The two ways of summing over `(i,j)` in the range `a<=i<=j<b` are equal.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
prod_Ico_eq_prod_range (f : ℕ → β) (m n : ℕ) : (∏ k in Ico m n, f k) = (∏ k in range (n - m), f (m + k))
begin by_cases h : m ≤ n, { rw [←nat.Ico_zero_eq_range, prod_Ico_add, zero_add, tsub_add_cancel_of_le h] }, { replace h : n ≤ m := le_of_not_ge h, rw [Ico_eq_empty_of_le h, tsub_eq_zero_iff_le.mpr h, range_zero, prod_empty, prod_empty] } end
lemma
finset.prod_Ico_eq_prod_range
algebra.big_operators
src/algebra/big_operators/intervals.lean
[ "algebra.big_operators.basic", "algebra.module.basic", "data.nat.interval", "tactic.linarith" ]
[ "tsub_add_cancel_of_le" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
prod_Ico_reflect (f : ℕ → β) (k : ℕ) {m n : ℕ} (h : m ≤ n + 1) : ∏ j in Ico k m, f (n - j) = ∏ j in Ico (n + 1 - m) (n + 1 - k), f j
begin have : ∀ i < m, i ≤ n, { intros i hi, exact (add_le_add_iff_right 1).1 (le_trans (nat.lt_iff_add_one_le.1 hi) h) }, cases lt_or_le k m with hkm hkm, { rw [← nat.Ico_image_const_sub_eq_Ico (this _ hkm)], refine (prod_image _).symm, simp only [mem_Ico], rintros i ⟨ki, im⟩ j ⟨kj, jm⟩ Hij, ...
lemma
finset.prod_Ico_reflect
algebra.big_operators
src/algebra/big_operators/intervals.lean
[ "algebra.big_operators.basic", "algebra.module.basic", "data.nat.interval", "tactic.linarith" ]
[ "nat.Ico_image_const_sub_eq_Ico", "tsub_le_tsub_left", "tsub_tsub_cancel_of_le" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
sum_Ico_reflect {δ : Type*} [add_comm_monoid δ] (f : ℕ → δ) (k : ℕ) {m n : ℕ} (h : m ≤ n + 1) : ∑ j in Ico k m, f (n - j) = ∑ j in Ico (n + 1 - m) (n + 1 - k), f j
@prod_Ico_reflect (multiplicative δ) _ f k m n h
lemma
finset.sum_Ico_reflect
algebra.big_operators
src/algebra/big_operators/intervals.lean
[ "algebra.big_operators.basic", "algebra.module.basic", "data.nat.interval", "tactic.linarith" ]
[ "add_comm_monoid", "multiplicative" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
prod_range_reflect (f : ℕ → β) (n : ℕ) : ∏ j in range n, f (n - 1 - j) = ∏ j in range n, f j
begin cases n, { simp }, { simp only [←nat.Ico_zero_eq_range, nat.succ_sub_succ_eq_sub, tsub_zero], rw prod_Ico_reflect _ _ le_rfl, simp } end
lemma
finset.prod_range_reflect
algebra.big_operators
src/algebra/big_operators/intervals.lean
[ "algebra.big_operators.basic", "algebra.module.basic", "data.nat.interval", "tactic.linarith" ]
[ "le_rfl", "tsub_zero" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
sum_range_reflect {δ : Type*} [add_comm_monoid δ] (f : ℕ → δ) (n : ℕ) : ∑ j in range n, f (n - 1 - j) = ∑ j in range n, f j
@prod_range_reflect (multiplicative δ) _ f n
lemma
finset.sum_range_reflect
algebra.big_operators
src/algebra/big_operators/intervals.lean
[ "algebra.big_operators.basic", "algebra.module.basic", "data.nat.interval", "tactic.linarith" ]
[ "add_comm_monoid", "multiplicative" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
prod_Ico_id_eq_factorial : ∀ n : ℕ, ∏ x in Ico 1 (n + 1), x = n!
| 0 := rfl | (n+1) := by rw [prod_Ico_succ_top $ nat.succ_le_succ $ zero_le n, nat.factorial_succ, prod_Ico_id_eq_factorial n, nat.succ_eq_add_one, mul_comm]
lemma
finset.prod_Ico_id_eq_factorial
algebra.big_operators
src/algebra/big_operators/intervals.lean
[ "algebra.big_operators.basic", "algebra.module.basic", "data.nat.interval", "tactic.linarith" ]
[ "mul_comm", "nat.factorial_succ" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
prod_range_add_one_eq_factorial : ∀ n : ℕ, ∏ x in range n, (x+1) = n!
| 0 := rfl | (n+1) := by simp [finset.range_succ, prod_range_add_one_eq_factorial n]
lemma
finset.prod_range_add_one_eq_factorial
algebra.big_operators
src/algebra/big_operators/intervals.lean
[ "algebra.big_operators.basic", "algebra.module.basic", "data.nat.interval", "tactic.linarith" ]
[ "finset.range_succ" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
sum_range_id_mul_two (n : ℕ) : (∑ i in range n, i) * 2 = n * (n - 1)
calc (∑ i in range n, i) * 2 = (∑ i in range n, i) + (∑ i in range n, (n - 1 - i)) : by rw [sum_range_reflect (λ i, i) n, mul_two] ... = ∑ i in range n, (i + (n - 1 - i)) : sum_add_distrib.symm ... = ∑ i in range n, (n - 1) : sum_congr rfl $ λ i hi, add_tsub_cancel_of_le $ nat.le_pred_of_lt $ mem_range.1 hi ... = n...
lemma
finset.sum_range_id_mul_two
algebra.big_operators
src/algebra/big_operators/intervals.lean
[ "algebra.big_operators.basic", "algebra.module.basic", "data.nat.interval", "tactic.linarith" ]
[ "add_tsub_cancel_of_le", "mul_two", "nat.le_pred_of_lt", "nat.nsmul_eq_mul" ]
Gauss' summation formula
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
sum_range_id (n : ℕ) : (∑ i in range n, i) = (n * (n - 1)) / 2
by rw [← sum_range_id_mul_two n, nat.mul_div_cancel]; exact dec_trivial
lemma
finset.sum_range_id
algebra.big_operators
src/algebra/big_operators/intervals.lean
[ "algebra.big_operators.basic", "algebra.module.basic", "data.nat.interval", "tactic.linarith" ]
[]
Gauss' summation formula
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
prod_range_succ_div_prod : (∏ i in range (n+1), f i) / ∏ i in range n, f i = f n
div_eq_iff_eq_mul'.mpr $ prod_range_succ f n
lemma
finset.prod_range_succ_div_prod
algebra.big_operators
src/algebra/big_operators/intervals.lean
[ "algebra.big_operators.basic", "algebra.module.basic", "data.nat.interval", "tactic.linarith" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
prod_range_succ_div_top : (∏ i in range (n+1), f i) / f n = ∏ i in range n, f i
div_eq_iff_eq_mul.mpr $ prod_range_succ f n
lemma
finset.prod_range_succ_div_top
algebra.big_operators
src/algebra/big_operators/intervals.lean
[ "algebra.big_operators.basic", "algebra.module.basic", "data.nat.interval", "tactic.linarith" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
prod_Ico_div_bot (hmn : m < n) : (∏ i in Ico m n, f i) / f m = ∏ i in Ico (m+1) n, f i
div_eq_iff_eq_mul'.mpr $ prod_eq_prod_Ico_succ_bot hmn _
lemma
finset.prod_Ico_div_bot
algebra.big_operators
src/algebra/big_operators/intervals.lean
[ "algebra.big_operators.basic", "algebra.module.basic", "data.nat.interval", "tactic.linarith" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
prod_Ico_succ_div_top (hmn : m ≤ n) : (∏ i in Ico m (n+1), f i) / f n = ∏ i in Ico m n, f i
div_eq_iff_eq_mul.mpr $ prod_Ico_succ_top hmn _
lemma
finset.prod_Ico_succ_div_top
algebra.big_operators
src/algebra/big_operators/intervals.lean
[ "algebra.big_operators.basic", "algebra.module.basic", "data.nat.interval", "tactic.linarith" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
sum_Ico_by_parts (hmn : m < n) : ∑ i in Ico m n, f i • g i = f (n-1) • G n - f m • G m - ∑ i in Ico m (n-1), (f (i+1) - f i) • G (i+1)
begin have h₁ : ∑ i in Ico (m+1) n, (f i • G i) = ∑ i in Ico m (n-1), (f (i+1) • G (i+1)), { conv in n { rw ←nat.sub_add_cancel (nat.one_le_of_lt hmn) }, rw ←sum_Ico_add' }, have h₂ : ∑ i in Ico (m+1) n, (f i • G (i+1)) = ∑ i in Ico m (n-1), (f i • G (i+1)) + f (n-1) • G n - f m • G (m+1) := by rw...
theorem
finset.sum_Ico_by_parts
algebra.big_operators
src/algebra/big_operators/intervals.lean
[ "algebra.big_operators.basic", "algebra.module.basic", "data.nat.interval", "tactic.linarith" ]
[ "nat.le_pred_of_lt", "nat.one_le_of_lt", "pos_of_gt", "smul_add", "smul_sub", "sub_smul" ]
**Summation by parts**, also known as **Abel's lemma** or an **Abel transformation**
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
sum_range_by_parts : ∑ i in range n, (f i • g i) = f (n-1) • G n - ∑ i in range (n-1), (f (i+1) - f i) • G (i+1)
begin by_cases hn : n = 0, { simp [hn], }, { rw [range_eq_Ico, sum_Ico_by_parts f g (nat.pos_of_ne_zero hn), sum_range_zero, smul_zero, sub_zero, range_eq_Ico] }, end
lemma
finset.sum_range_by_parts
algebra.big_operators
src/algebra/big_operators/intervals.lean
[ "algebra.big_operators.basic", "algebra.module.basic", "data.nat.interval", "tactic.linarith" ]
[ "smul_zero" ]
**Summation by parts** for ranges
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
prod_antidiagonal_succ {n : ℕ} {f : ℕ × ℕ → M} : ∏ p in antidiagonal (n + 1), f p = f (0, n + 1) * ∏ p in antidiagonal n, f (p.1 + 1, p.2)
begin rw [antidiagonal_succ, prod_cons, prod_map], refl, end
lemma
finset.nat.prod_antidiagonal_succ
algebra.big_operators
src/algebra/big_operators/nat_antidiagonal.lean
[ "data.finset.nat_antidiagonal", "algebra.big_operators.basic" ]
[ "prod_map" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
sum_antidiagonal_succ {n : ℕ} {f : ℕ × ℕ → N} : ∑ p in antidiagonal (n + 1), f p = f (0, n + 1) + ∑ p in antidiagonal n, f (p.1 + 1, p.2)
@prod_antidiagonal_succ (multiplicative N) _ _ _
lemma
finset.nat.sum_antidiagonal_succ
algebra.big_operators
src/algebra/big_operators/nat_antidiagonal.lean
[ "data.finset.nat_antidiagonal", "algebra.big_operators.basic" ]
[ "multiplicative" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
prod_antidiagonal_swap {n : ℕ} {f : ℕ × ℕ → M} : ∏ p in antidiagonal n, f p.swap = ∏ p in antidiagonal n, f p
by { nth_rewrite 1 ← map_swap_antidiagonal, rw [prod_map], refl }
lemma
finset.nat.prod_antidiagonal_swap
algebra.big_operators
src/algebra/big_operators/nat_antidiagonal.lean
[ "data.finset.nat_antidiagonal", "algebra.big_operators.basic" ]
[ "prod_map" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
prod_antidiagonal_succ' {n : ℕ} {f : ℕ × ℕ → M} : ∏ p in antidiagonal (n + 1), f p = f (n + 1, 0) * ∏ p in antidiagonal n, f (p.1, p.2 + 1)
begin rw [← prod_antidiagonal_swap, prod_antidiagonal_succ, ← prod_antidiagonal_swap], refl end
lemma
finset.nat.prod_antidiagonal_succ'
algebra.big_operators
src/algebra/big_operators/nat_antidiagonal.lean
[ "data.finset.nat_antidiagonal", "algebra.big_operators.basic" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
sum_antidiagonal_succ' {n : ℕ} {f : ℕ × ℕ → N} : ∑ p in antidiagonal (n + 1), f p = f (n + 1, 0) + ∑ p in antidiagonal n, f (p.1, p.2 + 1)
@prod_antidiagonal_succ' (multiplicative N) _ _ _
lemma
finset.nat.sum_antidiagonal_succ'
algebra.big_operators
src/algebra/big_operators/nat_antidiagonal.lean
[ "data.finset.nat_antidiagonal", "algebra.big_operators.basic" ]
[ "multiplicative" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
prod_antidiagonal_subst {n : ℕ} {f : ℕ × ℕ → ℕ → M} : ∏ p in antidiagonal n, f p n = ∏ p in antidiagonal n, f p (p.1 + p.2)
prod_congr rfl $ λ p hp, by rw [nat.mem_antidiagonal.1 hp]
lemma
finset.nat.prod_antidiagonal_subst
algebra.big_operators
src/algebra/big_operators/nat_antidiagonal.lean
[ "data.finset.nat_antidiagonal", "algebra.big_operators.basic" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
prod_antidiagonal_eq_prod_range_succ_mk {M : Type*} [comm_monoid M] (f : ℕ × ℕ → M) (n : ℕ) : ∏ ij in finset.nat.antidiagonal n, f ij = ∏ k in range n.succ, f (k, n - k)
begin convert prod_map _ ⟨λ i, (i, n - i), λ x y h, (prod.mk.inj h).1⟩ _, refl, end
lemma
finset.nat.prod_antidiagonal_eq_prod_range_succ_mk
algebra.big_operators
src/algebra/big_operators/nat_antidiagonal.lean
[ "data.finset.nat_antidiagonal", "algebra.big_operators.basic" ]
[ "comm_monoid", "finset.nat.antidiagonal", "prod_map" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
prod_antidiagonal_eq_prod_range_succ {M : Type*} [comm_monoid M] (f : ℕ → ℕ → M) (n : ℕ) : ∏ ij in finset.nat.antidiagonal n, f ij.1 ij.2 = ∏ k in range n.succ, f k (n - k)
prod_antidiagonal_eq_prod_range_succ_mk _ _
lemma
finset.nat.prod_antidiagonal_eq_prod_range_succ
algebra.big_operators
src/algebra/big_operators/nat_antidiagonal.lean
[ "data.finset.nat_antidiagonal", "algebra.big_operators.basic" ]
[ "comm_monoid", "finset.nat.antidiagonal" ]
This lemma matches more generally than `finset.nat.prod_antidiagonal_eq_prod_range_succ_mk` when using `rw ←`.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
decide_eq (l r : expr) : tactic (bool × expr)
do (l', l'_pf) ← or_refl_conv norm_num.derive l, (r', r'_pf) ← or_refl_conv norm_num.derive r, n₁ ← l'.to_rat, n₂ ← r'.to_rat, c ← infer_type l' >>= mk_instance_cache, if n₁ = n₂ then do pf ← i_to_expr ``(eq.trans %%l'_pf $ eq.symm %%r'_pf), pure (tt, pf) else do (_, p) ← norm_num.prove_ne c l' ...
def
tactic.norm_num.decide_eq
algebra.big_operators
src/algebra/big_operators/norm_num.lean
[ "algebra.big_operators.basic", "data.int.interval", "tactic.norm_num" ]
[ "norm_num.derive", "norm_num.prove_ne" ]
Use `norm_num` to decide equality between two expressions. If the decision procedure succeeds, the `bool` value indicates whether the expressions are equal, and the `expr` is a proof of (dis)equality. This procedure is partial: it will fail in cases where `norm_num` can't reduce either side to a rational numeral.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
list.not_mem_cons {α : Type*} {x y : α} {ys : list α} (h₁ : x ≠ y) (h₂ : x ∉ ys) : x ∉ y :: ys
λ h, ((list.mem_cons_iff _ _ _).mp h).elim h₁ h₂
lemma
tactic.norm_num.list.not_mem_cons
algebra.big_operators
src/algebra/big_operators/norm_num.lean
[ "algebra.big_operators.basic", "data.int.interval", "tactic.norm_num" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
list.decide_mem (decide_eq : expr → expr → tactic (bool × expr)) : expr → list expr → tactic (bool × expr)
| x [] := do pf ← i_to_expr ``(list.not_mem_nil %%x), pure (ff, pf) | x (y :: ys) := do (is_head, head_pf) ← decide_eq x y, if is_head then do pf ← i_to_expr ``((list.mem_cons_iff %%x %%y _).mpr (or.inl %%head_pf)), pure (tt, pf) else do (mem_tail, tail_pf) ← list.decide_mem x ys, if mem_tail ...
def
tactic.norm_num.list.decide_mem
algebra.big_operators
src/algebra/big_operators/norm_num.lean
[ "algebra.big_operators.basic", "data.int.interval", "tactic.norm_num" ]
[]
Use a decision procedure for the equality of list elements to decide list membership. If the decision procedure succeeds, the `bool` value indicates whether the expressions are equal, and the `expr` is a proof of (dis)equality. This procedure is partial iff its parameter `decide_eq` is partial.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
list.map_cons_congr {α β : Type*} (f : α → β) {x : α} {xs : list α} {fx : β} {fxs : list β} (h₁ : f x = fx) (h₂ : xs.map f = fxs) : (x :: xs).map f = fx :: fxs
by rw [list.map_cons, h₁, h₂]
lemma
tactic.norm_num.list.map_cons_congr
algebra.big_operators
src/algebra/big_operators/norm_num.lean
[ "algebra.big_operators.basic", "data.int.interval", "tactic.norm_num" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
eval_list_map (ef : expr) : list expr → tactic (list expr × expr)
| [] := do eq ← i_to_expr ``(list.map_nil %%ef), pure ([], eq) | (x :: xs) := do (fx, fx_eq) ← or_refl_conv norm_num.derive (expr.app ef x), (fxs, fxs_eq) ← eval_list_map xs, eq ← i_to_expr ``(list.map_cons_congr %%ef %%fx_eq %%fxs_eq), pure (fx :: fxs, eq)
def
tactic.norm_num.eval_list_map
algebra.big_operators
src/algebra/big_operators/norm_num.lean
[ "algebra.big_operators.basic", "data.int.interval", "tactic.norm_num" ]
[ "norm_num.derive" ]
Apply `ef : α → β` to all elements of the list, constructing an equality proof.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
list.cons_congr {α : Type*} (x : α) {xs : list α} {xs' : list α} (xs_eq : xs' = xs) : x :: xs' = x :: xs
by rw xs_eq
lemma
tactic.norm_num.list.cons_congr
algebra.big_operators
src/algebra/big_operators/norm_num.lean
[ "algebra.big_operators.basic", "data.int.interval", "tactic.norm_num" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
list.map_congr {α β : Type*} (f : α → β) {xs xs' : list α} {ys : list β} (xs_eq : xs = xs') (ys_eq : xs'.map f = ys) : xs.map f = ys
by rw [← ys_eq, xs_eq]
lemma
tactic.norm_num.list.map_congr
algebra.big_operators
src/algebra/big_operators/norm_num.lean
[ "algebra.big_operators.basic", "data.int.interval", "tactic.norm_num" ]
[ "list.map_congr" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
eval_list : expr → tactic (list expr × expr)
| e@`(list.nil) := do eq ← mk_eq_refl e, pure ([], eq) | e@`(list.cons %%x %%xs) := do (xs, xs_eq) ← eval_list xs, eq ← i_to_expr ``(list.cons_congr %%x %%xs_eq), pure (x :: xs, eq) | e@`(list.range %%en) := do n ← expr.to_nat en, eis ← (list.range n).mmap (λ i, expr.of_nat `(ℕ) i), eq ← mk_eq_refl e, ...
def
tactic.norm_num.eval_list
algebra.big_operators
src/algebra/big_operators/norm_num.lean
[ "algebra.big_operators.basic", "data.int.interval", "tactic.norm_num" ]
[ "expr.of_nat", "expr.to_nat", "list.fin_range" ]
Convert an expression denoting a list to a list of elements.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
multiset.cons_congr {α : Type*} (x : α) {xs : multiset α} {xs' : list α} (xs_eq : (xs' : multiset α) = xs) : (list.cons x xs' : multiset α) = x ::ₘ xs
by rw [← xs_eq]; refl
lemma
tactic.norm_num.multiset.cons_congr
algebra.big_operators
src/algebra/big_operators/norm_num.lean
[ "algebra.big_operators.basic", "data.int.interval", "tactic.norm_num" ]
[ "multiset" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
multiset.map_congr {α β : Type*} (f : α → β) {xs : multiset α} {xs' : list α} {ys : list β} (xs_eq : xs = (xs' : multiset α)) (ys_eq : xs'.map f = ys) : xs.map f = (ys : multiset β)
by rw [← ys_eq, ← multiset.coe_map, xs_eq]
lemma
tactic.norm_num.multiset.map_congr
algebra.big_operators
src/algebra/big_operators/norm_num.lean
[ "algebra.big_operators.basic", "data.int.interval", "tactic.norm_num" ]
[ "multiset", "multiset.coe_map", "multiset.map_congr" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
eval_multiset : expr → tactic (list expr × expr)
| e@`(@has_zero.zero (multiset _) _) := do eq ← mk_eq_refl e, pure ([], eq) | e@`(has_emptyc.emptyc) := do eq ← mk_eq_refl e, pure ([], eq) | e@`(has_singleton.singleton %%x) := do eq ← mk_eq_refl e, pure ([x], eq) | e@`(multiset.cons %%x %%xs) := do (xs, xs_eq) ← eval_multiset xs, eq ← i_to_expr ``(mul...
def
tactic.norm_num.eval_multiset
algebra.big_operators
src/algebra/big_operators/norm_num.lean
[ "algebra.big_operators.basic", "data.int.interval", "tactic.norm_num" ]
[ "expr.of_nat", "expr.to_nat" ]
Convert an expression denoting a multiset to a list of elements. We return a list rather than a finset, so we can more easily iterate over it (without having to prove that our tactics are independent of the order of iteration, which is in general not true).
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
finset.mk_congr {α : Type*} {xs xs' : multiset α} (h : xs = xs') (nd nd') : finset.mk xs nd = finset.mk xs' nd'
by congr; assumption
lemma
tactic.norm_num.finset.mk_congr
algebra.big_operators
src/algebra/big_operators/norm_num.lean
[ "algebra.big_operators.basic", "data.int.interval", "tactic.norm_num" ]
[ "multiset" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
finset.insert_eq_coe_list_of_mem {α : Type*} [decidable_eq α] (x : α) (xs : finset α) {xs' : list α} (h : x ∈ xs') (nd_xs : xs'.nodup) (hxs' : xs = finset.mk ↑xs' (multiset.coe_nodup.mpr nd_xs)) : insert x xs = finset.mk ↑xs' (multiset.coe_nodup.mpr nd_xs)
have h : x ∈ xs, by simpa [hxs'] using h, by rw [finset.insert_eq_of_mem h, hxs']
lemma
tactic.norm_num.finset.insert_eq_coe_list_of_mem
algebra.big_operators
src/algebra/big_operators/norm_num.lean
[ "algebra.big_operators.basic", "data.int.interval", "tactic.norm_num" ]
[ "finset", "finset.insert_eq_of_mem" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
finset.insert_eq_coe_list_cons {α : Type*} [decidable_eq α] (x : α) (xs : finset α) {xs' : list α} (h : x ∉ xs') (nd_xs : xs'.nodup) (nd_xxs : (x :: xs').nodup) (hxs' : xs = finset.mk ↑xs' (multiset.coe_nodup.mpr nd_xs)) : insert x xs = finset.mk ↑(x :: xs') (multiset.coe_nodup.mpr nd_xxs)
have h : x ∉ xs, by simpa [hxs'] using h, by { rw [← finset.val_inj, finset.insert_val_of_not_mem h, hxs'], simp only [multiset.cons_coe] }
lemma
tactic.norm_num.finset.insert_eq_coe_list_cons
algebra.big_operators
src/algebra/big_operators/norm_num.lean
[ "algebra.big_operators.basic", "data.int.interval", "tactic.norm_num" ]
[ "finset", "finset.insert_val_of_not_mem", "finset.val_inj", "multiset.cons_coe" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
eval_finset_interval : expr → tactic (option (list expr × expr × expr))
| e@`(@finset.Icc %%α %%inst_1 %%inst_2 %%ea %%eb) := do a ← expr.to_int ea, b ← expr.to_int eb, eis ← (finset.Icc a b).val.unquot.mmap (λ i, expr.of_int α i), eq ← mk_eq_refl e, nd ← i_to_expr ``(finset.nodup %%e), pure (eis, eq, nd) | e@`(@finset.Ico %%α %%inst_1 %%inst_2 %%ea %%eb) := do a ← expr.to_in...
def
tactic.norm_num.eval_finset_interval
algebra.big_operators
src/algebra/big_operators/norm_num.lean
[ "algebra.big_operators.basic", "data.int.interval", "tactic.norm_num" ]
[ "expr.of_int", "expr.to_int", "finset.Icc", "finset.Ico", "finset.Ioc", "finset.Ioo" ]
For now this only works on types that are contiguous subsets of the integers
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
eval_finset (decide_eq : expr → expr → tactic (bool × expr)) : expr → tactic (list expr × expr × expr)
| e@`(finset.mk %%val %%nd) := do (val', eq) ← eval_multiset val, eq' ← i_to_expr ``(finset.mk_congr %%eq _ _), pure (val', eq', nd) | e@`(has_emptyc.emptyc) := do eq ← mk_eq_refl e, nd ← i_to_expr ``(list.nodup_nil), pure ([], eq, nd) | e@`(has_singleton.singleton %%x) := do eq ← mk_eq_refl e, nd ← i_t...
def
tactic.norm_num.eval_finset
algebra.big_operators
src/algebra/big_operators/norm_num.lean
[ "algebra.big_operators.basic", "data.int.interval", "tactic.norm_num" ]
[ "expr.of_nat", "expr.to_nat" ]
Convert an expression denoting a finset to a list of elements, a proof that this list is equal to the original finset, and a proof that the list contains no duplicates. We return a list rather than a finset, so we can more easily iterate over it (without having to prove that our tactics are independent of the order of...
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
list.prod_cons_congr {α : Type*} [monoid α] (xs : list α) (x y z : α) (his : xs.prod = y) (hi : x * y = z) : (x :: xs).prod = z
by rw [list.prod_cons, his, hi]
lemma
tactic.norm_num.list.prod_cons_congr
algebra.big_operators
src/algebra/big_operators/norm_num.lean
[ "algebra.big_operators.basic", "data.int.interval", "tactic.norm_num" ]
[ "list.prod_cons", "monoid" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
list.prove_prod (α : expr) : list expr → tactic (expr × expr)
| [] := do result ← expr.of_nat α 1, proof ← i_to_expr ``(@list.prod_nil %%α _), pure (result, proof) | (x :: xs) := do eval_xs ← list.prove_prod xs, xxs ← i_to_expr ``(%%x * %%eval_xs.1), eval_xxs ← or_refl_conv norm_num.derive xxs, exs ← expr.of_list α xs, proof ← i_to_expr ``(list.prod_cons_congr...
def
tactic.norm_num.list.prove_prod
algebra.big_operators
src/algebra/big_operators/norm_num.lean
[ "algebra.big_operators.basic", "data.int.interval", "tactic.norm_num" ]
[ "expr.of_list", "expr.of_nat", "norm_num.derive" ]
Evaluate `list.prod %%xs`, producing the evaluated expression and an equality proof.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
list.prove_sum (α : expr) : list expr → tactic (expr × expr)
| [] := do result ← expr.of_nat α 0, proof ← i_to_expr ``(@list.sum_nil %%α _), pure (result, proof) | (x :: xs) := do eval_xs ← list.prove_sum xs, xxs ← i_to_expr ``(%%x + %%eval_xs.1), eval_xxs ← or_refl_conv norm_num.derive xxs, exs ← expr.of_list α xs, proof ← i_to_expr ``(list.sum_cons_congr %%...
def
tactic.norm_num.list.prove_sum
algebra.big_operators
src/algebra/big_operators/norm_num.lean
[ "algebra.big_operators.basic", "data.int.interval", "tactic.norm_num" ]
[ "expr.of_list", "expr.of_nat", "norm_num.derive" ]
Evaluate `list.sum %%xs`, sumucing the evaluated expression and an equality proof.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
list.prod_congr {α : Type*} [monoid α] {xs xs' : list α} {z : α} (h₁ : xs = xs') (h₂ : xs'.prod = z) : xs.prod = z
by cc
lemma
tactic.norm_num.list.prod_congr
algebra.big_operators
src/algebra/big_operators/norm_num.lean
[ "algebra.big_operators.basic", "data.int.interval", "tactic.norm_num" ]
[ "monoid" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
multiset.prod_congr {α : Type*} [comm_monoid α] {xs : multiset α} {xs' : list α} {z : α} (h₁ : xs = (xs' : multiset α)) (h₂ : xs'.prod = z) : xs.prod = z
by rw [← h₂, ← multiset.coe_prod, h₁]
lemma
tactic.norm_num.multiset.prod_congr
algebra.big_operators
src/algebra/big_operators/norm_num.lean
[ "algebra.big_operators.basic", "data.int.interval", "tactic.norm_num" ]
[ "comm_monoid", "multiset", "multiset.coe_prod" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
list.prove_prod_map (β ef : expr) (xs : list expr) : tactic (expr × expr)
do (fxs, fxs_eq) ← eval_list_map ef xs, (prod, prod_eq) ← list.prove_prod β fxs, eq ← i_to_expr ``(list.prod_congr %%fxs_eq %%prod_eq), pure (prod, eq)
def
tactic.norm_num.list.prove_prod_map
algebra.big_operators
src/algebra/big_operators/norm_num.lean
[ "algebra.big_operators.basic", "data.int.interval", "tactic.norm_num" ]
[]
Evaluate `(%%xs.map (%%ef : %%α → %%β)).prod`, producing the evaluated expression and an equality proof.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
list.prove_sum_map (β ef : expr) (xs : list expr) : tactic (expr × expr)
do (fxs, fxs_eq) ← eval_list_map ef xs, (sum, sum_eq) ← list.prove_sum β fxs, eq ← i_to_expr ``(list.sum_congr %%fxs_eq %%sum_eq), pure (sum, eq)
def
tactic.norm_num.list.prove_sum_map
algebra.big_operators
src/algebra/big_operators/norm_num.lean
[ "algebra.big_operators.basic", "data.int.interval", "tactic.norm_num" ]
[]
Evaluate `(%%xs.map (%%ef : %%α → %%β)).sum`, producing the evaluated expression and an equality proof.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
finset.eval_prod_of_list {β α : Type*} [comm_monoid β] (s : finset α) (f : α → β) {is : list α} (his : is.nodup) (hs : finset.mk ↑is (multiset.coe_nodup.mpr his) = s) {x : β} (hx : (is.map f).prod = x) : s.prod f = x
by rw [← hs, finset.prod_mk, multiset.coe_map, multiset.coe_prod, hx]
lemma
tactic.norm_num.finset.eval_prod_of_list
algebra.big_operators
src/algebra/big_operators/norm_num.lean
[ "algebra.big_operators.basic", "data.int.interval", "tactic.norm_num" ]
[ "comm_monoid", "finset", "finset.prod_mk", "multiset.coe_map", "multiset.coe_prod" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
eval_big_operators : expr → tactic (expr × expr)
| `(@list.prod %%α %%inst1 %%inst2 %%exs) := tactic.trace_error "Internal error in `tactic.norm_num.eval_big_operators`:" $ do (xs, list_eq) ← eval_list exs, (result, sum_eq) ← list.prove_prod α xs, pf ← i_to_expr ``(list.prod_congr %%list_eq %%sum_eq), pure (result, pf) | `(@list.sum %%α %%inst1 %%inst2 %%exs)...
def
tactic.norm_num.eval_big_operators
algebra.big_operators
src/algebra/big_operators/norm_num.lean
[ "algebra.big_operators.basic", "data.int.interval", "tactic.norm_num" ]
[]
`norm_num` plugin for evaluating big operators: * `list.prod` * `list.sum` * `multiset.prod` * `multiset.sum` * `finset.prod` * `finset.sum`
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
prod_insert_none (f : option α → M) (s : finset α) : ∏ x in s.insert_none, f x = f none * ∏ x in s, f (some x)
by simp [insert_none]
lemma
finset.prod_insert_none
algebra.big_operators
src/algebra/big_operators/option.lean
[ "algebra.big_operators.basic", "data.finset.option" ]
[ "finset" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
prod_erase_none (f : α → M) (s : finset (option α)) : ∏ x in s.erase_none, f x = ∏ x in s, option.elim 1 f x
by classical; calc ∏ x in s.erase_none, f x = ∏ x in s.erase_none.map embedding.some, option.elim 1 f x : (prod_map s.erase_none embedding.some $ option.elim 1 f).symm ... = ∏ x in s.erase none, option.elim 1 f x : by rw map_some_erase_none ... = ∏ x in s, option.elim 1 f x : prod_erase _ rfl
lemma
finset.prod_erase_none
algebra.big_operators
src/algebra/big_operators/option.lean
[ "algebra.big_operators.basic", "data.finset.option" ]
[ "finset", "option.elim", "prod_map" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
le_prod_nonempty_of_submultiplicative_on_pred (f : M → N) (p : M → Prop) (h_mul : ∀ x y, p x → p y → f (x * y) ≤ f x * f y) (hp_mul : ∀ x y, p x → p y → p (x * y)) (g : ι → M) (s : finset ι) (hs_nonempty : s.nonempty) (hs : ∀ i ∈ s, p (g i)) : f (∏ i in s, g i) ≤ ∏ i in s, f (g i)
begin refine le_trans (multiset.le_prod_nonempty_of_submultiplicative_on_pred f p h_mul hp_mul _ _ _) _, { simp [hs_nonempty.ne_empty], }, { exact multiset.forall_mem_map_iff.mpr hs, }, rw multiset.map_map, refl, end
lemma
finset.le_prod_nonempty_of_submultiplicative_on_pred
algebra.big_operators
src/algebra/big_operators/order.lean
[ "algebra.order.absolute_value", "algebra.order.ring.with_top", "algebra.big_operators.basic", "data.fintype.card" ]
[ "finset", "multiset.le_prod_nonempty_of_submultiplicative_on_pred", "multiset.map_map" ]
Let `{x | p x}` be a subsemigroup of a commutative monoid `M`. Let `f : M → N` be a map submultiplicative on `{x | p x}`, i.e., `p x → p y → f (x * y) ≤ f x * f y`. Let `g i`, `i ∈ s`, be a nonempty finite family of elements of `M` such that `∀ i ∈ s, p (g i)`. Then `f (∏ x in s, g x) ≤ ∏ x in s, f (g x)`.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
le_prod_nonempty_of_submultiplicative (f : M → N) (h_mul : ∀ x y, f (x * y) ≤ f x * f y) {s : finset ι} (hs : s.nonempty) (g : ι → M) : f (∏ i in s, g i) ≤ ∏ i in s, f (g i)
le_prod_nonempty_of_submultiplicative_on_pred f (λ i, true) (λ x y _ _, h_mul x y) (λ _ _ _ _, trivial) g s hs (λ _ _, trivial)
lemma
finset.le_prod_nonempty_of_submultiplicative
algebra.big_operators
src/algebra/big_operators/order.lean
[ "algebra.order.absolute_value", "algebra.order.ring.with_top", "algebra.big_operators.basic", "data.fintype.card" ]
[ "finset" ]
If `f : M → N` is a submultiplicative function, `f (x * y) ≤ f x * f y` and `g i`, `i ∈ s`, is a nonempty finite family of elements of `M`, then `f (∏ i in s, g i) ≤ ∏ i in s, f (g i)`.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
le_prod_of_submultiplicative_on_pred (f : M → N) (p : M → Prop) (h_one : f 1 = 1) (h_mul : ∀ x y, p x → p y → f (x * y) ≤ f x * f y) (hp_mul : ∀ x y, p x → p y → p (x * y)) (g : ι → M) {s : finset ι} (hs : ∀ i ∈ s, p (g i)) : f (∏ i in s, g i) ≤ ∏ i in s, f (g i)
begin rcases eq_empty_or_nonempty s with rfl|hs_nonempty, { simp [h_one] }, { exact le_prod_nonempty_of_submultiplicative_on_pred f p h_mul hp_mul g s hs_nonempty hs, }, end
lemma
finset.le_prod_of_submultiplicative_on_pred
algebra.big_operators
src/algebra/big_operators/order.lean
[ "algebra.order.absolute_value", "algebra.order.ring.with_top", "algebra.big_operators.basic", "data.fintype.card" ]
[ "finset" ]
Let `{x | p x}` be a subsemigroup of a commutative monoid `M`. Let `f : M → N` be a map such that `f 1 = 1` and `f` is submultiplicative on `{x | p x}`, i.e., `p x → p y → f (x * y) ≤ f x * f y`. Let `g i`, `i ∈ s`, be a finite family of elements of `M` such that `∀ i ∈ s, p (g i)`. Then `f (∏ i in s, g i) ≤ ∏ i in s, ...
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83