1
1
import Mathematics.Structures.Relation
2
2
3
- class Inv (T : Type ) where
4
- inv : T → T
3
+ class Inverse (T : Type ) where
4
+ inverse' : T → T
5
5
6
- postfix :max "⁻¹" => Inv .inverse
6
+ postfix :max "⁻¹" => Inverse .inverse'
7
7
8
- -- TODO to_additive
9
- class Group (T: Type ) extends Mul T, Inv T, OfNat T 1 :=
8
+ class Group (T: Type ) extends Mul T, Inverse T, OfNat T 1 :=
10
9
associativity : ∀ a b c: T, a * (b * c) = (a * b) * c
11
10
identity : ∀ a: T, a * 1 = a ∧ 1 * a = a
12
11
inverse : ∀ a: T, a⁻¹ * a = 1 ∧ a * a⁻¹ = 1
@@ -26,24 +25,24 @@ theorem one.multiply (a: T) : 1 * a = a := (Group.identity a).right
26
25
theorem multiply.associative : ∀ a b c: T, a * (b * c) = (a * b) * c := Group.associativity
27
26
28
27
theorem inv.double : (a⁻¹)⁻¹ = a := by
29
- rw [←multiply.one (a⁻¹)⁻¹, ←(Group.inverseerse a).left, Group.associativity, (Group.inverseerse _).left, one.multiply]
28
+ rw [←multiply.one (a⁻¹)⁻¹, ←(Group.inverse a).left, Group.associativity, (Group.inverse _).left, one.multiply]
30
29
31
- theorem one.inverseerse : (1 ⁻¹) = (1 : T) := by
32
- rw [←multiply.one 1 ⁻¹, (Group.inverseerse 1 ).1 ]
30
+ theorem one.inverse : (1 ⁻¹) = (1 : T) := by
31
+ rw [←multiply.one 1 ⁻¹, (Group.inverse 1 ).1 ]
33
32
34
33
theorem multiply.eq_one_implies_eq (h : a * b = 1 ) : a⁻¹ = b := by
35
- rw [←multiply.one a⁻¹, ←h, Group.associativity, (Group.inverseerse a).left, one.multiply]
34
+ rw [←multiply.one a⁻¹, ←h, Group.associativity, (Group.inverse a).left, one.multiply]
36
35
37
36
theorem inv.multiply : (a * b)⁻¹ = b⁻¹ * a⁻¹ := by
38
37
apply multiply.eq_one_implies_eq
39
- rw [←Group.associativity, Group.associativity b, (Group.inverseerse _).right, one.multiply, (Group.inverseerse a).right]
38
+ rw [←Group.associativity, Group.associativity b, (Group.inverse _).right, one.multiply, (Group.inverse a).right]
40
39
41
40
theorem multiply.left_cancel (h : a * b = a * c) : b = c := by
42
- rw [←one.multiply b, ←(Group.inverseerse a).left, ←Group.associativity, h, Group.associativity, (Group.inverseerse a).left, one.multiply c]
41
+ rw [←one.multiply b, ←(Group.inverse a).left, ←Group.associativity, h, Group.associativity, (Group.inverse a).left, one.multiply c]
43
42
44
43
-- Note the symmetry with above
45
44
theorem multiply.right_cancel (h : b * a = c * a) : b = c := by
46
- rw [←multiply.one b, ←(Group.inverseerse a).right, Group.associativity, h, ←Group.associativity, (Group.inverseerse a).right, multiply.one c]
45
+ rw [←multiply.one b, ←(Group.inverse a).right, Group.associativity, h, ←Group.associativity, (Group.inverse a).right, multiply.one c]
47
46
48
47
theorem multiply.injective_inverse : a⁻¹ = b⁻¹ ↔ a = b := by
49
48
apply Iff.intro
@@ -78,70 +77,6 @@ end groups
78
77
79
78
def conjugation { T: Type } [Group T] (c: T) := fun (x: T) => c * x * c⁻¹
80
79
81
- class GroupHomomorphism (T U: Type ) [Group T] [Group U] (f: T -> U) :=
82
- map_mul : ∀ a b: T, f (a * b) = f a * f b
83
-
84
- namespace group_homomorphism
85
-
86
- def in_kernel {T U: Type } [Group T] [Group U] (f: T -> U) (a: T): Prop := f a = 1
87
- def in_image {T U: Type } [Group T] [Group U] (f: T -> U) (b: U): Prop := ∃ a: T, f a = b
88
-
89
- open groups
90
-
91
- variable {T U: Type } [Group T] [Group U] (f: T -> U) [GroupHomomorphism T U f]
92
-
93
- theorem map.multiply : ∀ a b: T, f (a * b) = f a * f b := GroupHomomorphism.map_mul
94
-
95
- theorem map.one : f 1 = 1 := by
96
- apply groups.multiplytiply.left_cancel
97
- show f 1 * f 1 = f 1 * 1
98
- rw [←GroupHomomorphism.map_mul, multiply.one, multiply.one]
99
-
100
- def id := fun (x: T) => x
101
-
102
- theorem id.homomorphism : GroupHomomorphism T T id := {
103
- map_mul := by intros a b; exact rfl
104
- }
105
-
106
- theorem conjugation.homomorphism (c: T) : GroupHomomorphism T T (conjugation c) := {
107
- map_mul := by
108
- intros a b
109
- unfold conjugation
110
- rw [
111
- ←multiply.associative c b,
112
- multiply.associative _ c,
113
- ←multiply.associative _ _ c,
114
- (Group.inverseerse c).left,
115
- multiply.one,
116
- multiply.associative,
117
- multiply.associative
118
- ]
119
- }
120
-
121
- theorem homomorphism.compose { V: Type } [Group V] (f: T -> U) (g: U -> V) [GroupHomomorphism _ _ f] [GroupHomomorphism _ _ g]
122
- : GroupHomomorphism T V (g ∘ f) := {
123
- map_mul := by
124
- intros a b
125
- unfold Function.comp
126
- rw [←map.multiply, ←map.multiply]
127
- }
128
-
129
- theorem map.inverse (a : T) : f a⁻¹ = (f a)⁻¹ := by
130
- apply (multiply.left_cancel_iff (f a) (f a⁻¹) (f a)⁻¹).mp
131
- rw [←map.multiply, (Group.inverseerse a).right, (Group.inverseerse (f a)).right]
132
- exact @map.one T U _ _ f _
133
-
134
- theorem map.multiplytiply.inverse (a b : T) : (f (a * b))⁻¹ = f b⁻¹ * f a⁻¹ := by
135
- rw [←map.multiply, ←inv.multiply, ←map.inverse]
136
-
137
- -- TODO exponents
138
- -- theorem map_pow (a : T) (n : Natural) : f a ^ n = (f a) ^ n := by
139
- -- induction n with
140
- -- | zero => rw [ power.zero ]
141
- -- | successor n ih => rw [power.successor, ih]
142
-
143
- end group_homomorphism
144
-
145
80
namespace random
146
81
147
82
variable {T: Type } [Group T]
@@ -153,24 +88,24 @@ instance : Relation T are_conjugate := {
153
88
symmetric := by
154
89
intro a b h1
155
90
let ⟨g, h2⟩ := h1
156
- apply Exists.intro (Inv.inverse g)
91
+ apply Exists.intro g⁻¹
157
92
unfold conjugation at *
158
93
rw [
159
94
h2,
160
95
inv.double,
161
96
multiply.associative,
162
97
←multiply.associative _ g⁻¹ g,
163
- (Group.inverseerse g).1 ,
98
+ (Group.inverse g).1 ,
164
99
multiply.one,
165
100
multiply.associative,
166
- (Group.inverseerse g).1 ,
101
+ (Group.inverse g).1 ,
167
102
one.multiply
168
103
]
169
104
reflexivity := by
170
105
intro a
171
106
apply Exists.intro 1
172
107
unfold conjugation at *
173
- rw [one.multiply, one.inverseerse , multiply.one]
108
+ rw [one.multiply, one.inverse , multiply.one]
174
109
transitivity := by
175
110
intro a b c h1
176
111
let ⟨⟨g1, h2⟩, ⟨g2, h3⟩⟩ := h1
@@ -186,7 +121,7 @@ namespace product
186
121
def Group.Product (A B: Type ) [Group A] [Group B] : Type := A × B
187
122
188
123
instance (A B: Type ) [Group A] [Group B] : Mul (Group.Product A B) := ⟨fun (g1, g2) (h1, h2) => (g1 * h1, g2 * h2)⟩
189
- instance (A B: Type ) [Group A] [Group B] : Inv (Group.Product A B) := ⟨fun (g1, g2) => (g1⁻¹, g2⁻¹)⟩
124
+ instance (A B: Type ) [Group A] [Group B] : Inverse (Group.Product A B) := ⟨fun (g1, g2) => (g1⁻¹, g2⁻¹)⟩
190
125
instance (A B: Type ) [Group A] [Group B] : OfNat (Group.Product A B) 1 := ⟨(1 , 1 )⟩
191
126
192
127
theorem mul_eq (A B: Type ) [Group A] [Group B] (a b: Group.Product A B) : a * b = (a.1 * b.1 , a.2 * b.2 ) := rfl
@@ -200,7 +135,7 @@ instance (A B: Type) {ga: Group A} {gb: Group B} : Group (Group.Product A B) :=
200
135
rfl
201
136
inverse := by
202
137
intro a
203
- rw [mul_inv, mul_eq, (ga.inverseerse _).1 , (gb.inverseerse _).1 , mul_eq, (ga.inverseerse _).2 , (gb.inverseerse _).2 ]
138
+ rw [mul_inv, mul_eq, (ga.inverse _).1 , (gb.inverse _).1 , mul_eq, (ga.inverse _).2 , (gb.inverse _).2 ]
204
139
exact ⟨one_left _ _, one_left _ _⟩
205
140
identity := by
206
141
intro a
0 commit comments