-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGroupPresentation.class.st
More file actions
83 lines (71 loc) · 2.16 KB
/
Copy pathGroupPresentation.class.st
File metadata and controls
83 lines (71 loc) · 2.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
Class {
#name : #GroupPresentation,
#superclass : #Object,
#instVars : [
'generators',
'relators'
],
#category : #'Mathematics-Groups'
}
{ #category : #examples }
GroupPresentation class >> C: n [
"Answer the cyclic group of order n."
| x |
x := Word x: 1.
^ self generators: {x} relators: {x raiseTo: n}
]
{ #category : #examples }
GroupPresentation class >> D: n [
"Answer the dihedral group of order n."
| x1 x2 |
x1 := Word x: 1.
x2 := Word x: 2.
^ 'self generators: {x1. x2} relators: {x1^n. x2^2. (x1*x2)^2}'
]
{ #category : #examples }
GroupPresentation class >> free: aCollection [
"Answer the free group on aCollection."
^ self generators: aCollection relators: #()
]
{ #category : #'instance creation' }
GroupPresentation class >> generators: aCollection relators: anotherCollection [
^ self new generators: aCollection; relators: anotherCollection
]
{ #category : #morphisms }
GroupPresentation >> * aPresentation [
"Answer the free product of the receiver with the argument."
^ self class generators: (generators, aPresentation generators) relators: (relators, aPresentation relators)
]
{ #category : #accessing }
GroupPresentation >> deficiency [
^ generators size - relators size
]
{ #category : #accessing }
GroupPresentation >> generators [
^ generators
]
{ #category : #'accessing-private' }
GroupPresentation >> generators: aCollection [
generators := aCollection
]
{ #category : #printing }
GroupPresentation >> printOn: aStream [
aStream nextPut: $<.
generators do: [:each| aStream print: each] separatedBy: [aStream nextPut: $,].
aStream nextPutAll: ' | '.
relators isEmpty ifTrue: [aStream nextPut: Character emptySet].
relators do: [:each| aStream print: each; nextPutAll: '=1'] separatedBy: [aStream nextPut: $,].
aStream nextPut: $>
]
{ #category : #accessing }
GroupPresentation >> relators [
^ relators
]
{ #category : #'accessing-private' }
GroupPresentation >> relators: aCollection [
relators := aCollection
]
{ #category : #morphisms }
GroupPresentation >> square: aPresentation [ "◊ "
^ self class generators: (generators, aPresentation generators) relators: (relators, aPresentation relators, (self commutatorWith: aPresentation))
]