text:
\begin{document}
\begin{abstract}
\hfill \\
We prove the algebraic density property for the Calogero--Moser spaces $\camo{n}$, and give a description of the identity component of the group of holomorphic automorphisms of $\camo{n}$.
\end{abstract}

\maketitle

\section{Introduction}

The Calogero--Moser space $\camo{n}$, $n \in \NN$, describes the phase space of a Calogero--Moser system, which is a $n$-particle system in classical physics with a certain Hamiltonian. The idea to study these spaces as quotients of a group action goes back to Kazhdan, Kostant and Sternberg \cite{KKS}. A lot of interesting mathematical properties of these spaces were established by Wilson \cite{wilson}, and since then they have been an ongoing object of study in pure mathematics.

\begin{definition}[\cite{wilson}]
Let $\camo{n}$ be the $n$-th \emph{Calogero--Moser space}, $n \in \NN$, defined as follows:
\[
\begin{split}
\widetilde{\camo{n}} :=
\{
(X,Y) \in \mat{n \times n}{\CC} \times \mat{n \times n}{\CC} \;:\; \\ \rank( [X,Y] + \id ) = 1
\}
\end{split}
\]
Let $\glgrp_n(\CC)$ act on $\widetilde{\camo{n}}$ by simultaneous conjugation in both factors: $G \cdot (X,Y) := (GXG^{-1},GYG^{-1})$. Then
\[
{\camo{n}} := \widetilde{\camo{n}} \,/\!/ \, \glgrp_n(\CC)
\]
\end{definition}

\smallskip

Note that this $\glgrp_n(\CC)$-action also conjugates the commutator $[X,Y]$ and hence leaves the rank-$1$ condition invariant, thus the Calogero--Moser space $\camo{n}$ is well-defined.

One can easily see from the definition that $\camo{1} = \CC^2$. However for $n \geq 2$, the structure of the Calogero--Moser spaces $\camo{n}$ becomes more complicated. In fact, according to \cite{wilson}*{Section~8} the space $\camo{n}$ is diffeomorphic to the Hilbert scheme of $n$ points in $\CC^2$, whose Borel--Moore homology has been calculated by Ellingsrud and Str{\o}mme \cite{homology}.

As shown in \cite{wilson}*{Section~1}, $\camo{n}$ is a smooth irreducible complex affine-algebraic variety of dimension $2n$. Later, Berest and Wilson showed that the group of algebraic automorphisms of $\camo{n}$ acts transitively \cite{transitive}. And more recently, Popov \cite{popov}*{Remark~5} established that $\camo{n}$ is a rational variety.

\bigskip

We note that the Calogero--Moser space $\camo{n}$ is a flexible variety (see Section \ref{secflex}). This follows directly from the transitive action of the subgroup that is generated by locally nilpotent derivations, which had been established by Berest and Wilson \cite{transitive}, and a more general result characterizing flexibility by Arzhantsev et al.\ \cite{A-Z}. This is implicit also in Berest--Eshmatov--Eshmatov \cite{BEE}*{Conjecture 1, Remark 3}, but seems not to have been stated explicitly in the literature yet. Independent of the more general result, we give a short proof of the flexibility of the Calogero--Moser space $\camo{n}$ using only the transitivity result \cite{transitive}, see Proposition~\ref{propflex}.

\bigskip

The main result of this article is that the Calogero--Moser space $\camo{n}$ enjoys the algebraic density property, see Theorem~\ref{thmdens}. While this is well-known for $\camo{1} = \CC^2$, these results are new for the Calogero--Moser spaces $\camo{n}$, $n \geq 2,$ which provide new examples of flexible manifolds and of manifolds with the algebraic density property. Stein manifolds with the density property enjoy a Runge-type approximation theorem for holomorphic injections, which in turn can be used to show infinite transitivity, see Section \ref{secdens}.

\smallskip

In the Section \ref{secexample} we give an explicit description of $\camo{2}$ as an affine variety, and describe some Calogero--Moser flows and other $\CC^+$-flows of different type on $\camo{2}$.

\section{Flexibility and infinite transitivity}
\label{secflex}

The notion of flexibility was introduced in a paper by Arzhantsev et al.\ \cite{A-Z} and has since stimulated a lot of research in algebraic geometry and complex analysis.

\begin{definition}
Let $G$ be a group acting on a set $M$. We call the action \emph{infinitely transitive} if it is $m$-transitive for every $m \in \NN$.
\end{definition}

\begin{remark}
The term ``infinitely transitive'' may be misleading, but has been established in the literature. However, in the algebraic category, it is clear that $m$-transitivity for every $m \in \NN$ is the best one can hope for. In the holomorphic category, the situation is slighly more sophisticated. By a result of Winkelmann \cite{winkelmann}, every Stein manifold of dimension at least $2$ contains an infinite closed discrete subset whose image under a holomorphic automorphism can't be prescribed. Hence, $m$-transitivity for every $m \in \NN$ is the optimal result also in the holomorphic category.
\end{remark}

\begin{definition}
We call a complex algebraic variety $M$ \emph{flexible} if there exist finitely many locally nilpotent derivations on the ring of regular functions of $M$ such they span the tangent space in each point of $M_{\mathrm{reg}}$.
\end{definition}

For a reference book on locally nilpotent derivations, we refer the reader to the monograph of Freudenburg \cite{LND}. We only want to emphasize the following basic remark as we may switch between $\CC^{+}$-actions and locally nilpotent derivations.

\begin{remark}
The flow of a locally nilpotent derivation is an algebraic $\CC^{+}$-action. Conversely, the time-derivative of an algebraic $\CC^{+}$-action is a locally nilpotent derivation.
\end{remark}

\begin{definition}
The \emph{group of special automorphisms} $\mathrm{SAut}(M)$ of a complex algebraic variety $M$ is the group generated by the flows of locally nilpotent derivations on the ring of regular functions of $M$.
\end{definition}

\begin{theorem}[\cite{A-Z}*{Theorem~0.1}]
\label{thmflextrans}
For a reduced irreducible complex affine-algebraic variety $M$ of dimension $\geq 2$, the following conditions are equivalent.
\begin{enumerate}
\item The group $\mathrm{SAut}(M)$ acts transitively on $M_{\mathrm{reg}}$.
\item The group $\mathrm{SAut}(M)$ acts infinitely transitively on $M_{\mathrm{reg}}$.
\item $M$ is a flexible variety.
\end{enumerate}
\end{theorem}

\begin{example}
Examples of flexible complex manifolds, that are affine, include:
\begin{enumerate}
\item Complex linear groups without non-constant morphisms to $\CC^\ast$
\item Smooth Danielewski surfaces $\{ (x,y,z) \in \CC^3 \,:\,  x \cdot y - p(z) = 0 \}$ where $p$ is a polynomial with simple roots
\end{enumerate}
\end{example}

We give here a short and more elementary proof of the flexibility of the Calogero--Moser spaces that does not rely on the much more general result of Theorem \ref{thmflextrans}  above.

\begin{definition}[\cite{densitycriteria}*{Definition 2.1}]
Let $M$ be a complex algebraic manifold. We call $M$ \emph{tangentially semi-homogeneous} if it is homogeneous (with respect to the algebraic automorphisms of $M$) and admits a \emph{generating set} consisting of one vector, i.e.\ $\exists x_0 \in M, \; \exists v \in T_{x_0} M$ such that the image of $v$ under the induced action of the isotropy group of $x_0$ on $T_{x_0} M$ spans $T_{x_0} M$.
\end{definition}

\begin{proposition} \hfill
\label{propflex}
\begin{enumerate}
\item The Calogero--Moser space $\camo{n}$ is flexible for every $n \geq 1$.
\item The Calogero--Moser space $\camo{n}$ is tangentially semi-homogeneous for every $n \geq 1$.
\end{enumerate}
\end{proposition}

\begin{proof}
Let $\Upsilon = (\Upsilon_1, \Upsilon_2) \colon \camo{n} \to \CC^n/S_n \times \CC^n/S_n$ be the map that sends the matrices $(X,Y)$ to their eigenvalues (counted with multiplicity). The fibres of $\Upsilon_1$, $\Upsilon_2$, respectively, are of dimension $n$, see \cite{wilson}*{Section~1}.

For any point $(X,Y) \in \camo{n}$ with $X$ having $n$ distinct eigenvalues, according to Wilson \cite{wilson}*{Proposition~1.10} we can choose the following representative
\[
\begin{split}

&\left(
\begin{pmatrix}
\lambda_1 & & & & \\
& \lambda_2 & & & \\
& & \ddots & & \\
& & & & \lambda_n \\
\end{pmatrix}, \right. \\
&\quad
\left.
\begin{pmatrix}
\alpha_1 & (\lambda_1 - \lambda_2)^{-1} & \dots &   (\lambda_1 - \lambda_n)^{-1} \\
(\lambda_2 - \lambda_1)^{-1} & \alpha_2 & \ddots & \vdots \\
\vdots & \ddots & \ddots & (\lambda_{n-1} - \lambda_n)^{-1} \\
(\lambda_n - \lambda_1)^{-1} & \dots & (\lambda_{n} - \lambda_{n-1})^{-1} & \alpha_n \\
\end{pmatrix}
\right)

\end{split}
\]
where $(\alpha_1, \dots, \alpha_n) \in \CC^n$ is arbitrary.
This parametrization provides a trivialization of the tangent bundle over the subset $\{(X,Y) \in \camo{n} \,:\, X \text{ has } n \text{ distinct eigenvalues} \}$ which is biholomorphic to
\[
\Omega := \left( \CC^n \setminus \mathrm{diag} \right) \times \CC^n \ni (\lambda_1, \dots, \lambda_n, \alpha_1, \dots \alpha_n)
.\]
Note that the complex numbers $\alpha_1, \dots, \alpha_n$ are \textbf{not} the eigenvalues of $Y$.

\smallskip

The flow maps $(X, Y) \mapsto (X, Y + t X^k)$, where $k \in \NN_0$, are called \emph{Calogero--Moser flows}. It is easy to see that they are well-defined on $\camo{n}$, since they leave the commutator $[X,Y]$ invariant. Since these algebraic flow maps exist for all $t \in \CC$, they correspond to complete algebraic vector fields, which we denote by $X^k \frac{\partial}{\partial Y}$, slightly abusing notation.
We will also call their ``dual'' counterparts $(X, Y) \mapsto (X+ t Y^k, Y)$ \emph{Calogero--Moser flows}, whose corresponding vector fields we denote by $Y^k \frac{\partial}{\partial X}$.

\begin{enumerate}
\item Choose a point $(X_0, Y_0) \in \Omega$ such that $\lambda_1, \dots, \lambda_n, \alpha_1, \dots, \alpha_n$ do not satisfy any non-trivial polynomial relation over $\QQ$. Then the diagonal entries  of $X_0, X_0^2, \dots, X_0^n$, i.e.\ $(\lambda_1^k, \dots, \lambda_n^k)$ for $k = 1, \dots, n$, will span a $n$-dimensional vector space. Similarly, the diagonal entries of $Y_0, Y_0^2, \dots, Y_0^n$, which are rational functions of $\lambda_1, \dots, \lambda_n, \alpha_1, \dots, \alpha_n$ with integer coefficients, will span a $n$-dimensional vector space. Then the vector fields $X^k \frac{\partial}{\partial Y}$ for $k = 1, \dots, n$ span the tangent space in $(X_0, Y_0)$ along the fibre of $\Upsilon_2$. Let $\mu_1, \dots, \mu_n$ denote the eigenvalues of $Y_0$, which then can't satisfy any non-trivial polynomial relation over $\QQ$ either.
Using the same coordinates as above, but with roles of $X$ and $Y$ interchanged, we see that the vector fields $Y^k \frac{\partial}{\partial X}$ for $k = 1, \dots, n$ span the tangent space in $(X_0, Y_0)$ along the fibre of $\Upsilon_1$.
Together, these $2n$ vector fields with complete algebraic flows span the tangent space in $(X_0, Y_0)$ and thus on a Zariski-open subset of $\camo{n}$.

Using the well-known transitivity \cite{transitive}*{Theorem~1.3} of the algebraic automorphism group of the space, the flexibility follows from standard arguments: Let $A \subset \camo{n}$ be the subvariety where the vector fields above do not span. Pick a point $x_0 \in A$ and a point $x_1 \in \camo{n} \setminus A$. By transitivity, there exists an algebraic automorphism $\Phi$ of $\camo{n}$ with $\Phi(x_0) = x_1$. Conjugate the vector fields that span in $x_1$ with $\Phi$, to obtain spanning vector fields in $x_0$. This process will terminate after finitely many steps, since it reduces the dimension of the connected component of $A$ that contains $x_1$ in every step, and since there are only finitely many connected components.
\item
Let $(X_0,Y_0) \in \camo{n}$ be as above with the same coordinate neighborhood. Flexibility implies straight-forward homogeneity. To prove tangential semi-homogeneity, we need to find a tangent vector that is a generating set.
For $k \in \NN_0$, the functions
\begin{align*}
F_k(X, Y) &= (X + ( \mathop{\mathrm{tr}} Y - \mathop{\mathrm{tr}} Y_0 ) \cdot Y^k, Y) \\
G_k(X, Y) &= (X , Y + ( \mathop{\mathrm{tr}} X - \mathop{\mathrm{tr}} X_0 ) \cdot X^k)
\end{align*}
are well-defined and fix the point $(X_0, Y_0) \in \camo{n}$.
For their derivatives we obtain
\begin{align*}
d_{(X_0,Y_0)} F_k &= \begin{pmatrix}
 \id & d_{Y_0} \mathop{\mathrm{tr}} Y \cdot Y_0^k \\
   0 & \id
\end{pmatrix} \\
d_{(X_0,Y_0)} G_k &= \begin{pmatrix}
 \id & 0 \\
   d_{X_0} \mathop{\mathrm{tr}} X \cdot X_0^k & \id
\end{pmatrix}
&= \begin{pmatrix}
 \id & 0 \\
  \mathop{\mathrm{diag}}(\lambda_1^k, \dots, \lambda_n^k) & \id
\end{pmatrix}
\end{align*}
Any vector $w \in T_{(X_0,Y_0)}\camo{n}$ whose projections to each of the one-dimensional subspaces spanned by $\frac{\partial}{\partial \lambda_k}, \frac{\partial}{\partial \alpha_k}$, $k = 1, \dots, n$ is non-trivial, will be a generating set. \qedhere
\end{enumerate}
\end{proof}

\begin{cor}
The algebraic automorphism group of $\camo{n}$ acts infinitely transitively on $\camo{n}$.
\end{cor}

\begin{remark}
This corollary does not make use of the two-transitivity results of Berest--Eshmatov--Eshmatov \cite{BEE}, but only of the flexibility (and hence implicitly of the transitivity result). This corollary is also implied by a recently established result of Kuyumzhiyan \cite{kuyu} where they prove that a smaller group, which is a proper subgroup of the algebraic automorphism group, already acts infinitely transitively on $\camo{n}$.
\end{remark}

\section{Density property}
\label{secdens}

The density property was introduced by Varolin \cites{Varolin1,Varolin2} in order to describe that the holomorphic automorphism group of a complex manifold is large. The most important consequence is the so-called Anders\'en--Lempert Theorem. Among many interesting geometric consequences it implies that for a Stein manifold with the density property, the group of holomorphic automorphisms acts infinitely transitively.

\begin{definition}[\cite{Varolin1}]
Let $M$ be Stein manifold. We say that $M$ enjoys the \emph{density property} if the Lie algebra that is generated by all complete holomorphic vector fields on $M$ is dense (w.r.t.\ compact-open topology) in the Lie algebra of all holomorphic vector fields on $M$.
\end{definition}

In practice it is often simpler to fulfil the following, more algebraic condition, which then implies the density property:

\begin{definition}[\cite{Varolin1}]
Let $M$ be complex affine-algebraic manifold. We say that $M$ enjoys the \emph{algebraic density property} if the Lie algebra that is generated by all complete polynomial vector fields on $M$ is agrees with the Lie algebra of all polynomial vector fields on $M$.
\end{definition}

There is a close relation between flexibility and density property, in particular due to the fact that locally nilpotent derivations are complete polynomial vector fields. So far, all known examples of complex affine-algebraic manifolds that are flexible, also enjoy the algebraic density property. However, not all manifolds with the algebraic density property are flexible, a counter\-example is $\CC \times \CC^\ast$.

\begin{theorem}[Anders\'en--Lempert \cite{AL2}, Forstneri\v{c}--Rosay \cites{FR,FR-err}, Varolin \cite{Varolin1}]
\label{andlemp}
Let $M$ be a Stein manifold with the density property and with a distance function $d$. Let $\Omega \subseteq M$ be a Stein open subset and $\varphi \colon [0,1] \times \Omega \to M$ be a continuously differentiable map such that
\begin{enumerate}
\item $\varphi_0 \colon \Omega \to M$ is the natural embedding,
\item $\varphi_t \colon \Omega \to M$ is holomorphic and injective for every $t \in [0,1]$,
\item {$\varphi_t(\Omega)$ is a Runge subset of $M$ for every $t \in [0,1]$.}
\end{enumerate}
Then for every $\varepsilon > 0$ and for every compact $K \subset \Omega$ there exists a continuous family $\Phi \colon [0, 1] \to \mathrm{Aut}(M)$
with $\Phi_0 = \id_M$ and \[
\sup_{x \in K} d( \varphi_t(x), \Phi_t(x) ) < \varepsilon \] for every $t \in [0,1]$.

\smallskip
Moreover, these automorphisms can be chosen to be compositions of flows of completely integrable generators of any Lie subalgebra of holomorphic vector fields that is dense in the Lie algebra of all holomorphic vector fields on $M$.
\end{theorem}

\begin{cor}[\cite{Varolin1}]
Let $M$ be a Stein manifold with the density property.
Then the natural action of the group of holomorphic automorphisms of $M$ on $M$ is infinitely transitive.
\end{cor}

\bigskip

A crucial contribution for proving the algebraic density property are the following definition and theorem of Kaliman and Kutzschebauch:

\begin{definition}[\cite{densitycriteria}*{Definition~2.5}]
\label{defcompat}
Let $\Theta_1$ and $\Theta_2$ be non-trivial polynomial vector fields on an complex affine-algebraic manifold $M$ such that $\Theta_1$ is a locally nilpotent derivation on $\CC[M]$, and $\Theta_2$ is either also locally nilpotent or semi-simple. That is, $\Theta_j$ generates an algebraic action of $H_j$ on $M$
where $H_1 \cong \CC^+$ and $H_2$ is isomorphic to either $\CC^+$ or $\CC^\ast$. We say that $\Theta_1$ and $\Theta_2$ form a \emph{compatible pair} if (i) the vector space $\mathrm{span}(\ker \Theta_1 \cdot \ker \Theta_2)$ contains a nonzero ideal in $\CC[M]$ and (ii) some element $a \in \ker \Theta_2$ is of degree $1$ with
respect to $\Theta_1$, i.e.\ $\Theta_1(a) \in \ker \Theta_1 \setminus \{0\}$.
\end{definition}

\begin{theorem}[\cite{densitycriteria}*{Theorem~2, and Remark~2.7}]
\label{thmcompatpair}
Let $M$ be a complex-affine algebraic manifold that
\begin{enumerate}
\item is tangentially semi-homogenous, and
\item admits a compatible pair,
\end{enumerate}
then $M$ enjoys the algebraic density property.
\end{theorem}

\begin{example} Known examples of complex manifolds with the algebraic density property include the following.
\begin{enumerate}
\item Homogeneous spaces of linear algebraic groups $G/H$ that are affine and whose connected components are different from $\CC$ or $(\CC^\ast)^n$, see \cite{MR3623226}.
\item Smooth Danielewski surfaces $\{ (x,y,z) \in \CC^3 \,:\,  x \cdot y - p(z) = 0 \}$ where $p$ is a polynomial with simple roots, see \cite{MR2350038}.
\item A family of cubics including the Koras--Russel cubic threefold, see \cite{MR3513546}.

\item Gizatullin surfaces with a reduced degenerate fibre and a transitive action of the algebraic automorphism group, see \cite{MR3833804}.
\end{enumerate}
\end{example}

\begin{theorem}
\label{thmdens}
The Calogero--Moser spaces $\camo{n}$ have the algebraic density property.
\end{theorem}
\begin{proof}
Since it has already been established that $\camo{n}$ is tangentially semi-homogeneous in Proposition \ref{propflex}, we only need to find a compatible pair in order to apply Theorem \ref{thmcompatpair} above.

\smallskip

We consider two complete $\CC^+$-actions on $\camo{n}$ with times $t, s$, respectively:
\[
(X,Y) \mapsto (X + t \cdot Y,Y), \qquad (X,Y) \mapsto (X,Y + s \cdot X)
\]
These actions are non-trivial on $\camo{n}$ since they change the eigenvalues and therefore the conjugacy classes of the representatives $(X,Y)$.
In order to show that they form a compatible pair, we embed those two actions into a $\slgrp_2(\CC)$-action\footnote{Unfortunately, the quotient of an affine-algebraic variety by $\CC^+$-action does not need to be affine. However this is always true for quotients of affine varieties by reductive subgroups where moreover geometric and categorical quotients agree. This then also holds for quotients of $\CC^+$, as long as this $\CC^+$ is a subgroup of a reductive group that is acting. See \cite{LND} for details.} on $\mat{n \times n}{\CC} \times \mat{n \times n}{\CC}$:
\[
\begin{pmatrix}
a_{11} & a_{12} \\
a_{21} & a_{22}
\end{pmatrix}
\cdot (X, Y) = ( a_{11} X + a_{12} Y, a_{21} X + a_{22} Y )
\]
Since $[a_{11} X + a_{12} Y, a_{21} X + a_{22} Y] = (a_{11} a_{22} - a_{12} a_{21}) \cdot [X, Y] = [X,Y]$ and $a_{11} G X G^{-1} + a_{12} G Y G^{-1} = G (a_{11} X + a_{12} Y ) G^{-1}$ as well as $a_{21} G X G^{-1} + a_{22} G Y G^{-1} = G (a_{21} X + a_{22} Y ) G^{-1}$, this action descends to $\camo{n}$. The $\CC^+$-actions in question are then embedded as subgroups
\begin{align*}
&\begin{pmatrix}
1 & t \\ 0 & 1
\end{pmatrix}, \; t \in \CC \\
&\begin{pmatrix}
1 & 0 \\ s & 1
\end{pmatrix}, \; s \in \CC, \quad \text{respectively.}
\end{align*}
Thus, the vector fields corresponding to these two $\CC^+$-actions above form a compatible pair according to \cite{densitycriteria}*{Lemma~3.6}.
\end{proof}

\begin{remark}
We believe that the following vector fields also form a compatible pair on $\camo{n}$:
\[
(X,Y) \mapsto (X + t \cdot \id,Y), \qquad (X,Y) \mapsto (X,Y + s \cdot \id)
\]
Since they are not embedded in a $\slgrp_2(\CC)$ action, more work would be needed to show that their kernels are big enough. In Section \ref{secexample}, we show that these two vector fields indeed form a compatible pair for $n = 2$.
\end{remark}

As a consequence of Theorem \ref{andlemp}, we obtain a description of the holomorphic automorphisms.

\begin{definition}
Let $M$ be a complex manifold and let $\Theta$ be a complete holomorphic vector field on $M$ with flow map $\varphi_t$. Let $f \colon M \to \CC$ be a holomorphic function.
\begin{enumerate}
\item If $f \in \ker \Theta$, then we call the vector field $f \cdot \Theta$ a \emph{shear (vector field)} of $\Theta$, and we call the corresponding flow map a \emph{shear} of $\varphi_t$.
\item If $f \in \ker (\Theta \circ \Theta)$, but  $f \notin \ker \Theta$, then we call the vector field $f \cdot \Theta$ an \emph{overshear (vector field)} of $\Theta$, and we call the corresponding flow map an \emph{overshear} of $\varphi_t$.
\end{enumerate}
\end{definition}

\begin{remark}
For a complete vector field $\Theta$, the shear or overshear vector field $f \cdot \Theta$ is complete as well \cite{shear}. If $\Theta$ is a locally nilpotent derivation and $f \in \ker \Theta$ a regular function, then the shear $f \cdot \Theta$ is a locally nilpotent derivation as well, and sometimes called a \emph{replica} of $\Theta$ \cite{A-Z}*{Example~1.19}. The flow maps can be given explicitly \cite{fibred}*{Lemma~3.3}.
\begin{enumerate}
\item If $\Theta(f) = 0$, then the flow is given by $\varphi_{\displaystyle t \cdot f(x)}(x)$.
\item If $\Theta(\Theta(f)) = 0$, then the flow is given by $\varphi_{\displaystyle \varepsilon(t \Theta_x f) \cdot t \cdot f(x)}(x)$ where $\varepsilon \colon \CC \to \CC$ is given by $\varepsilon(\zeta) = \sum_{k=1}^\infty \frac{\zeta^{k-1}}{k!} = \frac{e^\zeta - 1}{\zeta}$
\end{enumerate}
\end{remark}

\begin{theorem}
\label{camoautos}
Let $\varphi$ be a holomorphic automorphism of $\camo{n}$ that is connected to the identity by a continuously (real) differentiable path of holomorphic automorphisms of $\camo{n}$. Then $\varphi$ can be approximated, uniformly on compacts of $\camo{n}$, by compositions of automorphisms of the form $(X, Y) \mapsto (X, Y + p(X))$ and $(X, Y) \mapsto (X + q(Y),Y)$, and their shears and overshears. Here, $p$ and $q$ are polynomials in one complex variable, evaluated on matrices.
\end{theorem}

\begin{example}
Consider the Calogero--Moser flow
\[
\varphi_t((X,Y)) = (X, Y + t \cdot \id)
\]
Obviously all well-defined polynomial functions of $X$ only are invariant functions, in particular all the elementary symmetric functions of the eigenvalues of $X$ and all polynomials therein.
A shear of $\varphi_t$ is for example given by
\[
(X,Y) \mapsto (X, Y + t \cdot (\mathop{\mathrm{tr}}(X) + \det(X)) \cdot \id)
\]
\end{example}

\begin{proof}[Proof of Theorem \ref{camoautos}]
This follows directly from Theorem \ref{andlemp} and the fact that the proof of transitivity in \cite{transitive}*{Theorem 1.3} requires only Calogero--Moser flows, and hence also flexibility requires only Calogero--Moser flows and their shears. The proof of the density property also involves shears and overshears of such Calogero--Moser flows.
\end{proof}

\begin{remark}
It is not obvious whether the automorphism given by \[(X,Y) \mapsto (Y^\intercal,X^\intercal)\] is connected to the identity by a continuously differentiable path within the holomorphic automorphisms of $\camo{n}$ for $n \geq 2$.
\end{remark}

\section{Example: automorphisms of $\camo{2}$}
\label{secexample}

In the following we will study $\camo{2}$. Our goal is to give an explicit description of the manifold (up to a finite cover) as well as some of the complete vector fields and their kernels.

We may choose $Y = \begin{pmatrix} \lambda & 1 \\ 0 & \lambda+\varepsilon \end{pmatrix}$ as a representative which will work both for the case of different eigenvalues and the double eigenvalue case which necessarily can't be diagonal due to the rank-$1$ condition. Note that for $\varepsilon \neq 0$, there are two representatives for the same element:
\[
Y = \begin{pmatrix} \lambda & 1 \\ 0 & \lambda+\varepsilon \end{pmatrix} \sim  \begin{pmatrix} \lambda+\varepsilon & 1 \\ 0 & \lambda \end{pmatrix}
\]
The rank-$1$ condition now becomes
\begin{equation}
\label{eqrank}
\tag{R}
  \varepsilon^2 x_{21} x_{12}
- \varepsilon x_{21} ( x_{22} - x_{11} )
+ 1 - x_{21}^2 = 0
\end{equation}
which forces $x_{21} \neq 0$.

The subgroup of $\glgrp_2(\CC)$ that leaves the given $Y$ invariant, can be parameterized by
\[G = \begin{pmatrix}g & h\\
0 & \epsilon h+g\end{pmatrix}\]
and we have to require $g \neq 0$. Then $h \in \CC$, if $\varepsilon = 0$, and $h \in \CC \setminus \{-g/\varepsilon\}$ otherwise.

Our goal is to find a canonical representative for $X$ with $x_{12} = 0$. To this end, we choose $g = x_{21}$ and note that
\[
G \cdot X \cdot G^{-1} =
\begin{pmatrix}{x_{11}}+h & (h {x_{22}}+{x_{12}} {x_{21}}-h {x_{11}}-{{h}^{2}})/({x_{21}}+\varepsilon  h) \\
{x_{21}}+\varepsilon  h & {x_{22}}-h\end{pmatrix}
\]
We can always solve $h x_{22}+x_{12} x_{21} - h x_{11}-h^2 = 0$ for $h$:
\[
2 h = \sqrt{(x_{22} - x_{11})^2 + 4 x_{12} x_{21}} + (x_{22} - x_{11})
\]
where we can take any complex root. We just need to check carefully if there exist different representatives for the same element. Using the formula above, we can see that there are generally two representatives which can be mapped to each other using $h = x_{22} - x_{11}$, and only one representative if $x_{22} = x_{11}$, i.e.\ when $X$ has a double eigenvalue:
\[
X = \begin{pmatrix}
x_{11} & 0 \\ x_{21} & x_{22}
\end{pmatrix} \sim \begin{pmatrix}{x_{22}} & 0\\
\epsilon  \left( {x_{22}}-{x_{11}}\right) +{x_{21}} & {x_{11}}\end{pmatrix}
\]

Setting $\delta = x_{22} - x_{11}$, we obtain
\[
\widehat{\camo{2}} := \{ (\lambda, \varepsilon, x_{11}, x_{21}, \delta) \in \CC^5 \; : \; x_{21}^2 + \varepsilon \cdot \delta \cdot x_{21} - 1 = 0 \}
\]

We can of course see easily that $\widehat{\camo{2}}$ is a smooth affine variety of dimension $4$. Moreover, we can find compatible pairs of $\CC^+$-actions and prove the algebraic density property for $\widehat{\camo{2}}$. However, we need to pass from $\widehat{\camo{2}}$ to $\camo{2}$ by identifying the pairs of equivalent representatives by two $\mathbb{Z}_2$-actions:
\begin{align}
\label{eqz2one}
(\lambda, \varepsilon, x_{11}, x_{21}, \delta) &\mapsto (\lambda, \varepsilon, x_{11} + \delta, x_{21} + \varepsilon \delta, -\delta) \\
\label{eqz2two}
(\lambda, \varepsilon, x_{11}, x_{21}, \delta) &\mapsto (\lambda+\varepsilon, -\varepsilon, x_{11}, x_{21} + \varepsilon \delta, \delta)
\end{align}
Where the first action as obtained by the proper choice of $G$ above ($h = \delta$), interchanging $x_{11}$ and $x_{22}$ without affecting the representative $Y$, and where the second action is obtained by conjugation with $\begin{pmatrix}
1 & 0 \\ -\varepsilon & 1
\end{pmatrix}$ interchanging the eigenvalues of $Y$ and which is also affecting $X$.

\begin{lemma}
The ring of regular functions of $\camo{2}$ is generated by
\[
\begin{split}
\delta^2 = (\mathop{\mathrm{tr}} X)^2 - 4 \det X, \; \varepsilon^2 = (\mathop{\mathrm{tr}} Y)^2 - 4 \det Y, \\ 2 \lambda + \varepsilon = \mathop{\mathrm{tr}} Y, \; 2 x_{11} + \delta = \mathop{\mathrm{tr}} X, \; x_{21} + \frac{1}{x_{21}}
\end{split}
\]
\end{lemma}
\begin{proof}
We have $\camo{2} = \widehat{\camo{2}} \,/\!/\, \ZZ_2 \times \ZZ_2$. The generators can be obtained by symmetrizing the generators of the ring of regular functions of $\widehat{\camo{2}}$.
\end{proof}

We have the following obvious $\CC^+$-actions on $\widehat{\camo{2}}$ that commute with both $\ZZ_2$-actions \eqref{eqz2one} and \eqref{eqz2two} above, and hence give rise to $\CC^+$-actions on $\camo{2}$:
\begin{align*}
(\lambda, \varepsilon, x_{11}, x_{21}, \delta) &\stackrel{\varphi_t}{\mapsto} (\lambda, \varepsilon, x_{11} + t, x_{21}, \delta) \\
(\lambda, \varepsilon, x_{11}, x_{21}, \delta) &\stackrel{\psi_s}{\mapsto} (\lambda + s, \varepsilon, x_{11}, x_{21}, \delta)
\end{align*}

Moreover, these two actions, corresponding to $(X + t \cdot \id, Y)$ and $(X, Y + s \cdot \id)$ respectively, commute. The following functions (and consequently all polynomials therein) on $\camo{2}$ are invariant under $\varphi_t$ and $\psi_t$:
\[
\delta^2, \varepsilon^2, x_{21} + \frac{1}{x_{21}}
\]
Note that the rank-$1$ condition \eqref{eqrank} gives a non-trivial polynomial relation between these three functions. We can now also see that for example
\[
(X,Y) \mapsto (X, Y + \varepsilon^2 t  \cdot \id) = (X, Y + ((\mathop{\mathrm{tr}} Y)^2 - 4 \det Y) \cdot t \cdot \id)
\]
is a $\CC^+$-action which is not a Calogero--Moser flow.

We have now explicitly identified two vector fields that form a compatible pair on $\camo{2}$ according to Definition \ref{defcompat}:
\begin{align*}
\Theta_1 &= \frac{d}{d s} \psi_s = \frac{\partial}{\partial \lambda} \\
\Theta_2 &= \frac{d}{d t} \varphi_t = \frac{\partial}{\partial x_{11}} \\
a &= 2 \lambda + \varepsilon
\end{align*}
with $\Theta_2(a) = 0$, $\Theta_1(a) \neq 0$ and $\Theta_1(\Theta_1(a)) = 0$.
For the kernels we obtain that
\begin{align*}
\ker \Theta_1 &\supset \mathop{\mathrm{span}} \{ \delta^2, \varepsilon^2, x_{21} + \frac{1}{x_{21}}, 2 x_{11} + \delta \} \\
\ker \Theta_2 &\supset \mathop{\mathrm{span}} \{ \delta^2, \varepsilon^2, x_{21} + \frac{1}{x_{21}}, 2 \lambda + \varepsilon \}
\end{align*}

Note that the kernel of a derivation is multiplicatively closed. It is then easy to see that $\mathop{\mathrm{span}} (\ker \Theta_1 \cdot \ker \Theta_2)$ contains the ideal generated by $(2 x_{11} + \delta) \cdot (2 \lambda + \varepsilon)$. Hence $\Theta_1$ and $\Theta_2$ form a compatible pair on $\camo{2}$.

We conclude with the remark that the automorphism $(X,Y) \mapsto (Y^\intercal,X^\intercal)$ is given by:
\[
(\lambda, \varepsilon, x_{11}, x_{21}, \delta) \mapsto (x_{11}, \delta, \lambda, x_{21}, \varepsilon)
\]
It it is not clear whether this automorphism is in the connected component of the identity.

\end{document}


TITLE: How do I find the point equidistant from three points $(x, y, z)$ and belonging to the plane $x-y+3z=0?$
QUESTION [2 upvotes]: I struggle to find the point ${P}$ equidistant from the points ${A(1,1,1), B(2,0,1), C(0,0,2)}$ and belonging to the plane ${x-y+3z=0}$.
Any tips?

REPLY [0 votes]: The line is perpendicular to the plane containing $A, B, C$. Transform the coordinates so the $ABC$ plane is the $x,y$-axis. Find the equidistant point on the $x,y$ plane. The line is the perpendicular to the plane at that point. Reverse the transform for that line.


TITLE: Let $G$ be a set with associative binary operation and a unit.
QUESTION [3 upvotes]: Let $G$ be a set with associative binary operation and a unit. Assume that for every $ g \in G$ there exists $ x \in G$ with $xg = 1$. Prove that $gx = 1$ is a consequence.
That above is the question, and i think i have the answer however I need clarification on the unit part of the question.
So by saying there is a unit in the set, does this mean that the neutral element is 1, and that the statement is saying that for $ x \in G$ there exists a left inverse $x$ such that $xg = 1$. And conversely we can say that for every $x$ there exists a left inverse say $g'$ such that $g'x=1$. And then by associativity i have proved the consequence.
Is this the right way to go and the simplest?

REPLY [1 votes]: Denote $x$ by $x_g$. then for each $g$:
$$gx_g=1gx_g=x_{x_g}x_ggx_g=x_{x_g}1x_g=x_{x_g}x_g=1$$


text:
\begin{document}

\maketitle

\begin{abstract}
  Hypergraph categories are symmetric monoidal categories where each object is equipped with a special commutative Frobenius algebra (SCFA). Dagger-hypergraph categories are the same, but with dagger-symmetric monoidal categories and dagger-SCFAs. In this paper, we show that finite matrices over a field $K$ of characteristic $0$ are complete for hypergraph categories, and that finite matrices where $K$ has a non-trivial involution are complete for dagger-hypergraph categories.
\end{abstract}

\section{Introduction}

Hypergraph categories enrich the language of traced symmetric monoidal or compact closed categories by allowing many inputs and outputs of a morphism to be connected together. We can represent this in a minimal, algebraic way by equipping each object in the category with a special commutative Frobenius algebra (SCFA). Intuitively, SCFAs endow an object with the ability to `split', `merge', `initialise', and `terminate' a wire. Furthermore they have extremely well-behaved normal forms, in that any connected diagram is equal. Thus, in addition to being able to interpret normal string diagrams, we can naturally interpret their hypergraph variations, for example:
\[ \tikzfig{dot-diagram-example} \quad := \quad
   \tikzfig{dot-diagram-expanded-canonical} \]

These structures play an important role in categories whose morphisms can be written as matrices over unital semirings, though they were perhaps overlooked for quite some time due to a certain failure of naturality, which concretely manifests itself as a `basis dependence'. However, in 2006 Coecke, Pavlovic, and Vicary pointed out that this basis-dependence is no accident, but rather that SCFAs \textit{characterise} bases in categories of linear maps~\cite{CPV}, as well as provide a useful set of building blocks for the types of maps one would define using a basis. This feature has been exploited numerous times, particularly within the program of categorical quantum mechanics~\cite{AC1,CD2,CPStar}.

This paper adds another piece to the story connecting SCFAs and bases. Namely, that the axioms of dagger-hypergraph categories are \textit{complete} for the category of finite-dimensional vector spaces where each object has a chosen basis, i.e. the category of \textit{finite matrices}.

\section{Preliminaries}\label{sec:prelims}

\begin{definition}
  A symmetric monoidal category $\mathcal C$ is called a \textit{dagger-symmetric monoidal category} if there exists a monoidal functor $(-)^\dagger : \mathcal C \to \mathcal C^{\textrm{op}}$ such that $\dagger \circ \dagger = 1_{\mathcal C}$ and:
  \[ \alpha^{-1} = \alpha^{\dagger} \qquad\qquad
     \lambda^{-1} = \lambda^{\dagger} \qquad\qquad
     \gamma^{-1} = \gamma^{\dagger} \]
  for $\alpha, \lambda, \gamma$ the associativity, unit, and symmetry natural transformations of $\mathcal C$.
\end{definition}

\begin{definition}
  A special commutative Frobenius algebra (SCFA) in a symmetric monoidal category $\mathcal C$ consists of a tuple $(A, \mu, \eta, \delta, \epsilon)$ satisfying the following equations:
  \[
      \mu \circ (1_A \otimes \eta) = 1_A \qquad\quad
      \mu \circ (1_A \otimes \mu) = \mu \circ (\mu \otimes 1_A) \qquad\quad
      \mu \circ \gamma_{A,A} = \mu
      \tag{\bf monoid}
  \]

  \[
      (1_A \otimes \epsilon) \circ \delta = 1_A \qquad\quad
      (1_A \otimes \delta) \circ \delta = (\delta \otimes 1_A) \circ \delta \qquad\quad
      \gamma_{A,A} \circ \delta = \delta
      \tag{\bf comonoid}
  \]

  \[
      (1_A \otimes \mu) \circ (\delta \otimes 1_A) = \delta \circ \mu
      \tag{\bf frobenius}
  \]

  \[
      \mu \circ \delta = 1_A
      \tag{\bf special}
  \]
  If $\mathcal C$ is a dagger-symmetric monoidal category, a \textit{dagger-SCFA} (dSCFA) additionally satisfies the equations
  \[ \mu^\dagger = \delta \qquad\qquad \eta^\dagger = \epsilon
     \tag{\bf dagger} \]
\end{definition}

From hence forth, we will always be working in a symmetric moniodal category, so we will use \textit{string diagram} notation for morphisms. In diagrammatic notation, the axioms of an SCFA become:
\ctikzfig{scfa-axioms}
The following is a well-known folk theorem about SCFAs.

\begin{theorem}[Spider] \label{thm:spider}
  Suppose $f$ and $g$ can be written as a connected string diagram from $A^{\otimes m}$ to $A^{\otimes n}$ consisting just of the morphisms from a single SCFA, then $f = g$.
\end{theorem}

\begin{proof}
  The proof proceeds by induction on the size of diagrams, showing that any connected diagram can be rewritten into a canonical diagram consisting of a tree of multiplies followed by an upside-down tree of comultiplies:
  \[ \tikzfig{spider-diag-arb} \quad \Rightarrow \quad \tikzfig{spider-diag-canonical} \]
  See e.g.~\cite{AleksThesis}, Theorem 3.2.28. For an alternative derivation via distributive laws see~\cite{Lack}, \S5.4.
\end{proof}

We express the fact that there is only one connected diagram with $m$ inputs and $n$ outputs by collapsing connected diagrams into a single dot:
\[
\tikzfig{spider-diag-arb} \ =\ \tikzfig{single-spider}
\]

\begin{definition}\label{def:spider}
  Canonical tree/co-tree morphisms are called \textit{spiders}. We let:
  \[ S_m^n \ := \ \tikzfig{S-mn}\ =\ \tikzfig{S-mn-tree} \]
\end{definition}

\section{(Dagger-)hypergraph categories}\label{sec:hypergraph-cats}

\begin{definition}
  A symmetric monoidal category $\mathcal C$ where every object is equipped with an SCFA satisfying:
  \[ (A, \whitemult) \otimes (B, \graymult) \ =\ (A \otimes B, \prodmult{white dot}{gray dot}) \]
  is called a \textit{hypergraph category}. Similarly, a dagger-symmetric monoidal category where every object is equipped with a dSCFA is called a \textit{dagger-hypergraph category}.
\end{definition}

A strong (dagger-)hypergraph functor is a strong (dagger-)symmetric monoidal functor that preserves the hypergraph structure. A strong monoidal functor is triple $(F, p_F, U_F)$ consisting of a functor $F : \mathcal C \to \mathcal D$ and natural isomorphisms:
\[ (p_F)_{A,B} : F(A \otimes B) \to FA \otimes FB  \qquad\qquad u_F : FI \to I \]
satisfying:
\[
\tikzfig{monoidal-assoc}
\]

\medskip

\[
\tikzfig{monoidal-unit1}
\qquad\qquad
\tikzfig{monoidal-unit2}
\]

Preserving symmetries can be written using `functorial box' notation (c.f.~\cite{PaulAndreFunBox}):

\[
\tikzfig{monoidal-symm}
\qquad\textrm{where}\qquad
\tikzfig{funct-box} \ :=\ Ff : FA \to FB
\]

A strong dagger-symmetric monoidal functor additionally satisfies $F(f^\dagger) = (Ff)^\dagger$, and preserving the hypergraph structure means:
\[
\tikzfig{monoidal-mult} \qquad
\tikzfig{monoidal-unit} \qquad
\tikzfig{monoidal-comult} \qquad
\tikzfig{monoidal-counit}
\]

Dagger-hypergraph functors are important in particular because they define models of the free dagger-hypergraph category into a semantic category. We will make use of the following construction in building the particular models we use to show completeness in Section~\ref{sec:completeness}.

\begin{theorem}
  If $M$ and $N$ are (dagger-)hypergraph functors, then $(P,p_P,u_P)$ defined as:
  \[ P(A) := M(A) \otimes N(A) \qquad\qquad P(f) := M(f) \otimes N(f) \]
  \[
  \tikzfig{product-functor-p}
  \qquad\qquad
  \tikzfig{product-functor-u}
  \]
  is also a (dagger-)hypergraph functor.
\end{theorem}

Let \MGCat be the 2-category of hypergraph categories, strong monoidal functors preserving the SCFA structure, and monoidal natural transformations. Let $\MGCat^\dagger$ be the 2-category of dagger-hypergraph categories, dagger-strong monoidal functors preserving the dSCFA structure, and monoidal natural transformations.

Note how we only assume a hypergraph category category is symmetric monoidal, rather than traced symmetric monoidal or compact closed. That is because this extra structure comes for free.

\begin{theorem}
  A (dagger-)hypergraph category is (dagger-)compact closed, with a coherent choice of self-dual compact structure for each object $A$, where by coherent we mean for all objects $A, B$, the following equations are satisfied:
  \[
  \tikzfig{product-cap} \qquad\qquad \tikzfig{swap-cap}
  \]
\end{theorem}

\begin{proof}
  We define the compact structure on $A$ in terms of its SCFA.
  \[ \tikzfig{frob-cap} \qquad\qquad \tikzfig{frob-cup} \]
  We can use the Frobenius axioms to show this cap and cup satisfy the snake equations.
  \[ \tikzfig{snake1} \qquad\qquad \tikzfig{snake2} \]
  The coherence equations follow from (co)commutativity of the Frobenius algebras and the definition of $A \otimes B$ as:
  \[ (A, \whitemult) \otimes (B, \graymult) \ =\ (A \otimes B, \prodmult{white dot}{gray dot}) \]
\end{proof}

\begin{remark}
  This notion is very close to that of `compact closed with a coherent self-duality', as introduced by Selinger in~\cite{SelingerSelfDual}. When a category $\mathcal C$ has a monoidal product that is free on objects, the two notions coincide. We simply let the (non-self) dual of $A = B_1 \otimes \ldots \otimes B_n$ be the `reversed' object $A^* := B_n \otimes \ldots \otimes B_1$ and define caps, cups, and the self-duality $A \cong A^*$ in the obvious way.

  If $\mathcal C$ is \textit{not} free on objects, we can pass by a standard construction to a new category $\widetilde{\mathcal{C}}$ that is free on objects then define the requisite structure.
\end{remark}

\section{Dot-diagrams}\label{sec:dot-diagrams}

We now define dot-diagrams, following the construction from~\cite{HasegawaHofmannPlotkin,SelingerCompleteness}.

\begin{definition}
  A (dagger) dot-diagram $F = (B^F, D^F, I^F, O^F, \Lbox^F, \Ldot^F, \Win^F, \Wout^F)$ for a (dagger) signature $\Sigma$ consists of the following data:
  \begin{itemize}
    \item A finite set $B^F$ of \textit{boxes},
    \item a finite set $D^F$ of multi-edges, or \textit{dots},
    \item a finite set $I^F := \{ \inp_1, \ldots, \inp_m \}$ of \textit{diagram inputs},
    \item a finite set $O^F := \{ \outp_1, \ldots, \outp_n \}$ of \textit{diagram outputs},
    \item labelling functions $\Lbox^F : B^F \to \Mor$ and $\Ldot^F : D^F \to \Obj$,
    \item and wiring functions $\Win : \Inputs^F \to D^F$ and $\Wout : \Outputs^F \to D^F$, where:
    \begin{align*}
      \Inputs^F & := \{ (b,i) \ |\
        b \in B^F,\,
        n = |\dom(\Lbox^F(b))|,\,
        1 \leq i \leq n \} + I^F \\
      \Outputs^F & := \{ (j,b) \ |\
        b \in B^F,\,
        m = |\cod(\Lbox^F(b))|,\,
        1 \leq j \leq m \} + O^F
    \end{align*}
  \end{itemize}
  Satisfying the conditions:
  \begin{itemize}
    \item $\Ldot^F(\Win^F(b,i)) = \dom(\Lbox^F(b))[i]$
    \item $\Ldot^F(\Wout^F(j,b)) = \cod(\Lbox^F(b))[j]$
  \end{itemize}
\end{definition}

Dot-diagrams are much like string diagrams, except that rather than requiring each wire to be associated with precisely one input and output (either to a box or the diagram as a while), we allow a single `wire', which we now called a \textit{dot}, to be connected to many inputs/outputs.
\[
\tikzfig{string-diagram-example}
\qquad\qquad \textrm{vs.} \qquad\qquad
\tikzfig{dot-diagram-example}
\]
Thus, dots serve as multi-edges in dot-diagrams. Normal string diagrams can be seen as a subset of dot-diagrams, where we write dots with one input and one output just as wires:
\[
\tikzfig{string-diagram-example} \quad = \quad
\tikzfig{string-dot-diagram-example}
\]

\begin{definition}
  Let $F$ and $G$ be dot-diagrams where $I^F = I^G$ and $O^F = O^G$. A \textit{dot-diagram homomorphism} $\Phi : F \to G$ is a pair of functions $(\Phi_b, \Phi_d)$ that respect all of the structure:
  \begin{align*}
    \Lbox^G(\Phi_b(b)) & = \Lbox^F(b) &
    \Win^G(\Phi_b(b), i) & = \Phi_d(\Win^F(b,i)) &
    \Win^F(\inp_i) & = \Win^G(\inp_i) \\
    \Ldot^G(\Phi_d(d)) & = \Ldot^F(d) &
    \Wout^G(j, \Phi_b(b)) & = \Phi_d(\Wout^F(j, b)) &
    \Wout^F(\outp_j) & = \Wout^G(\outp_j)
  \end{align*}
\end{definition}

It will simplify to proof to first restrict to the case where diagrams have no (global) inputs/outputs, and no `free-floating' dots. We call these simple closed dot-diagrams.

\begin{definition}
  A (dagger) dot-diagram is called \textit{simple} when the wiring functions $\Win, \Wout$ are both \textbf{surjections}, and it is called \textit{closed} when $I^M = O^M = \{ \}$.
\end{definition}

The only significant difference with the definition from~\cite{SelingerCompleteness} is that the bijections $\Win$, $\Wout$ are replaced with surjections. This makes the `dots' in dot-diagrams serve as multi-edges, rather than single wires.

When considering homomorphisms of simple, closed dot-diagrams, three of the equations above become redundant:
\[
\Ldot^G(\Phi_d(d)) = \Ldot^F(d) \qquad\qquad
\Win^F(\inp_i) = \Win^G(\inp_i) \qquad\qquad
\Wout^F(\outp_j) = \Wout^G(\outp_j)
\]
The first is forced by surjectivity and the fact that connections between boxes and dots must respect $\Sigma$. The other two are vacuously satisfied for closed diagrams. Furthermore, we only need to require the box function $\Psi_b$ to be surjective in order to obtain a surjective homomorphism of dot-diagrams.

\begin{theorem}\label{thm:surjection-lift}
  Let $(\Psi_b, \Psi_d)$ be a homomorphism of dot-diagrams, and let $\Psi_b$ be a surjective function. Then $\Psi_d$ is also surjective.
\end{theorem}

\begin{proof}
  Since $\Psi_b$ is a surjection, it indices a surjection $\widehat\Psi_b : \textrm{Inputs}^F \to \textrm{Inputs}^G$. Then, by the homomorphism conditions, the following diagram commutes:
  \[
  \begin{tikzpicture}
  \matrix(m)[cdiag]{
    \textrm{Inputs}^F & B^F \\
    \textrm{Inputs}^G & B^G \\
  };
  \path [arrs]
    (m-1-1) edge [->>] node {$\Win^F$} (m-1-2)
    (m-2-1) edge [->>] node {$\Win^G$} (m-2-2)
    (m-1-1) edge [->>] node [swap] {$\widehat\Psi_b$} (m-2-1)
    (m-1-2) edge [->] node {$\Psi_d$} (m-2-2);
  \end{tikzpicture}
  \]
  Suppose $\Psi_d$ is not surjective, then $\Psi_d \circ \Win^F$ ($= \Win^G \circ \Psi_b$) would not be surjective, which is a contradiction. Thus $\Psi_d$ is surjective.
\end{proof}

Unlike in~\cite{SelingerCompleteness}, it is the property of \textit{surjectivity} that lifts from the box function to the whole homomorphism, not \textit{isomorphism}. In fact, there are examples of homomorphisms with bijective box functions whose dot function is merely a surjection, and \textit{not} a bijection, e.g.
\ctikzfig{bij-surj-hm}

\begin{definition}
  For a (dagger) monoidal signature $\Sigma$, the (dagger) hypergraph category $\DotCat(\Sigma)$ of dot-diagrams is defined as follows:
  \begin{itemize}
    \item \textbf{Objects} are words in $\Obj^*$,
    \item \textbf{Morphisms} are (isomorphism classes of) dot-diagrams $F$ such that for all $i,j$:
    \[ \Ldot(\Win(\inp_i)) = \dom(F)[i] \qquad\qquad
       \Ldot(\Wout(\outp_j)) = \cod(F)[j] \]
    where $\dom(F)[i]$ is the $i$-th object in the input word of $F$ and $\cod(F)[j]$ the $j$-th object in the output word.
    \item \textbf{Composition} is defined by pushing out over adjacent dots:
    \[
    \begin{tikzpicture}[scale=2]
    \matrix(m)[cdiag]{
      O^F & I^G & D^G \\
      D^F &     & D^{G\circ F} \\
    };
    \path [arrs]
    (m-1-1) edge node {$\cong$} (m-1-2)
    (m-1-2) edge node {$\Win^G$} (m-1-3)
    (m-1-1) edge node [swap] {$\Wout^F$} (m-2-1)
    (m-1-3) edge node {$\iota^G$} (m-2-3)
    (m-2-1) edge node [swap] {$\iota^F$} (m-2-3);
    \NWbracket{(m-2-3)}
    \end{tikzpicture}
    \]
    where $\Win^G$ and $\Wout^F$ are (restrictions of) the wiring functions of $G$ and $F$. Then:
    \[ G \circ F := (B^F + B^G, D^{G \circ F}, I^F, O^G, \Lbox^{G\circ F}, \Ldot^{G\circ F}, \Win^{G\circ F}, \Wout^{G\circ F}) \]
    for $\Lbox^{G\circ F} := [\Lbox^F,\Lbox^G]$ induced by the coproduct of boxes, $\Ldot^{G\circ F}$ by the pushout of dots:
    \[
    \begin{tikzpicture}[scale=2]
    \matrix(m)[cdiag]{
      O^F & I^G & D^G & \\
      D^F &     & D^{G\circ F} &     \\
          &     &              & \Mor \\
    };
    \path [arrs]
    (m-1-1) edge node {$\cong$} (m-1-2)
    (m-1-2) edge node {$\Win^G$} (m-1-3)
    (m-1-1) edge node [swap] {$\Wout^F$} (m-2-1)
    (m-1-3) edge node {$\iota^G$} (m-2-3)
    (m-2-1) edge node [swap] {$\iota^F$} (m-2-3)
    (m-1-3) edge [bend left=30] node {$\Ldot^G$} (m-3-4)
    (m-2-1) edge [bend right=15] node {$\Ldot^F$} (m-3-4)
    (m-2-3) edge [dashed] node {$\Ldot^{G\circ F}$} (m-3-4);
    \NWbracket{(m-2-3)}
    \end{tikzpicture}
    \]
    and the wiring functions defined by:
    \[
    \begin{tikzpicture}[scale=2]
    \matrix(m)[cdiag]{
      \Inputs^{G \circ F} & \Inputs^F + \Inputs^G & & D^F + D^G & D^{G \circ F} \\
    };
    \path [arrs]
    (m-1-1) edge [right hook-latex] node {} (m-1-2)
    (m-1-2) edge node {$\Win^F + \Win^G$} (m-1-4)
    (m-1-4) edge [>=latex,->>] node {} (m-1-5);
    \end{tikzpicture}
    \]
    \[
    \begin{tikzpicture}[scale=2]
    \matrix(m)[cdiag]{
      \Outputs^{G \circ F} & \Outputs^F + \Outputs^G & & D^F + D^G & D^{G \circ F} \\
    };
    \path [arrs]
    (m-1-1) edge [right hook-latex] node {} (m-1-2)
    (m-1-2) edge node {$\Wout^F + \Wout^G$} (m-1-4)
    (m-1-4) edge [>=latex,->>] node {} (m-1-5);
    \end{tikzpicture}
    \]
    \item the \textbf{monoidal product} is defined as the disjoint union of two dot-diagrams:
    \[ F \otimes G := (B^F + B^G,\, D^F + D^G,\, I^F + I^G,\, O^F + O^G,\, [\Lbox^F, \Lbox^G],\, [\Ldot^F, \Ldot^G],\, \Win^F + \Win^G,\, \Wout^F + \Wout^G) \]
    where $I^F + I^G$ and $O^F + O^G$ are chosen coproducts of the form:
    \begin{align*}
      \{ \inp_1, \ldots, \inp_m \} + \{ \inp_1, \ldots, \inp_{m'} \}
      & := \{ \inp_1, \ldots, \inp_m, \inp_{m+1}, \ldots, \inp_{m+m'} \} \\
      \{ \outp_1, \ldots, \outp_n \} + \{ \outp_1, \ldots, \outp_{n'} \}
      & := \{ \outp_1, \ldots, \outp_n, \outp_{n+1}, \ldots, \outp_{n+n'} \}
    \end{align*}
    The \textbf{monoidal unit} is given by the empty dot-diagram.
    \item \textbf{Swap} maps are defined as pairs of dots with swapped outputs (or inputs):
    \begin{align*}
      \gamma_{A,B} & := (\{ d_1,d_2 \}, \{ \}, \{ \inp_1, \inp_2 \}, \{ \outp_1, \outp_2 \}, \{ \}, \{ d_1 \mapsto A, d_2 \mapsto B \}, \\
            & \qquad \{ \inp_1 \mapsto d_1, \inp_2 \mapsto d_2 \}, \{ \outp_1 \mapsto d_2, \outp_2 \mapsto d_1 \})
    \end{align*}
    \item For a fixed object $A$, we define the \textbf{SCFA structure} on $A$. Each map is the unique dot-diagram with a single dot of type $A$ and the appropriate number of inputs/outputs:
    \begin{align*}
      \mu_A & := (\{ d \}, \{ \}, \{ \inp_1, \inp_2 \}, \{ \outp_1 \}, \{ \},
        \{ d \mapsto A \}, !, !) \\
      \eta_A & := (\{ d \}, \{ \}, \{ \}, \{ \outp_1 \}, \{ \},
        \{ d \mapsto A \}, !, !) \\
      \delta_A & := (\{ d \}, \{ \}, \{ \inp_1 \}, \{ \outp_1, \outp_2 \}, \{ \},
        \{ d \mapsto A \}, !, !) \\
      \epsilon_A & := (\{ d \}, \{ \}, \{ \inp_1 \}, \{ \}, \{ \},
        \{ d \mapsto A \}, !, !) \\
    \end{align*}
    where $!$ is in all cases the terminal map into $\{ d \}$. \textbf{Identities} arise in the same way, taking a single input and output:
    \[ 1_A := (\{ d \}, \{ \}, \{ \inp_1 \}, \{ \outp_1 \}, \{ \},
        \{ d \mapsto A \}, !, !) \]
    \item If $\Sigma$ is a dagger signature, the \textbf{dagger structure} is obtained by changing all of the boxes to their daggered versions and interchanging the role of inputs/outputs:
    \[ F^\dagger = (B^F, D^F, O^F, I^F, \dagger \circ \Lbox^F, \Ldot^F, \Wout^F, \Win^F) \]
    where we change an element `$\inp_j$' to `$\outp_j$' as appropriate, and vice-versa.
  \end{itemize}
\end{definition}

This is very close to the combinatoric string diagram presentation of the free traced symmetric monoidal category given in~\cite{HasegawaHofmannPlotkin}. The biggest departure is in composition. In order to obtain a new dot-diagram as a composition of dot-diagrams, adjacent dots fuse together:
\[ \tikzfig{dots-fuse-g} \ \circ\ \tikzfig{dots-fuse-f} \ =\ \tikzfig{dots-fuse} \]

\begin{theorem}
  The category $\DotCat(\Sigma)$ is the free (dagger-)hypergraph category over a signature $\Sigma$. In other words, there is an equivalence of categories:
  \[ \textbf{Mod}(\Sigma, \mathcal C) \simeq \textbf{MGCat}(\DotCat(\Sigma), \mathcal C) \]
  or for $\Sigma$ a dagger-signature and $\mathcal C$ a dagger-hypergraph category:
  \[ \textbf{Mod}(\Sigma, \mathcal C) \simeq \textbf{MGCat}^\dagger(\DotCat(\Sigma), \mathcal C) \]
\end{theorem}

\begin{proof}
  Since the free category is characterised up to equivalence, let us show an equivalence (actually an isomorphism) between $\DotCat(\Sigma)$ and a more `obvious' representation of the free category. Let $\Sigma'$ be a signature containing $\Sigma$ and additional maps $(\mult, \unit, \comult, \counit)$ for each $A$ in the objects of $\Sigma$. Let $\Free(\Sigma')$ be the free traced symmetric monoidal category of $\Sigma'$ and let $\Free(\Sigma')_\equiv$ be the same, but with morphisms taken modulo the SCFA equations. This becomes a dagger-hypergraph category in the obvious way, and by construction, forms the \textit{free} dagger-hypergraph category.

  Since $\Free(\Sigma')$ is the free traced SMC, we can take its morphisms to be string diagrams. Define a functor $F : \Free(\Sigma')_\equiv \to \DotCat(\Sigma)$ that is identity-on-objects. For morphisms, it sends each box in $\Sigma$ to itself, each connected component of morphisms in $\Sigma' \backslash \Sigma$ to a dot, and each `blank' wire (i.e. a wire not otherwise touching a morphism in $\Sigma' \backslash \Sigma$) to a dot with one input and one output.
  \[ F \ ::\ \tikzfig{dot-diagram-expanded} \quad \mapsto \quad \tikzfig{dot-diagram-example} \]
  By Theorem~\ref{thm:spider}, any two connected diagrams built from $(\mult, \unit, \comult, \counit)$ are equal, so this mapping does not depend on the choice of representative in $\Free(\Sigma')_\equiv$. We can show this preserves composition by again invoking Theorem~\ref{thm:spider}, and it preserves the rest of the dagger-hypergraph structure by definition of the respective categories. In the other direction, define a functor $G$ which is also identity on objects and sends a dot-diagram to a string diagram with each dot replaced by a canonical tree/cotree $S_m^n$ (as in Definition~\ref{def:spider}) built from the SCFA structure.
  \[ G \ ::\ \tikzfig{dot-diagram-example} \quad \mapsto \quad \tikzfig{dot-diagram-S-mn} \]
  Again we can proof dagger-hypergraph functoriality by invoking Theorem~\ref{thm:spider}. The round-trip $F \circ G$ on morphism in $\DotCat(\Sigma)$ sends a dot-diagram to the identical dot-diagram, so $F \circ G = 1_{\DotCat(\Sigma)}$. The other round-trip $G \circ F$ sends a string diagram to another string diagram, where all connected components of $\Sigma' \backslash \Sigma$ are sent to a canonical form w.r.t. to the SCFA axioms. Clearly this is in the same $\equiv$-equivalence class as the original morphism, so $G \circ F = 1_{\Free(\Sigma')_\equiv}$.
\end{proof}

\section{The category $\Mat(R)$}\label{sec:matrix-category}

While it is more typical to define a category of matrices whose objects are natural numbers and whose matrices are indexed by sets of the form $\{ 1, \ldots, m \}$, it will be more convenient for our purposes to use an equivalent category with arbitrary finite sets as indices. It will also be convenient for the proofs to define $\Mat(R)$ for all unital semirings, not just fields. Thus, to fix notation, we will now define this version of $\Mat(R)$ and give its (dagger-)hypergraph structure.

Let $R$ be a unital semiring with a (possibly trivial) involution operation $\overline{(-)}$. Let $\Mat(R)$ be the category whose objects are finite sets ${\mathcal I},{\mathcal J},\ldots$ and whose morphisms $\psi : {\mathcal I} \to {\mathcal J}$ are $|{\mathcal J}| \times |{\mathcal I}|$ matrices, i.e. matrices whose rows are indexed by $i \in {\mathcal I}$ and whose columns are indexed by $j \in {\mathcal J}$, with composition and identities defined as usual.
\[
(g \circ f)_i^k := \sum_k f_i^j g_j^k
\qquad\qquad
(1_{\mathcal I})_i^j := \begin{cases}
1 & \textrm{ if } i = j \\
0 & \textrm{ otherwise}
\end{cases}
\]
Where the juxtaposition $f_i^k g_k^l$ means multiplication in $R$. Note we have adopted tensor notation where inputs/columns appear as lower indices and outputs/rows appear as upper indices:
\[
\psi = \left(\begin{matrix}
  \psi_0^0 & \psi_1^0 \\
  \psi_0^1 & \psi_1^1
\end{matrix}\right)
\]
We define a monidal product on objects as ${\mathcal I} \otimes {\mathcal J} := {\mathcal I} \times {\mathcal J}$ and on morphisms as the \textit{Kronecker product} of matrices:
\[
  (\psi \otimes \phi)_{(i,j)}^{(k,l)} = \psi_i^k \phi_j^l
\]
Note that we typically drop brackets and commas, when there can be no confusion:
\[ \psi_{i_1...i_m}^{j_1...j_n} \]

$\Mat(K)$ is a dagger-monoidal category, letting:
\[ (\psi^\dagger)_i^j := \overline{(\psi_j^i)} \]

The hypergraph structure is given by `generalised Kronecker delta' matrices.
\begin{align*}
  \mu_{ij}^k & = \begin{cases}
    1 & \textrm{ if } i = j = k \\
    0 & \textrm{ otherwise}
  \end{cases} &
  \eta^i & = 1 \\
  \delta_{i}^{jk} & = \begin{cases}
    1 & \textrm{ if } i = j = k \\
    0 & \textrm{ otherwise}
  \end{cases} &
  \epsilon_i & = 1
\end{align*}
Clearly any connected diagram of these matrices just becomes a bigger Kronecker delta, with the general case being:
\[
  (S_m^n)_{i_1...i_m}^{j_1...j_n} = \begin{cases}
    1 & \textrm{ if for some $k$, and all $\alpha$:\  } i_\alpha = j_\alpha = k \\
    0 & \textrm{ otherwise}
  \end{cases}
\]
From this and the observation that $S_1^1$ is the identity matrix, all the SCFA identities follow.

It is possible to characterise functors out of the free hypergraph category in terms of matrix (i.e. tensor) contraction. For a dot diagram $F$ and a hypergraph functor $M : \DotCat(\Sigma) \to \Mat(R)$, let
\[ \textrm{Idx}(F,M) := \prod_{d\in D^F} M(\Ldot^F(d)) \]
be the set of \textit{indexing functions} for $F$. The elements of $\textrm{Idx}(F,M)$ can be seen as tuples, but for out purposes, it will be more convenient to write them using (dependent) function notation. That is, each $\phi \in \textrm{Idx}(F,M)$ assigns an element $\phi(d) \in M(\Ldot^F(d))$ to each dot in $F$.

\begin{theorem}\label{thm:contraction}
  Let $F : I \to I$ be a morphism in $\DotCat(\Sigma)$ represented by a closed, simple dot-diagram (up to isomorphism), and let $M$ be a hypergraph functor. Then:
  \[
  M(F) =
  \sum_{\phi \in \textrm{Idx}(F,M)} \prod_{b \in B^F}
  M(\Lbox^F(b))_{\phi(\Win^F(b,1)) , ... , \phi(\Win^F(b,m))}^{\phi(\Wout^F(1,b)), ... , \phi(\Wout^F(n,b))}
  \]
  where $\sum$ and $\prod$ are sums and products in $K$, respectively.
\end{theorem}

\begin{proof}
  The only difference between this interpretation and the usual interpretation of a string diagram as a tensor contraction is that a single index can be repeated any number of times, not just as a single pair of upper and lower indices.

  Rather that summing over dots, we could have instead summed over individual wires. Since no wire is connected to more than one box, it is uniquely identified by being the $i$-th input or $j$-th output of box $b$. Each of these wires is then connected to a map of the form $S_m^n$.
  \[
  \sum_{(b,1)...(b,m_b),(1,b)...(n_b,b),...} \left(\prod_{b \in B^F}
  M(\Lbox^F(b))_{(b,1)...(b,m_b)}^{(1,b)...(n_b,b)} \right)
  \left(\prod_{d \in D^F}
  (S_{m_d}^{n_d})_{\Wout^{-1}(d)}^{\Win^{-1}(d)} \right)
  \]
  By commutativity, the order of the indices on the $S$-maps doesn't matter, so we've abused notation by writing them as the appropriate sets. Since the maps $S_m^n$ are generalised Kronecker deltas, we can simplify this expression by removing redundant indices e.g.
  \[
  \sum_{ijk} f_{ij}^{k} g_{k}  (S_{2}^{1})_{ij}^{k} =
  \sum_{i} f_{ii}^{i} g_{i}
  \]
  So we are left with one distinct index corresponding to each dot, and the indices which used to be labelled by wires are now labelled according to the dot each wire was connected to. This is precisely the form stated in the theorem.
\end{proof}

\section{Completeness of hypergraph categories}\label{sec:completeness}

In this section, we will prove the completeness theorem for hypergraph categories, without the dagger structure. In the next section, we will show the dagger case by tweaking the proof a little bit. Throughout this and the next section, let $K$ be a field of characteristic $0$. We begin by proving the simple, closed case, then generalising via corollaries.

\begin{theorem}\label{thm:hypergraph-completeness}
  Two simple, closed dot-diagrams $F$, and $G$ are isomorphic iff for all hypergraph functors $\llbracket-\rrbracket : \DotCat(\Sigma) \to \Mat(K)$, $\llbracket F \rrbracket = \llbracket G \rrbracket$.
\end{theorem}

\begin{proof}
  Suppose for simple, closed dot-diagrams $F$ and $G$ that $F \not\cong G$. Then, we need to show that there exists some functor $\llbracket-\rrbracket : \DotCat(\Sigma) \to \Mat(K)$ such that $\llbracket F \rrbracket \neq \llbracket G \rrbracket$. Suppose firstly that they have a different number of dots. Then, we can distinguish them by the `dot-counting' functor. This sends every object in $\Sigma$ to a two-element set, and every morphism to the following matrix:
  \[ (\llbracket f \rrbracket^d)_{x_1,...x_m}^{y_1,...,y_n} = 1 \]
  Then, using the form of evaluation given by Theorem~\ref{thm:contraction}, we can compute:
  \[
  \llbracket F \rrbracket^d \ =
  \sum_{\phi \in \textrm{Idx}(F, \llbracket \rrbracket^d)}
   \prod_{b \in B^F}
   (\llbracket \Lbox(b)^F \rrbracket^d)_{...}^{...} \ =
  \sum_{\phi \in \textrm{Idx}(F, \llbracket \rrbracket^d)} 1 \ =\
  |\textrm{Idx}(F, \llbracket \rrbracket^d)| \ =\  2^{|D^F|}
  \]
  If $F$ and $G$ have different numbers of dots, $\llbracket F\rrbracket^d \neq \llbracket G \rrbracket^d$. Therefore, assume $F$ and $G$ have the same number of dots. We will now construct a functor $\llbracket - \rrbracket_{FG}$ that distinguishes them. We do this in two phases, first let $\mathbf{X} := \{ X_b \ |\  b \in B^F \}$ be a set of variables indexed by the boxes in $F$ and let $\ZX$ be a polynomial ring. Then, we will construct a functor:
  \[ \llbracket - \rrbracket_{F} : \DotCat(\Sigma) \to \Mat(\ZX) \]

  On objects, let $\llbracket A \rrbracket_F$ be the (finite) set of all wires in $F$ labelled by $A$:
  \[ \llbracket A \rrbracket_F := \Ldot^{-1}(A) \]
  For each box $b$ labelled by $f$, let:
  \[ (f_b)_{x_1,...,x_m}^{y_1,...y_n} := \begin{cases}
      X_b & \textrm{ if }
        x_i = \Win^F(b,i) \textrm{ and }
        y_j = \Wout^F(j,b) \\
      0 & \textrm{ otherwise}
  \end{cases} \]
  The interpretation itself is then defined as a sum over all of the boxes in $F$ labelled $f$:
  \[ \llbracket f \rrbracket_F :=
        \sum_{b \in (\Lbox^F)^{-1}(f)} f_b
  \]
  We can then compute $\llbracket G \rrbracket_F$ by writing it in the form given by Theorem~\ref{thm:contraction}.
  \begin{align*}
    \llbracket G \rrbracket_F & =
    \sum_{\phi \in \textrm{Idx}(G,\llbracket\rrbracket_F)}
    \prod_{b \in B^G}
    (\llbracket\Lbox^G(b)\rrbracket_F)_{\phi(\Win^G(b,1)) , ... , \phi(\Win^G(b,m))}^{\phi(\Wout^G(1,b)), ... , \phi(\Wout^G(n,b))} \\
    & =
    \sum_{\phi \in \textrm{Idx}(G,\llbracket\rrbracket_F)}
    \prod_{b \in B^G}
    \sum_{b' \in (\Lbox^F)^{-1}(\Lbox^G(b))}
    (f_{b'})_{\phi(\Win^G(b,1)) , ... , \phi(\Win^G(b,m))}^{\phi(\Wout^G(1,b)), ... , \phi(\Wout^G(n,b))} \\
    & =
    \sum_{\phi \in \textrm{Idx}(G,\llbracket\rrbracket_F)}
    \prod_{b \in B^G}
    \sum_{b' \in B^G}
    \begin{cases}
    X_{b'}
      & \textrm{if } \Lbox^F(b') = \Lbox^G(b) \textrm{ and } \\
      & \phi(\Win^G(i,b)) = \Win^F(i,b') \textrm{ and } \\
      & \phi(\Wout^G(b,j)) = \Wout^F(b',j) \textrm{ for all } i, j \\
    0 & \textrm{otherwise}
    \end{cases}
  \end{align*}
  Applying distributivity yields:
  \begin{equation}\label{eq:big-sum}
    \llbracket G \rrbracket_F =
    \sum_{\phi \in \textrm{Idx}(G,\llbracket\rrbracket_F)}
    \sum_{\psi : B^G \to B^F}
    \prod_{b \in B^G}
    \begin{cases}
    X_{\psi(b)}
      & \textrm{if } \Lbox^F(\psi(b)) = \Lbox^G(b) \textrm{ and } \\
      & \phi(\Win^G(i,b)) = \Win^F(i,\psi(b)) \textrm{ and } \\
      & \phi(\Wout^G(b,j)) = \Wout^F(\psi(b),j) \textrm{ for all } i, j \\
    0 & \textrm{otherwise}
    \end{cases}
  \end{equation}
  We will refer to the coefficient of $\llbracket G \rrbracket_F$ corresponding of $\prod_b X_b$ as the `magic coefficient'. Clearly if two dot-diagrams $G, G'$ have different magic coefficients, then the polynomials $\llbracket G \rrbracket_F$ and $\llbracket G' \rrbracket_F$ will not be equal.

  Why do we call it the magic coefficient? Since the summation in~\eqref{eq:big-sum} is over a pair of functions $\phi, \psi$, computing the value of the magic coefficient amounts to identifying for which $\psi,\phi$ the following conditions are satisfied exactly once for each box $b' \in B^F$:
  \[ \psi(b) = b' \qquad
     \Lbox^F(\psi(b)) = \Lbox^G(b) \qquad
     \phi(\Wout^G(b,j)) = \Wout^F(\psi(b),j)
  \]
  The latter two conditions give precisely what it means for $(\psi,\phi)$ to be a homomorphism of dot-diagrams. As the product ranges over $b \in B^G$, the fact that these are satisfied exactly once means that $\psi$ is a bijection of boxes. Let $\textrm{BBij}(G,F)$ be the set of homomorphisms $(\psi,\phi)$ from $G$ to $F$ such that the box function is a bijection. It follows that the magic coefficient of $\llbracket G \rrbracket_F$ is $|\textrm{BBij}(G,F)|$.

  In particular, $\psi$ is a surjection, so by Theorem~\ref{thm:surjection-lift}, so too is $\phi$. But, since $F$ and $G$ have the same number of dots, a surjection from $G$ to $F$ is actually an isomorphism of dot-diagrams. Since we assumed $F \not\cong G$, the magic coefficient of $\llbracket G \rrbracket_F$ must be $0$, whereas the magic coefficient of $\llbracket F \rrbracket_F$ is $|\textrm{Aut}(F)|$. From this, we can conclude
  \[ \llbracket F \rrbracket_F \neq \llbracket G \rrbracket_F \]

  It only remains to turn this into a functor into $\Mat(K)$, rather than $\Mat(\ZX)$. Any ring homomorphism $h : \ZX \to K$ extends in the obvious way to a functor from $\Mat(\ZX)$ to $\Mat(K)$. In particular, any choice of values for the $X_b$ induces an evaluation functor $\textrm{ev} : \Mat(\ZX)\to \Mat(K)$. This defines a functor in $\Mat(K)$ by:
  \[ \llbracket - \rrbracket_{FG} := \textrm{ev}(\llbracket - \rrbracket_{F}) \]
  Since the polynomial $p := \llbracket F \rrbracket_F - \llbracket G \rrbracket_F$ is non-zero, it has finitely many roots in $K$. Since $K$ is infinite, choose values for $X_b$ in $K$ such that $p$ is non-zero. Then $\llbracket F \rrbracket_{FG} - \llbracket G \rrbracket_{FG} \neq 0$, and hence $\llbracket F \rrbracket_{FG} \neq \llbracket G \rrbracket_{FG}$.
\end{proof}

Extending to all morphisms in $\DotCat(\Sigma)$ is now straightforward. First, we eliminate the `simple' condition.

\begin{corollary}\label{cor:non-simple}
  Two closed morphisms $F$ and $G$ in $\DotCat(\Sigma)$ are equal iff for all hypergraph functors $\llbracket-\rrbracket : \DotCat(\Sigma) \to \Mat(K)$, $\llbracket F \rrbracket = \llbracket G \rrbracket$.
\end{corollary}

\begin{proof}
  Suppose $F$ and $G$ are closed, but not simple. The following functor counts the `free dots' of each type in $F$ and $G$, i.e. those not connected to a box. Fix a set of distinct prime numbers $\{ p_A \}$ for each object $A$ labelling a dot in $F$ or $G$.
  \[
  (\llbracket f \rrbracket_{FG}^f)_{i_1...i_m}^{j_1...j_n} =
  \begin{cases}
    1 & \textrm{ if } i_k = j_l = 1 \\
    0 & \textrm{ otherwise}
  \end{cases}
  \]
  This sends every simple closed diagram to $1$ and closed diagram consisting of a single free dot of type $A$ to the number $p_A$. Let $F = F' \otimes d_F$ and $G = G' \otimes d_G$, where $F', G'$ are simple, and $d_F, d_G$ consist only of free dots. Then:
  \[ \llbracket F \rrbracket_{FG}^f =
     \llbracket F' \rrbracket_{FG}^f \llbracket d_F \rrbracket_{FG}^f =
     \llbracket d_F \rrbracket_{FG}^f = (p_A)^{N_A} (p_B)^{N_B} (p_C)^{N_C} \ldots
  \]
  where $N_A$ is the number of free dots of type $A$. If $d_F \not\cong d_G$, then
  \[ \llbracket F \rrbracket_{FG}^f = \llbracket d_F \rrbracket_{FG}^f \neq \llbracket d_G \rrbracket_{FG}^f = \llbracket G \rrbracket_{FG}^f \]
  Otherwise, $d_F \cong d_G$. Let $\llbracket - \rrbracket_{FG}$ be the functor defined in the proof of Theorem~\ref{thm:hypergraph-completeness}. Then, it is easy to check that:
  \[ 0 \neq \llbracket d_F \rrbracket_{F'G'} = \llbracket d_G \rrbracket_{F'} \]
  from which follows that $\llbracket F \rrbracket_{F'G'} \neq \llbracket G \rrbracket_{F'G'}$.
\end{proof}

\begin{corollary}\label{cor:non-closed}
  Two morphisms $F$ and $G$ in $\DotCat(\Sigma)$ are equal iff for all hypergraph functors $\llbracket-\rrbracket : \DotCat(\Sigma) \to \Mat(K)$, $\llbracket F \rrbracket = \llbracket G \rrbracket$.
\end{corollary}

\begin{proof}
  Let $F, G : A \to B$ be two morphisms in $\DotCat(\Sigma)$. Let $\Sigma'$ be a new signature obtained by adding boxes $i_A : I \to A$ and $o_B : B \to I$. Then, there is a functor $E : \DotCat(\Sigma) \to \DotCat(\Sigma')$ defined in the obvious way.

  Then, as closed dot-diagrams, $o_B \circ E(F) \circ i_A \not\cong o_B \circ E(F) \circ i_A$. By the above arguments, there exists a functor $\llbracket - \rrbracket$ such that:
  \[ \llbracket o_B \circ E(F) \circ i_A \rrbracket \neq
     \llbracket o_B \circ E(G) \circ i_A \rrbracket \]
  It follows by functoriality that $\llbracket E(F) \rrbracket \neq \llbracket E(G) \rrbracket$.
\end{proof}

One might be tempted to short-circuit this step using the SCFA structure (i.e. units and counits) to provide $i_A$ and $o_B$, but this does not work. Consider the following example:
\[ \tikzfig{fdot-tens-g} \ \not\cong \ \tikzfig{f-tens-gdot} \]
If we attach dots everywhere:
\[ \tikzfig{fdot-tens-gdot} \ \cong \ \tikzfig{fdot-tens-gdot} \]
the above proof would not be valid. Compare this to attaching new, freely-added boxes:
\[ \tikzfig{fdot-tens-g-free} \ \not\cong \ \tikzfig{f-tens-gdot-free} \]

\section{Completeness of dagger-hypergraph categories}\label{sec:dagger-completeness}

We now turn to proving the completeness theorem of dagger-hypergraph categories for $\Mat(K)$, where $K$ is a field with non-trivial involution. Note that it is necessary take a non-trivial involution, otherwise new equations become true in all models. For example, scalars $s : I \to I$ would automatically satisfy $s^\dagger = s$ in all models, which is not provable by the dagger-hypergraph axioms. Also, the `tranposition' defined in terms of the Frobenius structure would become equal to the dagger:
\[ \left( \tikzfig{f} \right)^\dagger \ =\ \tikzfig{f-trans} \]
which again is not provable by the dagger-hypergraph axioms. This is natural to consider these two expressions not to be equal because the LHS computes the \textit{conjugate-transpose} whereas the RHS computes the \textit{transpose}.

\begin{theorem}\label{thm:dagger-hypergraph-completeness}
  Two dot-diagrams $F$, and $G$ are isomorphic iff for all dagger-hypergraph functors $\llbracket-\rrbracket : \DotCat(\Sigma) \to \Mat(K)$, $\llbracket F \rrbracket = \llbracket G \rrbracket$.
\end{theorem}

\begin{proof}
  The proof is almost identical to that of Theorem~\ref{thm:hypergraph-completeness}. The main difference is that we define the functor $\llbracket - \rrbracket_F$ in terms of a different ring. Let \ZXX be the polynomial ring taking as variables $\mathbf X$ as before, along with a second copy $\overline{\mathbf X} := \{ \overline{X}_b \ |\ b \in B^F \}$. This becomes a ring with involution by taking the involution to be the ring homomorphism that interchanges $X_b \leftrightarrow \overline X_b$ and leaves the other ring elements fixed. We can then define
  \[ \llbracket - \rrbracket_F : \DotCat(\Sigma) \to \Mat(\ZXX) \]
  as:
  \[ \llbracket f \rrbracket_F :=
        \sum_{b \in (\Lbox^F)^{-1}(f)} f_b +
        \sum_{b \in (\Lbox^F)^{-1}(f^\dagger)} (f_b)^\dagger \]
  Then, by a similar calculation to Theorem~\ref{thm:hypergraph-completeness} (and in fact, a nearly identical calculation to that in~\cite{SelingerCompleteness}) we get the following value for the closed, simple dot-diagram $G$:
  \begin{equation}\label{eq:big-sum}
    \llbracket G \rrbracket_F =
    \sum_{\phi \in \textrm{Idx}(G,\llbracket\rrbracket_F)}
    \sum_{\psi : B^G \to B^F}
    \prod_{b \in B^G}
    \begin{cases}
    X_{\psi(b)}
      & \textrm{if } \Lbox^F(\psi(b)) = \Lbox^G(b) \textrm{ and } \\
      & \phi(\Win^G(i,b)) = \Win^F(i,\psi(b)) \textrm{ and } \\
      & \phi(\Wout^G(b,j)) = \Wout^F(\psi(b),j) \textrm{ for all } i, j \\
    \overline X_{\psi(b)}
      & \textrm{if } \Lbox^F(\psi(b)) = \Lbox^G(b)^\dagger \textrm{ and } \\
      & \phi(\Wout^G(b,i)) = \Win^F(i,\psi(b)) \textrm{ and } \\
      & \phi(\Win^G(j,b)) = \Wout^F(\psi(b),j) \textrm{ for all } i, j \\
    0 & \textrm{otherwise}
    \end{cases}
  \end{equation}
  When $F$ and $G$ are simple and closed, we can still identify the `magic coefficient' of $\prod_b X_b$, whose value counts the cardinality of $\textrm{BBij}(G, F)$. Thus, if we first use the functor $\llbracket - \rrbracket^d$ to check if $F$ and $G$ have the same number of dots, then $\llbracket F \rrbracket_F = \llbracket G \rrbracket_F$ iff $F \cong G$.

  An involution-preserving semiring homomorphism will define a dagger-hypergraph functor from $\Mat(\ZXX)$ to $\Mat(K)$. Again, we define the functor $\textrm{ev} : \Mat(\ZXX) \to \Mat(K)$ in terms of an evaluation homomorphism, but this time one that sends $X_b$ to some element $k \in K$ which in turn fixes the value of $\overline{X}_b$ to be $\overline k$. Thus, the following is a dagger-hypergraph functor:
  \[ \llbracket - \rrbracket_{FG} := \textrm{ev}(\llbracket - \rrbracket_F) \]
  Note that we cannot choose \textit{all} the variables in $\llbracket F \rrbracket_{FG} - \llbracket G \rrbracket_{FG}$ independently, but rather only the $X_b$'s. However, whenever $K$ is characteristic zero and has a non-trivial involution, we can still choose values for $X_b$ such that $\llbracket F \rrbracket_{FG} - \llbracket G \rrbracket_{FG}$ is non-zero.\footnote{Thanks to Peter Selinger for pointing this out.} Thus, $\llbracket F \rrbracket_{FG} \neq \llbracket G \rrbracket_{FG}$.

  To extend from the simple, closed case, Corollaries~\ref{cor:non-simple} and~\ref{cor:non-closed} work unmodified.
\end{proof}

\bibliographystyle{akbib}
\bibliography{main}

\end{document}

config: arxiv