# Families of Lie Algebras

The radical of a Lie algebra is the maximal soluble ideal. A Lie algebra is called *reductive* if its radical is equal to its centre, and *semisimple* if its radical is trivial. A Lie algebra is *almost reductive (resp. simple, semisimple)* if the corresponding group of Lie type is reductive (resp. simple, semisimple). Note that these concepts are equivalent if the field has characteristic zero.

The commands in this section construct almost reductive Lie algebras over an arbitrary field. Such Lie algebras have a corresponding root datum. The matrix versions of these commands give the standard matrix representation, which is the smallest degree representation (with a few exceptions for small characteristic fields).

## Almost Reductive Lie Algebras

The intrinsics [`LieAlgebra`](#function-liealgebra) and [`MatrixLieAlgebra`](#function-matrixliealgebra) described below take as first argument an object which describes the type of the reductive Lie algebra to be constructed. Specifically, it may be one of the five following types:

**(a)**
A string describing the Cartan type;

**(b)**
A root datum (see Chapter [Root Data](../RootData/index-root-data.md#chaprootdtm));

**(c)**
A crystallographic root system (see Chapter [Root Systems](../RootSystems/index-root-systems.md#chaprootsys));

**(d)**
A Dynkin digraph (see Section [Dynkin Digraphs](../CoxeterSystems/dynkindigraph.md#sectcartandyndigrph));

**(e)**
A crystallographic Cartan matrix $C$ (see Section [Cartan Matrices](../CoxeterSystems/cartanmat.md#sectcartancarmat)).

In the cases (a), (d), and (e) these intrinsics take an optional argument `Isogeny`. See Section [Constructing Groups of Lie Type](../ChevalleyGroups/construction.md#sectgrplieconstruct) for the possible values of this flag.

### `LieAlgebra(T, k): MonStgElt, Rng -> AlgLie`

### `LieAlgebra(R, k): RootDtm, Rng -> AlgLie`

### `LieAlgebra(R, k): RootSys, Rng -> AlgLie`

### `LieAlgebra(D, k): GrphDir, Rng -> AlgLie`

### `LieAlgebra(C, k): AlgMatElt, Rng -> AlgLie`

```magma
Isogeny: .                    Default: "Ad"
```

Construct the reductive Lie algebra of type $T$ over the ring $k$.

### `MatrixLieAlgebra(T, k): MonStgElt, Rng -> AlgLie`

### `MatrixLieAlgebra(R, k): RootDtm, Rng -> AlgLie`

### `MatrixLieAlgebra(R, k): RootSys, Rng -> AlgLie`

### `MatrixLieAlgebra(D, k): GrphDir, Rng -> AlgLie`

### `MatrixLieAlgebra(C, k): AlgMatElt, Rng -> AlgLie`

```magma
Isogeny: .                    Default: "Ad"
```

Construct the reductive matrix Lie algebra of type $T$ over the ring $k$.

### `Example: Reductive Lie Algebra (ex-05c3a3)`

We construct some (semi)simple Lie algebras.

```magma
> LieAlgebra("D7", RationalField());
Lie Algebra of dimension 91 with base ring Rational Field
> LieAlgebra("G2", GF(5));
Lie Algebra of dimension 14 with base ring GF(5)
> L := LieAlgebra( "G2 B3", Rationals() );
> L;
Lie Algebra of dimension 35 with base ring Rational Field
> DirectSumDecomposition(L);
[
    Lie Algebra of dimension 14 with base ring Rational Field,
    Lie Algebra of dimension 21 with base ring Rational Field
]
> LieAlgebra( "E8", GF(2) );
Lie Algebra of dimension 248 with base ring GF(2)

```

### `Example: Lie Algebra Isogeny (ex-ef718c)`

This example demonstrates the use of the `Isogeny` option. Over a field of characteristic zero, this option only effects the basis used. In characteristic $p$, it sometimes effects the isomorphism type of the algebra. For type $A_n$ with $p|(n+1)$, the default Isogeny is “Ad” (adjoint), which gives an algebra with nontrivial derived subalgebra but no centre:

```magma
> L := LieAlgebra("A4", GF(5));
> Dimension(L);
24
> Dimension(L*L);
23
> Dimension(Centre(L));
0

```

If you take Isogeny to be “SC” (simply connected), you get a perfect algebra with a nontrivial centre.

```magma
> L := LieAlgebra("A4", GF(5) : Isogeny:="SC");
> Dimension(L);
24
> Dimension(L*L);
24
> Dimension(Centre(L));
1

```

If $p^2|(n+1)$ there is an intermediate isogeny type which has both a centre and a nontrivial derived algebra:

```magma
> L := LieAlgebra("A24", GF(5) : Isogeny:=5);
> Dimension(L);
624
> Dimension(L*L);
623
> Dimension(Centre(L));
1

```

Similar results can be obtained by constructing the Lie algebra from a root datum. This kind of phenomenon happens whenever the characteristic divides the order of the fundamental group of your root datum. See [[Hogeweij, 1982](../../references.md#cite-hogeweij82)] for more details.

```magma
> R := RootDatum("E6");
> #FundamentalGroup(R);
3
> L := LieAlgebra(R,GF(3));
> L;
Lie Algebra of dimension 78 with base ring GF(3)
> L*L;
Lie Algebra of dimension 77 with base ring GF(3)

```

### `LieAlgebra(N, k, p): MonStgElt, Rng, GrpPermElt -> AlgLie`

### `LieAlgebra(R, k, p): RootDtm, Rng, GrpPermElt -> AlgLie`

The twisted (almost) semisimple Lie algebra over the finite field $k$ with Cartan type $N$ given as a string or root datum $R$, with twist given by the permutation $p$. The twist should either be a permutation of the indices of the simple roots, or of the indices of all roots.

### `TwistedLieAlgebra(R, k): RootDtm, Rng -> AlgLie`

Given a twisted root datum $R$ and a finite field $k$, construct the twisted Lie algebra $L = R(k)$.

This variant has 5 return values. First, the twisted Lie algebra $L$. Second, a homomorphism $\phi$ from $L$ into the split Lie algebra $L'$ (over a suitable field extension of $k$); Third, $L'$; Fourth, a split toral subalgebra $H$ of $L$, and, fifth, a split toral subalgebra $H'$ of $L'$, such that $\phi(H) \subseteq H'$.

See also [`TwistedBasis`](operation.md#function-twistedbasis).

### `Example: Twisted Lie Algebra (ex-0173e2)`

We construct two twisted Lie algebras.

```magma
> DynkinDiagram("E6");

E6    1 - 3 - 4 - 5 - 6
              |
              2

> LieAlgebra( "E6", GF(5), Sym(6)!(1,6)(3,5) );
Lie Algebra of dimension 78 with base ring GF(5)
> Rt := TwistedRootDatum(RootDatum("D4") : Twist := 3);
> k := GF(7);
> L, phi, Lp, H, Hp := TwistedLieAlgebra(Rt, k);
> L;
Lie Algebra of dimension 28 with base ring GF(7)
> Lp;
Lie Algebra of dimension 28 with base ring GF(7^3)
> phi(L.3);
(0 0 ksi^49 ksi^7 ksi 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0)
> IsSplitToralSubalgebra(L, H);
true
> IsSplitToralSubalgebra(Lp, Hp);
true
> forall{b : b in Basis(H) | phi(b) in Hp};
true

```

## Cartan-Type Lie Algebras

Simple Lie algebras over fields of characteristic $0$ have been classified and are precisely the twisted forms of Lie algebras of types $A_l, B_l, C_l, D_l, E_6, E_7, E_8, F_4$ and $G_2$ (see previous Subsection). Over fields of finite characteristic $p$, the analogues of these algebras are called *classical-type* (including the exceptional algebras). Over such fields there are other simple Lie algebras, the first of them found by Witt sometimes before 1937. For $p \geq 7$, the only non-classical simple Lie algebras are the Lie algebras of *Cartan-type*, which we discuss in this section. For $p=5$, one further class of simple Lie algebras occurs: *Melikian* algebras, which are discussed in the next section. In characteristic $2$ and $3$, the classification of simple Lie algebras is not yet complete.

Cartan-type Lie algebras are non-classical Lie algebras which arise from infinite dimensional algebras of differential operators over ${\mathbb{C}}$:

- (generalised) Witt algebras,

- special and conformal special Lie algebras,

- Hamiltonian and conformal Hamiltonian Lie algebras,

- and contact Lie algebras.

The notation and the description of these Lie algebras closely follow Strade and Farnsteiner [[Strade, 2004](../../references.md#cite-str2004)] and [[Strade and Farnsteiner, 1988](../../references.md#cite-str-frn88)]. Where the notation of the two books differs, we follow [[Strade, 2004](../../references.md#cite-str2004)].

Let $F$ be a finite field of characteristic $p>0$ and $m$ a positive integer. We refer for the definition of $O(m)$ and $x^{(a)}$ to [[Strade, 2004](../../references.md#cite-str2004), 2.1]. The basis of $O(m)$ is $\{ x^{(a)} | 0\leq a, a\in {\mathbb{N}}^m \}$.

Let $n$ be a sequence of positive integers of length $m$ and set $N := \sum_{i=1}^m n_i$. Define

$$
O(m,n) := \langle x^{(a)} | 0 \leq a_i < p^{n_i} \rangle
$$

For $i=1,\dots,m$ denote by $\partial_i$ the derivation of $O(m)$ defined by

$$
\partial_i(x_j^{(r)}) = \delta_{i,j} x_j^{(r-1)}.
$$

Now define

$$
W(m,n) := \sum_{i=1}^m O(m)\partial_i.
$$

The algebra $W(m,n)$ is the *Witt* algebra and has dimension $m p^N$ over $F$. In particular, $W(1,[1])$ is the standard $p$-dimensional Witt algebra.

The Witt algebra $W(m,n)$ is simple unless $p=2$ and $m=1$ ([[Strade and Farnsteiner, 1988](../../references.md#cite-str-frn88), 4.2.4(1)]) and is restrictable if and only if $n=[1,\dots,1]$ ([[Strade and Farnsteiner, 1988](../../references.md#cite-str-frn88), 4.2.4(2)]).

Further define $\Omega^0(m,n) := O(m,n),$$\Omega^1(m,n) := {\operatorname{Hom}}{}_{O(m,n)}(W(m,n),O(m,n)),$$\Omega^r(m,n) := \bigwedge^r \Omega^1(m,n),$$\Omega(m,n) := \bigoplus \Omega^r(m,n).$

Let $m\geq 2$ and $\omega_S = dx_1 \wedge \dots \wedge dx_m$. Define the following subalgebras of $W(m,n)$:

$$
S(m,n) := \{ D\in W(m,n) | D(\omega_S) = 0 \},$$$$CS(m,n) := \{ D\in W(m,n) | D(\omega_S) \in F\omega_S \}.
$$

The algebra $S(m,n)$ is the *special* and $CS(m,n)$ is the *conformal special* Lie algebra. The dimension of $S(m,n)$ over $F$ is $(m-1)p^N + 1$ and the dimension of $CS(m,n)$ is $\dim S(m,n) + 1$.

Suppose $m\geq 3$. Then the algebra $S(m,n)^{(1)}$ is simple ([[Strade and Farnsteiner, 1988](../../references.md#cite-str-frn88), 4.3.5(1)]) and is restrictable if and only if $n=[1,\dots,1]$ ([[Strade and Farnsteiner, 1988](../../references.md#cite-str-frn88), 4.3.5(2)]).

Let $p>2$, $m = 2r \geq 2$ and let $\omega_H = \sum\limits_{i=1}^r dx_i \wedge dx_{i+r}$. Define the following subalgebras of $W(m,n)$:

$$
H(m,n) := \{ D\in W(m,n) | D(\omega_H) = 0 \},$$$$CH(m,n) := \{ D\in W(m,n) | D(\omega_H) \in F\omega_H \}.
$$

The algebra $H(m,n)$ is the *Hamiltonian* and $CH(m,n)$ is the *conformal Hamiltonian* Lie algebra. The dimension of $H(m,n)$ over $F$ is $p^N - 1$ and the dimension of $CH(m,n)$ is $\dim H(m,n) + 1$.

The algebra $H(m,n)^{(2)}$ is simple ([[Strade and Farnsteiner, 1988](../../references.md#cite-str-frn88), 4.4.5(1)]) and is restrictable if and only if $n=[1,\dots,1]$ ([[Strade and Farnsteiner, 1988](../../references.md#cite-str-frn88), 4.4.5(2)]). And, if $m>2$, then $H(m,n)^{(2)} = H(m,n)^{(1)}$.

Let $p>2$, $m = 2r+1 \geq 3$ and let $\omega_K = dx_m + \sum\limits_{i=1}^r (x_idx_{i+r} - x_{i+r}dx_i)$. Define the following subalgebra of $W(m,n)$:

$$
K(m,n) := \{ D\in W(m,n) | D(\omega_K) \in O(m,n)\omega_K \},
$$

The algebra $K(m,n)$ is the *contact* Lie algebra. The dimension of $K(m,n)$ over $F$ is $p^N$.

The algebra $K(m,n)^{(1)}$ is simple ([[Strade and Farnsteiner, 1988](../../references.md#cite-str-frn88), 4.5.5(1)]) and is restrictable if and only if $n=[1,\dots,1]$ ([[Strade and Farnsteiner, 1988](../../references.md#cite-str-frn88), 4.5.6]). If $m+3 \not\equiv 0 {\rm\ mod\ }p$, then $K(m,n)^{(1)} = K(m,n)$.

### `WittLieAlgebra(F, m, n): Fld, RngIntElt, SeqEnum[RngIntElt] -> AlgLie, Map`

```magma
Check: BoolElt                    Default: false
```

The Witt algebra $W(m,n)$ is constructed over the finite field $F$, where $m$ must be a positive integer and $n$ a sequence of positive integers of length $m$. If the optional argument `Check` is `true`, the algebra is checked to be Lie upon construction.

An invertible map from the polynomial ring $P$ over $F$ of degree $2m$ to $W(m,n)$ is returned as second value, to assist in identifying the elements of $W(m,n)$. For $1 \leq i\leq m$ the $i$-th generator of $P$ maps to $x_i$ in $W(m,n)$, and for $m+1 \leq i\leq 2m$ the $i$-th generator of $P$ maps to $\delta_{i-m}$ in $W(m,n)$.

### `Example: Witt Alg Ex (ex-ea6512)`

We compute the Witt algebra $W(2,[2,1])$ over $GF(9)$ and verify the multiplication of $x_1^{(1)} \delta_1$ and $x_1^{(2)} x_2^{(1)} \delta_2$.

```magma
> W, phi := WittLieAlgebra(GF(9), 2, [2,1]);
> W;
Lie Algebra of dimension 54 with base ring GF(3^2)
> IsSimple(W);
true
> P<x1, x2, d1, d2> := Domain(phi);
> phi(x1*d1);
(0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0)
> (phi(x1*d1)*phi(x1^2*x2*d2)) @@ phi;
2*x1^2*x2*d2

```

and the standard Witt algebra $W(1,[1])$ over $GF(2)$:

```magma
> W := WittLieAlgebra(GF(2), 1, [1]);
> W;
Lie Algebra of dimension 2 with base ring GF(2)
> IsSimple(W);
false
> IsRestrictedLieAlgebra(W);
true [ (0 0), (0 1) ]

```

### `SpecialLieAlgebra(F, m, n): Fld, RngIntElt, SeqEnum[RngIntElt] -> AlgLie, AlgLie, Map, Map`

### `ConformalSpecialLieAlgebra(F, m, n): Fld, RngIntElt, SeqEnum[RngIntElt] -> AlgLie, AlgLie, AlgLie, Map, Map`

```magma
Check: BoolElt                    Default: false
```

The (conformal) special Lie algebra $(C)S(m,n)$ is constructed over the finite field $F$, where $m\geq 2$ must be an integer and $n$ a sequence of positive integers of length $m$. If the optional argument `Check` is `true`, Magma checks that the algebra constructed is a Lie algebra.

The intrinsic `SpecialLieAlgebra` returns the Witt algebra $W(m,n)$ in which it is embedded as the second return value. In addition, similarly to `WittLieAlgebra`, a map from the polynomial ring $P$ of degree $2m$ over $F$ to $S(m,n)$ is returned as the third return value, and a map from $P$ to $W(m,n)$ as the fourth return value.

Similarly, `ConformalSpecialLieAlgebra` returns the special Lie algebra $S(m,n)$ which it contains and the Witt Lie algebra $W(m,n)$ in which it is embedded in as second and third return values. Maps from $P$ to $CS(m,n)$, $S(m,n)$, and $W(m,n)$ are returned as fourth, fifth, and sixth return values, respectively.

### `Example: Special Lie Alg Ex (ex-c2ee06)`

We compute both $S(3,[1,2,1])$ and $CS(3,[1,2,1])$ over $GF(9)$:

```magma
> CS,S,W := ConformalSpecialLieAlgebra( GF(9), 3, [1,2,1] );
> CS;S;W;
Lie Algebra of dimension 164 with base ring GF(3^2)
Lie Algebra of dimension 163 with base ring GF(3^2)
Lie Algebra of dimension 243 with base ring GF(3^2)
> IsSimple(S);
false
> IsSimple(S*S);
true
> IsRestrictedLieAlgebra(S*S);
false []

```

### `HamiltonianLieAlgebra(F, m, n): Fld, RngIntElt, SeqEnum[RngIntElt] -> AlgLie, AlgLie`

### `ConformalHamiltonianLieAlgebra(F, m, n): Fld, RngIntElt, SeqEnum[RngIntElt] -> AlgLie, AlgLie, AlgLie`

```magma
Check: BoolElt                    Default: false
```

The (conformal) Hamiltonian Lie algebra $(C)H(m,n)$ is constructed over the finite field $F$ of characteristic at least $3$, where $m\geq 2$ must be even and $n$ a sequence of positive integers of length $m$. If the optional argument `Check` is `true`, the algebra is checked to be Lie upon construction.

The intrinsic `HamiltonianlLieAlgebra` returns the Witt Lie algebra $W(m,n)$ in which it is embedded as the second return value. Additionally, similarly to `WittLieAlgebra`, a map from the polynomial ring $P$ of degree $2m$ over $F$ to $H(m,n)$ is returned as the third return value, and a map from $P$ to $W(m,n)$ as the fourth return value.

Similarly, `ConformalHamiltonianLieAlgebra` returns the Hamiltonian Lie algebra $H(m,n)$ it contains and the Witt Lie algebra $W(m,n)$ in which it is embedded as the second and third return values. Maps from $P$ to $CH(m,n)$, $H(m,n)$, and $W(m,n)$ are returned as the fourth, fifth, and sixth return values, respectively.

### `Example: Hamilton Alg Ex (ex-2e2daf)`

We compute both $H(2,[2,2])$ and $CH(2,[2,2])$ over $GF(9)$:

```magma
> CH,H,W := ConformalHamiltonianLieAlgebra( GF(9), 2, [2,2] );
> CH;H;W;
Lie Algebra of dimension 81 with base ring GF(3^2)
Lie Algebra of dimension 80 with base ring GF(3^2)
Lie Algebra of dimension 162 with base ring GF(3^2)
> IsSimple(H);
false
> IsSimple(H*H);
true
> IsSimple(H*H*H);
true
> IsRestrictedLieAlgebra(H*H*H);
false []

```

### `ContactLieAlgebra(F, m, n): Fld, RngIntElt, SeqEnum[RngIntElt] -> AlgLie, AlgLie`

```magma
Check: BoolElt                    Default: false
```

The contact Lie algebra $K(m,n)$ is constructed over the finite field $F$ of characteristic at least $3$, where $m\geq 3$ must be odd and $n$ a sequence of positive integers of length $m$. If the optional argument `Check` is `true`, the algebra is checked to be Lie upon construction.

The intrinsic `ContactLieAlgebra` returns the Witt Lie algebra $W(m,n)$ in which it is embedded as the second return value. Additionally, similarly to `WittLieAlgebra`, a map from the polynomial ring $P$ of degree $2m$ over $F$ to $K(m,n)$ is returned as the third return value, and a map from $P$ to $W(m,n)$ as the fourth return value.

### `Example: Contact Alg Ex (ex-983c1d)`

We compute the contact Lie algebra $K(3,[1,1,1])$ over $GF(5)$:

```magma
> K,W := ContactLieAlgebra( GF(5), 3, [1,1,1] );
> K;W;
Lie Algebra of dimension 125 with base ring GF(5)
Lie Algebra of dimension 375 with base ring GF(5)
> K*K eq K;
true
> IsSimple(K);
true

```

## Melikian Lie Algebras

The Melikian Lie Algebras are a class of simple Lie algebras over finite fields of characteristic $5$, parameterized by two positive integers $n_1$, $n_2$. We follow the explicit construction by Strade [[Strade, 2004](../../references.md#cite-str2004), Section 4.3].

Let $F$ be a field of characteristic $p = 5$ and recall the definition of $O(m,n)$ and $W(m,n)$ from Section [Cartan-Type Lie Algebras](#subsectalgcartyp). Define $W = W(2, [n_1, n_2])$, $O = O(2, [n_1, n_2])$, and take $W'$ to be a copy of $W$. We equip the vector space $W \oplus O \oplus W'$ with a bilinear product $[\cdot,\cdot]$ that is defined by the following equations, where $D, E \in W$ and $f, f_1, f_2, g, g_1, g_2 \in O$.

- On $W \times W$, the usual multiplication in $W$.

- On $W \times O$: $[D, f] = D(f) - 2$div$(D) f$.

- On $W \times W'$: $[D, E'] = ([D,E])' + 2$div$(D) E'$.

- On $O \times O$: $[f,g] = 2(g \delta_2(f) - f \delta_2(g)) \delta'_1 + 2(f \delta_1(g) - g \delta_1(f)) \delta'_2$.

- On $O \times W'$: $[f, E'] = fE$.

- On $W' \times W'$: $[f_1 \delta'_1 + f_2 \delta'_2, g_1 \delta'_1 + g_2 \delta'_2] = f_1 g_2 - f_2 g_1$.

Here div is the linear map defined by div($f \delta_i$) = $\delta_i f$. It follows that $M(n_1, n_2)$, of dimension $5^{n_1+n_2+1}$, is a simple Lie algebra [[Strade, 2004](../../references.md#cite-str2004)] (Lemma 4.3.1, Theorem 4.3.3).

### `MelikianLieAlgebra(F, n1, n2): Fld, RngIntElt, RngIntElt -> AlgLie, Map`

```magma
Check: BoolElt                    Default: false
```

The Melikian Lie algebra $M = M(n_1, n_2)$ over $F$. An invertible map from the polynomial ring $P$ of degree $6$ over $F$ to $M$ is returned as second value, to assist in identifying the elements of $M$. Here the six generators of $P$ represent $x_1$, $x_2$, $\delta_1$, $\delta_2$, $\delta'_1$, $\delta'_2$, respectively.

### `Example: Melikian Alg Ex (ex-c70322)`

We construct $M(2, 1)$ over ${\bf F}_{5}$ and inspect some of its properties.

```magma
> M, phi := MelikianLieAlgebra(GF(5), 2, 1);
> M;
Lie Algebra of dimension 625 with base ring GF(5)
> IsSimple(M);
true

```

Next, we construct subspaces (not subalgebras) $W$, $O$, $W'$ of $M$.

```magma
> P<x1, x2, d1, d2, dp1, dp2> := Domain(phi);
> V := VectorSpace(GF(5), Dimension(M));
> W := sub<V | [ V | phi(x1^i*x2^j*d) : i in [0..24], j in [0..4],
>                                                     d in [d1,d2] ]>;
> O := sub<V | [ V | phi(x1^i*x2^j) : i in [0..24], j in [0..4] ]>;
> Wp := sub<V | [ V | phi(x1^i*x2^j*d) : i in [0..24], j in [0..4],
>                                                      d in [dp1,dp2] ]>;
> Dimension(W), Dimension(O), Dimension(Wp);
250 125 250
> Dimension(W meet O), Dimension(W meet Wp), Dimension(O meet Wp);
0 0 0

```

Finally, we verify that these subspaces multiply as required by the definition.

```magma
> m := func< A, B | sub<V | [ V | M!a*M!b : a in Basis(A), b in Basis(B) ]> >;
> WxWp := m(W, Wp); [ WxWp subset VV : VV in [W, O, Wp] ];
[ false, false, true ]

```

So indeed $[W, W'] \subseteq W'$.

```magma
> VV := [W, O, Wp]; VVnm := ["W", "O", "W'" ];
> mm := function(A, B)
>   AB := m(A, B);
>   for i in [1..#VV] do
>     if AB eq VV[i] then return VVnm[i]; end if;
>   end for;
>   return "??";
> end function;
> mm(W, Wp);
W'
> for i,j in [1..#VV] do
>   printf "[ %2o, %2o ] = %2o%o", VVnm[i], VVnm[j], mm(VV[i], VV[j]),
>     (j eq 3) select "\\n" else ", ";
> end for;
[  W,  W ] =  W, [  W,  O ] =  O, [  W, W' ] = W'
[  O,  W ] =  O, [  O,  O ] = W', [  O, W' ] =  W
[ W',  W ] = W', [ W',  O ] =  W, [ W', W' ] =  O

```
