Documentation
¶
Overview ¶
Package group is some stuff for working with finitely-generated groups.
Index ¶
- func Abs[I signedInt](x I) I
- func GenerateRelations(relators ...Word) map[Word][]Word
- func Sign[I signedInt](x I) I
- type Basic
- type Word
- func (w Word) BasicLen() int
- func (w Word) Basics() iter.Seq[Basic]
- func (w Word) Generators() iter.Seq[Basic]
- func (w Word) Inv() Word
- func (w Word) LRot() Word
- func (w Word) Len() int
- func (w Word) Pow(n int32) Word
- func (w Word) RRot() Word
- func (w Word) Reduce() Word
- func (w Word) Split(n int32) (prefix, suffix Word)
- func (w Word) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateRelations ¶
GenerateRelations converts a relator word into a map from longer words into shorter equivalent words.
Types ¶
type Basic ¶
Basic is a generator-power pair. (Does this have another name? I forget.)
func DecodeBasic ¶
DecodeBasic decodes the first basic within the word, and returns the zero Basic if e is empty.
func (Basic) Gen ¶
Gen returns the generator of b, i.e. for b = g^p returns one of {g, g⁰, g⁻¹}. Examples: - (a⁷).Gen() = a - (b⁻⁵).Gen() = b⁻¹ - (c⁰).Gen() = c⁰
type Word ¶
type Word string
Word is a string of (encoded) Basics. It can be used to represent elements of finitely-generated groups.
func Commutator ¶
Commutator returns the commutator of x and y, [x, y] = xyx⁻¹y⁻¹.
func Mul ¶
Mul freely multiplies words, which is equivalent to freely reducing the concatenation of them.
func NewWord ¶
NewWord constructs a word from generator-power pairs. It panics if the argument slice does not have an even length.
func (Word) Generators ¶
Generators returns an iterator that yields Len generators, the product of which equal the word.
func (Word) Inv ¶
Inv returns w⁻¹. It does not require the input to be reduced, nor does it reduce its output. However a reduced input has a reduced inverse. Example: (aba⁻¹b⁻¹).Inv() = bab⁻¹a⁻¹.
func (Word) LRot ¶
LRot returns the word left-rotated by a single generator. For an input word W = ab...yz, where a...z are generators, W.LRot() = a⁻¹Wa = b...yza. If the word is a relator for a presentation, this returns an equivalent relator. It does not require the receiver to be reduced, but reduces its output if the receiver is nontrivial. Examples: - (aba⁻¹b⁻¹).LRot() = bab⁻¹a - (a³ba³).LRot() = a²ba⁴
func (Word) Len ¶
Len returns |w|, the length of the word measured in generators or their inverses - essentially the sum of b.P for each basic b. To ensure w.Len returns the geodesic length, ensure w is reduced before calling.
func (Word) RRot ¶
RRot returns the word right-rotated by a single generator. For an input word W = ab...yz, where a...z are generators, W.RRot() = zWz⁻¹ = zab...y. If the word is a relator for a presentation, this returns an equivalent relator. It does not require the receiver to be reduced, but reduces its output if the receiver is nontrivial. Examples: - (aba⁻¹b⁻¹).RRot() = b⁻¹aba⁻¹ - (a³ba³).RRot() = a⁴ba²