1
1
/-
2
2
Copyright (c) 2014 Patrick Massot. All rights reserved.
3
3
Released under Apache 2.0 license as described in the file LICENSE.
4
- Authors: Patrick Massot, Kevin Buzzard, Scott Morrison, Johan Commelin, Chris Hughes, Johannes Hölzl
4
+ Authors: Patrick Massot, Kevin Buzzard, Scott Morrison, Johan Commelin, Chris Hughes, Johannes Hölzl, Yury Kudryashov
5
5
6
6
Homomorphisms of multiplicative and additive (semi)groups and monoids.
7
7
-/
@@ -73,20 +73,16 @@ attribute [to_additive is_add_monoid_hom.map_zero] is_monoid_hom.map_one
73
73
namespace is_monoid_hom
74
74
variables [monoid α] [monoid β] (f : α → β) [is_monoid_hom f]
75
75
76
+ @[to_additive is_add_monoid_hom.map_add]
76
77
lemma map_mul (x y) : f (x * y) = f x * f y :=
77
78
is_mul_hom.map_mul f x y
78
79
79
80
end is_monoid_hom
80
81
81
- namespace is_add_monoid_hom
82
- variables [add_monoid α] [add_monoid β] (f : α → β) [is_add_monoid_hom f]
83
-
84
- lemma map_add (x y) : f (x + y) = f x + f y :=
85
- is_add_hom.map_add f x y
86
-
87
- attribute [to_additive is_add_monoid_hom.map_add] is_monoid_hom.map_mul
88
-
89
- end is_add_monoid_hom
82
+ @[to_additive is_add_monoid_hom.of_add]
83
+ theorem is_monoid_hom.of_mul [monoid α] [group β] (f : α → β) [is_mul_hom f] :
84
+ is_monoid_hom f :=
85
+ { map_one := mul_self_iff_eq_one.1 $ by rw [← is_mul_hom.map_mul f, one_mul] }
90
86
91
87
namespace is_monoid_hom
92
88
variables [monoid α] [monoid β] (f : α → β) [is_monoid_hom f]
@@ -137,9 +133,12 @@ namespace is_group_hom
137
133
variables [group α] [group β] (f : α → β) [is_group_hom f]
138
134
open is_mul_hom (map_mul)
139
135
136
+ @[to_additive is_add_group_hom.to_is_add_monoid_hom]
137
+ instance to_is_monoid_hom : is_monoid_hom f :=
138
+ is_monoid_hom.of_mul f
139
+
140
140
@[to_additive is_add_group_hom.map_zero]
141
- theorem map_one : f 1 = 1 :=
142
- mul_self_iff_eq_one.1 $ by rw [← map_mul f, one_mul]
141
+ lemma map_one : f 1 = 1 := is_monoid_hom.map_one f
143
142
144
143
@[to_additive is_add_group_hom.map_neg]
145
144
theorem map_inv (a : α) : f a⁻¹ = (f a)⁻¹ :=
@@ -151,10 +150,6 @@ instance id : is_group_hom (@id α) := { }
151
150
@[to_additive is_add_group_hom.comp]
152
151
instance comp {γ} [group γ] (g : β → γ) [is_group_hom g] : is_group_hom (g ∘ f) := { }
153
152
154
- @[to_additive is_add_group_hom.to_is_add_monoid_hom]
155
- lemma to_is_monoid_hom (f : α → β) [is_group_hom f] : is_monoid_hom f :=
156
- { map_one := map_one f }
157
-
158
153
@[to_additive is_add_group_hom.injective_iff]
159
154
lemma injective_iff (f : α → β) [is_group_hom f] :
160
155
function.injective f ↔ (∀ a, f a = 1 → a = 1 ) :=
@@ -163,9 +158,6 @@ lemma injective_iff (f : α → β) [is_group_hom f] :
163
158
← map_mul f] at hxy;
164
159
simpa using inv_eq_of_mul_eq_one (h _ hxy)⟩
165
160
166
- attribute [instance] is_group_hom.to_is_monoid_hom
167
- is_add_group_hom.to_is_add_monoid_hom
168
-
169
161
@[to_additive is_add_group_hom.add]
170
162
lemma mul {α β} [group α] [comm_group β]
171
163
(f g : α → β) [is_group_hom f] [is_group_hom g] :
@@ -193,9 +185,8 @@ namespace is_add_group_hom
193
185
variables [add_group α] [add_group β] (f : α → β) [is_add_group_hom f]
194
186
195
187
lemma map_sub (a b) : f (a - b) = f a - f b :=
196
- calc f (a - b) = f (a + -b) : rfl
197
- ... = f a + f (-b) : is_add_hom.map_add f _ _
198
- ... = f a - f b : by simp[map_neg f]
188
+ calc f (a + -b) = f a + f (-b) : is_add_hom.map_add f _ _
189
+ ... = f a + -f b : by rw [map_neg f]
199
190
200
191
end is_add_group_hom
201
192
0 commit comments