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

Commit 5307dc1

Browse files
committed
feat(data/equiv/module): add module.to_module_End (#10300)
The new definitions are: * `distrib_mul_action.to_module_End` * `distrib_mul_action.to_module_aut` * `module.to_module_End` Everything else is a move. This also moves the group structure on linear_equiv earlier in the import heirarchy. This is more consistent with where it is for `linear_map`.
1 parent 299af47 commit 5307dc1

File tree

3 files changed

+97
-64
lines changed

3 files changed

+97
-64
lines changed

src/algebra/module/linear_map.lean

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -730,3 +730,47 @@ instance apply_smul_comm_class' : smul_comm_class (module.End R M) R M :=
730730
end endomorphisms
731731

732732
end linear_map
733+
734+
/-! ### Actions as module endomorphisms -/
735+
736+
namespace distrib_mul_action
737+
738+
variables (R M) [semiring R] [add_comm_monoid M] [module R M]
739+
variables [monoid S] [distrib_mul_action S M] [smul_comm_class S R M]
740+
741+
/-- Each element of the monoid defines a linear map.
742+
743+
This is a stronger version of `distrib_mul_action.to_add_monoid_hom`. -/
744+
@[simps]
745+
def to_linear_map (s : S) : M →ₗ[R] M :=
746+
{ to_fun := has_scalar.smul s,
747+
map_add' := smul_add s,
748+
map_smul' := λ a b, smul_comm _ _ _ }
749+
750+
/-- Each element of the monoid defines a module endomorphism.
751+
752+
This is a stronger version of `distrib_mul_action.to_add_monoid_End`. -/
753+
@[simps]
754+
def to_module_End : S →* module.End R M :=
755+
{ to_fun := to_linear_map R M,
756+
map_one' := linear_map.ext $ one_smul _,
757+
map_mul' := λ a b, linear_map.ext $ mul_smul _ _ }
758+
759+
end distrib_mul_action
760+
761+
namespace module
762+
763+
variables (R M) [semiring R] [add_comm_monoid M] [module R M]
764+
variables [semiring S] [module S M] [smul_comm_class S R M]
765+
766+
/-- Each element of the monoid defines a module endomorphism.
767+
768+
This is a stronger version of `distrib_mul_action.to_module_End`. -/
769+
@[simps]
770+
def to_module_End : S →+* module.End R M :=
771+
{ to_fun := distrib_mul_action.to_linear_map R M,
772+
map_zero' := linear_map.ext $ zero_smul _,
773+
map_add' := λ f g, linear_map.ext $ add_smul _ _,
774+
..distrib_mul_action.to_module_End R M }
775+
776+
end module

src/data/equiv/module.lean

Lines changed: 53 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,51 @@ lemma restrict_scalars_inj (f g : M ≃ₗ[S] M₂) :
354354

355355
end restrict_scalars
356356

357+
section automorphisms
358+
variables [module R M]
359+
360+
instance automorphism_group : group (M ≃ₗ[R] M) :=
361+
{ mul := λ f g, g.trans f,
362+
one := linear_equiv.refl R M,
363+
inv := λ f, f.symm,
364+
mul_assoc := λ f g h, rfl,
365+
mul_one := λ f, ext $ λ x, rfl,
366+
one_mul := λ f, ext $ λ x, rfl,
367+
mul_left_inv := λ f, ext $ f.left_inv }
368+
369+
/-- Restriction from `R`-linear automorphisms of `M` to `R`-linear endomorphisms of `M`,
370+
promoted to a monoid hom. -/
371+
@[simps]
372+
def automorphism_group.to_linear_map_monoid_hom : (M ≃ₗ[R] M) →* (M →ₗ[R] M) :=
373+
{ to_fun := coe,
374+
map_one' := rfl,
375+
map_mul' := λ _ _, rfl }
376+
377+
/-- The tautological action by `M ≃ₗ[R] M` on `M`.
378+
379+
This generalizes `function.End.apply_mul_action`. -/
380+
instance apply_distrib_mul_action : distrib_mul_action (M ≃ₗ[R] M) M :=
381+
{ smul := ($),
382+
smul_zero := linear_equiv.map_zero,
383+
smul_add := linear_equiv.map_add,
384+
one_smul := λ _, rfl,
385+
mul_smul := λ _ _ _, rfl }
386+
387+
@[simp] protected lemma smul_def (f : M ≃ₗ[R] M) (a : M) :
388+
f • a = f a := rfl
389+
390+
/-- `linear_equiv.apply_distrib_mul_action` is faithful. -/
391+
instance apply_has_faithful_scalar : has_faithful_scalar (M ≃ₗ[R] M) M :=
392+
⟨λ _ _, linear_equiv.ext⟩
393+
394+
instance apply_smul_comm_class : smul_comm_class R (M ≃ₗ[R] M) M :=
395+
{ smul_comm := λ r e m, (e.map_smul r m).symm }
396+
397+
instance apply_smul_comm_class' : smul_comm_class (M ≃ₗ[R] M) R M :=
398+
{ smul_comm := linear_equiv.map_smul }
399+
400+
end automorphisms
401+
357402
end add_comm_monoid
358403

359404
end linear_equiv
@@ -375,22 +420,6 @@ end module
375420
namespace distrib_mul_action
376421

377422
variables (R M) [semiring R] [add_comm_monoid M] [module R M]
378-
379-
section
380-
variables [monoid S] [distrib_mul_action S M] [smul_comm_class S R M]
381-
382-
/-- Each element of the monoid defines a linear map.
383-
384-
This is a stronger version of `distrib_mul_action.to_add_monoid_hom`. -/
385-
@[simps]
386-
def to_linear_map (s : S) : M →ₗ[R] M :=
387-
{ to_fun := has_scalar.smul s,
388-
map_add' := smul_add s,
389-
map_smul' := λ a b, smul_comm _ _ _ }
390-
391-
end
392-
393-
section
394423
variables [group S] [distrib_mul_action S M] [smul_comm_class S R M]
395424

396425
/-- Each element of the group defines a linear equivalence.
@@ -401,6 +430,13 @@ def to_linear_equiv (s : S) : M ≃ₗ[R] M :=
401430
{ ..to_add_equiv M s,
402431
..to_linear_map R M s }
403432

404-
end
433+
/-- Each element of the group defines a module automorphism.
434+
435+
This is a stronger version of `distrib_mul_action.to_add_aut`. -/
436+
@[simps]
437+
def to_module_aut : S →* M ≃ₗ[R] M :=
438+
{ to_fun := to_linear_equiv R M,
439+
map_one' := linear_equiv.ext $ one_smul _,
440+
map_mul' := λ a b, linear_equiv.ext $ mul_smul _ _ }
405441

406442
end distrib_mul_action

src/linear_algebra/basic.lean

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -2580,53 +2580,6 @@ end linear_equiv
25802580

25812581
end fun_left
25822582

2583-
namespace linear_equiv
2584-
2585-
variables [semiring R] [add_comm_monoid M] [module R M]
2586-
variables (R M)
2587-
2588-
instance automorphism_group : group (M ≃ₗ[R] M) :=
2589-
{ mul := λ f g, g.trans f,
2590-
one := linear_equiv.refl R M,
2591-
inv := λ f, f.symm,
2592-
mul_assoc := λ f g h, by {ext, refl},
2593-
mul_one := λ f, by {ext, refl},
2594-
one_mul := λ f, by {ext, refl},
2595-
mul_left_inv := λ f, by {ext, exact f.left_inv x} }
2596-
2597-
/-- Restriction from `R`-linear automorphisms of `M` to `R`-linear endomorphisms of `M`,
2598-
promoted to a monoid hom. -/
2599-
def automorphism_group.to_linear_map_monoid_hom :
2600-
(M ≃ₗ[R] M) →* (M →ₗ[R] M) :=
2601-
{ to_fun := coe,
2602-
map_one' := rfl,
2603-
map_mul' := λ _ _, rfl }
2604-
2605-
/-- The tautological action by `M ≃ₗ[R] M` on `M`.
2606-
2607-
This generalizes `function.End.apply_mul_action`. -/
2608-
instance apply_distrib_mul_action : distrib_mul_action (M ≃ₗ[R] M) M :=
2609-
{ smul := ($),
2610-
smul_zero := linear_equiv.map_zero,
2611-
smul_add := linear_equiv.map_add,
2612-
one_smul := λ _, rfl,
2613-
mul_smul := λ _ _ _, rfl }
2614-
2615-
@[simp] protected lemma smul_def (f : M ≃ₗ[R] M) (a : M) :
2616-
f • a = f a := rfl
2617-
2618-
/-- `linear_equiv.apply_distrib_mul_action` is faithful. -/
2619-
instance apply_has_faithful_scalar : has_faithful_scalar (M ≃ₗ[R] M) M :=
2620-
⟨λ _ _, linear_equiv.ext⟩
2621-
2622-
instance apply_smul_comm_class : smul_comm_class R (M ≃ₗ[R] M) M :=
2623-
{ smul_comm := λ r e m, (e.map_smul r m).symm }
2624-
2625-
instance apply_smul_comm_class' : smul_comm_class (M ≃ₗ[R] M) R M :=
2626-
{ smul_comm := linear_equiv.map_smul }
2627-
2628-
end linear_equiv
2629-
26302583
namespace linear_map
26312584

26322585
variables [semiring R] [add_comm_monoid M] [module R M]

0 commit comments

Comments
 (0)