forked from leanprover-community/mathlib4
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEnd.lean
More file actions
81 lines (55 loc) · 2.12 KB
/
End.lean
File metadata and controls
81 lines (55 loc) · 2.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/-
Copyright (c) 2015 Nathaniel Thomas. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Nathaniel Thomas, Jeremy Avigad, Johannes Hölzl, Mario Carneiro
-/
module
public import Mathlib.Algebra.Group.Hom.End
public import Mathlib.Algebra.Module.NatInt
/-!
# Module structure and endomorphisms
In this file, we define `Module.toAddMonoidEnd`, which is `(•)` as a monoid homomorphism.
We use this to prove some results on scalar multiplication by integers.
-/
@[expose] public section
assert_not_exists RelIso Multiset Set.indicator Pi.single_smul₀ Field
open Function Set
universe u v
variable {R S M M₂ : Type*}
section AddCommMonoid
variable [Semiring R] [AddCommMonoid M] [Module R M] (r s : R) (x : M)
theorem AddMonoid.End.natCast_def (n : ℕ) :
(↑n : AddMonoid.End M) = DistribMulAction.toAddMonoidEnd ℕ M n :=
rfl
variable (R M)
set_option backward.isDefEq.respectTransparency false in
/-- `(•)` as an `AddMonoidHom`.
This is a stronger version of `DistribMulAction.toAddMonoidEnd` -/
@[simps! apply_apply]
def Module.toAddMonoidEnd : R →+* AddMonoid.End M :=
{ DistribMulAction.toAddMonoidEnd R M with
map_zero' := AddMonoidHom.ext fun r => by simp
map_add' x y :=
AddMonoidHom.ext fun r => by simp [(AddMonoidHom.add_apply), add_smul] }
/-- A convenience alias for `Module.toAddMonoidEnd` as an `AddMonoidHom`, usually to allow the
use of `AddMonoidHom.flip`. -/
def smulAddHom : R →+ M →+ M :=
(Module.toAddMonoidEnd R M).toAddMonoidHom
variable {R M}
@[simp]
theorem smulAddHom_apply : smulAddHom R M r x = r • x :=
rfl
variable {x}
lemma IsAddUnit.smul_left [DistribSMul S M] (hx : IsAddUnit x) (s : S) :
IsAddUnit (s • x) :=
hx.map (DistribSMul.toAddMonoidHom M s)
variable {r} (x)
lemma IsAddUnit.smul_right (hr : IsAddUnit r) : IsAddUnit (r • x) :=
hr.map (AddMonoidHom.flip (smulAddHom R M) x)
end AddCommMonoid
section AddCommGroup
variable (R M) [Semiring R] [AddCommGroup M]
theorem AddMonoid.End.intCast_def (z : ℤ) :
(↑z : AddMonoid.End M) = DistribMulAction.toAddMonoidEnd ℤ M z :=
rfl
end AddCommGroup