We present a novel application of category theory for deep learning.
We show how category theory can be used
to understand and work with the linear layer functions of group equivariant neural networks whose layers are some tensor power space of $\mathbb{R}^{n}$ for the groups $S_n$, $O(n)$, $Sp(n)$, and $SO(n)$.
By using category theoretic constructions, we build a richer structure that is not seen in the original formulation of these neural networks, leading to new insights.
In particular, we outline the development of an algorithm for quickly computing the result of a vector
that is
passed through an equivariant, linear layer for each group in question.
The success of our approach suggests that category theory could be beneficial for other areas of deep learning.

§ INTRODUCTION

Despite the numerous advances that have been made in many areas of deep learning, it is well known that the field is lacking a rigourous theoretical framework to support the applications that are being developed.
Practitioners typically spend a significant amount of time and effort searching for a neural network architecture that works well for the problem that they wish to solve.
The architectures are often designed using heuristics that have been shown to work well in practice, despite them being poorly understood in theory.
Notably, small modifications to the architecture can often result in a significant reduction in performance.

It has only become apparent very recently to researchers in the deep learning community that there is potential for category theory to provide a new set of tools for developing the theory of deep learning.

The hope is that category theory will provide the rigourous theoretical framework in which all existing and future results can be placed.

Category theory is based on the core concept of compositionality; that complex systems can be built out of smaller parts, and that the entire system can be understood by studying these smaller parts.
Category theory was first used in pure mathematics in the 1940s
as a way of establishing a higher-level structure for understanding a number of algebraic objects (sets, vector spaces, topological spaces etc.) and their maps (functions, linear maps, continuous maps etc.) that shared similar characteristics.
It has since been applied successfully to many other disciplines of science, such as physics, chemistry and computer science.
Given that many deep learning architectures share similar characteristics,
in that they are typically built out of layers and maps between these layers, it is no surprise that deep learning researchers are looking to
category theory to achieve a similar outcome for their own field.

In this paper, we present a novel application of category theory for deep learning.
We show that a number of group equivariant neural networks
– for the groups $S_n$, $O(n)$, $Sp(n)$ and $SO(n)$ –
whose layers are some tensor power of $\mathbb{R}^{n}$
that have recently appeared in the literature
([Maron et al., 2019, Pearce-Crump, 2022, Pearce-Crump, 2022, Godfrey et al., 2023])
can be understood in category theoretic terms.
We call this the "Categorification of Group Equivariant Neural Networks" because, in proving this result, we replace a number of set-theoretic constructions with category theoretic notions
that results in a deeper structure for understanding and working with the layer functions of the neural networks themselves.
We wish to emphasise that the outcome of this process is not simply a case of
rewriting the existing results in a different language,
but that, crucially, we

obtain new insights into these neural networks

from the richer structure that is established.

One particularly important consequence that we show is that any of the weight matrices that appear in the neural networks in question can be understood solely by using a certain type of combinatorial diagram that has a string-like quality to it.
By pulling on the strings or dragging their ends to different locations, we can use category theory to obtain new results for these group equivariant neural networks.

We describe a very powerful example of this idea, where the properties of the categorification

lead to a recovery of the algorithm
– using a very different method –
proposed by [Godfrey et al., 2023]
for computing the result of a vector that is passed through a symmetric group equivariant linear layer.

We suggest that our approach can be adapted to obtain an algorithm for computing the same procedure for the other groups mentioned in this paper; this result will appear in another paper by the same authors.

§ PRELIMINARIES

Examples of $(6,4)$–partition diagrams. b) is also a $(6,4)$–Brauer diagram, and c) is also a $10 \backslash 6$–diagram.

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, \dots, n\}$.

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

\begin{equation} \label{grouprephom}
\rho_V : G \rightarrow GL(V)
\end{equation}

Furthermore, recall that a map $\phi : V \rightarrow W$ between two representations of $G$ is said to be $G$-equivariant if, for all $g \in G$ and $v \in V$,

\begin{equation} \label{Gequivmapdefn}
\phi(\rho_{V}(g)[v]) = \rho_{W}(g)[\phi(v)]
\end{equation}

We denote the set of all linear $G$-equivariant maps between $V$ and $W$ by $\Hom_{G}(V,W)$.

It can be shown that $\Hom_{G}(V,W)$ is a vector space over $\mathbb{R}$.

See [Segal, 2014] for more details.

§.§ Tensor Power Spaces as Group Representations

The groups of interest, namely, $S_n$, $O(n)$, $Sp(n)$, and $SO(n)$,
can all be viewed as subgroups of $GL(n)$. We use the symbol $G$ to refer to any of these groups in the following.
Recall that $\mathbb{R}^{n}$ has a standard basis that is given by $\{e_i \mid i \in [n]\}$, where $e_i$ has a $1$ in the $i^{\text{th}}$ position and is $0$ otherwise.

(Note that if $G = Sp(n)$, then $n = 2m$, and we label the indices by
$1, 1', \dots, m, m'$
and call the standard basis of $\mathbb{R}^{n}$ the symplectic basis.)

There exists a (left) action of $G$ on $\mathbb{R}^{n}$ that is given by left multiplication on the standard basis, which can be extended linearly to obtain a representation $G \rightarrow GL(\mathbb{R}^n)$.

since the elements

\begin{equation} \label{tensorelementfirst}
e_I \coloneqq e_{i_1} \otimes e_{i_2} \otimes \dots \otimes e_{i_k}
\end{equation}

for all $I \coloneqq (i_1, i_2, \dots, i_k) \in [n]^k$ form a basis of
$(\mathbb{R}^{n})^{\otimes k}$,
the $k$–tensor power space of $\mathbb{R}^{n}$,
there also exists a (left) action of $G$ on $(\mathbb{R}^{n})^{\otimes k}$ that is given by

\begin{equation}
g \cdot e_I \coloneqq ge_{i_1} \otimes ge_{i_2} \otimes \dots \otimes ge_{i_k}
\end{equation}

Again, this action can be extended linearly to obtain a representation $\rho_k: G \rightarrow GL((\mathbb{R}^n)^{\otimes k})$.

We are interested in the space of $G$–equivariant linear maps
between any two tensor power spaces of $\mathbb{R}^{n}$,
$\Hom_G((\mathbb{R}^{n})^{\otimes k}, (\mathbb{R}^{n})^{\otimes l})$,
since these maps are the linear layer functions in the group equivariant neural networks of interest.

§.§ Set Partition Diagrams

[Pearce-Crump, 2022, Pearce-Crump, 2022] showed that, for the groups $G$ in question,
$\Hom_G((\mathbb{R}^{n})^{\otimes k}, (\mathbb{R}^{n})^{\otimes l})$
can be constructed from certain set partitions of $[l+k]$, and in particular, from their corresponding set partition diagrams. We review these constructions below.

For $l, k \in \mathbb{Z}_{\geq 0}$, consider the set
$[l+k] \coloneqq \{1, \dots, 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.

Let $\Pi_{l+k}$ be the set of all set partitions of $[l+k]$.

Then, for each set partition $\pi$ in $\Pi_{l+k}$, we can associate to it a diagram $d_\pi$,
called a $(k,l)$–partition diagram,
consisting of two
rows of vertices and edges between vertices such that there are

* $l$ vertices on the top row, labelled left to right by $1, \dots, l$

* $k$ vertices on the bottom row, labelled left to right by $l+1, \dots, l+k$, and

* the edges between the vertices correspond to the connected components of $\pi$.

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

There are special types of $(k,l)$–partition diagrams that we are interested in, namely:

* A $(k,l)$–Brauer diagram $d_\beta$ is a $(k,l)$–partition diagram where the size of every block in $\beta$ is exactly two.

* Given $k$ and $l$, an $(l+k)\backslash n$–diagram $d_\alpha$ is a $(k,l)$–partition diagram where exactly $n$ blocks in $\alpha$ have size one, with the rest having exactly size two. The vertices corresponding to the blocks of size one are called free vertices.

We give examples of these diagrams in Figure <ref>.

We can form a number of vector spaces as the $\mathbb{R}$-linear span of certain subsets of $(k,l)$–partition diagrams, as follows:

* The partition space $P_k^l(n)$ is defined to be the $\mathbb{R}$-linear span of the set of all $(k,l)$–partition diagrams.

* The Brauer space $B_k^l(n)$ is defined to be the $\mathbb{R}$-linear span of the set of all $(k,l)$–Brauer diagrams.

* The Brauer–Grood space $D_k^l(n)$ is defined to be the $\mathbb{R}$-linear span of the set of all $(k,l)$–Brauer diagrams together with the set of all $(l+k)\backslash n$–diagrams.

Furthermore, we can define two $\mathbb{R}$-bilinear operations on $(k,l)$–partition diagrams

\begin{align}
\text{composition:   } & \bullet: P_l^m(n) \times P_k^l(n) \rightarrow P_k^m(n) \label{composition} \\
\text{tensor product:   } & \otimes: P_k^l(n) \times P_q^m(n) \rightarrow P_{k+q}^{l+m}(n) \label{tensorprod}
\end{align}

as follows:

Composition: Let $d_{\pi_1} \in P_k^l(n)$ and $d_{\pi_2} \in P_l^m(n)$.
First, we concatenate the diagrams, written $d_{\pi_2} \circ d_{\pi_1}$, by putting $d_{\pi_1}$ below $d_{\pi_2}$, concatenating the edges in the middle row of vertices, and then removing all connected components that lie entirely in the middle row of the concatenated diagrams.
Let $c(d_{\pi_2}, d_{\pi_1})$ be the number of connected components that are removed from the middle row in $d_{\pi_2} \circ d_{\pi_1}$.

Then the composition is defined, using infix notation, as

\begin{equation}
d_{\pi_2} \bullet d_{\pi_1}
\coloneqq
n^{c(d_{\pi_2}, d_{\pi_1})} (d_{\pi_2} \circ d_{\pi_1})
\end{equation}

Tensor Product: Let $d_{\pi_1} \in P_k^l(n)$ and $d_{\pi_2} \in P_q^m(n)$. Then $d_{\pi_1} \otimes d_{\pi_2}$ is defined to be the $(k+q, l+m)$–partition diagram obtained by horizontally placing $d_{\pi_1}$ to the left of $d_{\pi_2}$ without any overlapping of vertices.

It is clear that both of these operations are associative.

The composition and tensor product operations for $B_k^l(n)$

are inherited from the composition and tensor product operations for $P_k^l(n)$, defined in
(<ref>) and (<ref>) respectively.

However, the composition and tensor product operations for $D_k^l(n)$ are rather more involved; full details of their formulation can be found in the Technical Appendix.

§.§ Group Equivariant Linear Layers

From the vector spaces defined in Section <ref>,

it is possible to obtain either a spanning set or a basis for
$\Hom_G((\mathbb{R}^{n})^{\otimes k}, (\mathbb{R}^{n})^{\otimes l})$.

We give the form of the
the spanning sets/bases, expressed in the basis of matrix units for
$\Hom((\mathbb{R}^{n})^{\otimes k}, (\mathbb{R}^{n})^{\otimes l})$,
in the Technical Appendix.
Here, we reproduce a number of results which describe the existence of a surjective map from each of the vector spaces defined in Section <ref> onto its corresponding vector space of $G$–equivariant linear maps, which arises from the spanning sets/bases.

For any $k, l \in \mathbb{Z}_{\geq 0}$ and any
$n \in \mathbb{Z}_{\geq 1}$, there is a surjection of vector spaces

\begin{equation} \label{surjectionSn}
\Theta_{k,n}^l : P_k^l(n) \rightarrow
\Hom_{S_n}((\mathbb{R}^{n})^{\otimes k}, (\mathbb{R}^{n})^{\otimes l})
\end{equation}

that is given by

\begin{equation}
d_\pi \mapsto E_\pi
\end{equation}

for all $(k,l)$–partition diagrams $d_\pi$, where $E_\pi$ is given in the Technical Appendix.

In particular, the set

\begin{equation} \label{klSnSpanningSet}
\{E_\pi \mid d_\pi \text{ is a } (k,l) \text{--partition diagram having at most } n \text{ blocks} \}
\end{equation}

is a basis for
$\Hom_{S_n}((\mathbb{R}^{n})^{\otimes k}, (\mathbb{R}^{n})^{\otimes l})$
in the standard basis of $\mathbb{R}^{n}$,
of size $\Bell(l+k,n) \coloneqq
\sum_{t=1}^{n}
\begin{Bsmallmatrix}
\end{Bsmallmatrix}
$, where
\begin{Bsmallmatrix}
\end{Bsmallmatrix}
is the Stirling number of the second kind.

For any $k, l \in \mathbb{Z}_{\geq 0}$ and any
$n \in \mathbb{Z}_{\geq 1}$, there is a surjection of vector spaces

\begin{equation} \label{surjectionO(n)}
\Phi_{k,n}^l : B_k^l(n) \rightarrow
\Hom_{O(n)}((\mathbb{R}^{n})^{\otimes k}, (\mathbb{R}^{n})^{\otimes l})
\end{equation}

that is given by

\begin{equation}
d_\beta \mapsto E_\beta
\end{equation}

for all $(k,l)$–Brauer diagrams $d_\beta$, where $E_\beta$
is given in the Technical Appendix.

In particular, the set

\begin{equation} \label{klOnSpanningSet}
\{E_\beta \mid d_\beta \text{ is a } (k,l) \text{--Brauer diagram} \}
\end{equation}

is a spanning set for
$\Hom_{O(n)}((\mathbb{R}^{n})^{\otimes k}, (\mathbb{R}^{n})^{\otimes l})$
in the standard basis of $\mathbb{R}^{n}$,
of size $0$ when $l+k$ is odd, and of size $(l+k-1)!!$ when $l+k$ is even.

For any $k, l \in \mathbb{Z}_{\geq 0}$ and any
$n \in \mathbb{Z}_{\geq 2}$ such that $n = 2m$, there is a surjection of vector spaces

\begin{equation} \label{surjectionSp(n)}
X_{k,n}^l : B_k^l(n) \rightarrow
\Hom_{Sp(n)}((\mathbb{R}^{n})^{\otimes k}, (\mathbb{R}^{n})^{\otimes l})
\end{equation}

that is given by

\begin{equation}
d_\beta \mapsto F_\beta
\end{equation}

for all $(k,l)$–Brauer diagrams $d_\beta$, where $F_\beta$ is
given in the Technical Appendix.

In particular, the set

\begin{equation} \label{klSpnSpanningSet}
\{F_\beta \mid d_\beta \text{ is a } (k,l) \text{--Brauer diagram} \}
\end{equation}

is a spanning set for
$\Hom_{Sp(n)}((\mathbb{R}^{n})^{\otimes k}, (\mathbb{R}^{n})^{\otimes l})$, for $n = 2m$,
in the symplectic basis of $\mathbb{R}^{n}$,
of size $0$ when $l+k$ is odd, and of size $(l+k-1)!!$ when $l+k$ is even.

For any $k, l \in \mathbb{Z}_{\geq 0}$ and any $n \in \mathbb{Z}_{\geq 1}$, there is a surjection of vector spaces

\begin{equation} \label{surjectionSO(n)}
\Psi_{k,n}^l : D_k^l(n) \rightarrow
\Hom_{SO(n)}((\mathbb{R}^{n})^{\otimes k}, (\mathbb{R}^{n})^{\otimes l})
\end{equation}

that is given by

\begin{equation}
d_\beta \mapsto E_\beta
\end{equation}

if $d_\beta$ is a $(k,l)$–Brauer diagram, where $E_\beta$
is given in the Technical Appendix,
and by

\begin{equation} \label{surjdalpha}
d_\alpha \mapsto H_\alpha
\end{equation}

if $d_\alpha$ is a $(k+l)\backslash n$–diagram, where $H_\alpha$ is
is also given in the Technical Appendix

In particular, the set

\begin{equation} \label{SOn2SpanningSet}
\{E_\beta\}_{\beta}
%\mid \beta \text{ is a } (k,l) \text{--Brauer diagram} \}
\cup
\{H_\alpha\}_{\alpha}
%\mid \alpha \text{ is a } (k+l) \backslash n \text{--diagram} \}
\end{equation}

where $d_\beta$ is a $(k,l)$–Brauer diagram, and $d_\alpha$ is a $(l+k) \backslash n$–diagram,
is a spanning set for
$\Hom_{SO(n)}((\mathbb{R}^{n})^{\otimes k}, (\mathbb{R}^{n})^{\otimes l})$
in the standard basis of $\mathbb{R}^{n}$.

§ STRICT $\MATHBB{R}$–LINEAR MONOIDAL CATEGORIES AND STRING DIAGRAMS

We appreciate that the language of category theory is not commonplace in the machine learning literature. To aid the reader, we have provided some foundational material in the Technical Appendix.
Other good references are [Mac Lane, 1998, Kock, 2003, Turaev & Virelizier, 2017].

At a basic level, category theory is concerned with objects and the relationships between objects. These relationships are called morphisms.
A collection of objects and a collection of morphisms between objects (satisfying some additional conditions) form a category.
We can perform operations with morphisms, such as (vertically) composing them, to form new morphisms between objects.
Category theory makes it possible to abstract away specific details of structures, to focus instead on the relationships between them.
We are interested not only in the relationships within a category but also in how relationships are preserved across different categories. These are described by functors.

In this paper, we are interested in categories that have a specific property called monoidal, and the (monoidal) functors between these categories.
We will see in Section <ref> that it is this property that has important implications for the group equivariant neural networks that we look at in this paper.
The monoidal property gives additional structure to the way in which objects and morphisms can be related.
In particular, monoidal categories have an additional operation, known as a tensor product, that allows objects and morphisms to be composed in a different way, which we call horizontal.
Monoidal functors preserve the tensor product across monoidal categories.

We assume throughout that all categories are locally small; that is, that the collection of morphisms between any two objects is a set.
In fact, all of the categories that we consider in this paper have morphism sets that are vector spaces: in particular, the morphisms between objects become linear maps.
We follow the presentation given in
[Hu, 2019] and [Savage, 2021]

§.§ Strict $\mathbb{R}$–Linear Monoidal Categories

A category $\mathcal{C}$ is said to be strict monoidal if it comes with
a bifunctor $\otimes: \mathcal{C} \times \mathcal{C} \rightarrow \mathcal{C}$, called the tensor product, and
a unit object $\mathds{1}$,

such that, for all objects $X, Y, Z$ in $\mathcal{C}$, we have that

\begin{equation}
(X \otimes Y) \otimes Z = X \otimes (Y \otimes Z)
\end{equation}

\begin{equation}
(\mathds{1} \otimes X) = X = (X \otimes \mathds{1})
\end{equation}

and, for all morphisms $f, g, h$ in $\mathcal{C}$, we have that

\begin{equation} \label{assocbifunctor}
(f \otimes g) \otimes h = f \otimes (g \otimes h)
\end{equation}

\begin{equation}
(1_\mathds{1} \otimes f) = f = (f \otimes 1_\mathds{1})
\end{equation}

where $1_\mathds{1}$ is the identity morphism $\mathds{1} \rightarrow \mathds{1}$.

We can assume that all monoidal categories are strict (nonstrict monoidal categories would have isomorphisms in the place of the equalities given in Definition <ref>) owing to a technical result known as Mac Lane's Coherence Theorem. See [Mac Lane, 1998] for more details.

A category $\mathcal{C}$ is said to be $\mathbb{R}$–linear if,
for any two objects $X, Y$ in $\mathcal{C}$, the morphism space $\Hom_{\mathcal{C}}(X,Y)$ is a vector space over $\mathbb{R}$, and
the composition of morphisms is $\mathbb{R}$–bilinear.

Combining Definitions <ref>
and <ref>,
we get

A category $\mathcal{C}$ is said to be strict $\mathbb{R}$–linear monoidal if it is a category that is both strict monoidal and $\mathbb{R}$–linear, such that the bifunctor $\otimes$ is $\mathbb{R}$–bilinear.

Analogous to how there exists maps between sets, there exists "maps" between categories, known as functors.

In particular, we are interested in the following type of functors:

Suppose that
$(\mathcal{C}, \otimes_\mathcal{C}, \mathds{1}_\mathcal{C})$
$(\mathcal{D}, \otimes_\mathcal{D}, \mathds{1}_\mathcal{D})$
are two strict $\mathbb{R}$–linear monoidal categories.

A strict $\mathbb{R}$–linear monoidal functor from $\mathcal{C}$ to $\mathcal{D}$ is a functor $\mathcal{F}: \mathcal{C} \rightarrow \mathcal{D}$ such that

* for all objects $X, Y$ in $\mathcal{C}$,
$\mathcal{F}(X \otimes_\mathcal{C} Y) =
\mathcal{F}(X) \otimes_\mathcal{D} \mathcal{F}(Y)$

* for all morphisms $f, g$ in $\mathcal{C}$,
$\mathcal{F}(f \otimes_\mathcal{C} g) =
\mathcal{F}(f) \otimes_\mathcal{D} \mathcal{F}(g)$

* $\mathcal{F}(\mathds{1}_\mathcal{C}) = \mathds{1}_\mathcal{D}$, and

* for all objects $X, Y$ in $\mathcal{C}$, the map

\begin{equation} \label{maphomsets}
\Hom_{\mathcal{C}}(X,Y)
\rightarrow
\Hom_{\mathcal{D}}(\mathcal{F}(X),\mathcal{F}(Y))
\end{equation}

given by
$f \mapsto \mathcal{F}(f)$
is $\mathbb{R}$–linear.

The following definition will also prove to be very important in what follows.

Given any two (locally small) categories $\mathcal{C}$ and $\mathcal{D}$
(not necessarily strict $\mathbb{R}$–linear monoidal),
a functor $\mathcal{F}: \mathcal{C} \rightarrow \mathcal{D}$
is said to be full if the map (<ref>) is surjective for all objects $X, Y$ in $\mathcal{C}$.

§.§ String Diagrams

Strict monoidal categories are particularly interesting because they can be represented by a very useful diagrammatic language known as string diagrams.
As this language is, in some sense, geometric in nature,

we will see that it is much easier to work with these diagrams than with their equivalent

algebraic form.

Suppose that $\mathcal{C}$ is a strict monoidal category.
Let $W, X, Y$ and $Z$ be objects in $\mathcal{C}$, and let
$f: X \rightarrow Y$, $g: Y \rightarrow Z$, and $h: W \rightarrow Z$ be morphisms in $\mathcal{C}$.
Then we can represent the morphisms
$1_{X}: X \rightarrow X$,
$f: X \rightarrow Y$,
$g \circ f: X \rightarrow Z$ and
$f \otimes h: X \otimes W \rightarrow Y \otimes Z$
as diagrams in the following way:

\begin{equation}
\begin{aligned}
\scalebox{0.75}{\tikzfig{stringdiagrams}}
\end{aligned}
\end{equation}

In particular, the vertical composition of morphisms $g \circ f$ is obtained by placing $g$ above $f$, and the horizontal composition of morphisms $f \otimes h$ is obtained by horizontally placing $f$ to the left of $h$.

We will often omit the labelling of the objects when they are clear or when they are not important.

As an example of how useful string diagrams are when working with strict monoidal categories, the associativity of the bifunctor given in (<ref>) becomes immediately apparent.
Another, more involved, example is given by the interchange law that exists for any strict monoidal category. It can be expressed algebraically as

\begin{equation}
(\mathds{1} \otimes g) \circ (f \otimes \mathds{1})
f \otimes g
(f \otimes \mathds{1}) \circ (\mathds{1} \otimes g)
\end{equation}

Without string diagrams, it is somewhat tedious to prove this result – see <cit.> –
but with them, the result is intuitively obvious, if we allow ourselves to deform the diagrams by pulling on the strings:

\begin{equation}
\begin{aligned}
\scalebox{0.75}{\tikzfig{interchangelaw}}
\end{aligned}
\end{equation}

§ CATEGORIFICATION

At this point, we have defined a vector space for each $k, l \in \mathbb{Z}_{\geq 0}$ that is the $\mathbb{R}$–linear span of a certain subset of $(k,l)$–partition diagrams.
However, it should be apparent that, for all values of $k$ and $l$,
these vector spaces are all similar in nature, in that the set partition diagrams only differ by the number of vertices that appear in each row and by the connections that are made between vertices.
Moreover, the astute reader may have noticed that set partition diagrams

look like string diagrams.
Given that string diagrams represent strict monoidal categories, and that we have
a collection of vector spaces

for certain subsets of set partition diagrams, this implies that we should have a number of strict $\mathbb{R}$–linear monoidal categories!
Indeed we do; we formalise this intuition below.

§.§ Category Definitions

We assume throughout that $n \in \mathbb{Z}_{> 0}$.

We define the partition category $\mathcal{P}(n)$ to be
the category whose objects are the non–negative integers $\mathbb{Z}_{\geq 0} = \{0, 1, 2, \dots \}$,
and, for any pair of objects $k$ and $l$, the morphism space

$\Hom_{\mathcal{P}(n)}(k,l)$ is $P_k^l(n)$.

The vertical composition of morphisms is given by the composition of partition diagrams defined in (<ref>);
the bifunctor (the horizontal composition of morphisms) is given by the tensor product of partition diagrams defined in (<ref>);
and the unit object is $0$.

We define the Brauer category $\mathcal{B}(n)$ to be the category
whose objects are the same as those of $\mathcal{P}(n)$
and, for any pair of objects $k$ and $l$, the morphism space

$\Hom_{\mathcal{B}(n)}(k,l)$ is $B_k^l(n)$.

The vertical composition of morphisms, the horizontal composition of morphisms and the unit object are the same as those of $\mathcal{P}(n)$.

We define the Brauer–Grood category $\mathcal{BG}(n)$ to be the category
whose objects are the same as those of $\mathcal{P}(n)$
and, for any pair of objects $k$ and $l$, the morphism space

$\Hom_{\mathcal{BG}(n)}(k,l)$ is $D_k^l(n)$.

The vertical composition of morphisms
and the horizontal composition of morphisms
are the same as those defined for $D_k^l(n)$, which can be found in the Technical Appendix.

The unit object is $0$.

It is easy to show that $\mathcal{P}(n)$, $\mathcal{B}(n)$ and $\mathcal{BG}(n)$ are strict $\mathbb{R}$–linear monoidal categories.

Also, for the four groups of interest, we can define the following category.

If $G$ is any of the groups $S_n, O(n), Sp(n)$ or $SO(n)$, then
we define $\mathcal{C}(G)$ to be the category
whose objects are pairs $\{((\mathbb{R}^n)^{\otimes k},\rho_k)\}_{k \in \mathbb{Z}_{\geq 0}}$,
where $\rho_k: G \rightarrow GL((\mathbb{R}^n)^{\otimes k})$ is the representation of $G$ given in Section <ref>,
for any pair of objects
$((\mathbb{R}^n)^{\otimes k},\rho_k)$ and $((\mathbb{R}^n)^{\otimes l},\rho_l)$,
the morphism space,
$\Hom_{\mathcal{C}(G)}(((\mathbb{R}^n)^{\otimes k},\rho_k), ((\mathbb{R}^n)^{\otimes l},\rho_l))$
is precisely

$\Hom_{G}((\mathbb{R}^n)^{\otimes k}, (\mathbb{R}^n)^{\otimes l})$.

The vertical composition of morphisms is given by the usual composition of linear maps, the
horizontal composition of morphisms
is given by the usual tensor product of linear maps, both of which are associative operations, and the unit object is given by $(\mathbb{R}, 1_\mathbb{R})$, where $1_\mathbb{R}$ is the one-dimensional trivial representation of $G$.

It can be shown that $\mathcal{C}(G)$ is a subcategory of the category of representations of $G$, $\Rep(G)$. See the Technical Appendix for more details.
In particular, it is also a strict $\mathbb{R}$–linear monoidal category.

§.§ Full, Strict $\mathbb{R}$–Linear Monoidal Functors

We can use the string-like aspect of $(k,l)$–partition diagrams to factor them as a composition of a permutation in $S_k$, a planar $(k,l)$–partition diagram, and a permutation in $S_l$.

Given that we have a number of categories from the vector spaces of the different types of partition diagrams, that we have a category from the group equivariant linear maps between tensor power spaces, and that we have a number of maps between these vector spaces – as seen in Section <ref> –
we should have a number of functors between the newly defined categories.

Indeed, we have that

There exists a full, strict $\mathbb{R}$–linear monoidal functor

\begin{equation}
\Theta : \mathcal{P}(n) \rightarrow \mathcal{C}(S_n)
\end{equation}

that is defined on the objects of $\mathcal{P}(n)$ by
$\Theta(k) \coloneqq ((\mathbb{R}^{n})^{\otimes k}, \rho_k)$
and, for any objects $k,l$ of $\mathcal{P}(n)$, the map

\begin{equation} \label{partmorphism}
\Hom_{\mathcal{P}(n)}(k,l)
\rightarrow
\Hom_{\mathcal{C}(S_n)}(\Theta(k),\Theta(l))
\end{equation}

is precisely the map

\begin{equation} \label{partmorphismmap}
\Theta_{k,n}^l : P_k^l(n) \rightarrow
\Hom_{S_n}((\mathbb{R}^{n})^{\otimes k}, (\mathbb{R}^{n})^{\otimes l})
\end{equation}

given in Theorem <ref>.

There exists a full, strict $\mathbb{R}$–linear monoidal functor

\begin{equation}
\Phi : \mathcal{B}(n) \rightarrow \mathcal{C}(O(n))
\end{equation}

that is defined on the objects of $\mathcal{B}(n)$ by
$\Phi(k) \coloneqq ((\mathbb{R}^{n})^{\otimes k}, \rho_k)$
and, for any objects $k,l$ of $\mathcal{B}(n)$, the map

\begin{equation}
\Hom_{\mathcal{B}(n)}(k,l)
\rightarrow
\Hom_{\mathcal{C}(O(n))}(\Phi(k),\Phi(l))
\end{equation}

is the map

\begin{equation}
\Phi_{k,n}^l : B_k^l(n) \rightarrow
\Hom_{O(n)}((\mathbb{R}^{n})^{\otimes k}, (\mathbb{R}^{n})^{\otimes l})
\end{equation}

given in Theorem <ref>.

There exists a full, strict $\mathbb{R}$–linear monoidal functor

\begin{equation}
X : \mathcal{B}(n) \rightarrow \mathcal{C}(Sp(n))
\end{equation}

that is defined on the objects of $\mathcal{B}(n)$ by
$X(k) \coloneqq ((\mathbb{R}^{n})^{\otimes k}, \rho_k)$
and, for any objects $k,l$ of $\mathcal{B}(n)$, the map

\begin{equation}
\Hom_{\mathcal{B}(n)}(k,l)
\rightarrow
\Hom_{\mathcal{C}(Sp(n))}(\Phi(k),\Phi(l))
\end{equation}

is the map

\begin{equation}
X_{k,n}^l : B_k^l(n) \rightarrow
\Hom_{Sp(n)}((\mathbb{R}^{n})^{\otimes k}, (\mathbb{R}^{n})^{\otimes l})
\end{equation}

given in Theorem <ref>.

There exists a full, strict $\mathbb{R}$–linear monoidal functor

\begin{equation}
\Psi : \mathcal{BG}(n) \rightarrow \mathcal{C}(SO(n))
\end{equation}

that is defined on the objects of $\mathcal{BG}(n)$ by
$\Psi(k) \coloneqq ((\mathbb{R}^{n})^{\otimes k}, \rho_k)$
and, for any objects $k,l$ of $\mathcal{B}(n)$, the map

\begin{equation}
\Hom_{\mathcal{BG}(n)}(k,l)
\rightarrow
\Hom_{\mathcal{C}(SO(n))}(\Phi(k),\Phi(l))
\end{equation}

is the map

\begin{equation}
\Psi_{k,n}^l : D_k^l(n) \rightarrow
\Hom_{SO(n)}((\mathbb{R}^{n})^{\otimes k}, (\mathbb{R}^{n})^{\otimes l})
\end{equation}

given in Theorem <ref>.

Proofs of these results are given in the Technical Appendix.

§ IMPLICATIONS FOR GROUP EQUIVARIANT NEURAL NETWORKS

The fullness of the functors given in Section <ref> is especially important.
This condition immediately implies that, to understand any $G$–equivariant linear map in
$\Hom_{G}((\mathbb{R}^{n})^{\otimes k}, (\mathbb{R}^{n})^{\otimes l})$,
it is enough to work with the subset of $(k,l)$–partition diagrams that correspond to $G$, since we can apply the appropriate functor to obtain the equivariant maps themselves.

Furthermore, as the $(k,l)$–partition diagrams have a string-like aspect to them – because they are morphisms in a strict $\mathbb{R}$–linear monoidal category – we are able to drag and bend the strings and/or move the vertices to obtain new partition diagrams, and, in the process, new $G$–equivariant linear maps via the appropriate functor!

One very powerful use of this idea can be seen in Figure <ref>.
On the left hand side, we have an arbitrary $(5,3)$–partition diagram.
Suppose that we wish to multiply a vector $v \in
(\mathbb{R}^{n})^{\otimes 5}$, expressed in the standard basis,

by the matrix that the diagram corresponds to under the functor $\Theta$ given in Theorem <ref>.
We assume here that $n \geq 4$, since the number of blocks in the set partition corresponding to the $(5,3)$–partition diagram is $4$.
One option would be to multiply the vector by the matrix as given.
However, we can vastly improve the speed of the computation by performing a number of deformations to the diagram as shown in the figure.

At each stage,
we drag and bend the strings representing the connected components of the set partition to obtain a factoring of the original $(5,3)$–partition diagram in terms of a composition of three other diagrams:
a $(5,5)$–partition diagram that is not only Brauer but also a diagram that represents a permutation in the symmetric group $S_5$;
another $(5,3)$–partition diagram that is planar – that is, none of the connected components in the diagram intersect each other –
and, finally, a diagram representing another permutation, this time in the symmetric group $S_3$.

Since the middle diagram is planar, this means that it can be decomposed as a tensor product of a number of simpler diagrams, using the strict monoidal property of $\mathcal{P}(n)$.
The tensor product decomposition is shown in Figure <ref>.
The key point is that, under the functor $\Theta$, the image of the planar partition diagram will be the Kronecker product of the images of these simpler diagrams, since the functor is strict $\mathbb{R}$–linear monoidal.
This will make the multiplication of any vector by this matrix

significantly quicker to perform.

Hence, we have outlined a procedure which shows that, to multiply $v$

by the linear map that is the image of the left hand diagram under $\Theta$ quickly,

we can first apply a permutation to the indices of the standard basis elements appearing in the input vector $v$, then apply the Kronecker product matrix that is the image under $\Theta$ of the planar $(5,3)$–partition diagram, and then finally apply another permutation to the indices of the standard basis elements in $(\mathbb{R}^{n})^{\otimes 3}$ appearing in the resulting vector.

By generalising this example to any $(k,l)$–partition diagram, we will recover

– with one key distinction –
the algorithm of [Godfrey et al., 2023]
for applying symmetric group equivariant layer functions on tensor power spaces of $\mathbb{R}^{n}$ to input vectors; however, we have used a very different approach to obtain it.
The key distinction between the two versions

comes from making
the middle diagram in the composition planar.

Moreover, it is not hard to see that this idea will generalise to give
an algorithm for applying group equivariant linear maps to input vectors
for the other groups presented in this paper.
This result will appear in another paper by the same authors.

The decomposition of the planar $(5,3)$–partition diagram into a tensor product of simpler partition diagrams.

§ RELATED WORK

[Maron et al., 2019] studied the classification of linear permutation equivariant and invariant neural network layers.
They characterised the learnable, linear, permutation equivariant layer functions in
$\Hom_{S_n}((\mathbb{R}^{n})^{\otimes k}, (\mathbb{R}^{n})^{\otimes l})$
for $n \geq k + l$, using the orbit basis.
However, [Godfrey et al., 2023] discovered that using the diagram basis, first constructed by [Jones, 1994] in the case $k = l$, is beneficial for permutation equivariant neural network computations.
[Pearce-Crump, 2022] established the connection between permutation equivariant linear layers and the partition algebra, using Schur–Weyl duality. They fully characterised these layer functions for all values of $n$ and tensor power space orders, revealing that the dimension of the layer function space is not independent of $n$.
The partition algebra was introduced by [Martin, 1990, Martin, 1994, Martin, 1996] and expanded upon by [Jones, 1994].
Recent papers by [Benkart & Halverson, 2019, Benkart & Halverson, 2019] and [Benkart et al., 2017]
show how the partition algebra can be used to construct the invariant theory of the symmetric group.
[Comes, 2020] discovered the partition category and expressed it in terms of generators and relations.
[Pearce-Crump, 2022] characterised all learnable, linear, equivariant layer functions in
$\Hom_{G}((\mathbb{R}^{n})^{\otimes k}, (\mathbb{R}^{n})^{\otimes l})$
for $G = O(n)$, $Sp(n)$, and $SO(n)$, using various sets of set partition diagrams.
This characterisation was adapted from the combinatorial representation theory of the Brauer algebra, first developed by [Brauer, 1937].
[Grood, 1999] studied the representation theory of the Brauer–Grood algebra, while the Brauer category first appeared in [Lehrer & Zhang, 2012].
The same authors investigated the theory behind what we have termed the Brauer–Grood category in [Lehrer & Zhang, 2018].

§ CONCLUSION

In this paper, we showed how category theory can be applied to the linear layer functions of group equivariant neural networks for the groups $S_n$, $O(n)$, $Sp(n)$, and $SO(n)$, resulting in a richer structure

and a deeper understanding of these layer functions.
In particular, we outlined the development of an algorithm for computing the result of a vector that is passed through an equivariant, linear layer for each group.
The success of our approach suggests that category theory could be beneficial

for other areas of deep learning, leading to new insights and approaches.

§ ACKNOWLEDGMENTS

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.

[Barcelo & Ram, 1997]
Barcelo, H. and Ram, A.
Combinatorial Representation Theory, 1997.

[Benkart & Halverson, 2019]
Benkart, G. and Halverson, T.
Partition algebras $P_k(n)$ with $2k>n$ and the fundamental
theorems of invariant theory for the symmetric group $S_n$.
J. London Math. Soc, 990 (2):0 194–224,
URL <https://doi.org/10.1112/jlms.12175>.

[Benkart & Halverson, 2019]
Benkart, G. and Halverson, T.
Partition Algebras and the Invariant Theory of the Symmetric
In Barcelo, H., Karaali, G., and Orellana, R. (eds.), Recent
Trends in Algebraic Combinatorics, volume 16 of Association for Women
in Mathematics Series, pp.  1–41. Springer, 2019b.
URL <https://doi.org/10.1007/978-3-030-05141-9>.

[Benkart et al., 2017]
Benkart, G., Halverson, T., and Harman, N.
Dimensions of irreducible modules for partition algebras and tensor
power multiplicities for symmetric and alternating groups.
J. Algebraic Combin., 460 (1):0 77–108, 2017.
ISSN 0925-9899.
URL <https://doi.org/10.1007/s10801-017-0748-4>.

[Brauer, 1937]
Brauer, R.
On Algebras Which Are Connected with the Semisimple
Continuous Groups.
Ann. Math., 38:0 857–872, 1937.
ISSN 0003486X.
URL <http://www.jstor.org/stable/1968843>.

[Brown, 1955]
Brown, W. P.
An Algebra Related to the Orthogonal Group.
Michigan Mathematical Journal, 30 (1):0 1 –
22, 1955.
URL <https://doi.org/10.1307/mmj/1031710528>.

[Brown, 1956]
Brown, W. P.
The Semisimplicity of the Brauer Algebra.
Annals of Mathematics, 630 (2):0 324–335,
URL <https://www.jstor.org/stable/1969613>.

[Comes, 2020]
Comes, J.
Jellyfish Partition Categories.
Algebr Represent Theor, 23:0 327–347, 2020.
URL <https://doi.org/10.1007/s10468-018-09851-7>.

[Finzi et al., 2021]
Finzi, M., Welling, M., and Wilson, A. G. G.
A Practical Method for Constructing Equivariant Multilayer
Perceptrons for Arbitrary Matrix Groups.
In Meila, M. and Zhang, T. (eds.), Proceedings of the 38th
International Conference on Machine Learning, volume 139 of
Proceedings of Machine Learning Research, pp.  3318–3328. PMLR,
18–24 Jul 2021.
URL <https://proceedings.mlr.press/v139/finzi21a.html>.

[Godfrey et al., 2023]
Godfrey, C., Rawson, M. G., Brown, D., and Kvinge, H.
Fast computation of permutation equivariant layers with the
partition algebra.
In ICLR 2023 Workshop on Physics for Machine Learning, 2023.
URL <https://openreview.net/forum?id=VXwts-IZFi>.

[Goodman & Wallach, 2009]
Goodman, R. and Wallach, N. R.
Symmetry, Representations and Invariants.
Springer, 2009.

[Grood, 1999]
Grood, C.
Brauer Algebras and Centralizer Algebras for SO(2n,C).
Journal of Algebra, 2220 (2):0 678–707, 1999.
ISSN 0021-8693.
URL <https://doi.org/10.1006/jabr.1999.8069>.

[Halverson & Ram, 2022]
Halverson, T. and Ram, A.
Gems from the Work of Georgia Benkart.
Notices of the American Mathematical Society, 690
(3):0 375–384, March 2022.
URL <https://doi.org/10.1090/noti2447>.

[Hanlon & Wales, 1989]
Hanlon, P. and Wales, D.
On the Decomposition of Brauer's Centralizer Algebras.
Journal of Algebra, 1210 (2):0 409–445, 1989.
ISSN 0021-8693.
URL <https://doi.org/10.1016/0021-8693(89)90076-8>.

[Hu, 2019]
Hu, M.
Presentations of Diagram Categories.
The PUMP Journal of Undergraduate Research, 3:0 1–25,
Dec. 2019.
URL <https://journals.calstate.edu/pump/article/view/2256>.

[Jones, 1994]
Jones, V.
The Potts model and the symmetric group.
In Araki, H., Kawahigashi, Y., and Kosaki, H. (eds.),
Subfactors: Proceedings of the Taniguchi Symposium on Operator
Algebras (Kyuzeso, 1993), pp.  259–267. World Scientific, 1994.

[Kock, 2003]
Kock, J.
Frobenius Algebras and 2-D Topological Quantum
Field Theories.
London Mathematical Society Student Texts. Cambridge University
Press, 2003.
URL <https://doi.org/10.1017/CBO9780511615443>.

[Lauda & Sussan, 2022]
Lauda, A. D. and Sussan, J.
An Invitation to Categorification.
Notices of the American Mathematical Society, 690
(1):0 11–21, January 2022.
URL <https://doi.org/10.1090/noti2399>.

[Lehrer & Zhang, 2012]
Lehrer, G. I. and Zhang, R. B.
The Brauer category and invariant theory.
Journal of the European Mathematical Society, 17:0
2311–2351, 2012.
URL <https://ems.press/content/serial-article-files/7287>.

[Lehrer & Zhang, 2018]
Lehrer, G. I. and Zhang, R. B.
Invariants of the special orthogonal group and an enhanced Brauer
L’Enseignement Mathématique, 63:0 181–200, 2018.
URL <https://ems.press/journals/lem/articles/15344>.

[Mac Lane, 1998]
Mac Lane, S.
Categories for the Working Mathematician.
Springer New York, NY, 1998.
URL <https://doi.org/10.1007/978-1-4757-4721-8>.

[Maron et al., 2019]
Maron, H., Ben-Hamu, H., Shamir, N., and Lipman, Y.
Invariant and Equivariant Graph Networks.
In International Conference on Learning Representations, 2019.
URL <https://openreview.net/forum?id=Syx72jC9tm>.

[Martin, 1990]
Martin, P.
Representations of Graph Temperley–Lieb Algebras.
Publ. Res. Inst. Math. Sci., 260 (3):0
485–503, 1990.
ISSN 0034-5318.
URL <http://dx.doi.org/10.2977/prims/1195170958>.

[Martin, 1994]
Martin, P.
Temperley–Lieb Algebras for Non–Planar Statistical
Mechanics – the Partition Algebra Construction.
Journal of Knot Theory and Its Ramifications, 030
(01):0 51–82, 1994.
URL <https://doi.org/10.1142/S0218216594000071>.

[Martin, 1996]
Martin, P.
The Structure of the Partition Algebras.
J. Algebra, 183:0 319–358, 1996.
URL <https://doi.org/10.1006/jabr.1996.0223>.

[Pan & Kondor, 2022]
Pan, H. and Kondor, R.
Permutation Equivariant Layers for Higher Order
In Camps-Valls, G., Ruiz, F. J. R., and Valera, I. (eds.),
Proceedings of The 25th International Conference on Artificial
Intelligence andl Statistics, volume 151 of Proceedings of Machine
Learning Research, pp.  5987–6001. PMLR, 28–30 Mar 2022.
URL <https://proceedings.mlr.press/v151/pan22a.html>.

[Pearce-Crump, 2022]
Pearce-Crump, E.
Connecting Permutation Equivariant Neural Networks and
Partition Diagrams.
, 2022a.

[Pearce-Crump, 2022]
Pearce-Crump, E.
Brauer's Group Equivariant Neural Networks.
, 2022b.

[Pearce-Crump, 2023]
Pearce-Crump, E.
An Algorithm for Computing with Brauer's Group
Equivariant Neural Network Layers.
To appear, 2023a.

[Pearce-Crump, 2023]
Pearce-Crump, E.
How Jellyfish Characterise Alternating Group Equivariant
Neural Networks.
, 2023b.

[Savage, 2021]
Savage, A.
String Diagrams and Categorification, pp.  3–36.
Springer International Publishing, Cham, 2021.
ISBN 978-3-030-63849-8.
URL <https://doi.org/10.1007/978-3-030-63849-8_1>.

[Segal, 2014]
Segal, E.
Group Representation Theory.
Course Notes for Imperial College London, 2014.
<https://www.homepages.ucl.ac.uk/ ucaheps/papers/Group

[Shiebler et al., 2021]
Shiebler, D., Gavranović, B., and Wilson, P.
Category Theory in Machine Learning, 2021.

[Turaev & Virelizier, 2017]
Turaev, V. and Virelizier, A.
Monoidal Categories and Topological Field Theory.
Birkhäuser, 2017.
URL <https://doi.org/10.1007/978-3-319-49834-8>.

[Wenzl, 1988]
Wenzl, H.
On the Structure of Brauer's Centralizer Algebras.
Annals of Mathematics, 1280 (1):0 173–193,
URL <http://www.jstor.org/stable/1971466>.

[Weyl, 1946]
Weyl, H.
The Classical Groups: Their Invariants and Representations.
Princeton University Press, 1946.

§ COMPOSITION AND TENSOR PRODUCT OPERATIONS FOR $D_K^L(N)$

Recall that $D_k^l(n)$ is defined to be the $\mathbb{R}$–linear span of the set of all $(k,l)$–Brauer diagrams together with the set of all $(l+k) \backslash n$–diagrams.

We wish to define two $\mathbb{R}$-bilinear operations

\begin{align}
\text{composition:   } & \bullet: D_l^m(n) \times D_k^l(n) \rightarrow D_k^m(n) \label{brauergroodcomposition} \\
\text{tensor product:   } & \otimes: D_k^l(n) \times D_q^m(n) \rightarrow D_{k+q}^{l+m}(n) \label{brauergroodtensorprod}
\end{align}

It is clear that we need to define these operations on each possible pair of diagrams, hence there are four cases (with the number of vertices to be amended depending on the operation):

* Brauer and Brauer

* Brauer and $(l+k) \backslash n$

* $(l+k) \backslash n$ and Brauer, and

* $(l+k) \backslash n$ and $(l+k) \backslash n$

To do this, we follow the constructions given in [Comes, 2020].
<cit.>, in particular, contains excellent motivation as to why we do the following.

Firstly, we introduce a jellyfish, which takes the $n$ free vertices in a $(l+k) \backslash n$ diagram
and attaches them to a blue head, in top–to–bottom, left–to-right order.
For example, if $k = 2$, $l = 1$ and $n = 3$,
the jellyfish has the form

\begin{equation} \label{attachjellyfish}
\begin{aligned}
\scalebox{0.5}{\tikzfig{jellyfishex}}
\end{aligned}
\end{equation}

The jellyfish satisfies two rules.

Rule 1: composing an adjacent permutation with a jellyfish, which is equivalent to having two adjacent legs of the jellyfish crossed, is equal to the negative of the uncrossed jellyfish:

Rule 2: the juxtaposition of two jellyfish, each with $n$ legs, is equal to the following linear combination of Brauer diagrams.

For example, if $n = 2$, then we have that

One consequence of Rule 1 that we need is that if two legs of the same jellyfish are connected, then it is equal to $0$. For example

With this, we can define the composition and tensor product operations for each of the cases.

§.§ Composition

Case 1: The composition of a $(k,l)$–Brauer diagram with a $(l,m)$–Brauer diagram is the usual composition as defined in (<ref>).

Cases 2, 3: We explain this in the situation where we have a $(k,l)$–Brauer diagram $d_\beta$ and a $(m+l) \backslash n$–diagram $d_\alpha$, but the same steps apply in the other case.
We perform the following procedure:

* Attach a jellyfish to $d_\alpha$ as in (<ref>).

* Place $d_\beta$ below $d_\alpha$, and concatenate the diagrams as per usual to obtain a diagram with three rows of vertices.

* If any two legs of the same jellyfish are connected in this diagram, the result is $0$, and we can stop.

* Otherwise, fully concatenate the diagrams to obtain a diagram with two rows of vertices, removing all connected components that lie entirely in the middle row of the concatenated diagrams.
Let $c(d_\alpha, d_\beta)$ be the number of connected components that are removed from the middle row.

* Now repeatedly apply Rule 1 to fully uncross the legs of the jellyfish.
This action is actually a permutation $\sigma \in S_n$, and the resulting sign in front of the diagram that we obtain is $\sgn(\sigma)$.

* Finally, detach/remove the jellyfish to obtain a $(m+k) \backslash n$–diagram $d_\gamma$.
Consequently, the result that we obtain is $\sgn(\sigma)n^{c(d_\alpha, d_\beta)}d_\gamma$.

Case 4: Suppose that we have a
$(l+k) \backslash n$–diagram $d_{\alpha_1}$ and a
$(m+l) \backslash n$–diagram $d_{\alpha_2}$.
We perform the following procedure:

* Attach separate jellyfish to $d_{\alpha_1}$ and $d_{\alpha_2}$ as in (<ref>).

* Place $d_{\alpha_1}$ below $d_{\alpha_2}$, and concatenate the diagrams as per usual to obtain a diagram with three rows of vertices.

* If any two legs of the same jellyfish are connected in this diagram, the result is $0$, and we can stop.

* Otherwise, fully concatenate the diagrams to obtain a diagram with two rows of vertices, removing all connected components that lie entirely in the middle row of the concatenated diagrams.
Let $c(d_{\alpha_2}, d_{\alpha_1})$ be the number of connected components that are removed from the middle row.

* Now repeatedly apply rule 1 to fully uncross the legs of each of the jellyfish.
This action is actually a product of permutations $\sigma\tau \in S_n$, and the resulting sign of the diagram that we obtain is $\sgn(\sigma\tau) = \sgn(\sigma)\sgn(\tau)$.

* Now apply Rule 2 to obtain a linear combination of $(k,m)$–Brauer diagrams. Call this linear combination $d$.
Consequently, the result that we obtain is $\sgn(\sigma)\sgn(\tau)n^{c(d_{\alpha_2}, d_{\alpha_1})}d$.

§.§ Tensor Product

Case 1: The tensor product of a $(k,l)$–Brauer diagram with a $(q,m)$–Brauer diagram is the usual tensor product as defined in (<ref>).

Case 2:
The tensor product of a $(k,l)$–Brauer diagram $d_\beta$ with an $(m+q) \backslash n$–diagram $d_\alpha$ is defined to be the $(l+m+k+q) \backslash n$–diagram that is obtained by horizontally placing $d_\beta$ to the left of $d_\alpha$ without any overlapping of vertices.

Case 3:
The tensor product of a
$(l+k) \backslash n$–diagram $d_\alpha$
with a
$(q,m)$–Brauer diagram $d_\beta$
is defined to be the $(l+m+k+q) \backslash n$–diagram that is obtained by horizontally placing $d_\alpha$ to the left of $d_\beta$ without any overlapping of vertices.

Case 4: Suppose that we have a
$(l+k) \backslash n$–diagram $d_{\alpha_1}$ and a
$(m+q) \backslash n$–diagram $d_{\alpha_2}$.
We perform the following procedure:

* Attach separate jellyfish to $d_{\alpha_1}$ and $d_{\alpha_2}$ as in (<ref>).

* Horizontally place $d_{\alpha_1}$ to the left of $d_{\alpha_2}$ without any overlapping of vertices.

* Apply Rule 2 to obtain a linear combination of $(k+q, l+m)$–Brauer diagrams. This is the end result.

§.§ Examples

Composition, Case 3

Let $d_\alpha$ be the diagram

and let $d_\beta$ be the diagram

Then $d_\alpha \bullet d_\beta$ is equal to

Composition, Case 4

Let $d_{\alpha_1}$ and $d_{\alpha_2}$ be the diagrams

Then $d_{\alpha_2} \bullet d_{\alpha_1}$ is equal to

Tensor Product, Case 4

Let $d_{\alpha_1}$ and $d_{\alpha_2}$ be as above.
Then $d_{\alpha_1} \otimes d_{\alpha_2}$ is equal to

§ MATRIX DEFINITIONS

$\HOM_{G}((\MATHBB{R}^{N})^{\OTIMES K}, (\MATHBB{R}^{N})^{\OTIMES L})$

In Section <ref>,
we said that there exists a spanning set or a basis of
$\Hom_{G}((\mathbb{R}^{n})^{\otimes k}, (\mathbb{R}^{n})^{\otimes l})$ for each of the groups in question, expressed in the basis of matrix units of
$\Hom((\mathbb{R}^{n})^{\otimes k}, (\mathbb{R}^{n})^{\otimes l})$, without stating what the matrices actually are

in the main part of the paper. We state what these matrices are below.

These definitions can also be found in <cit.> for $S_n$, and in <cit.> for $O(n), Sp(n)$ and $SO(n)$.

Recall that, for any $k,l \in \mathbb{Z}_{\geq 0}$,
as a result of picking the standard/symplectic basis for $\mathbb{R}^{n}$,
the vector space
$\Hom((\mathbb{R}^{n})^{\otimes k}, (\mathbb{R}^{n})^{\otimes l})$
has a standard basis of matrix units

\begin{equation} \label{standardbasisunits}
\{E_{I,J}\}_{I \in [n]^l, J \in [n]^k}
\end{equation}

where $I$ is a tuple $(i_1, i_2, \dots, i_l) \in [n]^l$,
$J$ is a tuple $(j_1, j_2, \dots, j_k) \in [n]^k$
and $E_{I,J}$ has a $1$ in the $(I,J)$ position and is $0$ elsewhere.
If one or both of $k$, $l$ is equal to $0$, then we replace the tuple that indexes the matrix by a $1$.
For example, when $k = 0$ and $l \in \mathbb{Z}_{\geq 1}$, (<ref>) becomes $\{E_{I,1}\}_{I \in [n]^l}$.

Suppose that $d_\pi$ is a $(k,l)$–partition diagram.
Then $E_\pi$ is defined as follows.

Associate the indices $i_1, i_2, \dots, i_l$ with the vertices in the top row of $d_\pi$, and $j_1, j_2, \dots, j_k$ with the vertices in the bottom row of $d_\pi$.
Then, if $S_\pi((I,J))$ is defined to be the set

\begin{equation} \label{Snindexingset}
\{(I,J) \in [n]^{l+k} \mid \text{if } x,y \text{ are in the same block of } \pi, \text{then } i_x = i_y \}
\end{equation}

(where we have momentarily replaced the elements of $J$ by $i_{l+m} \coloneqq j_m$ for all $m \in [k]$),
we have that

\begin{equation} \label{mappeddiagbasisSn}
\coloneqq
\sum_{I \in [n]^l, J \in [n]^k}
\delta_{\pi, (I,J)}
\end{equation}

\begin{equation}
\delta_{\pi, (I,J)}
\coloneqq
\begin{cases}
1 & \text{if } (I,J) \in S_\pi((I,J)) \\
0 & \text{otherwise}
\end{cases}
\end{equation}

We give an example in Figure <ref>.

colspec = X[c,h]X[c]X[c],
stretch = 0,
rowsep = 8pt,
hlines = 1pt,
vlines = 1pt,

Partition Diagram
$d_\pi$ 	    $S_\pi((I,J))$

Matrix Element
with $n = 4$

$\{(i,i) \in [n]^2\}$

\NiceMatrixOptions{code-for-first-row = \scriptstyle \color{blue},
code-for-first-col = \scriptstyle \color{blue}
\begin{bNiceArray}{*{4}{c}}[first-row,first-col]
& 1 	& 2	& 3	& 4 	\\
1		& 1	& 0	& 0	& 0	\\
2		& 0	& 1	& 0	& 0	\\
3		& 0	& 0	& 1	& 0	\\
4		& 0	& 0	& 0	& 1
\end{bNiceArray}

$\{(i,j) \in [n]^2\}$

\NiceMatrixOptions{code-for-first-row = \scriptstyle \color{blue},
code-for-first-col = \scriptstyle \color{blue}
\begin{bNiceArray}{*{4}{c}}[first-row,first-col]
& 1 	& 2	& 3	& 4 	\\
1		& 1	& 1	& 1	& 1	\\
2		& 1	& 1	& 1	& 1	\\
3		& 1	& 1	& 1	& 1	\\
4		& 1	& 1	& 1	& 1
\end{bNiceArray}

A table showing how $(1,1)$–partition diagrams correspond to matrices in
$\Hom_{S_4}(\mathbb{R}^{4}, \mathbb{R}^{4})$.

Suppose that $d_\beta$ is a $(k,l)$–Brauer diagram.
Then $F_\beta$ is defined as follows.

Associate the indices $i_1, i_2, \dots, i_l$ with the vertices in the top row of $d_\beta$, and $j_1, j_2, \dots, j_k$ with the vertices in the bottom row of $d_\beta$.
Then, we have that

\begin{equation} \label{matrixSp(n)}
\coloneqq
\sum_{I, J}
\gamma_{r_1, u_1}
\gamma_{r_2, u_2}
\dots
\gamma_{r_{\frac{l+k}{2}}, u_{\frac{l+k}{2}}}
\end{equation}

where the indices $i_p, j_p$ range over $1, 1', \dots, m, m'$,
where $r_1, u_1, \dots, r_{\frac{l+k}{2}}, u_{\frac{l+k}{2}}$ is any permutation of the indices $i_1, i_2, \dots, i_l, j_1, j_2, \dots, j_k$ such that the vertices corresponding to
$r_p, u_p$
are in the same block of $\beta$, and

\begin{equation} \label{gammarpup}
\gamma_{r_p, u_p} \coloneqq
\begin{cases}
\delta_{r_p, u_p} & \text{if the vertices corresponding to } r_p, u_p \text{ are in different rows of } d_\beta \\
\epsilon_{r_p, u_p} & \text{if the vertices corresponding to } r_p, u_p \text{ are in the same row of } d_\beta
\end{cases}
\end{equation}

Here, $\epsilon_{r_p, u_p}$ is given by

\begin{equation} \label{epsilondef1}
\epsilon_{\alpha, \beta} = \epsilon_{{\alpha'}, {\beta'}} = 0
\end{equation}

\begin{equation} \label{epsilondef2}
\epsilon_{\alpha, {\beta'}} = - \epsilon_{{\alpha'}, {\beta}} = \delta_{\alpha, \beta}
\end{equation}

We give an example in Figure <ref>.

Suppose that $d_\alpha$ is a $(l+k)\backslash n$–diagram.
Then $H_\alpha$ is defined as follows.

the indices $i_1, i_2, \dots, i_l$ with the vertices in the top row of $d_\alpha$, and $j_1, j_2, \dots, j_k$ with the vertices in the bottom row of $d_\alpha$.
Suppose that there are $s$ free vertices in the top row. Then there are $n-s$ free vertices in the bottom row.
Relabel the $s$ free indices in the top row (from left to right) by
$t_1, \dots, t_s$, and the $n-s$ free indices in the bottom row (from left to right) by $b_1, \dots, b_{n-s}$.

Then, define
\chi
\left(\begin{smallmatrix}
1 & 2 & \cdots & s & s+1 & \cdots & n\\
t_1 & t_2 & \cdots & t_s & b_1 & \cdots & b_{n-s}
\end{smallmatrix}\right)
as follows: it is
$0$ if the elements $t_1, \dots, t_s, b_1, \dots, b_{n-s}$ are not distinct, otherwise, it is
\sgn
\left(\begin{smallmatrix}
1 & 2 & \cdots & s & s+1 & \cdots & n\\
t_1 & t_2 & \cdots & t_s & b_1 & \cdots & b_{n-s}
\end{smallmatrix}\right)
considered as a permutation of $[n]$.

As a result, for any $n \in \mathbb{Z}_{\geq 1}$, we have that

\begin{equation} \label{SO(n)Halpha}
\coloneqq
\sum_{I \in [n]^l, J \in [n]^k}
\chi
\left(\begin{smallmatrix}
1 & 2 & \cdots & s & s+1 & \cdots & n\\
t_1 & t_2 & \cdots & t_s & b_1 & \cdots & b_{n-s}
\end{smallmatrix}\right)
\delta_{r_1, u_1}
\delta_{r_2, u_2}
\dots
\delta_{r_{\frac{l+k-n}{2}}, u_{\frac{l+k-n}{2}}}
\end{equation}

Here, $r_1, u_1, \dots, r_{\frac{l+k-n}{2}}, u_{\frac{l+k-n}{2}}$
is any permutation of the indices

\begin{equation}
\{i_1, \dots, i_l, j_1, \dots, j_k\} \backslash \{t_1, \dots, t_s, b_1, \dots, b_{n-s}\}
\end{equation}

such that the vertices corresponding to $r_p, u_p$ are in the same block of $\alpha$.

We give an example in Figure <ref>.

colspec = X[c,h]X[c]X[c],
stretch = 0,
rowsep = 6pt,
hlines = 1pt,
vlines = 1pt,

Brauer Diagram
$d_\beta$ 	    Matrix Entries
Matrix Element
with $n = 2$

0.6brauer22sq1     $(\epsilon_{i_1, i_2}\epsilon_{j_1,j_2})$

\NiceMatrixOptions{code-for-first-row = \scriptstyle \color{blue},
code-for-first-col = \scriptstyle \color{blue}
\begin{bNiceArray}{*{2}{c}*{2}{c}}[first-row,first-col]
& 1,1 	& 1,1'	& 1,1'	& 1',1'	\\
1,1		& 0	& 0	& 0	& 0	\\
1,1'		& 0	& 1	& -1	& 0	\\
1',1		& 0	& -1	& 1	& 0	\\
1',1'		& 0	& 0	& 0	& 0
\end{bNiceArray}

$(\delta_{i_1, j_1}\delta_{i_2,j_2})$

\NiceMatrixOptions{code-for-first-row = \scriptstyle \color{blue},
code-for-first-col = \scriptstyle \color{blue}
\begin{bNiceArray}{*{2}{c}*{2}{c}}[first-row,first-col]
& 1,1 	& 1,1'	& 1,1'	& 1',1'	\\
1,1		& 1	& 0	& 0	& 0	\\
1,1'		& 0	& 1	& 0	& 0	\\
1',1		& 0	& 0	& 1	& 0	\\
1',1'		& 0	& 0	& 0	& 1
\end{bNiceArray}

$(\delta_{i_1, j_2}\delta_{i_2,j_1})$

\NiceMatrixOptions{code-for-first-row = \scriptstyle \color{blue},
code-for-first-col = \scriptstyle \color{blue}
\begin{bNiceArray}{*{2}{c}*{2}{c}}[first-row,first-col]
& 1,1 	& 1,1'	& 1,1'	& 1',1'	\\
1,1		& 1	& 0	& 0	& 0	\\
1,1'		& 0	& 0	& 1	& 0	\\
1',1		& 0	& 1	& 0	& 0	\\
1',1'		& 0	& 0	& 0	& 1
\end{bNiceArray}

A table showing how $(2,2)$–Brauer diagrams correspond to matrices in
$\Hom_{Sp(2)}((\mathbb{R}^{2})^{\otimes 2}, (\mathbb{R}^{2})^{\otimes 2})$.

colspec = X[c,h]X[c]X[c],
stretch = 0,
rowsep = 6pt,
hlines = 1pt,
vlines = 1pt,

$d_\alpha$ 	    Matrix Entries
Matrix Element
with $n = 2$

\chi
\left(\begin{smallmatrix}
1 & 2 \\
j_1 & j_2
\end{smallmatrix}\right)
\delta_{i_1,i_2})$

\NiceMatrixOptions{code-for-first-row = \scriptstyle \color{blue},
code-for-first-col = \scriptstyle \color{blue}
\begin{bNiceArray}{*{2}{c}*{2}{c}}[first-row,first-col]
& 1,1 	& 1,2	& 2,1	& 2,2	\\
1,1		& 0	& 1	& -1	& 0	\\
1,2		& 0	& 0	& 0	& 0	\\
2,1		& 0	& 0	& 0	& 0	\\
2,2		& 0	& 1	& -1	& 0
\end{bNiceArray}

\chi
\left(\begin{smallmatrix}
1 & 2 \\
i_2 & j_2
\end{smallmatrix}\right)
\delta_{i_1,j_1})$

\NiceMatrixOptions{code-for-first-row = \scriptstyle \color{blue},
code-for-first-col = \scriptstyle \color{blue}
\begin{bNiceArray}{*{2}{c}*{2}{c}}[first-row,first-col]
& 1,1 	& 1,2	& 2,1	& 2,2	\\
1,1		& 0	& 1	& 0	& 0	\\
1,2		& -1	& 0	& 0	& 0	\\
2,1		& 0	& 0	& 0	& 1	\\
2,2		& 0	& 0	& -1	& 0
\end{bNiceArray}

\chi
\left(\begin{smallmatrix}
1 & 2 \\
i_2 & j_1
\end{smallmatrix}\right)
\delta_{i_1,j_2})$

\NiceMatrixOptions{code-for-first-row = \scriptstyle \color{blue},
code-for-first-col = \scriptstyle \color{blue}
\begin{bNiceArray}{*{2}{c}*{2}{c}}[first-row,first-col]
& 1,1 	& 1,2	& 2,1	& 2,2	\\
1,1		& 0	& 0	& 1	& 0	\\
1,2		& -1	& 0	& 0	& 0	\\
2,1		& 0	& 0	& 0	& 1	\\
2,2		& 0	& -1	& 0	& 0
\end{bNiceArray}

\chi
\left(\begin{smallmatrix}
1 & 2 \\
i_1 & j_2
\end{smallmatrix}\right)
\delta_{i_2,j_1})$

\NiceMatrixOptions{code-for-first-row = \scriptstyle \color{blue},
code-for-first-col = \scriptstyle \color{blue}
\begin{bNiceArray}{*{2}{c}*{2}{c}}[first-row,first-col]
& 1,1 	& 1,2	& 2,1	& 2,2	\\
1,1		& 0	& 1	& 0	& 0	\\
1,2		& 0	& 0	& 0	& 1	\\
2,1		& -1	& 0	& 0	& 0	\\
2,2		& 0	& 0	& -1	& 0
\end{bNiceArray}

\chi
\left(\begin{smallmatrix}
1 & 2 \\
i_1 & j_1
\end{smallmatrix}\right)
\delta_{i_2,j_2})$

\NiceMatrixOptions{code-for-first-row = \scriptstyle \color{blue},
code-for-first-col = \scriptstyle \color{blue}
\begin{bNiceArray}{*{2}{c}*{2}{c}}[first-row,first-col]
& 1,1 	& 1,2	& 2,1	& 2,2	\\
1,1		& 0	& 0	& 1	& 0	\\
1,2		& 0	& 0	& 0	& 1	\\
2,1		& -1	& 0	& 0	& 0	\\
2,2		& 0	& -1	& 0	& 0
\end{bNiceArray}

\chi
\left(\begin{smallmatrix}
1 & 2 \\
i_1 & i_2
\end{smallmatrix}\right)
\delta_{j_1,j_2})$

\NiceMatrixOptions{code-for-first-row = \scriptstyle \color{blue},
code-for-first-col = \scriptstyle \color{blue}
\begin{bNiceArray}{*{2}{c}*{2}{c}}[first-row,first-col]
& 1,1 	& 1,2	& 2,1	& 2,2	\\
1,1		& 0	& 0	& 0	& 0	\\
1,2		& 1	& 0	& 0	& 1	\\
2,1		& -1	& 0	& 0	& -1	\\
2,2		& 0	& 0	& 0	& 0
\end{bNiceArray}

A table showing how $(2+2) \backslash 2$–diagrams correspond to matrices in
$\Hom_{SO(2)}((\mathbb{R}^{2})^{\otimes 2}, (\mathbb{R}^{2})^{\otimes 2})$.

§ BASICS OF CATEGORY THEORY

We provide some of the basics on Category Theory to help the reader to understand some of the language that is used in the main text.
Other good references are [Mac Lane, 1998, Kock, 2003, Turaev & Virelizier, 2017].

§.§ Categories

A category $\mathcal{C}$
consists of

* a collection of objects $Ob(\mathcal{C})$,

* for every $X, Y \in Ob(\mathcal{C})$, a collection $\Hom_{\mathcal{C}}(X,Y)$ of morphisms from $X$ to $Y$

* for every $X, Y, Z \in Ob(\mathcal{C})$, an associative composition rule

\begin{equation}
\circ :
\Hom_{\mathcal{C}}(Y,Z)
\times
\Hom_{\mathcal{C}}(X,Y)
\rightarrow
\Hom_{\mathcal{C}}(X,Z)
\end{equation}

* and, for every $X \in Ob(\mathcal{C})$, there is an identity morphism $1_X \in \Hom_{\mathcal{C}}(X,X)$, such that every morphism $f \in \Hom_{\mathcal{C}}(Y,X)$

satisfies $1_X \circ f = f$, and every morphism $g \in \Hom_{\mathcal{C}}(X,Z)$

satisfies $g \circ 1_X = g$.

We write $f: X \rightarrow Y$ for a morphism in $\Hom_{\mathcal{C}}(X,Y)$.

A category is said to be locally small if the collection of morphisms between any two objects in the category is a set.

We list some examples of categories below.

* The category Set, whose objects are all sets, and whose morphisms are the set mappings.

* The category Vect$_{\mathbb{R}}$, whose objects are all vector spaces over $\mathbb{R}$, and whose morphisms are the $\mathbb{R}$–linear maps.

* The category Grp, whose objects are all groups, and whose morphisms are the group homomorphisms.

§.§ Functors

Just as there is a notion of a map between sets, there is also a notion of a "map" between categories, called functors.

Suppose that $\mathcal{C}$ and $\mathcal{D}$ are two categories.

Then a functor $\mathcal{F}: \mathcal{C} \rightarrow \mathcal{D}$ consists of

* a map $\mathcal{F}: Ob(\mathcal{C}) \rightarrow Ob(\mathcal{D})$, and

* for each pair of objects $X, Y \in \mathcal{C}$, a map

\begin{equation}
\mathcal{F}_{X,Y}:
\Hom_{\mathcal{C}}(X,Y)
\rightarrow
\Hom_{\mathcal{D}}(\mathcal{F}(X),\mathcal{F}(Y))
\end{equation}

that preserves 1) the composition rule in each category, that is, for morphisms $f: X \rightarrow Y$, $g: Y \rightarrow Z$ in $\mathcal{C}$, we have that

\begin{equation}
\mathcal{F}(g \circ_{\mathcal{C}} f)
\mathcal{F}(g) \circ_{\mathcal{D}} \mathcal{F}(f)
\end{equation}

and 2) the identity morphisms, that is, for all $X \in Ob(\mathcal{C})$, we have that

\begin{equation}
\mathcal{F}_{X,X}(1_X) = 1_{\mathcal{F}(X)}
\end{equation}

We list some examples of functors below.

* the functor Grp $\rightarrow$ Set, which to each group $G$ associates the underlying set, and to each group homomorphism, the underlying set map.

* the functor Set$ \rightarrow$ Vect$_{\mathbb{R}}$, which to each set associates the vector space spanned by the elements of the set, and, for a given set map, the associated linear map is the one that is given by extending linearly.

§ MONOIDAL CATEGORIES AND MONOIDAL FUNCTOR PROOFS

We first show that $\mathcal{C}(G)$, for the groups $G = S_n, O(n), Sp(n)$ and $SO(n)$,
is a subcategory of $\Rep(G)$.

The category of representations of a group $G$, $\Rep(G)$, is defined as follows.

Let $G$ be a group. Then $\Rep(G)$ is the category
whose objects are pairs $(V, \rho_V)$,
where $\rho_V: G \rightarrow GL(V)$ is a representation of $G$,
for any pair of objects
$(V, \rho_V)$ and $(W, \rho_W)$,
the morphism space,
$\Hom_{Rep(G)}((V, \rho_V), (W, \rho_W))$,
is precisely the vector space of $G$–equivariant linear maps $V \rightarrow W$,
$\Hom_{G}(V, W)$.

The vertical composition of morphisms is given by the usual composition of linear maps, the
horizontal composition of morphisms
is given by the usual tensor product of linear maps, both of which are associative operations, and the unit object is given by $(\mathbb{R}, 1_\mathbb{R})$, where $1_\mathbb{R}$ is the one-dimensional trivial representation of $G$.

With this definition, it is clear that $\mathcal{C}(G)$ is a subcategory of $\Rep(G)$.
In fact, it is a full subcategory, as, for any pair of objects in $C(G)$,
$((\mathbb{R}^n)^{\otimes k},\rho_k)$ and $((\mathbb{R}^n)^{\otimes l},\rho_l)$,
the morphism space,
$\Hom_{\mathcal{C}(G)}(((\mathbb{R}^n)^{\otimes k},\rho_k), ((\mathbb{R}^n)^{\otimes l},\rho_l))$
is precisely
$\Hom_{\Rep(G)}(((\mathbb{R}^n)^{\otimes k},\rho_k), ((\mathbb{R}^n)^{\otimes l},\rho_l))$.

We now prove the existence of the full, strict $\mathbb{R}$–linear monoidal functors given in Section <ref>.

The functor $\Theta$ is full because the map (<ref>), for all objects $k, l$ in $\mathcal{P}(n)$, which, by definition, is (<ref>), is surjective, by Theorem <ref>.

To show that $\Theta$ is strict, $\mathbb{R}$–linear monoidal,
we need to show that $\Theta$ satisfies the conditions of Definition <ref>.
The picture to have in mind for point 2. below is that the tensor product on set partition diagrams places the diagrams side-by-side, without any overlapping of vertices.

* Let $k, l$ be any two objects in $\mathcal{P}(n)$. Then

\begin{align}
\Theta(k \otimes l)
& = \Theta(k + l) \\
& = ((\mathbb{R}^{n})^{\otimes k+l}, \rho_{k+l}) \\
& = ((\mathbb{R}^{n})^{\otimes k} \otimes (\mathbb{R}^{n})^{\otimes l}, \rho_k \otimes \rho_l) \\
& = \Theta(k) \otimes \Theta(l)
\end{align}

* It is enough to show this on arbitrary basis elements of arbitrary morphism spaces as the morphism spaces are vector spaces.
Suppose that $f: k \rightarrow l$ and $g: q \rightarrow m$ are two basis elements in $\Hom_{\mathcal{P}(n)}(k,l)$ and $\Hom_{\mathcal{P}(n)}(q,m)$ respectively.
Then $f = d_\pi$ for some set partition $\pi$ in $\Pi_{l+k}$, and $g = d_\tau$ for some set partition $\tau$ in $\Pi_{m+q}$.

As $\Hom_{\mathcal{P}(n)}(k,l) = P_k^l(n)$
and $\Hom_{\mathcal{P}(n)}(q,m) = P_q^m(n)$, we have, by (<ref>), that $f \otimes g$ is an element of $P_{k+q}^{l+m}(n) = \Hom_{\mathcal{P}(n)}(k+q,l+m)$.

In particular, $f \otimes g = d_{\omega}$ for the set partition $\omega \coloneqq \pi \cup \tau \in \Pi_{l+m+k+q}$.

By Theorem <ref>, we have that $\Theta(f) = E_\pi$, $\Theta(g) = E_\tau$, and $\Theta(f \otimes g) = E_\omega$.

\begin{align}
\Theta(f) \otimes \Theta(g)
& =
E_\pi \otimes E_\tau \\
& =
\left(
\sum_{I \in [n]^l, J \in [n]^k}
\delta_{\pi, (I,J)}
\right)
\otimes
\left(
\sum_{X \in [n]^m, Y \in [n]^q}
\delta_{\tau, (X,Y)}
\right)
\\
& =
\sum_{(I,X) \in [n]^{l+m}, (J,Y) \in [n]^{k+q}}
\delta_{\omega, (I,X),(J,Y))}
E_{(I,X),(J,Y)} \label{deltaprod} \\
& = E_\omega \\
& = \Theta(f \otimes g)
\end{align}

where (<ref>) holds because $S_\pi((I,J)) \cup S_\tau((X,Y))
= S_\omega((I,X),(J,Y))$.

* It is clear from the statement of the theorem that
$\Theta$ sends the unit object $0$ in $\mathcal{P}(n)$ to $(\mathbb{R}, 1_\mathbb{R})$, which is the unit object in $\mathcal{C}(S_n)$.

* This is immediate because the map (<ref>) is $\mathbb{R}$–linear by Theorem <ref>.

The proof is practically identical to that of Theorem <ref>, except we replace $\Theta$ by $\Phi$.

The proof is very similar to that of Theorem <ref>.
For point 2., we need to consider the form of the matrix (<ref>),
but it is not hard to see how the proof of point 2. for Theorem <ref> can be adapted for this situation, since,
if $d_{\beta_1}$ is a $(k,l)$–Brauer diagram, and
if $d_{\beta_2}$ is a $(q,m)$–Brauer diagram, then,
defining $\omega \coloneqq \beta_1 \cup \beta_2$, that is,
$d_\omega$ is a $(k+q,l+m)$–Brauer diagram,
we have that
two vertices in $d_{\beta_i}$ are in different rows (the same row) if and only if they are in different rows (the same row) of $d_\omega$.

The proof can be found in <cit.>.