The Magma package in Maple 15 includes the command IsSubMagma. This tests whether a specified subset of a magma is closed under the binary operation that defines the magma. For example, consider the following Cayley table for a group of order four.

> with( Magma ):

> m := << 1, 2, 3, 4 |

> 2, 1, 4, 3 |

> 3, 4, 1, 2 |

> 4, 3, 2, 1 >>;

[1 2 3 4]

[ ]

[2 1 4 3]

m := [ ]

[3 4 1 2]

[ ]

[4 3 2 1]

> IsGroup( m );

true

The subset { 1, 2 } is a submagma (indeed, subgroup) of m.

> IsSubMagma( { 1, 2 }, m );

true

However, the subset { 2, 3 } is not a submagma,

> IsSubMagma( { 2, 3 }, m );

false

since (for instance) m[2,3] (representing the product 2 • 3 in the group) is equal to 4.

A subquandle of a quandle is a subset that, under the restriction of the quandle operation, itself forms a quandle. This means, in particular, that the restricted quandle operation is a binary operation on the subset in question; that is, the subset must be a submagma of the original quandle.

In general, it is *not* sufficient that a subset of a quandle be a submagma in order for it to be a subquandle, although the assertion that this is the case has appeared more than once in the literature. A clever counterexample to the claim that it is sufficient appeared in the following paper.

S. Kamada, *Quandles derived from dynamical systems and subsets which are*

*closed under quandle operations*, Topology Appl. 157 (2010), 298 -- 301.

However, there is a much simpler example that makes the same point. Consider the set Q of rational integers together with the binary operation • defined by

a • b = (a+b)/2.

It is straightforward to check that this binary operation defines a quandle operation on Q. (It is, in fact, a kind of Alexander quandle.) Now, the subset P of positive rationals is a submagma of Q because the average of two positive rationals is a positive rational. However, P is not a subquandle of Q. There is no problem with idempotence or the right distributive law. But, the equation x • a = b has no solution x, in P, for some choices of a and b. A specific instance for which there is no solution x is the pair ( a, b ) = ( 3, 1/2 ). For, if x • a = b, then we must have 1/2 = (x + 3)/2, so that x + 3 = 1. Therefore, x must be equal to -2, which is not positive.

Thus, it would *seem* that we cannot use the IsSubMagma command in the Magma package to determine whether a subset of a quandle is a subquandle. However, not all is lost. It turns out that, if Q is a quandle, and if P is a *finite* submagma of Q then, indeed, P is a subquandle of Q. To see that this is so, let P be a finite submagma of a quandle Q. Again, there are no worries about the equational properties of idempotence and right distributivity. Let a be an arbitrary member of P, and consider the right translation map x -> x • a (where • denotes the quandle operation on P, inherited from Q). Because Q is a quandle, this map is bijective on Q, and hence, its restriction to P is injective. But, because P was supposed to be a submagma of Q, this right translation mapping takes P into itself. And, since P was assumed to be finite, therefore, the map must be bijective on P as well. Consequently, given arbitrary elements a and b in P, the right translation map x -> x • a induced on P by a is bijective, so the equation x • a = b has an unique solution x. This suffices to demonstrate that P is a subquandle of Q.

Now, because the Magma package deals exclusively with finite magmas (given by their Cayley, or operation, tables), the result explained above applies in all cases of interest, and so the IsSubMagma command may, indeed, be used to determine whether a subset of a (finite) quandle is a subquandle.

Let's look at a small example, in which the answers to our queries are obvious from inspection. Consider the quandle with the following Cayley table.

> q := << 1, 1, 1, 1, 1 |

3, 2, 2, 2, 2 |

2, 3, 3, 3, 3 |

5, 5, 5, 4, 4 |

4, 4, 4, 5, 5 >>:

[1 3 2 5 4]

[ ]

[1 2 3 5 4]

[ ]

q := [1 2 3 5 4]

[ ]

[1 2 3 4 5]

[ ]

[1 2 3 4 5]

Since the upper left 3x3 submatrix of the operation table contains only the numbers 1, 2 and 3, we see that the subset { 1, 2, 3 } is a subquandle of q. Indeed,

> IsSubMagma( { 1, 2, 3 }, q );

true

However, the upper left 4x4 submatrix includes 5 among its entries, so { 1, 2, 3, 4 } is not a subquandle of q:

> IsSubMagma( { 1, 2, 3, 4 }, q );

false

As it happens, the quandle defined by the Cayley table above has 14 subquandles.