|
1 | 1 | /-
|
2 |
| -Copyright (c) 2015 Nathaniel Thomas. All rights reserved. |
| 2 | +Copyright (c) 2018 Chris Hughes. All rights reserved. |
3 | 3 | Released under Apache 2.0 license as described in the file LICENSE.
|
4 |
| -Authors: Nathaniel Thomas, Jeremy Avigad, Johannes Hölzl, Mario Carneiro |
| 4 | +Authors: Chris Hughes, Yury Kudryashov, Yaël Dillies |
5 | 5 | -/
|
6 |
| - |
7 | 6 | import algebra.module.basic
|
8 |
| -import algebra.big_operators.basic |
| 7 | +import group_theory.group_action.big_operators |
9 | 8 |
|
10 | 9 | /-!
|
11 | 10 | # Finite sums over modules over a ring
|
12 | 11 | -/
|
13 | 12 |
|
14 | 13 | open_locale big_operators
|
15 | 14 |
|
16 |
| -universes u v |
17 |
| -variables {α R k S M M₂ M₃ ι : Type*} |
| 15 | +variables {α β R M ι : Type*} |
| 16 | + |
18 | 17 | section add_comm_monoid
|
19 | 18 | variables [semiring R] [add_comm_monoid M] [module R M] (r s : R) (x y : M)
|
20 |
| -variables {R M} |
| 19 | + |
21 | 20 | lemma list.sum_smul {l : list R} {x : M} : l.sum • x = (l.map (λ r, r • x)).sum :=
|
22 | 21 | ((smul_add_hom R M).flip x).map_list_sum l
|
23 | 22 |
|
24 | 23 | lemma multiset.sum_smul {l : multiset R} {x : M} : l.sum • x = (l.map (λ r, r • x)).sum :=
|
25 | 24 | ((smul_add_hom R M).flip x).map_multiset_sum l
|
26 | 25 |
|
| 26 | +lemma multiset.sum_smul_sum {s : multiset R} {t : multiset M} : |
| 27 | + s.sum • t.sum = ((s ×ˢ t).map $ λ p : R × M, p.fst • p.snd).sum := |
| 28 | +begin |
| 29 | + induction s using multiset.induction with a s ih, |
| 30 | + { simp }, |
| 31 | + { simp [add_smul, ih, ←multiset.smul_sum] } |
| 32 | +end |
| 33 | + |
27 | 34 | lemma finset.sum_smul {f : ι → R} {s : finset ι} {x : M} :
|
28 | 35 | (∑ i in s, f i) • x = (∑ i in s, (f i) • x) :=
|
29 | 36 | ((smul_add_hom R M).flip x).map_sum f s
|
| 37 | + |
| 38 | +lemma finset.sum_smul_sum {f : α → R} {g : β → M} {s : finset α} {t : finset β} : |
| 39 | + (∑ i in s, f i) • (∑ i in t, g i) = ∑ p in s ×ˢ t, f p.fst • g p.snd := |
| 40 | +by { rw [finset.sum_product, finset.sum_smul, finset.sum_congr rfl], intros, rw finset.smul_sum } |
| 41 | + |
30 | 42 | end add_comm_monoid
|
31 | 43 |
|
32 | 44 | lemma finset.cast_card [comm_semiring R] (s : finset α) : (s.card : R) = ∑ a in s, 1 :=
|
|
0 commit comments