@@ -7,27 +7,38 @@ Lift monoid homomorphisms to group homomorphisms of their units subgroups.
7
7
-/
8
8
import algebra.group.units algebra.group.hom
9
9
10
+ universes u v w
11
+
10
12
namespace units
11
- variables {α : Type *} {β : Type *}
13
+ variables {α : Type u} {β : Type v} {γ : Type w} [monoid α] [monoid β] [monoid γ]
14
+
15
+ def map (f : α →* β) : units α →* units β :=
16
+ monoid_hom.mk'
17
+ (λ u, ⟨f u.val, f u.inv,
18
+ by rw [← f.map_mul, u.val_inv, f.map_one],
19
+ by rw [← f.map_mul, u.inv_val, f.map_one]⟩)
20
+ (λ x y, ext (f.map_mul x y))
21
+
22
+ @[reducible] def map' (f : α → β) [is_monoid_hom f] : units α →* units β :=
23
+ map (as_monoid_hom f)
12
24
13
- variables {γ : Type *} [monoid α] [monoid β] [monoid γ] (f : α → β) (g : β → γ)
14
- [is_monoid_hom f] [is_monoid_hom g]
25
+ @[simp] lemma coe_map (f : α →* β) (x : units α) : ↑(map f x) = f x := rfl
15
26
16
- definition map : units α → units β :=
17
- λ u, ⟨f u.val, f u.inv,
18
- by rw [← is_monoid_hom.map_mul f, u.val_inv, is_monoid_hom.map_one f],
19
- by rw [← is_monoid_hom.map_mul f, u.inv_val, is_monoid_hom.map_one f] ⟩
27
+ @[simp] lemma coe_map' (f : α → β) [is_monoid_hom f] (x : units α) :
28
+ ↑((map' f : units α → units β) x) = f x :=
29
+ rfl
20
30
21
- instance : is_group_hom (units.map f) :=
22
- { map_mul := λ a b, by ext; exact is_monoid_hom.map_mul f a b }
31
+ @[simp] lemma map_comp (f : α →* β) (g : β →* γ) : map (g.comp f) = (map g).comp (map f) := rfl
23
32
24
- instance coe_is_monoid_hom : is_monoid_hom (coe : units α → α) :=
25
- { map_one := rfl, map_mul := by simp }
33
+ variables (α)
34
+ @[simp] lemma map_id : map (monoid_hom.id α) = monoid_hom.id (units α) :=
35
+ by ext; refl
26
36
27
- @[simp] lemma coe_map (u : units α) : (map f u : β) = f u := rfl
37
+ /-- Coercion `units α → α` as a monoid homomorphism. -/
38
+ def coe_hom : units α →* α := ⟨coe, coe_one, coe_mul⟩
28
39
29
- @[simp] lemma map_id : map (id : α → α) = id := by ext; refl
40
+ @[simp] lemma coe_hom_apply (x : units α) : coe_hom α x = ↑x := rfl
30
41
31
- lemma map_comp : map (g ∘ f) = map g ∘ map f := rfl
42
+ instance coe_is_monoid_hom : is_monoid_hom (coe : units α → α) := (coe_hom α).is_monoid_hom
32
43
33
44
end units
0 commit comments