---
title: "Operations on Elements"
canonical: "https://docs.magma-maths.org/v2.30-1/LieTheory/CoxeterGroups/group-elt-op.html"
source: "https://docs.magma-maths.org/v2.30-1/LieTheory/CoxeterGroups/group-elt-op.md"
part: "Lie Theory"
chapter: "Coxeter Groups"
breadcrumbs:
  - {"title": "Magma Handbook", "source": "https://docs.magma-maths.org/v2.30-1/index.md"}
  - {"title": "Lie Theory", "source": "https://docs.magma-maths.org/v2.30-1/LieTheory/index-lie-theory.md"}
  - {"title": "Coxeter Groups", "source": "https://docs.magma-maths.org/v2.30-1/LieTheory/CoxeterGroups/index-coxeter-groups.md"}
prev: {"title": "Properties of Coxeter Groups", "source": "https://docs.magma-maths.org/v2.30-1/LieTheory/CoxeterGroups/group-prop.md"}
next: {"title": "Roots, Coroots, and Reflections", "source": "https://docs.magma-maths.org/v2.30-1/LieTheory/CoxeterGroups/root-data-roots.md"}
intrinsics:
  - {"name": "#", "signature": "# w: GrpFPCoxElt -> RngIntElt"}
  - {"name": "Length", "signature": "Length(w): GrpFPCoxElt -> RngIntElt"}
  - {"name": "Length", "signature": "Length(W, w): GrpPermCox, GrpPermElt -> RngIntElt"}
  - {"name": "CoxeterLength", "signature": "CoxeterLength(w): GrpFPCoxElt -> RngIntElt"}
  - {"name": "CoxeterLength", "signature": "CoxeterLength(W, w): GrpPermCox, GrpPermElt -> RngIntElt"}
  - {"name": "LongestElement", "signature": "LongestElement(W): GrpFPCox -> SeqEnum"}
  - {"name": "LongestElement", "signature": "LongestElement(W): GrpPermCox -> GrpPermElt"}
  - {"name": "CoxeterElement", "signature": "CoxeterElement(W): GrpFPCox -> SeqEnum"}
  - {"name": "CoxeterElement", "signature": "CoxeterElement(W): GrpPermCox -> GrpPermElt"}
  - {"name": "CoxeterNumber", "signature": "CoxeterNumber(W): GrpFPCox -> SeqEnum"}
  - {"name": "CoxeterNumber", "signature": "CoxeterNumber(W): GrpPermCox -> GrpPermElt"}
  - {"name": "LeftDescentSet", "signature": "LeftDescentSet(W, w): GrpFPCox, GrpFPCoxElt -> SetEnum"}
  - {"name": "LeftDescentSet", "signature": "LeftDescentSet(W, w): GrpPermCox, GrpPermElt -> SetEnum"}
  - {"name": "RightDescentSet", "signature": "RightDescentSet(W, w): GrpFPCox, GrpFPCoxElt -> SetEnum"}
  - {"name": "RightDescentSet", "signature": "RightDescentSet(W, w): GrpPermCox, GrpPermElt -> SetEnum"}
examples:
  - "ex-8999bf"
  - "ex-ba43d4"
  - "ex-e2a89d"
---

<a id="group-elt-op"></a>
<a id="sectgrpeltop"></a>
# Operations on Elements

See Chapter [Finitely Presented Groups](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/FPGroups/index-fpgroups.md#chapgrpfp) for general functions for finitely presented groups or Chapter [Permutation Groups](https://docs.magma-maths.org/v2.30-1/FiniteGroups/PermutationGroups/index-permutation-groups.md#chapgrpperm) for general functions for permutation groups.

Unlike groups of type `GrpFP`, elements of a group of type [`GrpFPCox`](https://docs.magma-maths.org/v2.30-1/LieTheory/CoxeterGroups/index-coxeter-groups.md#chapgrpfpcox) are always converted into the normal form of Section [The Normal Form for Words](https://docs.magma-maths.org/v2.30-1/LieTheory/CoxeterGroups/introduction.md#subsectgrpcoxred).

<a id="example-ex-8999bf"></a>
## `Example: Arithmetic with Coxeter Words (ex-8999bf)`

Arithmetic with words.

```magma
> W<[s]> := CoxeterGroup(GrpFPCox, "G2");
> w1 := W![2,1,2,1,2] ;
> w1;
s[2] * s[1] * s[2] * s[1] * s[2]
> w2 := W![1,2,2,1,2,1];
> w2;
s[2] * s[1]
> w1 * w2;
s[1] * s[2] * s[1]
> W![1,2,1,2,1,2] eq W![2,1,2,1,2,1];
true
```

<a id="operation-operation-grpfpcoxelt-rngintelt"></a>
## `# w: GrpFPCoxElt -> RngIntElt`

<a id="function-length-grpfpcoxelt"></a>
## `Length(w): GrpFPCoxElt -> RngIntElt`

<a id="function-length-grppermcox-grppermelt"></a>
## `Length(W, w): GrpPermCox, GrpPermElt -> RngIntElt`

<a id="function-coxeterlength-grpfpcoxelt"></a>
## `CoxeterLength(w): GrpFPCoxElt -> RngIntElt`

<a id="function-coxeterlength-grppermcox-grppermelt"></a>
## `CoxeterLength(W, w): GrpPermCox, GrpPermElt -> RngIntElt`

The length of $w$ as an element of the Coxeter group $W$, ie. the number of positive roots of $W$ which become negative under the action of $w$. The # operator does not work for permutation Coxeter group elements.

<a id="function-longestelement-grpfpcox"></a>
## `LongestElement(W): GrpFPCox -> SeqEnum`

<a id="function-longestelement-grppermcox"></a>
## `LongestElement(W): GrpPermCox -> GrpPermElt`

The unique longest element of the Coxeter group $W$.

<a id="function-coxeterelement-grpfpcox"></a>
## `CoxeterElement(W): GrpFPCox -> SeqEnum`

<a id="function-coxeterelement-grppermcox"></a>
## `CoxeterElement(W): GrpPermCox -> GrpPermElt`

The Coxeter element of the Coxeter group $W$, ie. the product of the generators of $W$.

<a id="function-coxeternumber-grpfpcox"></a>
## `CoxeterNumber(W): GrpFPCox -> SeqEnum`

<a id="function-coxeternumber-grppermcox"></a>
## `CoxeterNumber(W): GrpPermCox -> GrpPermElt`

The Coxeter number of the irreducible Coxeter group $W$ (see [[Car93](https://docs.magma-maths.org/v2.30-1/references.md#cite-carter-big), page 20]).

<a id="example-ex-ba43d4"></a>
## `Example: Longest Elements and Coxeter Elements (ex-ba43d4)`

```magma
> W<[s]> := CoxeterGroup(GrpFPCox, "F4");
> LongestElement(W);
s[1] * s[2] * s[1] * s[3] * s[2] * s[1] * s[3] * s[2] * s[3] * s[4] * s[3] *
s[2] * s[1] * s[3] * s[2] * s[3] * s[4] * s[3] * s[2] * s[1] * s[3] * s[2] *
s[3] * s[4]
> CoxeterElement(W);
s[1] * s[2] * s[3] * s[4]
> W := CoxeterGroup("E8");
> Length(W, LongestElement(W));
120
> Length(W, CoxeterElement(W));
8
```

The Coxeter number can be described in a variety of ways.

```magma
> W := CoxeterGroup("D5");
> CoxeterNumber(W) eq Order(CoxeterElement(W));
true
> CoxeterNumber(W) eq #Roots(W) / Rank(W);
true
> R := RootDatum(W);
> CoxeterNumber(W) eq &+Eltseq(HighestRoot(R)) + 1;
true
```

<a id="function-leftdescentset-grpfpcox-grpfpcoxelt"></a>
## `LeftDescentSet(W, w): GrpFPCox, GrpFPCoxElt -> SetEnum`

<a id="function-leftdescentset-grppermcox-grppermelt"></a>
## `LeftDescentSet(W, w): GrpPermCox, GrpPermElt -> SetEnum`

The set of indices $r$ of simple roots of the Coxeter group $W$ such that the length of the product $s_rw$ is less than that of the element $w$.

<a id="function-rightdescentset-grpfpcox-grpfpcoxelt"></a>
## `RightDescentSet(W, w): GrpFPCox, GrpFPCoxElt -> SetEnum`

<a id="function-rightdescentset-grppermcox-grppermelt"></a>
## `RightDescentSet(W, w): GrpPermCox, GrpPermElt -> SetEnum`

The set of indices $r$ of simple roots of the Coxeter group $W$ such that the length of the product $ws_r$ is less than that of the element $w$.

<a id="example-ex-e2a89d"></a>
## `Example: Left and Right Descent Sets (ex-e2a89d)`

```magma
> W := CoxeterGroup("A5");
> x := W.1*W.2*W.4*W.5;
> LeftDescentSet(W, x);
{ 1, 4 }
> RightDescentSet(W, x);
{ 2, 5 }
```
