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

Commit 2d26cc1

Browse files
committed
refactor(*): unify group/monoid_action, use standard names, make semimodule extend action
1 parent 410ae5d commit 2d26cc1

File tree

4 files changed

+52
-58
lines changed

4 files changed

+52
-58
lines changed

src/algebra/module.lean

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,9 @@ variables {α : Type u} {β : Type v} {γ : Type w} {δ : Type x}
2323
(where `r : α` and `x : β`) with some natural associativity and
2424
distributivity axioms similar to those on a ring. -/
2525
class semimodule (α : Type u) (β : Type v) [semiring α]
26-
[add_comm_monoid β] extends has_scalar α β :=
26+
[add_comm_monoid β] extends action α β :=
2727
(smul_add : ∀(r : α) (x y : β), r • (x + y) = r • x + r • y)
2828
(add_smul : ∀(r s : α) (x : β), (r + s) • x = r • x + s • x)
29-
(mul_smul : ∀(r s : α) (x : β), (r * s) • x = r • s • x)
30-
(one_smul : ∀x : β, (1 : α) • x = x)
3129
(zero_smul : ∀x : β, (0 : α) • x = 0)
3230
(smul_zero {} : ∀(r : α), r • (0 : β) = 0)
3331

@@ -37,10 +35,10 @@ include R
3735

3836
theorem smul_add : r • (x + y) = r • x + r • y := semimodule.smul_add r x y
3937
theorem add_smul : (r + s) • x = r • x + s • x := semimodule.add_smul r s x
40-
theorem mul_smul : (r * s) • x = r • s • x := semimodule.mul_smul r s x
38+
theorem mul_smul : (r * s) • x = r • s • x := action.mul_smul r s x
4139
@[simp] theorem smul_zero : r • (0 : β) = 0 := semimodule.smul_zero r
4240
variables (α)
43-
@[simp] theorem one_smul : (1 : α) • x = x := semimodule.one_smul α x
41+
@[simp] theorem one_smul : (1 : α) • x = x := action.one_smul α x
4442
@[simp] theorem zero_smul : (0 : α) • x = 0 := semimodule.zero_smul α x
4543

4644
lemma smul_smul : r • s • x = (r * s) • x := (mul_smul _ _ _).symm

src/group_theory/group_action.lean

Lines changed: 35 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@ class has_scalar (α : Type u) (γ : Type v) := (smul : α → γ → γ)
1313

1414
infixr ` • `:73 := has_scalar.smul
1515

16-
class monoid_action (α : Type u) (β : Type v) [monoid α] extends has_scalar α β :=
17-
(one : ∀ b : β, (1 : α) • b = b)
18-
(mul : ∀ (x y : α) (b : β), (x * y) • b = x • y • b)
16+
class action (α : Type u) (β : Type v) [monoid α] extends has_scalar α β :=
17+
(one_smul : ∀ b : β, (1 : α) • b = b)
18+
(mul_smul : ∀ (x y : α) (b : β), (x * y) • b = x • y • b)
1919

20-
namespace monoid_action
20+
namespace action
2121

22-
variables (α) [monoid α] [monoid_action α β]
22+
variables (α) [monoid α] [action α β]
23+
24+
attribute [simp] one_smul
2325

2426
def orbit (b : β) := set.range (λ x : α, x • b)
2527

@@ -32,7 +34,7 @@ iff.rfl
3234
⟨x, rfl⟩
3335

3436
@[simp] lemma mem_orbit_self (b : β) : b ∈ orbit α b :=
35-
1, by simp [monoid_action.one]⟩
37+
1, by simp [action.one_smul]⟩
3638

3739
instance orbit_fintype (b : β) [fintype α] [decidable_eq β] :
3840
fintype (orbit α b) := set.fintype_range _
@@ -62,33 +64,31 @@ lemma mem_fixed_points' {b : β} : b ∈ fixed_points α β ↔
6264
λ h b, mem_stabilizer_iff.2 (h _ (mem_orbit _ _))⟩
6365

6466
def comp_hom [monoid γ] (g : γ → α) [is_monoid_hom g] :
65-
monoid_action γ β :=
67+
action γ β :=
6668
{ smul := λ x b, (g x) • b,
67-
one := by simp [is_monoid_hom.map_one g, monoid_action.one],
68-
mul := by simp [is_monoid_hom.map_mul g, monoid_action.mul] }
69-
70-
end monoid_action
69+
one_smul := by simp [is_monoid_hom.map_one g, action.one_smul],
70+
mul_smul := by simp [is_monoid_hom.map_mul g, action.mul_smul] }
7171

72-
class group_action (α : Type u) (β : Type v) [group α] extends monoid_action α β
72+
end action
7373

74-
namespace group_action
75-
variables [group α] [group_action α β]
74+
namespace action
75+
variables [group α] [action α β]
7676

7777
section
78-
open monoid_action quotient_group
78+
open action quotient_group
7979

8080
variables (α) (β)
8181

8282
def to_perm (g : α) : equiv.perm β :=
8383
{ to_fun := (•) g,
8484
inv_fun := (•) g⁻¹,
85-
left_inv := λ a, by rw [← monoid_action.mul, inv_mul_self, monoid_action.one],
86-
right_inv := λ a, by rw [← monoid_action.mul, mul_inv_self, monoid_action.one] }
85+
left_inv := λ a, by rw [← action.mul_smul, inv_mul_self, action.one_smul],
86+
right_inv := λ a, by rw [← action.mul_smul, mul_inv_self, action.one_smul] }
8787

8888
variables {α} {β}
8989

9090
instance : is_group_hom (to_perm α β) :=
91-
{ mul := λ x y, equiv.ext _ _ (λ a, monoid_action.mul x y a) }
91+
{ mul := λ x y, equiv.ext _ _ (λ a, action.mul_smul x y a) }
9292

9393
lemma bijective (g : α) : function.bijective (λ b : β, g • b) :=
9494
(to_perm α β g).bijective
@@ -97,25 +97,21 @@ lemma orbit_eq_iff {a b : β} :
9797
orbit α a = orbit α b ↔ a ∈ orbit α b:=
9898
⟨λ h, h ▸ mem_orbit_self _,
9999
λ ⟨x, (hx : x • b = a)⟩, set.ext (λ c, ⟨λ ⟨y, (hy : y • a = c)⟩, ⟨y * x,
100-
show (y * x) • b = c, by rwa [monoid_action.mul, hx]⟩,
100+
show (y * x) • b = c, by rwa [action.mul_smul, hx]⟩,
101101
λ ⟨y, (hy : y • b = c)⟩, ⟨y * x⁻¹,
102102
show (y * x⁻¹) • a = c, by
103103
conv {to_rhs, rw [← hy, ← mul_one y, ← inv_mul_self x, ← mul_assoc,
104-
monoid_action.mul, hx]}⟩⟩)⟩
104+
action.mul_smul, hx]}⟩⟩)⟩
105105

106106
instance (b : β) : is_subgroup (stabilizer α b) :=
107-
{ one_mem := monoid_action.one _ _,
107+
{ one_mem := action.one_smul _ _,
108108
mul_mem := λ x y (hx : x • b = b) (hy : y • b = b),
109-
show (x * y) • b = b, by rw monoid_action.mul; simp *,
109+
show (x * y) • b = b, by rw action.mul_smul; simp *,
110110
inv_mem := λ x (hx : x • b = b), show x⁻¹ • b = b,
111-
by rw [← hx, ← monoid_action.mul, inv_mul_self, monoid_action.one, hx] }
111+
by rw [← hx, ← action.mul_smul, inv_mul_self, action.one_smul, hx] }
112112

113-
variables (β)
114113

115-
def comp_hom [group γ] (g : γ → α) [is_group_hom g] :
116-
group_action γ β := { ..monoid_action.comp_hom β g }
117-
118-
variables (α)
114+
variables (α) (β)
119115

120116
def orbit_rel : setoid β :=
121117
{ r := λ a b, a ∈ orbit α b,
@@ -131,35 +127,35 @@ noncomputable def orbit_equiv_quotient_stabilizer (b : β) :
131127
equiv.symm (@equiv.of_bijective _ _
132128
(λ x : quotient (stabilizer α b), quotient.lift_on' x
133129
(λ x, (⟨x • b, mem_orbit _ _⟩ : orbit α b))
134-
(λ g h (H : _ = _), subtype.eq $ (group_action.bijective (g⁻¹)).1
130+
(λ g h (H : _ = _), subtype.eq $ (action.bijective (g⁻¹)).1
135131
$ show g⁻¹ • (g • b) = g⁻¹ • (h • b),
136-
by rw [← monoid_action.mul, ← monoid_action.mul,
137-
H, inv_mul_self, monoid_action.one]))
132+
by rw [← action.mul_smul, ← action.mul_smul,
133+
H, inv_mul_self, action.one_smul]))
138134
⟨λ g h, quotient.induction_on₂' g h (λ g h H, quotient.sound' $
139135
have H : g • b = h • b := subtype.mk.inj H,
140136
show (g⁻¹ * h) • b = b,
141-
by rw [monoid_action.mul, ← H, ← monoid_action.mul, inv_mul_self, monoid_action.one]),
137+
by rw [action.mul_smul, ← H, ← action.mul_smul, inv_mul_self, action.one_smul]),
142138
λ ⟨b, ⟨g, hgb⟩⟩, ⟨g, subtype.eq hgb⟩⟩)
143139

144140
end
145141

146-
open quotient_group monoid_action is_subgroup
142+
open quotient_group action is_subgroup
147143

148144
def mul_left_cosets (H : set α) [is_subgroup H]
149145
(x : α) (y : quotient H) : quotient H :=
150146
quotient.lift_on' y (λ y, quotient_group.mk ((x : α) * y))
151147
(λ a b (hab : _ ∈ H), quotient_group.eq.2
152148
(by rwa [mul_inv_rev, ← mul_assoc, mul_assoc (a⁻¹), inv_mul_self, mul_one]))
153149

154-
instance (H : set α) [is_subgroup H] : group_action α (quotient H) :=
150+
instance (H : set α) [is_subgroup H] : action α (quotient H) :=
155151
{ smul := mul_left_cosets H,
156-
one := λ a, quotient.induction_on' a (λ a, quotient_group.eq.2
152+
one_smul := λ a, quotient.induction_on' a (λ a, quotient_group.eq.2
157153
(by simp [is_submonoid.one_mem])),
158-
mul := λ x y a, quotient.induction_on' a (λ a, quotient_group.eq.2
154+
mul_smul := λ x y a, quotient.induction_on' a (λ a, quotient_group.eq.2
159155
(by simp [mul_inv_rev, is_submonoid.one_mem, mul_assoc])) }
160156

161157
instance mul_left_cosets_comp_subtype_val (H I : set α) [is_subgroup H] [is_subgroup I] :
162-
group_action I (quotient H) :=
163-
group_action.comp_hom (quotient H) (subtype.val : I → α)
158+
action I (quotient H) :=
159+
action.comp_hom (quotient H) (subtype.val : I → α)
164160

165-
end group_action
161+
end action

src/group_theory/sylow.lean

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ Authors: Chris Hughes
66
import group_theory.group_action group_theory.quotient_group
77
import group_theory.order_of_element data.zmod.basic algebra.pi_instances
88

9-
open equiv fintype finset group_action monoid_action function
9+
open equiv fintype finset action function
1010
open equiv.perm is_subgroup list quotient_group
1111
universes u v w
1212
variables {G : Type u} {α : Type v} {β : Type w} [group G]
1313

1414
local attribute [instance, priority 0] subtype.fintype set_fintype classical.prop_decidable
1515

16-
namespace group_action
17-
variables [group_action G α]
16+
namespace action
17+
variables [action G α]
1818

1919
lemma mem_fixed_points_iff_card_orbit_eq_one {a : α}
2020
[fintype (orbit G a)] : a ∈ fixed_points G α ↔ card (orbit G a) = 1 :=
@@ -58,7 +58,7 @@ begin
5858
end
5959
... = _ : by simp; refl
6060

61-
end group_action
61+
end action
6262

6363
lemma quotient_group.card_preimage_mk [fintype G] (s : set G) [is_subgroup s]
6464
(t : set (quotient s)) : fintype.card (quotient_group.mk ⁻¹' t) =
@@ -98,11 +98,11 @@ def rotate_vectors_prod_eq_one (G : Type*) [group G] (n : ℕ+) (m : multiplicat
9898
(v : vectors_prod_eq_one G n) : vectors_prod_eq_one G n :=
9999
⟨⟨v.1.to_list.rotate m.1, by simp⟩, prod_rotate_eq_one_of_prod_eq_one v.2 _⟩
100100

101-
instance rotate_vectors_prod_eq_one.is_group_action (n : ℕ+) :
102-
group_action (multiplicative (zmod n)) (vectors_prod_eq_one G n) :=
101+
instance rotate_vectors_prod_eq_one.action (n : ℕ+) :
102+
action (multiplicative (zmod n)) (vectors_prod_eq_one G n) :=
103103
{ smul := (rotate_vectors_prod_eq_one G n),
104-
one := λ v, subtype.eq $ vector.eq _ _ $ rotate_zero v.1.to_list,
105-
mul := λ a b ⟨⟨v, hv₁⟩, hv₂⟩, subtype.eq $ vector.eq _ _ $
104+
one_smul := λ v, subtype.eq $ vector.eq _ _ $ rotate_zero v.1.to_list,
105+
mul_smul := λ a b ⟨⟨v, hv₁⟩, hv₂⟩, subtype.eq $ vector.eq _ _ $
106106
show v.rotate ((a + b : zmod n).val) = list.rotate (list.rotate v (b.val)) (a.val),
107107
by rw [zmod.add_val, rotate_rotate, ← rotate_mod _ (b.1 + a.1), add_comm, hv₁] }
108108

@@ -128,7 +128,7 @@ have hcard : card (vectors_prod_eq_one G (n + 1)) = card G ^ (n : ℕ),
128128
set.card_range_of_injective (mk_vector_prod_eq_one_inj _), card_vector],
129129
have hzmod : fintype.card (multiplicative (zmod p')) =
130130
(p' : ℕ) ^ 1 := (nat.pow_one p').symm ▸ card_fin _,
131-
have hmodeq : _ = _ := @group_action.card_modeq_card_fixed_points
131+
have hmodeq : _ = _ := @action.card_modeq_card_fixed_points
132132
(multiplicative (zmod p')) (vectors_prod_eq_one G p') _ _ _ _ _ _ 1 hp hzmod,
133133
have hdvdcard : p ∣ fintype.card (vectors_prod_eq_one G (n + 1)) :=
134134
calc p ∣ card G ^ 1 : by rwa nat.pow_one
@@ -157,7 +157,7 @@ let ⟨a, ha⟩ := this in
157157
(hp.2 _ (order_of_dvd_of_pow_eq_one this)).resolve_left
158158
(λ h, ha1 (order_of_eq_one_iff.1 h))⟩
159159

160-
open is_subgroup is_submonoid is_group_hom group_action
160+
open is_subgroup is_submonoid is_group_hom action
161161

162162
lemma mem_fixed_points_mul_left_cosets_iff_mem_normalizer {H : set G} [is_subgroup H] [fintype H]
163163
{x : G} : (x : quotient H) ∈ fixed_points H (quotient H) ↔ x ∈ normalizer H :=

src/ring_theory/algebra.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -381,10 +381,10 @@ instance algebra : algebra R S :=
381381
by rw algebra.smul_def; exact @@is_submonoid.mul_mem _ S.2.2 (S.3 ⟨c, rfl⟩) x.2⟩,
382382
smul_add := λ c x y, subtype.eq $ by apply _inst_3.1.1.2,
383383
add_smul := λ c x y, subtype.eq $ by apply _inst_3.1.1.3,
384-
mul_smul := λ c x y, subtype.eq $ by apply _inst_3.1.1.4,
385-
one_smul := λ x, subtype.eq $ by apply _inst_3.1.1.5,
386-
zero_smul := λ x, subtype.eq $ by apply _inst_3.1.1.6,
387-
smul_zero := λ x, subtype.eq $ by apply _inst_3.1.1.7,
384+
mul_smul := λ c x y, subtype.eq $ by simp [mul_smul],
385+
one_smul := λ x, subtype.eq $ by simp [one_smul],
386+
zero_smul := λ x, subtype.eq $ by apply _inst_3.1.1.4,
387+
smul_zero := λ x, subtype.eq $ by apply _inst_3.1.1.5,
388388
to_fun := λ r, ⟨algebra_map A r, S.range_le ⟨r, rfl⟩⟩,
389389
hom := ⟨subtype.eq $ algebra.map_one R A, λ x y, subtype.eq $ algebra.map_mul A x y,
390390
λ x y, subtype.eq $ algebra.map_add A x y⟩,

0 commit comments

Comments
 (0)