Ops.free {freegroup} | R Documentation |
Arithmetic Ops methods for the free group
Description
Allows arithmetic operators to be used for manipulation of free group elements such as addition, multiplication, powers, etc
Usage
## S3 method for class 'free'
Ops(e1, e2)
free_equal(e1,e2)
free_power(e1,e2)
free_repeat(e1,n)
juxtapose(e1,e2)
## S3 method for class 'free'
inverse(e1)
## S3 method for class 'matrix'
inverse(e1)
Arguments
e1 , e2 |
Objects of class |
n |
An integer, possibly non-positive |
Details
The function Ops.free()
passes binary arithmetic operators
(“+
”, “-
”, “*
”,
“^
”, and “==
”) to the appropriate
specialist function.
There are two non-trivial operations: juxtaposition, denoted
“a+b
”, and inversion, denoted “-a
”. Note
that juxtaposition is noncommutative and a+b
will not, in
general, be equal to b+a
.
All operations return a reduced word.
The caret, as in a^b
, denotes group-theoretic exponentiation
(-b+a+b
); the notation is motivated by the identities
x^(yz)=(x^y)^z
and (xy)^z=x^z*y^z
, as in the
permutations
package.
Multiplication between a free object a
and an integer n
is defined as juxtaposing n
copies of a
and reducing.
Zero and negative values of n
work as expected.
Note
The package uses additive notation but multiplicative notation might have been better.
Author(s)
Robin K. S. Hankin
Examples
x <- as.free(c("a","ab","aaab","abacc"))
y <- as.free(c("aa","BA","Bab","aaaaa"))
x
y
x + x
x + y
x + as.free("xyz")
x+y == y+x # not equal in general
x*5 == x+x+x+x+x # always true
x + alpha(26)
x^y