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

Commit 02baf14

Browse files
committed
refactor(module_action): bundle and introduce notation
1 parent 989efab commit 02baf14

File tree

3 files changed

+149
-126
lines changed

3 files changed

+149
-126
lines changed

src/algebra/module.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ Authors: Nathaniel Thomas, Jeremy Avigad, Johannes Hölzl, Mario Carneiro
66
Modules over a ring.
77
-/
88

9-
import algebra.ring algebra.big_operators group_theory.subgroup
9+
import algebra.ring algebra.big_operators group_theory.subgroup group_theory.group_action
1010
open function
1111

1212
universes u v w x
1313
variables {α : Type u} {β : Type v} {γ : Type w} {δ : Type x}
1414

15-
/-- Typeclass for types with a scalar multiplication operation, denoted `•` (`\bu`) -/
16-
class has_scalar (α : Type u) (γ : Type v) := (smul : α → γ → γ)
15+
-- /-- Typeclass for types with a scalar multiplication operation, denoted `•` (`\bu`) -/
16+
-- class has_scalar (α : Type u) (γ : Type v) := (smul : α → γ → γ)
1717

18-
infixr ` • `:73 := has_scalar.smul
18+
-- infixr ` • `:73 := has_scalar.smul
1919

2020
/-- A semimodule is a generalization of vector spaces to a scalar semiring.
2121
It consists of a scalar semiring `α` and an additive monoid of "vectors" `β`,

src/group_theory/group_action.lean

Lines changed: 104 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -8,137 +8,158 @@ import data.set.finite group_theory.coset
88
universes u v w
99
variables {α : Type u} {β : Type v} {γ : Type w}
1010

11-
class is_monoid_action [monoid α] (f : α → β → β) : Prop :=
12-
(one : ∀ a : β, f (1 : α) a = a)
13-
(mul : ∀ (x y : α) (a : β), f (x * y) a = f x (f y a))
11+
/-- Typeclass for types with a scalar multiplication operation, denoted `•` (`\bu`) -/
12+
class has_scalar (α : Type u) (γ : Type v) := (smul : α → γ → γ)
1413

15-
namespace is_monoid_action
14+
infixr ` • `:73 := has_scalar.smul
1615

17-
variables [monoid α] (f : α → β → β) [is_monoid_action f]
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)
1819

19-
def orbit (a : β) := set.range (λ x : α, f x a)
20+
namespace monoid_action
2021

21-
@[simp] lemma mem_orbit_iff {f : α → β → β} [is_monoid_action f] {a b : β} :
22-
b ∈ orbit f a ↔ ∃ x : α, f x a = b :=
22+
variables (α) [monoid α] [monoid_action α β]
23+
24+
def orbit (b : β) := set.range (λ x : α, x • b)
25+
26+
variable {α}
27+
28+
@[simp] lemma mem_orbit_iff {b₁ b₂ : β} : b₂ ∈ orbit α b₁ ↔ ∃ x : α, x • b₁ = b₂ :=
2329
iff.rfl
2430

25-
@[simp] lemma mem_orbit (a : β) (x : α) :
26-
f x a ∈ orbit f a :=
31+
@[simp] lemma mem_orbit (b : β) (x : α) : x • b ∈ orbit α b :=
2732
⟨x, rfl⟩
2833

29-
@[simp] lemma mem_orbit_self (a : β) :
30-
a ∈ orbit f a :=
31-
1, show f 1 a = a, by simp [is_monoid_action.one f]⟩
34+
@[simp] lemma mem_orbit_self (b : β) : b ∈ orbit α b :=
35+
1, by simp [monoid_action.one]⟩
3236

33-
instance orbit_fintype (a : β) [fintype α] [decidable_eq β] :
34-
fintype (orbit f a) := set.fintype_range _
37+
instance orbit_fintype (b : β) [fintype α] [decidable_eq β] :
38+
fintype (orbit α b) := set.fintype_range _
3539

36-
def stabilizer (a : β) : set α :=
37-
{x : α | f x a = a}
40+
variable (α)
3841

39-
@[simp] lemma mem_stabilizer_iff {f : α → β → β} [is_monoid_action f] {a : β} {x : α} :
40-
x ∈ stabilizer f a ↔ f x a = a :=
41-
iff.rfl
42+
def stabilizer (b : β) : set α :=
43+
{x : α | x • b = b}
44+
45+
variable {α}
46+
47+
@[simp] lemma mem_stabilizer_iff {b : β} {x : α} :
48+
x ∈ stabilizer α b ↔ x • b = b := iff.rfl
4249

43-
def fixed_points : set β := {a : β | ∀ x, x ∈ stabilizer f a}
50+
variables (α) (β)
4451

45-
@[simp] lemma mem_fixed_points {f : α → β → β} [is_monoid_action f] {a : β} :
46-
a ∈ fixed_points f ↔ ∀ x : α, f x a = a := iff.rfl
52+
def fixed_points : set β := {b : β | ∀ x, x ∈ stabilizer α b}
4753

48-
lemma mem_fixed_points' {f : α → β → β} [is_monoid_action f] {a : β} : a ∈ fixed_points f ↔
49-
(∀ b, b ∈ orbit f a → b = a) :=
54+
variables {α} (β)
55+
56+
@[simp] lemma mem_fixed_points {b : β} :
57+
b ∈ fixed_points α β ↔ ∀ x : α, x • b = b := iff.rfl
58+
59+
lemma mem_fixed_points' {b : β} : b ∈ fixed_points α β ↔
60+
(∀ b', b' ∈ orbit α b → b' = b) :=
5061
⟨λ h b h₁, let ⟨x, hx⟩ := mem_orbit_iff.1 h₁ in hx ▸ h x,
51-
λ h b, mem_stabilizer_iff.2 (h _ (mem_orbit _ _ _))⟩
62+
λ h b, mem_stabilizer_iff.2 (h _ (mem_orbit _ _))⟩
5263

53-
lemma comp_hom [group γ] (f : α → β → β) [is_monoid_action f] (g : γ → α) [is_monoid_hom g] :
54-
is_monoid_action (f ∘ g) :=
55-
{ one := by simp [is_monoid_hom.map_one g, is_monoid_action.one f],
56-
mul := by simp [is_monoid_hom.map_mul g, is_monoid_action.mul f] }
64+
def comp_hom [monoid γ] (g : γ → α) [is_monoid_hom g] :
65+
monoid_action γ β :=
66+
{ 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] }
5769

58-
end is_monoid_action
70+
end monoid_action
5971

60-
class is_group_action [group α] (f : α → β → β) extends is_monoid_action f : Prop
72+
class group_action (α : Type u) (β : Type v) [group α] extends monoid_action α β
6173

62-
namespace is_group_action
63-
variables [group α]
74+
namespace group_action
75+
variables [group α] [group_action α β]
6476

6577
section
66-
variables (f : α → β → β) [is_group_action f]
67-
open is_monoid_action quotient_group
78+
open monoid_action quotient_group
79+
80+
variables (α) (β)
6881

6982
def to_perm (g : α) : equiv.perm β :=
70-
{ to_fun := f g,
71-
inv_fun := f g⁻¹,
72-
left_inv := λ a, by rw [← is_monoid_action.mul f, inv_mul_self, is_monoid_action.one f],
73-
right_inv := λ a, by rw [← is_monoid_action.mul f, mul_inv_self, is_monoid_action.one f] }
74-
75-
instance : is_group_hom (to_perm f) :=
76-
{ mul := λ x y, equiv.ext _ _ (λ a, is_monoid_action.mul f x y a) }
77-
78-
lemma bijective (g : α) : function.bijective (f g) :=
79-
(to_perm f g).bijective
80-
81-
lemma orbit_eq_iff {f : α → β → β} [is_monoid_action f] {a b : β} :
82-
orbit f a = orbit f b ↔ a ∈ orbit f b:=
83-
⟨λ h, h ▸ mem_orbit_self _ _,
84-
λ ⟨x, (hx : f x b = a)⟩, set.ext (λ c, ⟨λ ⟨y, (hy : f y a = c)⟩, ⟨y * x,
85-
show f (y * x) b = c, by rwa [is_monoid_action.mul f, hx]⟩,
86-
λ ⟨y, (hy : f y b = c)⟩, ⟨y * x⁻¹,
87-
show f (y * x⁻¹) a = c, by
83+
{ to_fun := (•) g,
84+
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] }
87+
88+
variables {α} {β}
89+
90+
instance : is_group_hom (to_perm α β) :=
91+
{ mul := λ x y, equiv.ext _ _ (λ a, monoid_action.mul x y a) }
92+
93+
lemma bijective (g : α) : function.bijective (λ b : β, g • b) :=
94+
(to_perm α β g).bijective
95+
96+
lemma orbit_eq_iff {a b : β} :
97+
orbit α a = orbit α b ↔ a ∈ orbit α b:=
98+
⟨λ h, h ▸ mem_orbit_self _,
99+
λ ⟨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]⟩,
101+
λ ⟨y, (hy : y • b = c)⟩, ⟨y * x⁻¹,
102+
show (y * x⁻¹) • a = c, by
88103
conv {to_rhs, rw [← hy, ← mul_one y, ← inv_mul_self x, ← mul_assoc,
89-
is_monoid_action.mul f, hx]}⟩⟩)⟩
104+
monoid_action.mul, hx]}⟩⟩)⟩
90105

91-
instance (a : β) : is_subgroup (stabilizer f a) :=
92-
{ one_mem := is_monoid_action.one _ _,
93-
mul_mem := λ x y (hx : f x a = a) (hy : f y a = a),
94-
show f (x * y) a = a, by rw is_monoid_action.mul f; simp *,
95-
inv_mem := λ x (hx : f x a = a), show f x⁻¹ a = a,
96-
by rw [← hx, ← is_monoid_action.mul f, inv_mul_self, is_monoid_action.one f, hx] }
106+
instance (b : β) : is_subgroup (stabilizer α b) :=
107+
{ one_mem := monoid_action.one _ _,
108+
mul_mem := λ x y (hx : x • b = b) (hy : y • b = b),
109+
show (x * y) • b = b, by rw monoid_action.mul; simp *,
110+
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] }
97112

98-
lemma comp_hom [group γ] (f : α → β → β) [is_group_action f] (g : γ → α) [is_group_hom g] :
99-
is_group_action (f ∘ g) := { ..is_monoid_action.comp_hom f g }
113+
variables (β)
114+
115+
def comp_hom [group γ] (g : γ → α) [is_group_hom g] :
116+
group_action γ β := { ..monoid_action.comp_hom β g }
117+
118+
variables (α)
100119

101120
def orbit_rel : setoid β :=
102-
{ r := λ a b, a ∈ orbit f b,
103-
iseqv := ⟨mem_orbit_self f, λ a b, by simp [orbit_eq_iff.symm, eq_comm],
121+
{ r := λ a b, a ∈ orbit α b,
122+
iseqv := ⟨mem_orbit_self, λ a b, by simp [orbit_eq_iff.symm, eq_comm],
104123
λ a b, by simp [orbit_eq_iff.symm, eq_comm] {contextual := tt}⟩ }
105124

125+
variables {β}
126+
106127
open quotient_group
107128

108-
noncomputable def orbit_equiv_quotient_stabilizer (a : β) :
109-
orbit f a ≃ quotient (stabilizer f a) :=
129+
noncomputable def orbit_equiv_quotient_stabilizer (b : β) :
130+
orbit α b ≃ quotient (stabilizer α b) :=
110131
equiv.symm (@equiv.of_bijective _ _
111-
(λ x : quotient (stabilizer f a), quotient.lift_on' x
112-
(λ x, (⟨f x a, mem_orbit _ _ _⟩ : orbit f a))
113-
(λ g h (H : _ = _), subtype.eq $ (is_group_action.bijective f (g⁻¹)).1
114-
$ show f g⁻¹ (f g a) = f g⁻¹ (f h a),
115-
by rw [← is_monoid_action.mul f, ← is_monoid_action.mul f,
116-
H, inv_mul_self, is_monoid_action.one f]))
132+
(λ x : quotient (stabilizer α b), quotient.lift_on' x
133+
(λ x, (⟨x • b, mem_orbit _ _⟩ : orbit α b))
134+
(λ g h (H : _ = _), subtype.eq $ (group_action.bijective (g⁻¹)).1
135+
$ show g⁻¹ • (g • b) = g⁻¹ • (h • b),
136+
by rw [← monoid_action.mul, ← monoid_action.mul,
137+
H, inv_mul_self, monoid_action.one]))
117138
⟨λ g h, quotient.induction_on₂' g h (λ g h H, quotient.sound' $
118-
have H : f g a = f h a := subtype.mk.inj H,
119-
show f (g⁻¹ * h) a = a,
120-
by rw [is_monoid_action.mul f, ← H, ← is_monoid_action.mul f, inv_mul_self,
121-
is_monoid_action.one f]),
139+
have H : g • b = h • b := subtype.mk.inj H,
140+
show (g⁻¹ * h) • b = b,
141+
by rw [monoid_action.mul, ← H, ← monoid_action.mul, inv_mul_self, monoid_action.one]),
122142
λ ⟨b, ⟨g, hgb⟩⟩, ⟨g, subtype.eq hgb⟩⟩)
123143

124144
end
125145

126-
open quotient_group is_monoid_action is_subgroup
146+
open quotient_group monoid_action is_subgroup
127147

128148
def mul_left_cosets (H : set α) [is_subgroup H]
129149
(x : α) (y : quotient H) : quotient H :=
130150
quotient.lift_on' y (λ y, quotient_group.mk ((x : α) * y))
131151
(λ a b (hab : _ ∈ H), quotient_group.eq.2
132152
(by rwa [mul_inv_rev, ← mul_assoc, mul_assoc (a⁻¹), inv_mul_self, mul_one]))
133153

134-
instance (H : set α) [is_subgroup H] : is_group_action (mul_left_cosets H) :=
135-
{ one := λ a, quotient.induction_on' a (λ a, quotient_group.eq.2
154+
instance (H : set α) [is_subgroup H] : group_action α (quotient H) :=
155+
{ smul := mul_left_cosets H,
156+
one := λ a, quotient.induction_on' a (λ a, quotient_group.eq.2
136157
(by simp [is_submonoid.one_mem])),
137158
mul := λ x y a, quotient.induction_on' a (λ a, quotient_group.eq.2
138159
(by simp [mul_inv_rev, is_submonoid.one_mem, mul_assoc])) }
139160

140161
instance mul_left_cosets_comp_subtype_val (H I : set α) [is_subgroup H] [is_subgroup I] :
141-
is_group_action (mul_left_cosets H ∘ (subtype.val : I → α)) :=
142-
is_group_action.comp_hom _ _
162+
group_action I (quotient H) :=
163+
group_action.comp_hom (quotient H) (subtype.val : I → α)
143164

144-
end is_group_action
165+
end group_action

0 commit comments

Comments
 (0)