5.1.1 monoids.free_monoid - Free monoids

AUTHOR: David Kohel, 2005-09

SAGE supports free monoids on any prescribed finite number $ n\geq 0$ of generators. Use the FreeMonoid function to create a free monoid, and the gen and gens functions to obtain the corresponding generators. You can print the generators as arbitrary strings using the optional names argument to the FreeMonoid function.

The module monoids.free_monoid defines the following methods:

FreeMonoid( n, [names=None])

Returns a free monoid on $ n$ generators.

INPUT:
    n -- integer
    names -- (optional) names of generators

OUTPUT:
    free abelian monoid

sage: FreeMonoid(0)
Free monoid on 0 generators ()
sage: F = FreeMonoid(5, names = list("abcde"))
sage: F
Free monoid on 5 generators (a, b, c, d, e)
sage: F(1)
1
sage: (a, b, c, d, e) = F.gens()
sage: mul([ a, b, a, c, b, d, c, d ])
a*b*a*c*b*d*c*d

is_FreeMonoid( x)

Return True if $ x$ is a free monoid.

sage: is_FreeMonoid(5)
False
sage: is_FreeMonoid(FreeMonoid(7))
True
sage: is_FreeMonoid(FreeAbelianMonoid(7))
False
sage: is_FreeMonoid(FreeAbelianMonoid(0))
False

The module monoids.free_monoid defines the following classes:

class FreeMonoid_class
The free monoid on $ n$ generators.



Subsections
See About this document... for information on suggesting changes.