Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 883d974

Browse files
kbuzzardmergify[bot]
authored andcommitted
feat(algebra/module): sum_smul' (for semimodules) (#1752)
* feat(algebra/module): sum_smul' (for semimodules) * adding docstring * use `classical` tactic * moving ' name to the weaker theorem
1 parent e875492 commit 883d974

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/algebra/big_operators.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,10 +428,10 @@ end comm_monoid
428428

429429
attribute [to_additive] prod_hom
430430

431-
lemma sum_smul [add_comm_monoid β] (s : finset α) (n : ℕ) (f : α → β) :
431+
lemma sum_smul' [add_comm_monoid β] (s : finset α) (n : ℕ) (f : α → β) :
432432
s.sum (λ x, add_monoid.smul n (f x)) = add_monoid.smul n (s.sum f) :=
433433
@prod_pow _ (multiplicative β) _ _ _ _
434-
attribute [to_additive sum_smul] prod_pow
434+
attribute [to_additive sum_smul'] prod_pow
435435

436436
@[simp] lemma sum_const [add_comm_monoid β] (b : β) :
437437
s.sum (λ a, b) = add_monoid.smul s.card b :=

src/algebra/module.lean

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,13 @@ instance smul.is_add_monoid_hom {r : α} : is_add_monoid_hom (λ x : β, r • x
5454
lemma semimodule.eq_zero_of_zero_eq_one (zero_eq_one : (0 : α) = 1) : x = 0 :=
5555
by rw [←one_smul α x, ←zero_eq_one, zero_smul]
5656

57+
/-- R-linearity of finite sums of elements of an R-semimodule. -/
58+
lemma finset.sum_smul {α : Type*} {R : Type*} [semiring R] {M : Type*} [add_comm_monoid M]
59+
[semimodule R M] (s : finset α) (r : R) (f : α → M) :
60+
finset.sum s (λ (x : α), (r • (f x))) = r • (finset.sum s f) :=
61+
by classical; exact
62+
finset.induction_on s (by simp) (by simp [_root_.smul_add] {contextual := tt})
63+
5764
end semimodule
5865

5966
section prio

0 commit comments

Comments
 (0)