# Representations Of A Semigroup¶

AUTHORS:

• Travis Scrimshaw (2015-11-21): Initial version

• Siddharth Singh (2020-03-21): Signed Representation

class sage.modules.with_basis.representation.RegularRepresentation(semigroup, base_ring, side='left')

The regular representation of a semigroup.

The left regular representation of a semigroup $$S$$ over a commutative ring $$R$$ is the semigroup ring $$R[S]$$ equipped with the left $$S$$-action $$x b_y = b_{xy}$$, where $$(b_z)_{z \in S}$$ is the natural basis of $$R[S]$$ and $$x,y \in S$$.

INPUT:

• semigroup – a semigroup

• base_ring – the base ring for the representation

• side – (default: "left") whether this is a "left" or "right" representation

REFERENCES:

class sage.modules.with_basis.representation.Representation(semigroup, module, on_basis, side='left', **kwargs)

Representation of a semigroup.

INPUT:

• semigroup – a semigroup

• module – a module with a basis

• on_basis – function which takes as input g, m, where g is an element of the semigroup and m is an element of the indexing set for the basis, and returns the result of g acting on m

• side – (default: "left") whether this is a "left" or "right" representation

EXAMPLES:

We construct the sign representation of a symmetric group:

sage: G = SymmetricGroup(4)
sage: M = CombinatorialFreeModule(QQ, ['v'])
sage: from sage.modules.with_basis.representation import Representation
sage: on_basis = lambda g,m: M.term(m, g.sign())
sage: R = Representation(G, M, on_basis)
sage: x = R.an_element(); x
2*B['v']
sage: c,s = G.gens()
sage: c,s
((1,2,3,4), (1,2))
sage: c * x
-2*B['v']
sage: s * x
-2*B['v']
sage: c * s * x
2*B['v']
sage: (c * s) * x
2*B['v']


This extends naturally to the corresponding group algebra:

sage: A = G.algebra(QQ)
sage: s,c = A.algebra_generators()
sage: c,s
((1,2,3,4), (1,2))
sage: c * x
-2*B['v']
sage: s * x
-2*B['v']
sage: c * s * x
2*B['v']
sage: (c * s) * x
2*B['v']
sage: (c + s) * x
-4*B['v']


REFERENCES:

class Element
product_by_coercion(left, right)

Return the product of left and right by passing to self._module and then building a new element of self.

EXAMPLES:

sage: G = groups.permutation.KleinFour()
sage: E = algebras.Exterior(QQ,'e',4)
sage: on_basis = lambda g,m: E.monomial(m) # the trivial representation
sage: from sage.modules.with_basis.representation import Representation
sage: R = Representation(G, E, on_basis)
sage: r = R.an_element(); r
1 + 2*e0 + 3*e1 + e1*e2
sage: g = G.an_element();
sage: g*r == r
True
sage: r*r
Traceback (most recent call last):
...
TypeError: unsupported operand parent(s) for *:
'Representation of The Klein 4 group of order 4, as a permutation
group indexed by Subsets of {0, 1, 2, 3} over Rational Field' and
'Representation of The Klein 4 group of order 4, as a permutation
group indexed by Subsets of {0, 1, 2, 3} over Rational Field'

sage: from sage.categories.algebras import Algebras
sage: category = Algebras(QQ).FiniteDimensional().WithBasis()
sage: T = Representation(G, E, on_basis, category=category)
sage: t = T.an_element(); t
1 + 2*e0 + 3*e1 + e1*e2
sage: g*t == t
True
sage: t*t
1 + 4*e0 + 4*e0*e1*e2 + 6*e1 + 2*e1*e2

side()

Return whether self is a left or a right representation.

OUTPUT:

• the string "left" or "right"

EXAMPLES:

sage: G = groups.permutation.Dihedral(4)
sage: R = G.regular_representation()
sage: R.side()
'left'
sage: S = G.regular_representation(side="right")
sage: S.side()
'right'

class sage.modules.with_basis.representation.Representation_abstract(semigroup, base_ring, *args, **opts)

Abstract base class for representations of semigroups.

INPUT:

• semigroup – a semigroup

• base_ring – a commutative ring

invariant_module(S=None, **kwargs)

Return the submodule of self invariant under the action of S.

For a semigroup $$S$$ acting on a module $$M$$, the invariant submodule is given by

$M^S = \{m \in M : s \cdot m = m \forall s \in S\}.$

INPUT:

• S – a finitely-generated semigroup (default: the semigroup this is a representation of)

• action – a function (default: operator.mul)

• side'left' or 'right' (default: side()); which side of self the elements of S acts

Note

Two sided actions are considered as left actions for the invariant module.

OUTPUT:

EXAMPLES:

sage: S3 = SymmetricGroup(3)
sage: M = S3.regular_representation()
sage: I = M.invariant_module()
sage: [I.lift(b) for b in I.basis()]
[() + (2,3) + (1,2) + (1,2,3) + (1,3,2) + (1,3)]


We build the $$D_4$$-invariant representation inside of the regular representation of $$S_4$$:

sage: D4 = groups.permutation.Dihedral(4)
sage: S4 = SymmetricGroup(4)
sage: R = S4.regular_representation()
sage: I = R.invariant_module(D4)
sage: [I.lift(b) for b in I.basis()]
[() + (2,4) + (1,2)(3,4) + (1,2,3,4) + (1,3) + (1,3)(2,4) + (1,4,3,2) + (1,4)(2,3),
(3,4) + (2,3,4) + (1,2) + (1,2,4) + (1,3,2) + (1,3,2,4) + (1,4,3) + (1,4,2,3),
(2,3) + (2,4,3) + (1,2,3) + (1,2,4,3) + (1,3,4,2) + (1,3,4) + (1,4,2) + (1,4)]

semigroup()

Return the semigroup whose representation self is.

EXAMPLES:

sage: G = SymmetricGroup(4)
sage: M = CombinatorialFreeModule(QQ, ['v'])
sage: from sage.modules.with_basis.representation import Representation
sage: on_basis = lambda g,m: M.term(m, g.sign())
sage: R = Representation(G, M, on_basis)
sage: R.semigroup()
Symmetric group of order 4! as a permutation group

semigroup_algebra()

Return the semigroup algebra whose representation self is.

EXAMPLES:

sage: G = SymmetricGroup(4)
sage: M = CombinatorialFreeModule(QQ, ['v'])
sage: from sage.modules.with_basis.representation import Representation
sage: on_basis = lambda g,m: M.term(m, g.sign())
sage: R = Representation(G, M, on_basis)
sage: R.semigroup_algebra()
Symmetric group algebra of order 4 over Rational Field

side()

Return whether self is a left, right, or two-sided representation.

OUTPUT:

• the string "left", "right", or "twosided"

EXAMPLES:

sage: G = groups.permutation.Dihedral(4)
sage: R = G.regular_representation()
sage: R.side()
'left'

twisted_invariant_module(chi, G=None, **kwargs)

Create the isotypic component of the action of G on self with irreducible character given by chi.

INPUT:

• chi – a list/tuple of character values or an instance of ClassFunction_gap

• G – a finitely-generated semigroup (default: the semigroup this is a representation of)

This also accepts the group to be the first argument to be the group.

OUTPUT:

EXAMPLES:

sage: G = SymmetricGroup(3)
sage: R = G.regular_representation(QQ)
sage: T = R.twisted_invariant_module([2,0,-1])
sage: T.basis()
Finite family {0: B, 1: B, 2: B, 3: B}
sage: [T.lift(b) for b in T.basis()]
[() - (1,2,3), -(1,2,3) + (1,3,2), (2,3) - (1,2), -(1,2) + (1,3)]


We check the different inputs work

sage: R.twisted_invariant_module([2,0,-1], G) is T True sage: R.twisted_invariant_module(G, [2,0,-1]) is T True

class sage.modules.with_basis.representation.SignRepresentationCoxeterGroup(group, base_ring, sign_function=None)

The sign representation for a Coxeter group.

EXAMPLES:

sage: G = WeylGroup(["A", 1, 1])
sage: V = G.sign_representation()
sage: TestSuite(V).run()

class sage.modules.with_basis.representation.SignRepresentationMatrixGroup(group, base_ring, sign_function=None)

The sign representation for a matrix group.

EXAMPLES:

sage: G = groups.permutation.PGL(2, 3)
sage: V = G.sign_representation()
sage: TestSuite(V).run()

class sage.modules.with_basis.representation.SignRepresentationPermgroup(group, base_ring, sign_function=None)

The sign representation for a permutation group.

EXAMPLES:

sage: G = groups.permutation.PGL(2, 3)
sage: V = G.sign_representation()
sage: TestSuite(V).run()

class sage.modules.with_basis.representation.SignRepresentation_abstract(group, base_ring, sign_function=None)

Generic implementation of a sign representation.

The sign representation of a semigroup $$S$$ over a commutative ring $$R$$ is the $$1$$-dimensional $$R$$-module on which every element of $$S$$ acts by 1 if order of element is even (including 0) or -1 if order of element if odd.

This is simultaneously a left and right representation.

INPUT:

• permgroup – a permgroup

• base_ring – the base ring for the representation

• sign_function – a function which returns 1 or -1 depending on the elements sign

REFERENCES:

class Element
side()

Return that self is a two-sided representation.

OUTPUT:

• the string "twosided"

EXAMPLES:

sage: G = groups.permutation.Dihedral(4)
sage: R = G.sign_representation()
sage: R.side()
'twosided'

class sage.modules.with_basis.representation.TrivialRepresentation(semigroup, base_ring)

The trivial representation of a semigroup.

The trivial representation of a semigroup $$S$$ over a commutative ring $$R$$ is the $$1$$-dimensional $$R$$-module on which every element of $$S$$ acts by the identity.

This is simultaneously a left and right representation.

INPUT:

• semigroup – a semigroup

• base_ring – the base ring for the representation

REFERENCES:

class Element
side()

Return that self is a two-sided representation.

OUTPUT:

• the string "twosided"

EXAMPLES:

sage: G = groups.permutation.Dihedral(4)
sage: R = G.trivial_representation()
sage: R.side()
'twosided'