@@ -98,28 +98,34 @@ Group >> \ aSubgroup [
98
98
{ #category : #operations }
99
99
Group >> \\ aSubgroup [
100
100
" Answer the set of right cosets of the receiver by aSubgroup."
101
+
101
102
| answer |
102
103
answer := Set new .
103
- self do: [:each | answer add: (RightCoset on: aSubgroup representative: each)].
104
+ self
105
+ do: [ :each | answer add: (RightCoset on: aSubgroup representative: each) ].
104
106
^ answer
105
107
]
106
108
107
109
{ #category : #operations }
108
110
Group >> abelianization [
109
111
" Answer the receiver 'made abelian'."
112
+
110
113
^ (self / self commutator)
111
114
propertyAt: #isCommutative put: true ;
112
115
yourself
113
116
]
114
117
115
118
{ #category : #private }
116
119
Group >> additiveInverseMap [
117
- ^ (self to: self evaluating: [:each | each negated]) name: ' -id'
120
+ ^ (self to: self evaluating: [ :each | each negated ]) name: ' -id'
118
121
]
119
122
120
123
{ #category : #private }
121
124
Group >> additiveOperation [
122
- ^ (GroupAction from: (self , self ) to: self evaluatingWithArguments: [:x :y | x + y]) name: ' +'
125
+ ^ (GroupAction
126
+ from: self , self
127
+ to: self
128
+ evaluatingWithArguments: [ :x :y | x + y ]) name: ' +'
123
129
]
124
130
125
131
{ #category : #morphisms }
@@ -139,8 +145,13 @@ Group >> adjointAction [
139
145
140
146
{ #category : #random }
141
147
Group >> atRandom: aRandom bits: bitSize [
142
- self propertyAt: #elements ifPresent: [:aCollection | ^ aCollection atRandom: aRandom bits: bitSize].
143
- self generators notNil ifTrue: [^ (GroupRandomGenerator on: self random: aRandom) bits: bitSize; next].
148
+ self
149
+ propertyAt: #elements
150
+ ifPresent: [ :aCollection | ^ aCollection atRandom: aRandom bits: bitSize ].
151
+ self generators notNil
152
+ ifTrue: [ ^ (GroupRandomGenerator on: self random: aRandom)
153
+ bits: bitSize;
154
+ next ].
144
155
^ self subclassResponsibility
145
156
]
146
157
@@ -167,15 +178,31 @@ Group >> cayleyGraphMorph [
167
178
Group >> cayleyGraphMorph: generators [
168
179
" Answer the colored Cayley graph of the receiver for the given set of generators.
169
180
The set of generators is usually assumed to be symmetric (contains all inverses too) and to not contain the identity."
181
+
170
182
| G answer colors |
171
183
G := self cayleyGraph: generators.
172
184
answer := G asMorph.
173
185
colors := AutomaticPalette new .
174
- answer nodesDo: [:each | each color: Color transparent; radius: 0 ].
175
- generators do: [:each | colors at: each].
176
- generators do: [:each | (answer nodeAt: each) color: (colors at: each); radius: 10 ].
177
- answer edgesAndLabelsDo: [:each :label | each hideLabel; color: (colors at: label)].
178
- (answer nodeAt: self identity) color: Color white; shape: #square ; radius: 10 .
186
+ answer
187
+ nodesDo: [ :each |
188
+ each
189
+ color: Color transparent;
190
+ radius: 0 ].
191
+ generators do: [ :each | colors at: each ].
192
+ generators
193
+ do: [ :each |
194
+ (answer nodeAt: each)
195
+ color: (colors at: each);
196
+ radius: 10 ].
197
+ answer
198
+ edgesAndLabelsDo: [ :each :label |
199
+ each
200
+ hideLabel;
201
+ color: (colors at: label) ].
202
+ (answer nodeAt: self identity)
203
+ color: Color white;
204
+ shape: #square ;
205
+ radius: 10 .
179
206
^ answer
180
207
]
181
208
@@ -188,22 +215,36 @@ Group >> center [
188
215
Group >> centralizerOf: aCollection [
189
216
| op |
190
217
op := self operation.
191
- ^ self select: [:x | aCollection allSatisfy: [:y | (op value: {x. y}) = (op value: {y. x})]]
218
+ ^ self
219
+ select: [ :x |
220
+ aCollection
221
+ allSatisfy: [ :y |
222
+ (op
223
+ value:
224
+ {x.
225
+ y})
226
+ =
227
+ (op
228
+ value:
229
+ {y.
230
+ x}) ] ]
192
231
]
193
232
194
233
{ #category : #enumerating }
195
234
Group >> collect: aBlock [
196
235
" Answer the subgroup resulting of mapping the elements of the receiver by aBlock."
236
+
197
237
| elements |
198
238
elements := Set new .
199
- self do: [:each | elements add: (aBlock value: each)].
239
+ self do: [ :each | elements add: (aBlock value: each) ].
200
240
^ self copyEmpty elements: elements
201
241
]
202
242
203
243
{ #category : #operations }
204
244
Group >> commutator [
205
245
" Answer the commutator group [G,G] of the receiver G, also called the derived group and noted G'.
206
246
This is the smallest normal subgroup of G such that the quotient G / [G,G] is commutative."
247
+
207
248
^ self commutator: self
208
249
]
209
250
0 commit comments