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

Commit 52a2e8b

Browse files
committed
chore(algebra/group/hom_instances): add monoid_hom versions of linear_map lemmas (#8461)
I mainly want the additive versions, but we may as well get the multiplicative ones too. This also adds the missing `monoid_hom.map_div` and some other division versions of subtraction lemmas.
1 parent 894fb0c commit 52a2e8b

File tree

2 files changed

+36
-18
lines changed

2 files changed

+36
-18
lines changed

src/algebra/group/hom.lean

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,11 @@ eq_inv_of_mul_eq_one $ f.map_mul_eq_one $ inv_mul_self g
701701
theorem map_mul_inv {G H} [group G] [group H] (f : G →* H) (g h : G) :
702702
f (g * h⁻¹) = (f g) * (f h)⁻¹ := by rw [f.map_mul, f.map_inv]
703703

704+
/-- Group homomorphisms preserve division. -/
705+
@[simp, to_additive /-" Additive group homomorphisms preserve subtraction. "-/]
706+
theorem map_div {G H} [group G] [group H] (f : G →* H) (g h : G) : f (g / h) = (f g) / (f h) :=
707+
by rw [div_eq_mul_inv, div_eq_mul_inv, f.map_mul_inv g h]
708+
704709
/-- A homomorphism from a group to a monoid is injective iff its kernel is trivial.
705710
For the iff statement on the triviality of the kernel, see `monoid_hom.injective_iff'`. -/
706711
@[to_additive /-" A homomorphism from an additive group to an additive monoid is injective iff
@@ -733,6 +738,7 @@ def mk' (f : M → G) (map_mul : ∀ a b : M, f (a * b) = f a * f b) : M →* G
733738
omit mM
734739

735740
/-- Makes a group homomorphism from a proof that the map preserves right division `λ x y, x * y⁻¹`.
741+
See also `monoid_hom.of_map_div` for a version using `λ x y, x / y`.
736742
-/
737743
@[to_additive "Makes an additive group homomorphism from a proof that the map preserves
738744
the operation `λ a b, a + -b`. See also `add_monoid_hom.of_map_sub` for a version using
@@ -749,6 +755,16 @@ calc f (x * y) = f x * (f $ 1 * 1⁻¹ * y⁻¹)⁻¹ : by simp only [one_mul, o
749755
⇑(of_map_mul_inv f map_div) = f :=
750756
rfl
751757

758+
/-- Define a morphism of additive groups given a map which respects ratios. -/
759+
@[to_additive /-"Define a morphism of additive groups given a map which respects difference."-/]
760+
def of_map_div {H : Type*} [group H] (f : G → H) (hf : ∀ x y, f (x / y) = f x / f y) : G →* H :=
761+
of_map_mul_inv f (by simpa only [div_eq_mul_inv] using hf)
762+
763+
@[simp, to_additive]
764+
lemma coe_of_map_div {H : Type*} [group H] (f : G → H) (hf : ∀ x y, f (x / y) = f x / f y) :
765+
⇑(of_map_div f hf) = f :=
766+
rfl
767+
752768
/-- If `f` is a monoid homomorphism to a commutative group, then `f⁻¹` is the homomorphism sending
753769
`x` to `(f x)⁻¹`. -/
754770
@[to_additive]
@@ -788,24 +804,6 @@ add_decl_doc add_monoid_hom.has_sub
788804

789805
end monoid_hom
790806

791-
namespace add_monoid_hom
792-
793-
variables {A B : Type*} [add_zero_class A] [add_comm_group B] [add_group G] [add_group H]
794-
795-
/-- Additive group homomorphisms preserve subtraction. -/
796-
@[simp] theorem map_sub (f : G →+ H) (g h : G) : f (g - h) = (f g) - (f h) :=
797-
by rw [sub_eq_add_neg, sub_eq_add_neg, f.map_add_neg g h]
798-
799-
/-- Define a morphism of additive groups given a map which respects difference. -/
800-
def of_map_sub (f : G → H) (hf : ∀ x y, f (x - y) = f x - f y) : G →+ H :=
801-
of_map_add_neg f (by simpa only [sub_eq_add_neg] using hf)
802-
803-
@[simp] lemma coe_of_map_sub (f : G → H) (hf : ∀ x y, f (x - y) = f x - f y) :
804-
⇑(of_map_sub f hf) = f :=
805-
rfl
806-
807-
end add_monoid_hom
808-
809807
section commute
810808

811809
variables [mul_one_class M] [mul_one_class N] {a x y : M}

src/algebra/group/hom_instances.lean

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,26 @@ def flip {mM : mul_one_class M} {mN : mul_one_class N} {mP : comm_monoid P} (f :
112112
f.flip y x = f x y :=
113113
rfl
114114

115+
@[to_additive]
116+
lemma map_one₂ {mM : mul_one_class M} {mN : mul_one_class N} {mP : comm_monoid P}
117+
(f : M →* N →* P) (n : N) : f 1 n = 1 :=
118+
(flip f n).map_one
119+
120+
@[to_additive]
121+
lemma map_mul₂ {mM : mul_one_class M} {mN : mul_one_class N} {mP : comm_monoid P}
122+
(f : M →* N →* P) (m₁ m₂ : M) (n : N) : f (m₁ * m₂) n = f m₁ n * f m₂ n :=
123+
(flip f n).map_mul _ _
124+
125+
@[to_additive]
126+
lemma map_inv₂ {mM : group M} {mN : mul_one_class N} {mP : comm_group P}
127+
(f : M →* N →* P) (m : M) (n : N) : f m⁻¹ n = (f m n)⁻¹ :=
128+
(flip f n).map_inv _
129+
130+
@[to_additive]
131+
lemma map_div₂ {mM : group M} {mN : mul_one_class N} {mP : comm_group P}
132+
(f : M →* N →* P) (m₁ m₂ : M) (n : N) : f (m₁ / m₂) n = f m₁ n / f m₂ n :=
133+
(flip f n).map_div _ _
134+
115135
/-- Evaluation of a `monoid_hom` at a point as a monoid homomorphism. See also `monoid_hom.apply`
116136
for the evaluation of any function at a point. -/
117137
@[to_additive "Evaluation of an `add_monoid_hom` at a point as an additive monoid homomorphism.

0 commit comments

Comments
 (0)