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

Commit df3e886

Browse files
committed
feat(group_theory/group_action): generalize mul_action.function_End to other endomorphisms (#8724)
The main aim of this PR is to remove [`intermediate_field.subgroup_action`](https://leanprover-community.github.io/mathlib_docs/field_theory/galois.html#intermediate_field.subgroup_action) which is a weird special case of the much more general instance `f • a = f a`, added in this PR as `alg_equiv.apply_mul_semiring_action`. We add the same actions for all the other hom types for consistency. These generalizations are in line with the `mul_action.function_End` (renamed to `function.End.apply_mul_action`) and `mul_action.perm` (renamed to `equiv.perm.apply_mul_action`) instances introduced by @dwarn, providing any endomorphism that has a monoid structure with a faithful `mul_action` corresponding to function application. Note that there is no monoid structure on `ring_equiv`, or `alg_hom`, so this PR does not bother with the corresponding action.
1 parent 3c49044 commit df3e886

File tree

8 files changed

+167
-21
lines changed

8 files changed

+167
-21
lines changed

src/algebra/algebra/basic.lean

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,6 +1008,29 @@ by { ext, refl }
10081008
@[simp] lemma aut_congr_trans (ϕ : A₁ ≃ₐ[R] A₂) (ψ : A₂ ≃ₐ[R] A₃) :
10091009
(aut_congr ϕ).trans (aut_congr ψ) = aut_congr (ϕ.trans ψ) := rfl
10101010

1011+
/-- The tautological action by `A₁ ≃ₐ[R] A₁` on `A₁`.
1012+
1013+
This generalizes `function.End.apply_mul_action`. -/
1014+
instance apply_mul_semiring_action : mul_semiring_action (A₁ ≃ₐ[R] A₁) A₁ :=
1015+
{ smul := ($),
1016+
smul_zero := alg_equiv.map_zero,
1017+
smul_add := alg_equiv.map_add,
1018+
smul_one := alg_equiv.map_one,
1019+
smul_mul := alg_equiv.map_mul,
1020+
one_smul := λ _, rfl,
1021+
mul_smul := λ _ _ _, rfl }
1022+
1023+
@[simp] protected lemma smul_def (f : A₁ ≃ₐ[R] A₁) (a : A₁) : f • a = f a := rfl
1024+
1025+
instance apply_has_faithful_scalar : has_faithful_scalar (A₁ ≃ₐ[R] A₁) A₁ :=
1026+
⟨λ _ _, alg_equiv.ext⟩
1027+
1028+
instance apply_smul_comm_class : smul_comm_class R (A₁ ≃ₐ[R] A₁) A₁ :=
1029+
{ smul_comm := λ r e a, (e.to_linear_equiv.map_smul r a).symm }
1030+
1031+
instance apply_smul_comm_class' : smul_comm_class (A₁ ≃ₐ[R] A₁) R A₁ :=
1032+
{ smul_comm := λ e r a, (e.to_linear_equiv.map_smul r a) }
1033+
10111034
end semiring
10121035

10131036
section comm_semiring

src/algebra/module/basic.lean

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,23 @@ instance semiring.to_opposite_module [semiring R] : module Rᵒᵖ R :=
251251
def ring_hom.to_module [semiring R] [semiring S] (f : R →+* S) : module R S :=
252252
module.comp_hom S f
253253

254+
/-- The tautological action by `R →+* R` on `R`.
255+
256+
This generalizes `function.End.apply_mul_action`. -/
257+
instance ring_hom.apply_distrib_mul_action [semiring R] : distrib_mul_action (R →+* R) R :=
258+
{ smul := ($),
259+
smul_zero := ring_hom.map_zero,
260+
smul_add := ring_hom.map_add,
261+
one_smul := λ _, rfl,
262+
mul_smul := λ _ _ _, rfl }
263+
264+
@[simp] protected lemma ring_hom.smul_def [semiring R] (f : R →+* R) (a : R) :
265+
f • a = f a := rfl
266+
267+
/-- `ring_hom.apply_distrib_mul_action` is faithful. -/
268+
instance ring_hom.apply_has_faithful_scalar [semiring R] : has_faithful_scalar (R →+* R) R :=
269+
⟨ring_hom.ext⟩
270+
254271
section add_comm_monoid
255272

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

src/data/equiv/mul_add_aut.lean

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,23 @@ mul_equiv.apply_symm_apply _ _
7272
def to_perm : mul_aut M →* equiv.perm M :=
7373
by refine_struct { to_fun := mul_equiv.to_equiv }; intros; refl
7474

75+
/-- The tautological action by `mul_aut M` on `M`.
76+
77+
Note this also satisfies the axioms of `mul_semiring_action` that aren't inherited from
78+
`distrib_mul_action`.
79+
80+
This generalizes `function.End.apply_mul_action`. -/
81+
instance apply_mul_action {M} [monoid M] : mul_action (mul_aut M) M :=
82+
{ smul := ($),
83+
one_smul := λ _, rfl,
84+
mul_smul := λ _ _ _, rfl }
85+
86+
@[simp] protected lemma smul_def {M} [monoid M] (f : mul_aut M) (a : M) : f • a = f a := rfl
87+
88+
/-- `mul_aut.apply_mul_action` is faithful. -/
89+
instance apply_has_faithful_scalar {M} [monoid M] : has_faithful_scalar (mul_aut M) M :=
90+
⟨λ _ _, mul_equiv.ext⟩
91+
7592
/-- Group conjugation, `mul_aut.conj g h = g * h * g⁻¹`, as a monoid homomorphism
7693
mapping multiplication in `G` into multiplication in the automorphism group `mul_aut G`. -/
7794
def conj [group G] : G →* mul_aut G :=
@@ -130,6 +147,22 @@ add_equiv.apply_symm_apply _ _
130147
def to_perm : add_aut A →* equiv.perm A :=
131148
by refine_struct { to_fun := add_equiv.to_equiv }; intros; refl
132149

150+
/-- The tautological action by `add_aut A` on `A`.
151+
152+
This generalizes `function.End.apply_mul_action`. -/
153+
instance apply_distrib_mul_action {A} [add_monoid A] : distrib_mul_action (add_aut A) A :=
154+
{ smul := ($),
155+
smul_zero := add_equiv.map_zero,
156+
smul_add := add_equiv.map_add,
157+
one_smul := λ _, rfl,
158+
mul_smul := λ _ _ _, rfl }
159+
160+
@[simp] protected lemma smul_def {A} [add_monoid A] (f : add_aut A) (a : A) : f • a = f a := rfl
161+
162+
/-- `add_aut.apply_distrib_mul_action` is faithful. -/
163+
instance apply_has_faithful_scalar {A} [add_monoid A] : has_faithful_scalar (add_aut A) A :=
164+
⟨λ _ _, add_equiv.ext⟩
165+
133166
/-- Additive group conjugation, `add_aut.conj g h = g + h - g`, as an additive monoid
134167
homomorphism mapping addition in `G` into multiplication in the automorphism group `add_aut G`
135168
(written additively in order to define the map). -/

src/field_theory/galois.lean

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -162,18 +162,6 @@ variables (H : subgroup (E ≃ₐ[F] E)) (K : intermediate_field F E)
162162

163163
namespace intermediate_field
164164

165-
instance subgroup_action : mul_semiring_action H E :=
166-
{ smul := λ h x, h x,
167-
smul_zero := λ _, map_zero _,
168-
smul_add := λ _, map_add _,
169-
one_smul := λ _, rfl,
170-
smul_one := λ _, map_one _,
171-
mul_smul := λ _ _ _, rfl,
172-
smul_mul := λ _, map_mul _ }
173-
174-
instance : has_faithful_scalar H E :=
175-
{ eq_of_smul_eq_smul := λ x y z, subtype.ext (alg_equiv.ext z) }
176-
177165
/-- The intermediate_field fixed by a subgroup -/
178166
def fixed_field : intermediate_field F E :=
179167
{ carrier := mul_action.fixed_points H E,

src/group_theory/group_action/defs.lean

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,14 +424,48 @@ instance : inhabited (function.End α) := ⟨1⟩
424424

425425
variable {α}
426426

427-
/-- The tautological action by `function.End α` on `α`. -/
428-
instance mul_action.function_End : mul_action (function.End α) α :=
427+
/-- The tautological action by `function.End α` on `α`.
428+
429+
This is generalized to bundled endomorphisms by:
430+
* `equiv.perm.apply_mul_action`
431+
* `add_monoid.End.apply_distrib_mul_action`
432+
* `add_aut.apply_distrib_mul_action`
433+
* `ring_hom.apply_distrib_mul_action`
434+
* `linear_equiv.apply_distrib_mul_action`
435+
* `linear_map.apply_module`
436+
* `ring_hom.apply_mul_semiring_action`
437+
* `alg_equiv.apply_mul_semiring_action`
438+
-/
439+
instance function.End.apply_mul_action : mul_action (function.End α) α :=
429440
{ smul := ($),
430441
one_smul := λ _, rfl,
431442
mul_smul := λ _ _ _, rfl }
432443

433444
@[simp] lemma function.End.smul_def (f : function.End α) (a : α) : f • a = f a := rfl
434445

446+
/-- `function.End.apply_mul_action` is faithful. -/
447+
instance function.End.apply_has_faithful_scalar : has_faithful_scalar (function.End α) α :=
448+
⟨λ x y, funext⟩
449+
450+
/-- The tautological action by `add_monoid.End α` on `α`.
451+
452+
This generalizes `function.End.apply_mul_action`. -/
453+
instance add_monoid.End.apply_distrib_mul_action [add_monoid α] :
454+
distrib_mul_action (add_monoid.End α) α :=
455+
{ smul := ($),
456+
smul_zero := add_monoid_hom.map_zero,
457+
smul_add := add_monoid_hom.map_add,
458+
one_smul := λ _, rfl,
459+
mul_smul := λ _ _ _, rfl }
460+
461+
@[simp] lemma add_monoid.End.smul_def [add_monoid α] (f : add_monoid.End α) (a : α) :
462+
f • a = f a := rfl
463+
464+
/-- `add_monoid.End.apply_distrib_mul_action` is faithful. -/
465+
instance add_monoid.End.apply_has_faithful_scalar [add_monoid α] :
466+
has_faithful_scalar (add_monoid.End α) α :=
467+
⟨add_monoid_hom.ext⟩
468+
435469
/-- The monoid hom representing a monoid action.
436470
437471
When `M` is a group, see `mul_action.to_perm_hom`. -/

src/group_theory/group_action/group.lean

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,19 @@ def add_action.to_perm_hom (α : Type*) [add_group α] [add_action α β] :
6060
map_zero' := equiv.ext $ zero_vadd α,
6161
map_add' := λ a₁ a₂, equiv.ext $ add_vadd a₁ a₂ }
6262

63-
/-- The tautological action by `equiv.perm α` on `α`. -/
64-
instance mul_action.perm (α : Type*) : mul_action (equiv.perm α) α :=
63+
/-- The tautological action by `equiv.perm α` on `α`.
64+
65+
This generalizes `function.End.apply_mul_action`.-/
66+
instance equiv.perm.apply_mul_action (α : Type*) : mul_action (equiv.perm α) α :=
6567
{ smul := λ f a, f a,
6668
one_smul := λ _, rfl,
6769
mul_smul := λ _ _ _, rfl }
6870

69-
@[simp] lemma equiv.perm.smul_def {α : Type*} (f : equiv.perm α) (a : α) : f • a = f a := rfl
71+
@[simp] protected lemma equiv.perm.smul_def {α : Type*} (f : equiv.perm α) (a : α) : f • a = f a :=
72+
rfl
7073

71-
/-- `mul_action.perm` is faithful. -/
72-
instance equiv.perm.has_faithful_scalar (α : Type*) : has_faithful_scalar (equiv.perm α) α :=
74+
/-- `equiv.perm.apply_mul_action` is faithful. -/
75+
instance equiv.perm.apply_has_faithful_scalar (α : Type*) : has_faithful_scalar (equiv.perm α) α :=
7376
⟨λ x y, equiv.ext⟩
7477

7578
variables {α} {β}

src/linear_algebra/basic.lean

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,30 @@ by refine_struct
569569
.. linear_map.add_comm_monoid, .. };
570570
intros; try { refl }; apply linear_map.ext; simp {proj := ff}
571571

572+
/-- The tautological action by `M →ₗ[R] M` on `M`.
573+
574+
This generalizes `function.End.apply_mul_action`. -/
575+
instance apply_module : module (M →ₗ[R] M) M :=
576+
{ smul := ($),
577+
smul_zero := linear_map.map_zero,
578+
smul_add := linear_map.map_add,
579+
add_smul := linear_map.add_apply,
580+
zero_smul := (linear_map.zero_apply : ∀ m, (0 : M →ₗ[R] M) m = 0),
581+
one_smul := λ _, rfl,
582+
mul_smul := λ _ _ _, rfl }
583+
584+
@[simp] protected lemma smul_def (f : M →ₗ[R] M) (a : M) : f • a = f a := rfl
585+
586+
/-- `linear_map.apply_module` is faithful. -/
587+
instance apply_has_faithful_scalar : has_faithful_scalar (M →ₗ[R] M) M :=
588+
⟨λ _ _, linear_map.ext⟩
589+
590+
instance apply_smul_comm_class : smul_comm_class R (M →ₗ[R] M) M :=
591+
{ smul_comm := λ r e m, (e.map_smul r m).symm }
592+
593+
instance apply_smul_comm_class' : smul_comm_class (M →ₗ[R] M) R M :=
594+
{ smul_comm := linear_map.map_smul }
595+
572596
end semiring
573597

574598
section ring
@@ -2866,6 +2890,29 @@ def automorphism_group.to_linear_map_monoid_hom :
28662890
map_one' := rfl,
28672891
map_mul' := λ _ _, rfl }
28682892

2893+
/-- The tautological action by `M ≃ₗ[R] M` on `M`.
2894+
2895+
This generalizes `function.End.apply_mul_action`. -/
2896+
instance apply_distrib_mul_action : distrib_mul_action (M ≃ₗ[R] M) M :=
2897+
{ smul := ($),
2898+
smul_zero := linear_equiv.map_zero,
2899+
smul_add := linear_equiv.map_add,
2900+
one_smul := λ _, rfl,
2901+
mul_smul := λ _ _ _, rfl }
2902+
2903+
@[simp] protected lemma smul_def (f : M ≃ₗ[R] M) (a : M) :
2904+
f • a = f a := rfl
2905+
2906+
/-- `linear_equiv.apply_distrib_mul_action` is faithful. -/
2907+
instance apply_has_faithful_scalar : has_faithful_scalar (M ≃ₗ[R] M) M :=
2908+
⟨λ _ _, linear_equiv.ext⟩
2909+
2910+
instance apply_smul_comm_class : smul_comm_class R (M ≃ₗ[R] M) M :=
2911+
{ smul_comm := λ r e m, (e.map_smul r m).symm }
2912+
2913+
instance apply_smul_comm_class' : smul_comm_class (M ≃ₗ[R] M) R M :=
2914+
{ smul_comm := linear_equiv.map_smul }
2915+
28692916
end linear_equiv
28702917

28712918
namespace linear_map

src/ring_theory/derivation.lean

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ non-commutative case. Any development on the theory of derivations is discourage
2424
definitive definition of derivation will be implemented.
2525
-/
2626

27-
open algebra ring_hom
27+
open algebra
2828

2929
-- to match `linear_map`
3030
set_option old_structure_cmd true
@@ -87,7 +87,8 @@ begin
8787
end
8888

8989
@[simp] lemma map_algebra_map : D (algebra_map R A r) = 0 :=
90-
by rw [←mul_one r, ring_hom.map_mul, map_one, ←smul_def, map_smul, map_one_eq_zero, smul_zero]
90+
by rw [←mul_one r, ring_hom.map_mul, ring_hom.map_one, ←smul_def, map_smul, map_one_eq_zero,
91+
smul_zero]
9192

9293
/- Data typeclasses -/
9394

0 commit comments

Comments
 (0)