How Jellyfish Characterise Alternating Group Equivariant Neural Networks
We provide a full characterisation of all of the possible alternating group
($A_n$) equivariant neural networks whose layers are some tensor power of
$\mathbb{R}^{n}$. In particular, we find a basis of matrices for the learnable,
linear, $A_n$-equivariant layer functions between such tensor power spaces in
the standard basis of $\mathbb{R}^{n}$. We also describe how our approach
generalises to the construction of neural networks that are equivariant to
local symmetries.
Edward Pearce-Crump
# How Jellyfish Characterise Alternating Group Equivariant Neural Networks

###### Abstract

We provide a full characterisation of all of the possible alternating group (\(A_{n}\)) equivariant neural networks whose layers are some tensor power of \(\mathbb{R}^{n}\). In particular, we find a basis of matrices for the learnable, linear, \(A_{n}\)-equivariant layer functions between such tensor power spaces in the standard basis of \(\mathbb{R}^{n}\). We also describe how our approach generalises to the construction of neural networks that are equivariant to local symmetries.

Machine Learning, ICML

## 1 Introduction

There has been a growing research effort in deep learning to develop neural network architectures that can be used to efficiently learn from data that possesses an underlying symmetry. These architectures guarantee that the functions that are learned are subject to a geometric property connected with the symmetry group known as _equivariance_. Group equivariant neural networks are important due to the additional advantages that they possess over traditional multilayer perceptron models. They commonly display high levels of parameter sharing within each layer, resulting in significantly fewer parameters overall. This often results in models with improved prediction performance on new data.

The symmetry group that has received the most attention, in terms of it being explicitly incorporated into neural network architectures, is the group of all permutations on some fixed number of objects, called the symmetric group. Creating neural networks that are equivariant to permutations is important as many data structures, such as sets and graphs, exhibit natural permutation symmetry. It is easily understood that the labelling of the elements of a set or of the vertices of a graph is arbitrary; hence, it is crucial to ensure that the functions that are learned from such data do not depend on how the data is labelled.

In this paper, we look instead at how to construct neural networks that are equivariant to the alternating group. The alternating group is an index two subgroup of the symmetric group consisting solely of all the even permutations in the symmetric group. We give a full characterisation of all of the possible alternating group equivariant neural networks whose layers are some tensor power of \(\mathbb{R}^{n}\) by finding a basis of matrices for the learnable, linear, alternating group equivariant layer functions between such tensor power spaces in the standard basis of \(\mathbb{R}^{n}\). This makes the neural networks in question simple to implement.

Our approach is similar the one presented in the papers written by Pearce-Crump (2022a; 2022b). They used different sets of set partition diagrams to characterise all of the learnable, linear, group equivariant layer functions between tensor power spaces in the standard basis of \(\mathbb{R}^{n}\) for the following groups: the symmetric group \(S_{n}\); the orthogonal group \(O(n)\); the symplectic group \(Sp(n)\); and the special orthogonal group \(SO(n)\). We will show that in the case of the alternating group \(A_{n}\), the layer functions can also be characterised by specific sets of set partition diagrams.

The main contributions of this paper are as follows:

1. We are the first to show how the combinatorics underlying set partition diagrams, together with some jellyfish, serves as the theoretical foundation for constructing neural networks that are equivariant to the alternating group when the layers are some tensor power of \(\mathbb{R}^{n}\).
2. Specifically, we find a basis for the learnable, linear, \(A_{n}\)-equivariant layer functions between such tensor power spaces in the standard basis of \(\mathbb{R}^{n}\).
3. We extend our approach to show how to construct neural networks that are equivariant to local symmetries.

## 2 Preliminaries

We choose our field of scalars to be \(\mathbb{R}\) throughout. Tensor products are also taken over \(\mathbb{R}\), unless otherwise stated. Also, we let \([n]\) represent the set \(\{1,\ldots,n\}\).

Recall that a representation of a group \(G\) is a choice of
vector space \(V\) over \(\mathbb{R}\) and a group homomorphism

\[\rho:G\to GL(V) \tag{1}\]

We choose to focus on finite-dimensional vector spaces \(V\) that are some tensor power of \(\mathbb{R}^{n}\) in this paper.

We often abuse our terminology by calling \(V\) a representation of \(G\), even though the representation is technically the homomorphism \(\rho\). When the homomorphism \(\rho\) needs to be emphasised alongside its vector space \(V\), we will use the notation \((V,\rho)\).

## 3 \((\mathbb{R}^{n})^{\otimes k}\), a representation of both \(S_{n}\) and \(A_{n}\)

Recall that \(S_{n}\) is the group of all permutations on \([n]\), and that \(A_{n}\) is the subgroup of \(S_{n}\) consisting of all permutations on \([n]\) whose image under the function

\[\operatorname{sgn}:S_{n}\to\{\pm 1\} \tag{2}\]

is \(+1\), where \(\operatorname{sgn}\) is defined, for all \(\sigma\in S_{n}\), as

\[\operatorname{sgn}(\sigma)\coloneqq\begin{cases}+1&\text{if $\sigma$ is an even permutation in $S_{n}$}\\ -1&\text{if $\sigma$ is an odd permutation in $S_{n}$}\end{cases} \tag{3}\]

We have that \(\mathbb{R}^{n}\) is a representation of \(S_{n}\) via its (left) action on the basis \(\{e_{a}\mid a\in[n]\}\) which is extended linearly, where, specifically, the action is given by

\[\sigma\cdot e_{a}=e_{\sigma(a)}\text{ for all $\sigma\in S_{n}$ and $a\in[n]$} \tag{4}\]

Restricting this action to \(A_{n}\) and extending linearly shows that \(\mathbb{R}^{n}\) is also a representation of \(A_{n}\).

We also have that any \(k\)-tensor power of \(\mathbb{R}^{n}\), \((\mathbb{R}^{n})^{\otimes k}\), for any \(k\in\mathbb{Z}_{\geq 0}\), is a representation of \(S_{n}\), since the elements

\[e_{I}\coloneqq e_{i_{1}}\otimes e_{i_{2}}\otimes\cdots\otimes e_{i_{k}} \tag{5}\]

for all \(I\coloneqq(i_{1},i_{2},\ldots,i_{k})\in[n]^{k}\) form a basis of \((\mathbb{R}^{n})^{\otimes k}\), and the action of \(S_{n}\) that maps a basis element of \((\mathbb{R}^{n})^{\otimes k}\) of the form (5) to

\[e_{\sigma(I)}\coloneqq e_{\sigma(i_{1})}\otimes e_{\sigma(i_{2})}\otimes \cdots\otimes e_{\sigma(i_{k})} \tag{6}\]

can be extended linearly. Again, restricting this action to \(A_{n}\) and extending linearly shows that \((\mathbb{R}^{n})^{\otimes k}\) is also a representation of \(A_{n}\).

We denote the representation of \(S_{n}\) by \(\rho_{k}\). We will use the same notation for the restriction of this representation to \(A_{n}\), with the context making clear that it is the restriction of the \(S_{n}\) representation.

## 4 Group Equivariant Neural Networks

Group equivariant neural networks are constructed by alternately composing linear and non-linear \(G\)-equivariant maps between representations of a group \(G\). We define _\(G\)-equivariance_ below:

**Definition 4.1**.: Suppose that \((V,\rho_{V})\) and \((W,\rho_{W})\) are two representations of a group \(G\).

A map \(\phi:V\to W\) is said to be \(G\)-equivariant if, for all \(g\in G\) and \(v\in V\),

\[\phi(\rho_{V}(g)[v])=\rho_{W}(g)[\phi(v)] \tag{7}\]

The set of all _linear_\(G\)-equivariant maps between \(V\) and \(W\) is denoted by \(\operatorname{Hom}_{G}(V,W)\). When \(V=W\), we write this set as \(\operatorname{End}_{G}(V)\). It can be shown that \(\operatorname{Hom}_{G}(V,W)\) is a vector space over \(\mathbb{R}\), and that \(\operatorname{End}_{G}(V)\) is an algebra over \(\mathbb{R}\). See (Segal, 2014) for more details.

A special case of \(G\)-equivariance is _\(G\)-invariance_:

**Definition 4.2**.: The map \(\phi\) given in Definition 4.1 is said to be \(G\)-invariant if \(\rho_{W}\) is defined to be the \(1\)-dimensional trivial representation of \(G\). As a result, \(W=\mathbb{R}\).

We can now define the type of neural network that is the focus of this paper:

**Definition 4.3**.: An \(L\)-layer \(G\)-equivariant neural network \(f_{\textit{NN}}\) is a composition of _layer functions_

\[f_{\textit{NN}}\coloneqq f_{L}\circ\ldots\circ f_{l}\circ\ldots\circ f_{1} \tag{8}\]

such that the \(l^{\text{th}}\) layer function is a map of representations of \(G\)

\[f_{l}:(V_{l-1},\rho_{l-1})\to(V_{l},\rho_{l}) \tag{9}\]

that is itself a composition

\[f_{l}\coloneqq\sigma_{l}\circ\phi_{l} \tag{10}\]

of a learnable, linear, \(G\)-equivariant function \(\phi_{l}:(V_{l-1},\rho_{l-1})\to(V_{l},\rho_{l})\) together with a fixed, non-linear activation function \(\sigma_{l}:(V_{l},\rho_{l})\to(V_{l},\rho_{l})\) such that

1. \(\sigma_{l}\) is a \(G\)-equivariant map, as in (7), and
2. \(\sigma_{l}\) acts pointwise (after a basis has been chosen for each copy of \(V_{l}\) in \(\sigma_{l}\).)

We focus on the learnable, linear, \(G\)-equivariant functions in this paper, since the non-linear functions are fixed.

_Remark 4.4_.: The entire neural network \(f_{\textit{NN}}\) is itself a \(G\)-equivariant function because it can be shown that the composition of any number of \(G\)-equivariant functions is itself \(G\)-equivariant.

_Remark 4.5_.: One way of making a neural network of the form given in Definition 4.3\(G\)-invariant is by choosing the representation in the final layer to be the \(1\)-dimensional trivial representation of \(G\).
## 5 Symmetric Group

In this section, we recall the technique of using set partitions to find a basis of \(\mathrm{Hom}_{S_{n}}((\mathbb{R}^{n})^{\otimes k},(\mathbb{R}^{n})^{\otimes l})\) in the standard basis of \(\mathbb{R}^{n}\) since it will feature heavily in what follows for the alternating group. For more details, see (Pearce-Crump, 2022).

### Set Partitions

For \(l,k\in\mathbb{Z}_{\geq 0}\), consider the set \([l+k]\) having \(l+k\) elements. We can create a set partition of \([l+k]\) by partitioning it into a number of subsets. We call the subsets of a set partition _blocks_. Define \(\Pi_{l+k}\) to be the set of all set partitions of \([l+k]\). Let \(\Pi_{l+k,n}\) be the subset of \(\Pi_{l+k}\) consisting of all set partitions of \([l+k]\) having at most \(n\) blocks.

As the number of set partitions in \(\Pi_{l+k}\) having exactly \(t\) blocks is the Stirling number \(\left\{\begin{smallmatrix}l+k\\ t\end{smallmatrix}\right\}\) of the second kind, we see that the number of elements in \(\Pi_{l+k}\) is equal to \(\mathrm{B}(l+k)\), the \((l+k)^{\text{th}}\) Bell number, and that the number of elements in \(\Pi_{l+k,n}\) is therefore equal to

\[\sum_{t=1}^{n}\left\{\begin{smallmatrix}l+k\\ t\end{smallmatrix}\right\}\coloneqq\mathrm{B}(l+k,n) \tag{11}\]

the \(n\)-restricted \((l+k)^{\text{th}}\) Bell number.

For each set partition \(\pi\) in \(\Pi_{l+k}\), we can define a diagram \(d_{\pi}\) that has two rows of vertices and edges between vertices such that there are

1. \(l\) vertices on the top row, labelled by \(1,\ldots,l\)
2. \(k\) vertices on the bottom row, labelled by \(l+1,\ldots,l+k\), and
3. the edges between the vertices correspond to the connected components of the set partition that indexes the diagram.

As a result, \(d_{\pi}\) represents the equivalence class of all diagrams with connected components equal to the blocks of \(\pi\).

For example, if \(l=3\) and \(k=5\), the diagram corresponding to the set partition

\[\pi\coloneqq\{1,5\mid 2,4\mid 3,6,8\mid 7\} \tag{12}\]

in \(\Pi_{8}\) consisting of \(4\) blocks is given in Figure 1.

We can define another diagram related to each set partition \(\pi\) in \(\Pi_{l+k}\): it is the flattened version of \(d_{\pi}\), where we pull the top row of \(l\) vertices down and to the left of the bottom row of \(k\) vertices, maintaining the order of the labels.

For example, the flattened diagram corresponding to the set partition (12) is given in Figure 2.

### A Basis of \(\mathrm{Hom}_{S_{n}}((\mathbb{R}^{n})^{\otimes k},(\mathbb{R}^{n})^{\otimes l})\)

We begin by noting that \(\mathrm{Hom}((\mathbb{R}^{n})^{\otimes k},(\mathbb{R}^{n})^{\otimes l})\) has a standard basis of matrix units

\[\{E_{I,J}\}_{I\in[n]^{l},J\in[n]^{k}} \tag{13}\]

where \(E_{I,J}\) has a \(1\) in the \((I,J)\) position and is \(0\) elsewhere. Hence, expressing \(f\in\mathrm{Hom}((\mathbb{R}^{n})^{\otimes k},(\mathbb{R}^{n})^{\otimes l})\) in this basis as

\[f=\sum_{I\in[n]^{l}}\sum_{J\in[n]^{k}}f_{I,J}E_{I,J} \tag{14}\]

it can be shown that \(f\in\mathrm{Hom}_{S_{n}}((\mathbb{R}^{n})^{\otimes k},(\mathbb{R}^{n})^{ \otimes l})\) if and only if

\[f_{\sigma(I),\sigma(J)}=f_{I,J} \tag{15}\]

for all \(\sigma\in S_{n}\) and \(I\in[n]^{l},J\in[n]^{k}\).

Concatenating each \(I\in[n]^{l},J\in[n]^{k}\) into a single element \((I,J)\in[n]^{l+k}\), we see from (15) that the basis elements of \(\mathrm{Hom}_{S_{n}}((\mathbb{R}^{n})^{\otimes k},(\mathbb{R}^{n})^{\otimes l})\) are in bijective correspondence with the orbits coming from the action of \(S_{n}\) on \([n]^{l+k}\), where \(\sigma\in S_{n}\) acts on the pair \((I,J)\) by

\[\sigma(I,J)\coloneqq(\sigma(I),\sigma(J)) \tag{16}\]

As \(S_{n}\) acts on \([n]\) transitively, it acts on \([n]^{l+k}\) transitively, meaning that the orbits under this action actually partition the set \([n]^{l+k}\) into equivalence classes.

Furthermore, we can define a bijection between the orbits coming from the action of \(S_{n}\) on \([n]^{l+k}\) and the set partitions \(\pi\) in \(\Pi_{l+k}\) having at most \(n\) blocks. Indeed, if \((I,J)\) is a class representative of an orbit, then, replacing momentarily the elements of \(J\) by \(i_{l+m}\coloneqq j_{m}\) for all \(m\in[k]\), so that

\[(I,J) =(i_{1},i_{2},\ldots,i_{l},j_{1},j_{2},\ldots,j_{k})\] \[=(i_{1},i_{2},\ldots,i_{l},i_{l+1},i_{l+2},\ldots i_{l+k}) \tag{17}\]

Figure 2: The flattened diagram corresponding to the set partition \(\pi\) given in (12).

Figure 1: The diagram \(d_{\pi}\) corresponding to the set partition \(\pi\) given in (12) with \(l=3\) and \(k=5\).
we define the bijection by

\[i_{x}=i_{y}\iff x,y\text{ are in the same block of }\pi \tag{18}\]

for all \(x\), \(y\in[l+k]\).

The bijection (18) is independent of the choice of class representative since

\[i_{x}=i_{y}\iff\sigma(i_{x})=\sigma(i_{y})\text{ for all }\sigma\in S_{n} \tag{19}\]

Notice that the LHS of (18) is checking for an equality on the elements of \([n]\), whereas the RHS is separating the elements of \([l+k]\) into blocks; hence \(\pi\) must have at most \(n\) blocks.

As a result, we have shown the following.

**Theorem 5.1**.: _The basis elements of \(\operatorname{Hom}_{S_{n}}((\mathbb{R}^{n})^{\otimes k},(\mathbb{R}^{n})^{ \otimes l})\), in the standard basis of \(\mathbb{R}^{n}\), correspond bijectively with all set partitions \(\pi\) in \(\Pi_{l+k}\) having at most \(n\) blocks, which correspond bijectively with the orbits coming from the action of \(S_{n}\) on \([n]^{l+k}\)._

We can obtain the basis elements themselves, as follows:

Taking a set partition \(\pi\) in \(\Pi_{l+k,n}\), and denoting the number of blocks in \(\pi\) by \(t\), we obtain a labelling of the blocks by letting \(B_{1}\) be the block that contains the number \(1\in[l+k]\), and iteratively letting \(B_{j}\), for \(1<j\leq t\), be the block that contains the smallest number in \([l+k]\) that is not in \(B_{1}\cup B_{2}\cup\cdots\cup B_{j-1}\).

Using this labelling of the blocks, we can create an element of \([n]^{l+k}\) by letting the \(i^{\text{th}}\) position, \(i\in[l+k]\), be the label of the block containing the number \(i\). This is called the _block labelling_ of \(\pi\). Denote it by the pair \((I_{\pi},J_{\pi})\), where clearly \(I_{\pi}\in[n]^{l},J_{\pi}\in[n]^{k}\).

In doing so, we have created a representative of the orbit for the \(S_{n}\) action on \([n]^{l+k}\) corresponding to the set partition \(\pi\in\Pi_{l+k,n}\) under the bijection given in (18). Denote this orbit by \(O_{S_{n}}((I_{\pi},J_{\pi}))\).

We form a basis element of \(\operatorname{Hom}_{S_{n}}((\mathbb{R}^{n})^{\otimes k},(\mathbb{R}^{n})^{ \otimes l})\), denoted by \(X_{\pi}\), by adding together all matrix units whose indexing pair \((I,J)\) appears in the orbit \(O_{S_{n}}((I_{\pi},J_{\pi}))\); that is,

\[X_{\pi}\coloneqq\sum_{(I,J)\in O_{S_{n}}((I_{\pi},J_{\pi}))}E_{I,J} \tag{20}\]

We see that \(X_{\pi}\) is a basis element of \(\operatorname{Hom}_{S_{n}}((\mathbb{R}^{n})^{\otimes k},(\mathbb{R}^{n})^{ \otimes l})\) by (15).

Doing this for each set partition \(\pi\) in \(\Pi_{l+k,n}\), or, equivalently, for all of the orbits coming from the action of \(S_{n}\) on \([n]^{l+k}\), gives:

**Theorem 5.2** ([10]).: _For \(l,k\in\mathbb{Z}_{\geq 0},n\in\mathbb{Z}_{\geq 1}\), we have that_

\[\{X_{\pi}\mid\pi\in\Pi_{l+k,n}\} \tag{21}\]

_is a basis of \(\operatorname{Hom}_{S_{n}}((\mathbb{R}^{n})^{\otimes k},(\mathbb{R}^{n})^{ \otimes l})\), and so_

\[\dim\operatorname{Hom}_{S_{n}}((\mathbb{R}^{n})^{\otimes k},(\mathbb{R}^{n}) ^{\otimes l})=\operatorname{B}(l+k,n) \tag{22}\]

## 6 Alternating Group

In exactly the same way as for the symmetric group, we can show that the basis elements of \(\operatorname{Hom}_{A_{n}}((\mathbb{R}^{n})^{\otimes k},(\mathbb{R}^{n})^{ \otimes l})\) are in bijective correspondence with the orbits coming from the action of \(A_{n}\) on \([n]^{l+k}\).

However, the major difference between the symmetric group and the alternating group is that the \(A_{n}\) orbits on \([n]^{l+k}\), and consequently the basis elements of \(\operatorname{Hom}_{A_{n}}((\mathbb{R}^{n})^{\otimes k},(\mathbb{R}^{n})^{ \otimes l})\), are not necessarily in bijective correspondence with the set partitions of \([l+k]\) having at most \(n\) blocks. This is because some of the \(S_{n}\) orbits on \([n]^{l+k}\) become the disjoint union of more than one \(A_{n}\) orbit on \([n]^{l+k}\). We say that an \(S_{n}\) orbit on \([n]^{l+k}\)_splits_ if it is the disjoint union of more than one \(A_{n}\) orbit on \([n]^{l+k}\). Our first task is to identify which \(S_{n}\) orbits on \([n]^{l+k}\) split and which do not.

Let \(\pi\) be a set partition in \(\Pi_{l+k,n}\) having some \(t\) blocks. Its corresponding \(S_{n}\) orbit on \([n]^{l+k}\) is \(O_{S_{n}}((I_{\pi},J_{\pi}))\).

Choose some arbitrary element \((I_{\alpha},J_{\alpha})\in O_{S_{n}}((I_{\pi},J_{\pi}))\), and consider its \(A_{n}\) orbit on \([n]^{l+k}\). We shall denote it by \(O_{A_{n}}((I_{\alpha},J_{\alpha}))\). Clearly, \(O_{A_{n}}((I_{\alpha},J_{\alpha}))\subseteq O_{S_{n}}((I_{\pi},J_{\pi}))\), since \(A_{n}\) is a subgroup of \(S_{n}\).

Denote the stabilizer of \((I_{\pi},J_{\pi})\) under the action of \(S_{n}\) by \(\operatorname{Stab}_{S_{n}}((I_{\pi},J_{\pi}))\), and the stabilizer of \((I_{\alpha},J_{\alpha})\) under the action of \(A_{n}\) by \(\operatorname{Stab}_{A_{n}}((I_{\alpha},J_{\alpha}))\).

Then, by the Orbit-Stabilizer Theorem, we have that

\[|O_{S_{n}}((I_{\pi},J_{\pi}))|=\frac{|S_{n}|}{|\operatorname{Stab}_{S_{n}}((I_{ \pi},J_{\pi}))|}=\frac{n!}{(n-t)!} \tag{23}\]

as \(\operatorname{Stab}_{S_{n}}((I_{\pi},J_{\pi}))\cong S_{n-t}\), and

\[|O_{A_{n}}((I_{\alpha},J_{\alpha}))| =\frac{|A_{n}|}{|\operatorname{Stab}_{A_{n}}((I_{\alpha},J_{\alpha }))|}\] \[=\frac{n!}{2|\operatorname{Stab}_{A_{n}}((I_{\alpha},J_{\alpha}))|} \tag{24}\]

Since each \(S_{n}\) orbit will either be an \(A_{n}\) orbit or a disjoint union of \(A_{n}\) orbits, by studying \(\operatorname{Stab}_{A_{n}}((I_{\alpha},J_{\alpha}))\), we shall see under what conditions the \(S_{n}\) orbits split. Indeed, these conditions are given in the following theorem:

**Theorem 6.1** (\(S_{n}\) orbits split).: _Let \(\pi\) be a set partition in \(\Pi_{l+k,n}\) having some \(t\) blocks, and consider its corresponding \(S_{n}\) orbit on \([n]^{l+k}\), \(O_{S_{n}}((I_{\pi},J_{\pi}))\)._

_If \(t\leq n-2\), then \(O_{S_{n}}((I_{\pi},J_{\pi}))\) does not split._

_If \(t=n-1\) or \(n\), then \(O_{S_{n}}((I_{\pi},J_{\pi}))\) splits into a disjoint union of exactly two \(A_{n}\) orbits._
Proof.: Consider the case where \(\pi\) has \(t=n\) blocks. We look at \(\operatorname{Stab}_{A_{n}}((I_{\alpha},J_{\alpha}))\). As all of the elements in \([n]\) appear in the tuple \((I_{\alpha},J_{\alpha})\), the only element of \(A_{n}\) that fixes the entries of \((I_{\alpha},J_{\alpha})\) is the identity element; that is, \(\operatorname{Stab}_{A_{n}}((I_{\alpha},J_{\alpha}))=\{e_{A_{n}}\}\). Hence, by (24), we have that \(|O_{A_{n}}((I_{\alpha},J_{\alpha}))|=\frac{n!}{2}\). Since \(|O_{S_{n}}((I_{\pi},J_{\pi}))|=n!\) in this case, by (23), and because \((I_{\alpha},J_{\alpha})\) was an arbitrary element of \(O_{S_{n}}((I_{\pi},J_{\pi}))\), we have that \(O_{S_{n}}((I_{\pi},J_{\pi}))\) splits into a disjoint union of two \(A_{n}\) orbits.

Similarly, for the case where \(\pi\) has \(t=n-1\) blocks, we see that \(\operatorname{Stab}_{A_{n}}((I_{\alpha},J_{\alpha}))=\{e_{A_{n}}\}\), and so, by the same argument, we have that \(O_{S_{n}}((I_{\pi},J_{\pi}))\) splits into a disjoint union of two \(A_{n}\) orbits.

Finally, for \(t\leq n-2\), we have that \(\operatorname{Stab}_{A_{n}}((I_{\alpha},J_{\alpha}))\cong A_{n-t}\), and so, by (23) and (24), we see that \(|O_{A_{n}}((I_{\alpha},J_{\alpha}))|=|O_{S_{n}}((I_{\pi},J_{\pi}))|\). Consequently, the \(S_{n}\) orbit \(O_{S_{n}}((I_{\pi},J_{\pi}))\) does not split. 

As a result, we immediately obtain the following two theorems:

**Theorem 6.2**.: _Let \(k,l\in\mathbb{Z}_{\geq 0}\) and \(n\in\mathbb{Z}_{\geq 1}\)._

_If \(\pi\) is a set partition in \(\Pi_{l+k,n}\) having \(n-2\) blocks or fewer, then \(\pi\) corresponds bijectively to a basis element of \(\operatorname{Hom}_{A_{n}}((\mathbb{R}^{n})^{\otimes k},(\mathbb{R}^{n})^{ \otimes l})\),_

_Otherwise, \(\pi\) corresponds to two basis elements of \(\operatorname{Hom}_{A_{n}}((\mathbb{R}^{n})^{\otimes k},(\mathbb{R}^{n})^{ \otimes l})\)._

**Theorem 6.3**.: _For \(k,l\in\mathbb{Z}_{\geq 0},n\in\mathbb{Z}_{\geq 1}\), the dimension of \(\operatorname{Hom}_{A_{n}}((\mathbb{R}^{n})^{\otimes k},(\mathbb{R}^{n})^{ \otimes l})\) is equal to_

\[\sum_{t=1}^{n-2}\genfrac{\{}{\}}{0.0pt}{}{l+k}{t}+2\genfrac{\{}{\}}{0.0pt}{}{ l+k}{n-1}+2\genfrac{\{}{\}}{0.0pt}{}{l+k}{n} \tag{25}\]

In other words, Theorem 6.2 tells us that finding a basis of \(\operatorname{Hom}_{A_{n}}((\mathbb{R}^{n})^{\otimes k},(\mathbb{R}^{n})^{ \otimes l})\) in the standard basis of \(\mathbb{R}^{n}\) is very similar to finding a basis of \(\operatorname{Hom}_{S_{n}}((\mathbb{R}^{n})^{\otimes k},(\mathbb{R}^{n})^{ \otimes l})\) in the standard basis of \(\mathbb{R}^{n}\), since finding the basis amounts once again to considering all of the set partitions of \([l+k]\) having at most \(n\) blocks.

Indeed, if a set partition \(\pi\) in \(\Pi_{l+k,n}\) has at most \(n-2\) blocks, then we see that \(X_{\pi}\) given in (20) is a basis element of \(\operatorname{Hom}_{A_{n}}((\mathbb{R}^{n})^{\otimes k},(\mathbb{R}^{n})^{ \otimes l})\) since, in this case, \(O_{S_{n}}((I_{\pi},J_{\pi}))=O_{A_{n}}((I_{\pi},J_{\pi}))\), by Theorem 6.1.

The question remains as to how to take a set partition \(\pi\) in \(\Pi_{l+k,n}\) having either \(n-1\) or \(n\) blocks and use it to obtain the two basis elements of \(\operatorname{Hom}_{A_{n}}((\mathbb{R}^{n})^{\otimes k},(\mathbb{R}^{n})^{ \otimes l})\) that it corresponds to. Said differently, we would like to take such a set partition \(\pi\) and identify the two \(A_{n}\) orbits that its corresponding \(S_{n}\) orbit on \([n]^{l+k}\), \(O_{S_{n}}((I_{\pi},J_{\pi}))\), splits into.

### Enter: the Jellyfish

Comes (2020) originally came up with the idea of using _jellyfish_ to identify the two \(A_{n}\) orbits; here, however, our choice of exposition is rather different and our proofs are simpler than those given in their paper.

We begin by defining the following map.

**Definition 6.4**.: For \(n\in\mathbb{Z}_{\geq 1}\), we define the determinant map

\[\det:(\mathbb{R}^{n})^{\otimes n}\to\mathbb{R} \tag{26}\]

on the standard basis of \((\mathbb{R}^{n})^{\otimes n}\) by

\[e_{I}=e_{i_{1}}\otimes\cdots\otimes e_{i_{n}}\mapsto\left|e_{i_{1}}\quad \ldots\quad e_{i_{n}}\right| \tag{27}\]

and extend linearly, where the RHS of (27) is the determinant of an \(n\times n\) matrix.

**Lemma 6.5**.: _The determinant map is an element of \(\operatorname{Hom}_{A_{n}}((\mathbb{R}^{n})^{\otimes n},(\mathbb{R}^{n})^{ \otimes 0})\), but it is not an element of \(\operatorname{Hom}_{S_{n}}((\mathbb{R}^{n})^{\otimes n},(\mathbb{R}^{n})^{ \otimes 0})\)._

Proof.: It is clear that the determinant map is a linear map.

Then, for any \(\sigma\in S_{n}\), we have that

\[\det(\rho_{n}(\sigma)[e_{I}])=(-1)^{\operatorname{sgn}(\sigma)}\det(e_{I}) \tag{28}\]

since a transposition in \(S_{n}\) corresponds to swapping two columns of the \(n\times n\) matrix.

As \(\operatorname{sgn}(\sigma)=1\) for all \(\sigma\in A_{n}\), (28) shows that \(\det\) is an element of \(\operatorname{Hom}_{A_{n}}((\mathbb{R}^{n})^{\otimes n},(\mathbb{R}^{n})^{ \otimes 0})\). It is enough to see that for any odd permutation in \(S_{n}\), (28) implies that \(\det\) is not an element of \(\operatorname{Hom}_{S_{n}}((\mathbb{R}^{n})^{\otimes n},(\mathbb{R}^{n})^{ \otimes 0})\). 

For each \(n\in\mathbb{Z}_{\geq 1}\), we represent the determinant map by a diagram that has a single row of \(n\) vertices, each of which is attached to a blue head. We will call this diagram a _jellyfish_, for obvious reasons.

For example, if \(n=3\), the jellyfish has the form

_Remark 6.6_.: It is important to highlight that the determinant map (26) is different from the determinant operator on an \(n\times n\) matrix. In particular, the determinant map is a linear map on \((\mathbb{R}^{n})^{\otimes n}\) whereas the determinant operator on \(n\times n\) matrices is not linear.

We introduce the following useful lemma.

**Lemma 6.7**.: _The determinant map applied to a standard basis vector of \((\mathbb{R}^{n})^{\otimes n}\) gives either \(-1,0\) or \(+1\)._
Proof.: Let \(e_{I}=e_{i_{1}}\otimes\cdots\otimes e_{i_{n}}\) be a standard basis vector of \((\mathbb{R}^{n})^{\otimes n}\).

If \(i_{x}=i_{y}\) for some \(1\leq x\neq y\leq n\), then \(\det(e_{I})=0\) since two columns in the \(n\times n\) matrix will be the same. Otherwise, \(\{i_{1},\ldots,i_{n}\}\) is some permutation of \([n]\). Defining \(e_{[n]}\coloneqq e_{1}\otimes\cdots\otimes e_{n}\), we know that \(\det(e_{[n]})=+1\). Since, in this case, \(e_{I}=\rho_{n}(\sigma)e_{[n]}\) for some \(\sigma\in S_{n}\), we can use (28) to calculate \(\det(e_{I})\), giving a result of \(\pm 1\). 

_Remark 6.8_.: We can view Lemma 6.7 in another way; namely, that the determinant map splits basis vectors of \((\mathbb{R}^{n})^{\otimes n}\) into disjoint classes. Let us call these classes \(-1,0\) and \(+1\).

Consequently, Remark 6.8 suggests that the determinant map is a possible candidate function for identifying the \(A_{n}\) orbits that the \(S_{n}\) orbit \(O_{S_{n}}((I_{\pi},J_{\pi}))\) splits into, where \(\pi\) is a set partition in \(\Pi_{l+k,n}\) having either \(n-1\) or \(n\) blocks.

However, since the determinant map is a map \((\mathbb{R}^{n})^{\otimes n}\to\mathbb{R}\), and the elements of \(O_{S_{n}}((I_{\pi},J_{\pi}))\) are elements of \([n]^{l+k}\), to use the determinant map to try to identify the \(A_{n}\) orbits in \(O_{S_{n}}((I_{\pi},J_{\pi}))\), it would be useful to create a map \(g_{\pi}:(\mathbb{R}^{n})^{\otimes l+k}\to(\mathbb{R}^{n})^{\otimes n}\) that corresponds bijectively with the set partition \(\pi\), since such a map would project standard basis elements of \((\mathbb{R}^{n})^{\otimes l+k}\) onto, at the very least, a linear combination of basis elements of \((\mathbb{R}^{n})^{\otimes n}\). We could then use the splitting property of the determinant map on such linear combinations to try to split the elements of \(O_{S_{n}}((I_{\pi},J_{\pi}))\) into different classes. However, in order to use the three classes given in Remark 6.8, we cannot choose any map \((\mathbb{R}^{n})^{\otimes l+k}\to(\mathbb{R}^{n})^{\otimes n}\). We will see that with a clever choice of \(g_{\pi}\), the determinant map then splits the elements of \(O_{S_{n}}((I_{\pi},J_{\pi}))\) into the \(\pm 1\) classes and sends all other elements of \([n]^{l+k}\) to the \(0\) class.

We create \(g_{\pi}\) as follows. Flatten the diagram \(d_{\pi}\) that corresponds to \(\pi\). Add a new top row of \(n\) nodes above the row of \(l+k\) vertices. From the bottom row, take the lowest numbered vertex in block \(i\) of \(\pi\), \(1\leq i\leq t\), where \(t=n-1\) or \(n\), and connect that vertex to vertex \(i\) in the top row. Call this new diagram \(b_{\pi}\).

We claim the following:

**Proposition 6.9**.: _The diagram \(b_{\pi}\) corresponds bijectively with a basis element of \(\operatorname{Hom}_{S_{n}}((\mathbb{R}^{n})^{\otimes l+k},(\mathbb{R}^{n})^{ \otimes n})\). Consequently, we define \(g_{\pi}\) to be this basis element._

Proof.: It is clear that the diagram \(b_{\pi}\) corresponds to a set partition of \([n+l+k]\) having exactly \(n\) blocks. Hence this set partition is an element of \(\Pi_{n+l+k,n}\). Since each set partition in \(\Pi_{n+l+k,n}\) corresponds bijectively with a basis element of \(\operatorname{Hom}_{S_{n}}((\mathbb{R}^{n})^{\otimes l+k},(\mathbb{R}^{n})^{ \otimes n})\), by Theorem 5.2, we obtain the result. 

The following result is immediate from the construction of the diagram \(b_{\pi}\).

**Proposition 6.10**.: _In the standard basis of matrix units of \(\operatorname{Hom}((\mathbb{R}^{n})^{\otimes l+k},(\mathbb{R}^{n})^{\otimes n})\), \(g_{\pi}\) is given by_

\[g_{\pi}\coloneqq\sum_{(K,I,J)\in O_{S_{n}}((K_{\pi},I_{\pi},J_{\pi}))}E_{K,(I,J)} \tag{29}\]

_where_

\[K_{\pi}\coloneqq(1,2,\ldots,n) \tag{30}\]

_and \(O_{S_{n}}((K_{\pi},I_{\pi},J_{\pi}))\) is defined to be_

\[\left\{(K,I,J)\left.\begin{array}{l}(I,J)\in O_{S_{n}}((I_{\pi},J_{\pi}))\\ \text{and if }(I,J)=\sigma(I_{\pi},J_{\pi}),\\ \text{then }K\coloneqq\sigma(K_{\pi})\end{array}\right\} \tag{31}\]

In order to see that \(g_{\pi}\) has the properties that we need, we first define the following map.

**Definition 6.11**.: Let \(\pi\) be a set partition in \(\Pi_{l+k,n}\) having either \(n-1\) or \(n\) blocks. Then we define \(f_{\pi}\coloneqq\det\circ g_{\pi}:(\mathbb{R}^{n})^{\otimes l+k}\to\mathbb{R}\). Clearly, \(f_{\pi}\) corresponds bijectively with the set partition \(\pi\).

We can associate to \(f_{\pi}\) a diagram that is built from the composition of \(b_{\pi}\) (which corresponds to the map \(g_{\pi}\)) and a jellyfish (which corresponds to the determinant map).

For example, the diagram that is associated to \(f_{\pi}\) for the set partition \(\pi\) whose diagram \(d_{\pi}\) is given in Figure 1, where we choose \(l=3\), \(k=5\) and \(n=5\), is

**Proposition 6.12**.: _The map \(f_{\pi}\) is an element of \(\operatorname{Hom}_{A_{n}}((\mathbb{R}^{n})^{\otimes l+k},(\mathbb{R}^{n})^{ \otimes 0})\)._

Proof.: Let \(e_{(I,J)}\) be any standard basis vector in \((\mathbb{R}^{n})^{\otimes l+k}\), where \(I\in[n]^{l},J\in[n]^{k}\).

Then, for all \(\sigma\in A_{n}\), we have that

\[f_{\pi}(\rho_{l+k}(\sigma)[e_{(I,J)}]) =\det\circ g_{\pi}(\rho_{l+k}(\sigma)[e_{(I,J)}]) \tag{32}\] \[=\det(\rho_{n}(\sigma)[g_{\pi}(e_{(I,J)})])\] (33) \[=\det(g_{\pi}(e_{(I,J)}))\] (34) \[=f_{\pi}(e_{(I,J)}) \tag{35}\]

where, in (33), we have used Proposition 6.9 and in (34), we have used (28).
We come to the crucial result for our purposes.

**Theorem 6.13**.: _Let \(e_{(I,J)}\) be any standard basis vector in \((\mathbb{R}^{n})^{\otimes l+k}\), where \(I\in[n]^{l},J\in[n]^{k}\)._

_Then_

\[f_{\pi}:e_{(I,J)}\to\begin{cases}\pm 1&\text{if }(I,J)\in O_{S_{n}}((I_{\pi},J_{ \pi}))\\ 0&\text{otherwise}\end{cases} \tag{36}\]

Proof.: For any standard basis vector \(e_{(I,J)}\) in \((\mathbb{R}^{n})^{\otimes l+k}\), we have, on a matrix unit of \(\operatorname{Hom}((\mathbb{R}^{n})^{\otimes l+k},(\mathbb{R}^{n})^{\otimes n})\), that

\[E_{K,(L,M)}e_{(I,J)}=\delta_{((L,M),(I,J))}e_{K} \tag{37}\]

where \(e_{K}\) is a standard basis vector in \((\mathbb{R}^{n})^{\otimes n}\).

Hence, by (29), we see that, for the otherwise case, \(g_{\pi}(e_{(I,J)})=0\), and so \(f_{\pi}(e_{(I,J)})=0\).

If \((I,J)\in O_{S_{n}}((I_{\pi},J_{\pi}))\), then we have that \((I,J)=\sigma(I_{\pi},J_{\pi})\) for some \(\sigma\in S_{n}\).

Hence, by (29), (37) and the definition of \(O_{S_{n}}((K_{\pi},I_{\pi},J_{\pi}))\) given in (31), we see that \(g_{\pi}(e_{(I,J)})=e_{K}\), where \(K=\sigma(K_{\pi})\).

Since \(K\) is a permutation of \([n]\), we can apply Lemma 6.7 to get that \(f_{\pi}(e_{(I,J)})=\det(e_{K})=\pm 1\). 

Consequently, we can define the following two sets:

\[O_{\pi}^{+}\coloneqq\{(I,J)\in O_{S_{n}}((I_{\pi},J_{\pi}))\mid f_{\pi}(e_{(I,J)})=+1\} \tag{38}\]

and

\[O_{\pi}^{-}\coloneqq\{(I,J)\in O_{S_{n}}((I_{\pi},J_{\pi}))\mid f_{\pi}(e_{(I,J)})=-1\} \tag{39}\]

We claim the following result.

**Theorem 6.14**.: \(O_{\pi}^{+}\) _and \(O_{\pi}^{-}\) are the two \(A_{n}\) orbits that \(O_{S_{n}}((I_{\pi},J_{\pi}))\) splits into._

Proof.: It is enough to show that if \((I,J)\in O_{\pi}^{+}\), then \(\sigma(I,J)\in O_{\pi}^{+}\) for all \(\sigma\in A_{n}\), and if \((I,J)\in O_{\pi}^{-}\), then \(\sigma(I,J)\in O_{\pi}^{-}\) for all \(\sigma\in A_{n}\), where the action of \(\sigma\) on the pair \((I,J)\) is given in (16). Indeed, by Proposition 6.12, we have that

\[f_{\pi}(e_{\sigma(I,J)})=f_{\pi}(\rho_{l+k}(\sigma)[e_{(I,J)}])=f_{\pi}(e_{(I,J)}) \tag{40}\]

Applying Theorem 6.13 gives the result. 

Relabelling \(O_{\pi}^{+}\) as \(O_{A_{n}}((I_{\pi}^{+},J_{\pi}^{+}))\), and \(O_{\pi}^{-}\) as \(O_{A_{n}}((I_{\pi}^{-},J_{\pi}^{-}))\), we obtain the two basis elements of \(\operatorname{Hom}_{A_{n}}((\mathbb{R}^{n})^{\otimes k},(\mathbb{R}^{n})^{ \otimes l})\) from the one set partition \(\pi\in\Pi_{l+k,n}\) that has either \(n-1\) or \(n\) blocks, namely

\[X_{\pi}^{+}\coloneqq\sum_{(I,J)\in O_{A_{n}}((I_{\pi}^{+},J_{\pi}^{+}))}E_{I,J} \tag{41}\]

and

\[X_{\pi}^{-}\coloneqq\sum_{(I,J)\in O_{A_{n}}((I_{\pi}^{-},J_{\pi}^{-}))}E_{I,J} \tag{42}\]

We summarise the above results into the following theorem.

**Theorem 6.15**.: _For \(l,k\in\mathbb{Z}_{\geq 0},n\in\mathbb{Z}_{\geq 1}\), the union of the two sets_

\[\{X_{\pi}\mid\pi\in\Pi_{l+k,n-2}\} \tag{43}\]

\[\{X_{\pi}^{+},X_{\pi}^{-}\mid\pi\in\Pi_{l+k,n}\setminus\Pi_{l+k,n-2}\} \tag{44}\]

_forms a basis of \(\operatorname{Hom}_{A_{n}}((\mathbb{R}^{n})^{\otimes k},(\mathbb{R}^{n})^{ \otimes l})\). Its dimension is given in Theorem 6.3._

## 7 Adding Features and Biases

### Features

We have assumed throughout that the feature dimension for all of the layers appearing in the neural network is one. We can adapt all of the results that have been shown for the case where the feature dimension of the layers is greater than one.

Suppose that an \(r\)-order tensor has a feature space of dimension \(d_{r}\). We now wish to find a basis for

\[\operatorname{Hom}_{A_{n}}((\mathbb{R}^{n})^{\otimes k}\otimes\mathbb{R}^{d_{k} },(\mathbb{R}^{n})^{\otimes l}\otimes\mathbb{R}^{d_{l}}) \tag{45}\]

in the standard basis of \(\mathbb{R}^{n}\).

Such a basis can be found by making the following substitutions, where now \(i\in[d_{l}],j\in[d_{k}]\):

* replace \(E_{I,J}\) by \(E_{I,i,J,j}\) in (20), (41), and (42)
* relabel \(X_{\pi}\) by \(X_{\pi,i,j}\), \(X_{\pi}^{+}\) by \(X_{\pi,i,j}^{+}\), and \(X_{\pi}^{-}\) by \(X_{\pi,i,j}^{-}\).

Consequently, a basis for (45) in the standard basis of \(\mathbb{R}^{n}\) is given by the union of the two sets

\[\{X_{\pi,i,j}\mid\pi\in\Pi_{l+k,n-2},i\in[d_{l}],j\in[d_{k}]\} \tag{46}\]

\[\left\{X_{\pi,i,j}^{+},X_{\pi,i,j}^{-}\ \middle|\ \begin{array}{l}\pi\in\Pi_{l+k,n} \setminus\Pi_{l+k,n-2},\\ i\in[d_{l}],j\in[d_{k}]\end{array}\right.\right\} \tag{47}\]

### Biases

Including bias terms in the layer functions of a \(A_{n}\)-equivariant neural network is harder, but it can be done. For the learnable linear layers of the form \(\operatorname{Hom}_{A_{n}}((\mathbb{R}^{n})^{\otimes k},(\mathbb{R}^{n})^{ \otimes l})\), Pearce-Crump (2022a) shows that the \(A_{n}\)-equivariance of the bias function, \(\beta:((\mathbb{R}^{n})^{\otimes k},\rho_{k})\to((\mathbb{R}^{n})^{\otimes l}, \rho_{l})\), needs to satisfy

\[c=\rho_{l}(g)c \tag{48}\]
for all \(g\in A_{n}\) and \(c\in(\mathbb{R}^{n})^{\otimes l}\).

Since any \(c\in(\mathbb{R}^{n})^{\otimes l}\) satisfying (48) can be viewed as an element of \(\operatorname{Hom}_{A_{n}}(\mathbb{R},(\mathbb{R}^{n})^{\otimes l})\), to find the matrix form of \(c\), all we need to do is to find a basis for \(\operatorname{Hom}_{A_{n}}(\mathbb{R},(\mathbb{R}^{n})^{\otimes l})\).

But this is simply a matter of applying Theorem 6.15, setting \(k=0\).

## 8 Equivariance to Local Symmetries

We can extend our results to looking at linear layer functions that are equivariant to a direct product of alternating groups; that is, we can construct neural networks that are equivariant to local symmetries.

Specifically, we wish to find a basis for

\[\operatorname{Hom}_{A_{n_{1}}\times\cdots\times A_{n_{p}}}(V,W) \tag{49}\]

where

\[V\coloneqq(\mathbb{R}^{n_{1}})^{\otimes k_{1}}\boxtimes\cdots\boxtimes( \mathbb{R}^{n_{p}})^{\otimes k_{p}} \tag{50}\]

\[W\coloneqq(\mathbb{R}^{n_{1}})^{\otimes l_{1}}\boxtimes\cdots\boxtimes( \mathbb{R}^{n_{p}})^{\otimes l_{p}} \tag{51}\]

and \(\boxtimes\) is the external tensor product.

The \(\operatorname{Hom}\)-space given in (49) is isomorphic to

\[\bigotimes_{r=1}^{p}\operatorname{Hom}_{A_{n_{r}}}((\mathbb{R}^{n_{r}})^{ \otimes k_{r}},(\mathbb{R}^{n_{r}})^{\otimes l_{r}}) \tag{52}\]

As Theorem 6.15 gives a basis for each individual \(\operatorname{Hom}\)-space in (52), we can obtain a basis for the overall \(\operatorname{Hom}\)-space (49) by forming all possible \(p\)-length Kronecker products of basis elements in the standard way for tensor product spaces.

## 9 Related Work

The theory for the alternating group has its roots in the theory for the symmetric group and its links to the partition algebra. Jones (1994) constructed a surjective algebra homomorphism between the partition algebra \(P_{k}(n)\) and the centraliser algebra of the symmetric group, \(\operatorname{End}_{S_{n}}((\mathbb{R}^{n})^{\otimes k})\). Most notably, Benkart and Halverson went on to develop much of the theory for the duality between the symmetric group and the partition algebra in a number of important papers (2017, 2019a, 2019b). Bloss (2005) used the result of Jones (1994) to study the centralizer algebra of the alternating group, \(\operatorname{End}_{A_{n}}((\mathbb{R}^{n})^{\otimes k})\). He showed that the partition algebra \(P_{k}(n)\), which has a basis consisting of set partition diagrams having two rows of \(k\) vertices, is isomorphic to the centralizer algebra when \(n\geq 2k+2\). He also highlighted the difficulty of finding a diagrammatic approach for characterising \(\operatorname{End}_{A_{n}}((\mathbb{R}^{n})^{\otimes k})\) in the remaining cases since he recognised that the \(S_{n}\) orbits that correspond bijectively with the set partition diagrams split in these cases. Comes (2020) solved this problem and extended it to all \(\operatorname{Hom}\)-spaces \(\operatorname{Hom}_{A_{n}}((\mathbb{R}^{n})^{\otimes k},(\mathbb{R}^{n})^{ \otimes l})\), developing much of the theory in the process. In particular, he came up with the idea of using the determinant map to show how the \(S_{n}\) orbits split, and introduced jellyfish to represent this map in its diagrammatic form.

Finding the form of neural networks that are equivariant to a particular group has become an important area of research. Zaheer et al. (2017) introduced the first permutation equivariant neural network, called Deep Sets, for learning from sets in a permutation equivariant manner. Maron et al. (2019) were the first to study the problem of classifying all of the linear permutation equivariant and invariant neural network layers, with their motivation coming from learning relations between the nodes of graphs. They characterised all of the learnable, linear, permutation equivariant layer functions in \(\operatorname{Hom}_{S_{n}}((\mathbb{R}^{n})^{\otimes k},(\mathbb{R}^{n})^{ \otimes l})\) in the practical cases (specifically, when \(n\geq k+l\)). They used some equalities involving Kronecker products to find a number of fixed point equations which they solved to find a basis, in tensor form, for the layer functions under consideration.

As discussed in the Introduction, the approach taken in this paper to characterise all of the learnable, linear, equivariant layer functions in \(\operatorname{Hom}_{A_{n}}((\mathbb{R}^{n})^{\otimes k},(\mathbb{R}^{n})^{ \otimes l})\) is similar to the one seen in the papers written by Pearce-Crump (2022a, 2022b). They used various sets of set partition diagrams to characterise all of the learnable, linear, equivariant layer functions in \(\operatorname{Hom}_{G}((\mathbb{R}^{n})^{\otimes k},(\mathbb{R}^{n})^{ \otimes l})\) when \(G\) is any of the following groups: the symmetric group \(S_{n}\), the orthogonal group \(O(n)\), the symplectic group \(Sp(n)\), and the special orthogonal group \(SO(n)\).

## 10 Conclusion

We are the first to show how the combinatorics underlying set partition diagrams, together with some jellyfish representing the determinant map, provides the theoretical background for constructing neural networks that are equivariant to the alternating group when the layers are some tensor power of \(\mathbb{R}^{n}\). We looked at the problem of calculating the form of the learnable, linear, \(A_{n}\)-equivariant layer functions between such tensor power spaces in the standard basis of \(\mathbb{R}^{n}\). We achieved this by finding a basis for the \(\operatorname{Hom}\)-spaces in which these layer functions live. In particular, we showed how set partition diagrams correspond to a number of basis elements, and we used jellyfish to identify the individual basis elements when a set partition diagram corresponded to more than one basis element. In doing so, we calculated the number of weights that appear in these layer functions. We also generalised our approach to show
how to construct neural networks that are equivariant to local symmetries.

## Acknowledgements

The author would like to thank his PhD supervisor Professor William J. Knottenbelt for being generous with his time throughout the author's period of research prior to the publication of this paper.

This work was funded by the Doctoral Scholarship for Applied Research which was awarded to the author under Imperial College London's Department of Computing Applied Research scheme. This work will form part of the author's PhD thesis at Imperial College London.
