Sets with few differences in abelian groups

Abstract: Let $(G, +)$ be an abelian group. In 2004, Eliahou and Kervaire found an explicit formula for the smallest possible cardinality of the sumset $A+A$, where $A \subseteq G$ has fixed cardinality $r$. We consider instead the smallest possible cardinality of the difference set $A-A$, which is always greater than or equal to the smallest possible cardinality of $A+A$ and can be strictly greater. We conjecture a formula for this quantity and prove the conjecture in the case that $G$ is a cyclic group or a vector space over a finite field. This resolves a conjecture of Bajnok and Matzke on signed sumsets.

\section{Introduction}
Let $G$ be a finite abelian group of order $N$ written with additive notation. Given subsets $A, B \subseteq G$, the \textit{sumset} of $A$ and $B$ is defined as \[A+B = \{a + b \mid a \in A, b \in B\}\] and the \textit{difference set} of $A$ and $B$ is defined as \[A - B = \{a - b \mid a \in A, b \in B\}.\]
Let $-A$ denote the difference set $\{0\} - A = \{-a \mid a \in A\}$.

\par Given integers $r$ and $s$ with $1 \leq r, s \leq N$, define
\begin{align}
	\mu_G(r, s) &= \min \{|A + B| \mid A, B \subseteq G, |A| = r, |B| = s\} \label{mu}\\
	\rho^+_G(r) &= \min \{|A + A| \mid A \subseteq G, |A| = r\} \label{rhoplus} \\
	\rho^-_G(r) &= \min \{|A - A| \mid A \subseteq G, |A| = r\}. \label{rhominus}
\end{align}
We remark that taking $B = A$ in \eqref{mu} yields $\mu_G(r, r) \leq \rho^+_G(r)$ and taking $B = -A$ yields $\mu_G(r, r) \leq \rho^-_G(r)$.
\par The functions $\mu_G(r, s)$ and $\rho^+_G(r)$ have held considerable interest for over 200 years. In 1813, Cauchy \cite{cauchy} proved the following classical result, which was rediscovered by Davenport \cite{davenport} in 1935.
\begin{restatable}[Cauchy-Davenport Theorem \cite{cauchy,davenport}]{theorem}{cauchydavenport}\label{cauchydavenport}
	\par Let $G=\Z / p\Z$ where $p$ is prime. Then $\mu_{G}(r, s) = \min\{r + s - 1, p\}$ for $1 \leq r, s \leq p$.
\end{restatable}
\par In 2004, Eliahou and Kervaire \cite{sumsets_infinite} used a classical result of Kneser \cite{kneser} to compute $\mu_G(r, s)$ and $\rho_G^+(r)$ for all finite abelian groups $G$.

\begin{theorem}[Eliahou and Kervaire, {\cite[Theorem~2, Proposition~7]{sumsets_infinite}}] \label{sumsets_arbitrary}
	Let $G$ be a finite abelian group of order $N$. Then \[\mu_G(r, s) = \min_{d \in D(N)} d \left( \left\lceil\frac{r}{d}\right\rceil + \left\lceil\frac{s}{d}\right\rceil - 1\right)\] for $1 \leq r, s \leq N$, where $D(N)$ denotes the set of positive divisors of $N$. Furthermore, we have $\rho^+_G(r) = \mu_G(r, r)$.
\end{theorem}
\begin{remark}\label{remarkdepend}
	By \autoref{sumsets_arbitrary}, the quantities $\mu_G(r, s)$ and $\rho_G^+(r)$ depend on $N$, $r$, and $s$, but not the group structure of $G$.
\end{remark}

However, there is no known explicit formula for $\rho^-_G(r)$. In \cite{signed_sumsets, signed_sumsets_elementary}, Bajnok and Matzke considered an $h$-fold variant of this problem. A small adaptation of their proofs yields the following upper bound for $\rho^-_G(r)$, which we conjecture holds with equality.

\begin{restatable}[{cf. \cite[Theorem~5]{signed_sumsets}}]{theorem}{upperbound} \label{upperbound}
	Let $G$ be a finite abelian group of order $N$. Let $e = \exp G$ be the exponent of $G$; that is, the least common multiple of the orders of the elements of $G$. For $1 \leq r \leq N$, define \[D(N, e, r) = \{d_1 d_2 \mid d_1 \in D(N/e), d_2 \in D(e), d_1 e \geq r\}.\] Then \[\rho_G^-(r) \leq \min_{d \in D(N, e, r)} d \left(2\left\lceil\frac{r}{d}\right\rceil - 1\right).\]
\end{restatable}

\begin{conjecture}[cf. {\cite[Conjecture~10]{signed_sumsets}}]\label{difference_conjecture}
	The inequality in \autoref{upperbound} holds with equality. That is, under the hypotheses of \autoref{upperbound}, we have \[\rho_G^-(r) = \min_{d \in D(N, e, r)} d \left(2\left\lceil\frac{r}{d}\right\rceil - 1\right).\]
\end{conjecture}

\begin{remark}
	We have the inequality $\rho_G^+(r) = \mu_G(r, r) \leq \rho_G^-(r)$, and it is possible that $\rho_G^+(r) < \rho_G^-(r)$. For example, if $G = (\Z / 3 \Z)^2$, then $\rho_G^+(4) = 7$ and $\rho_G^-(4) = 9$. It is also worth noting that in contrast to $\rho_G^+(r)$ (see \autoref{remarkdepend}), the quantity $\rho_G^-(r)$ cannot be determined from $N$ and $r$ alone.
\end{remark}

The goal of this paper is to prove two important special cases of \autoref{difference_conjecture}.

First, consider the case that $G = \Z / N\Z$ is a finite cyclic group. In this case, we have $e = \exp G = N$, so $D(N, e, r) = D(N)$ for $1 \leq r \leq N$. Thus, the statement of \autoref{difference_conjecture} becomes \autoref{cyclic} below.

\begin{restatable}[{cf. \cite[Theorem~4]{signed_sumsets}}]{theorem}{cyclic} \label{cyclic}
	Let $G = \Z / N\Z$. Then \[\rho_G^-(r) = \min_{d \in D(N)} d \left( 2\left\lceil\frac{r}{d}\right\rceil  - 1\right)\] for $1 \leq r \leq N$.
\end{restatable}

Second, consider the case that $G = (\Z / p\Z)^d$ where $p$ is prime and $d \geq 0$. Then \autoref{mainthm} below, which is the main result of this paper, computes $\rho_G^-(r)$ for $1 \leq r \leq p^d$. We will verify in \autoref{sectionoutline} that \autoref{mainthm} agrees with the prediction given by \autoref{difference_conjecture}.

\begin{restatable}{theorem}{mainthm}\label{mainthm}
	Let $G=(\Z / p\Z)^d$ where $p$ is prime and $d \geq 0$. Let $t$ and $r$ be integers with $0 \leq t \leq d$ and $p^t < r \leq p^{t+1}$. Then \[\rho_G^-(r) = p^t \min\left\{2\left\lceil\frac{r}{p^t}\right\rceil - 1, p\right\}.\]
\end{restatable}

\par As a consequence of \autoref{mainthm}, we obtain the following result, which appears as Conjecture~18 in \cite{signed_sumsets_elementary}. We use the notation $\rho_\pm(G, m, r)$ defined in \cite{signed_sumsets_elementary}.
\begin{restatable}[{\cite[Conjecture~18]{signed_sumsets_elementary}}]{theorem}{bajnokmatzkeconjecture} \label{bajnokmatzkeconjecture}
	Let $p > 2$ be a prime number, and let $c$ and $v$ be integers with $0 \leq c \leq p-1$ and $1 \leq v \leq p$. Let $m = cp + v$.
	\begin{enumerate}[(a)]
		\item If $1 \leq c \leq (p-3)/2$, then \[\rho_\pm((\Z / p\Z)^2, m, 2) = (2c+1)p.\]
		\item If $c = (p-1)/2$ and $v \leq (p-1)/2$, then \[\rho_\pm((\Z / p\Z)^2, m, 2) = p^2 - 1.\]
	\end{enumerate}
\end{restatable}

\par  In \autoref{sectioncyclic}, we will prove \autoref{cyclic}. In \autoref{sectionupper}, we will prove \autoref{upperbound}. In \Cref{sectionoutline,sectionindependence,sectionsmall,sectionmainthm}, we will prove \autoref{mainthm}. Finally, in \autoref{bajnokmatzkeproof}, we will prove \autoref{bajnokmatzkeconjecture}.

\section{The cyclic case}\label{sectioncyclic}
The goal of this section is to prove \autoref{cyclic}, which computes $\rho_G^-(r)$ in the case that $G$ is a finite cyclic group. The proof closely follows that of \cite[Theorem~4]{signed_sumsets}, though it should be noted that \autoref{cyclic} does not follow directly from \cite[Theorem~4]{signed_sumsets} due to differences in the definitions of $2_{\pm} A$ and $A - A$.
\cyclic*
\begin{proof}[Proof of \autoref{cyclic}]
	By \autoref{sumsets_arbitrary}, we have \[\rho_G^-(r) \geq \mu_G(r, r) = \min_{d \in D(N)} d \left( 2\left\lceil\frac{r}{d}\right\rceil  - 1\right)\] so it remains to show that \[\rho_G^-(r) \leq \min_{d \in D(N)} d \left( 2\left\lceil\frac{r}{d}\right\rceil  - 1\right).\]
	\par It suffices to show that \[\rho_G^-(r) \leq d \left( 2\left\lceil\frac{r}{d}\right\rceil  - 1\right)\] for each $d \in D(N)$.
	For this, we will construct a set $A \subseteq G$ with $|A| \geq r$ and \[|A - A| \leq d \left( 2\left\lceil\frac{r}{d}\right\rceil  - 1\right).\] Let $H$ be the subgroup of $G$ of order $d$, and let $x$ be a generator for $G / H$. Take $A$ to be the ``coset arithmetic progression'' \[A = \bigcup_{i=0}^{\left\lceil r/d\right\rceil - 1} (H + i x).\] We compute \[A - A = \bigcup_{i=1 - \left\lceil r/d\right\rceil }^{\left\lceil r/d\right\rceil - 1} (H + i x),\] so $|A| = d \lceil r/d \rceil \geq r$ and \[|A - A| \leq d \left( 2\left\lceil\frac{r}{d}\right\rceil  - 1\right)\] as desired.
\end{proof}

\begin{remark}
	By comparing the expressions in \autoref{sumsets_arbitrary} and \autoref{cyclic}, we see that $\rho_G^-(r) = \rho_G^+(r) = \mu_G(r, r)$ for $1 \leq r \leq N$ if $G = \Z / N\Z$ is a finite cyclic group.
\end{remark}

\section{\texorpdfstring{An upper bound on $\rho_G^-(r)$}{An upper bound}} \label{sectionupper}
We shall now restate and prove \autoref{upperbound}. The proof very closely follows that of \cite[Theorem~5]{signed_sumsets}.

\upperbound*

\begin{proof}
	\par It suffices to show that \[\rho_G^-(r) \leq d \left(2 \left \lceil \frac{r}{d} \right \rceil - 1\right)\] for each $d \in D(N, e, r)$. For this, we will construct a set $A \subseteq G$ with $|A| \geq r$ and \[|A - A| \leq d \left( 2\left\lceil\frac{r}{d}\right\rceil  - 1\right).\]  Write $d = d_1 d_2$ for $d_1 \in D(N / e)$, $d_2 \in D(e)$, and $d_1 e \geq r$.
	\par By the structure theorem for finitely generated abelian groups, the group $G$ is isomorphic to a direct product $H \times (\Z/e\Z)$ for some abelian group $H$ with $|H| = N/e$. Since $d_1 \in D(N / e)$, we can find a subgroup $A_1 \subseteq H$ with $|A_1| = d_1$. Let $s = \lceil r / d_1 \rceil$. Then $s \leq e$, so by \autoref{cyclic} there is a subset $A_2 \subseteq \Z / e \Z$ with $|A_2| = s$ and \[|A_2 - A_2| \leq d_2 \left(2 \left\lceil\frac{s}{d_2}\right\rceil - 1\right).\]
	Take $A = A_1 \times A_2 \subseteq H \times (\Z / e \Z) \cong G$. Then $|A| = d_1s = d_1\lceil r / d_1 \rceil \geq r$ and
	\begin{align*}
		|A - A| &=|(A_1 \times A_2) - (A_1 \times A_2)| \\
		&=|(A_1 - A_1) \times (A_2 - A_2)| \\
		&=|A_1 - A_1| |A_2 - A_2| \\
		&\leq d_1  \left(d_2 \left(2 \left\lceil\frac{\lceil r / d_1 \rceil}{d_2}\right\rceil - 1\right)\right) \\
		&= d \left(2 \left \lceil \frac{r}{d} \right \rceil - 1\right)
	\end{align*}
	as desired.
\end{proof}

\section{An outline of the proof of \autoref{mainthm}}\label{sectionoutline}
\Cref{sectionoutline,sectionindependence,sectionsmall,sectionmainthm} of this paper will contain the proof of \autoref{mainthm}, which will proceed in four steps:

\begin{enumerate}
	\item \label{step_upper} We will show that the bound given in \autoref{mainthm} is achieved. That is, we will show that \[\rho_G^-(r) \leq p^t \min\left\{2\left\lceil\frac{r}{p^t}\right\rceil - 1, p\right\}.\]
	\item \label{step_inv} We will show that for $G = (\Z / p\Z)^d$, the quantity $\rho_G^-(r)$ only depends on $r$ and $p$ and not $d$, as long as $d$ is large enough that $\rho_G^-(r)$ is defined (that is, $r \leq p^d$).
	\item \label{step_small} By applying the Cauchy-Davenport~Theorem (\autoref{cauchydavenport}) repeatedly, we will prove \autoref{mainthm} in the case that $r \leq p^2$.
	\item \label{step_large} We will conclude the proof of the theorem by induction on $r$.
\end{enumerate}

We start with the following result, which is step~\eqref{step_upper} above.

\begin{lemma}\label{uppervector}
	With the notation of \autoref{mainthm}, we have\[\rho_G^-(r) \leq p^t \min\left\{ 2\left\lceil\frac{r}{p^t}\right\rceil - 1, p\right\}.\]
\end{lemma}

\begin{proof}
	\par Using the notation of \autoref{upperbound}, we have $N = |G| = p^d$ and $e = \exp G = p$, so \begin{align*}
	D(N, e, r) &= \{d_1 d_2 \mid d_1 \in D(p^{d-1}), d_2 \in D(p), d_1p \geq r\} \\
	&= \{p^t, p^{t+1}, \ldots, p^{d-1}, p^d\}.
	\end{align*}
	By \autoref{upperbound}, we have \begin{align*}\min_{d \in D(N, e, r)} d \left(2 \left\lceil \frac{r}{d} \right \rceil - 1\right) &= \min\left\{p^t \left(2\left\lceil\frac{r}{p^t}\right\rceil - 1\right), p^{t+1}, \ldots, p^{d-1}, p^d\right\} \\
	&= p^t \min\left\{2\left\lceil\frac{r}{p^t}\right\rceil - 1, p\right\},\end{align*}
	as desired.
\end{proof}

\begin{remark}
	The proof of \autoref{uppervector} given above shows that \autoref{mainthm} agrees with the prediction given by \autoref{difference_conjecture}.
\end{remark}
\begin{remark}
	Here is an explicit example of a subset $A \subseteq G$ achieving the bound of \autoref{uppervector}. Put a total order $<$ on $\Z / p\Z$ by identifying it with $\{0, 1, \ldots, p-1\}$ in the usual way. Then, recall that $(\Z / p\Z)^d$ is totally ordered by the \textit{lexicographic order}, which is defined as follows: we say that $x = (x_1, \ldots, x_d)$ precedes $y = (y_1, \ldots, y_d)$ in the lexicographic order if for some $i$ we have $x_i < y_i$ and $x_j = y_j$ for $j < i$. Let $A$ be the set of the smallest $r$ elements of $(\Z / p\Z)^d$ in the lexicographic order. Then one can easily verify that \[|A - A| = p^t \min\left\{ 2\left\lceil\frac{r}{p^t}\right\rceil - 1, p\right\},\] which provides an alternative constructive proof of \autoref{uppervector}. It is worth noting that by \cite[Proposition~3.1]{sumsets_vectors}, the same set $A$ satisfies $|A + A| = \rho_G^+(r)$.
\end{remark}

\section{Independence of dimension}\label{sectionindependence}
The following result is step~\eqref{step_inv} in the proof of \autoref{mainthm}.

\begin{lemma}\label{invariance}
	Let $p$ be a prime and let $d_1 > d_2 \geq 0$ be integers. Let $G = (\Z / p\Z)^{d_1}$ and $H = (\Z / p\Z)^{d_2}$. Then $\rho_{G}^-(r) = \rho_{H}^-(r)$ for $1 \leq r \leq p^{d_2}$.
\end{lemma}

\begin{proof}
	It suffices to consider the case that $d_1 = d_2 + 1$. Since $H$ embeds in $G$ as a subgroup, we have $\rho_{G}^-(r) \leq \rho_{H}^-(r)$, so it remains to show that $\rho_{H}^-(r) \leq \rho_{G}^-(r)$.
	\par Take a subset $A \subseteq G$ with $|A| = r$ and $|A - A| = \rho_{G}^-(r)$. Considering $G$ as a vector space of dimension $d_1 = d_2  + 1$ over the finite field $\F_p$, there are \[\frac{p^{d_1} - 1}{p - 1} = 1 + p + \cdots + p^{d_2} \geq p^{d_2}\] lines containing $0$ (that is, vector subspaces of dimension $1$) in $G$. On the other hand, there are only \[|A-A| - 1 \leq \rho_{G}^-(r) - 1 \leq \rho_{H}^-(r) - 1 < p^{d_2}\] nonzero elements of $A - A$. Since no two distinct lines in $G$ containing $0$ share a nonzero element, we conclude that there is a line $\ell$ in $G$ such that $\ell \cap (A - A) = \{0\}$.
	\par Considering $H$ as a vector space of dimension $d_2 = d_1 - 1$ over $\F_p$, fix an $\F_p$-linear transformation $\pi : G \to H$ whose kernel is the line $\ell$. Such a transformation $\pi$ exists because \[\dim_{\F_p} \ell + \dim_{\F_p} H = 1 + d_2 = d_1 = \dim_{\F_p} G.\] We claim that the restriction $\pi|_{A}$ is an injection. To show this, take $x, y \in A$ with $\pi(x) = \pi(y)$; we will show that $x = y$. Since $\pi$ is linear, we have $\pi(x - y) = 0$, so $x - y \in \ker \pi = \ell$. Therefore, we have $x - y \in \ell \cap (A - A) = \{0\}$. That is, we have $x = y$, as desired.
	\par Since $\pi|_{A}$ is an injection, we have $|\pi(A)| = |A| = r$, where $\pi(A)$ is the image of $A$ under the map $\pi$. Therefore \[\rho_{H}^-(r) \leq |\pi(A) - \pi(A)| = |\pi(A - A)| \leq |A - A| = \rho_{G}^{-}(r)\] as desired.
\end{proof}

\section{\texorpdfstring{The case $r \leq p^2$}{The case r≤p²}}\label{sectionsmall}
In this section, we show that the statement of \autoref{mainthm} holds when $r \leq p^2$, which is step \eqref{step_small} in the proof of \autoref{mainthm}.

\begin{lemma}\label{smallr}
	Let $p$ be a prime and let $d$ be a nonnegative integer. Let $G$ be the group $(\Z / p\Z)^d$. Then \[\rho_G^-(r) = p^t \min\left\{ 2\left\lceil\frac{r}{p^t}\right\rceil - 1, p\right\}\] for $1 \leq r \leq \min\{p^d, p^2\}$, where $t$ is the unique integer satisfying $p^t < r \leq p^{t+1}$.
\end{lemma}

The following lemma will be instrumental in the proof of \autoref{smallr}.

\begin{restatable}{lemma}{sumlemma}\label{sumlemma2}
	Let $p$ be a prime, and let $m$ and $n$ be integers with $n \geq 1$ and $n+2 \leq m \leq (p-1)/2$. Let $\lambda = (\lambda_1, \ldots, \lambda_m)$ be a sequence of integers with $p \geq \lambda_1 \geq \cdots \geq \lambda_m > 0$ and $\sum_{k=1}^m \lambda_k \geq n p + 1$. Let $\mu = (\mu_1, \ldots, \mu_{2m - 1})$ be a sequence of integers such that $\mu_{i + j - 1} \geq \min\{\lambda_i + \lambda_j - 1, p\}$ for $1 \leq i, j \leq m$. Then \[\sum_{k = 1}^{2m-1} \mu_k \geq (2n + 1)p.\]
\end{restatable}

\begin{proof}
	We defer the proof to \autoref{appendixproof}.
\end{proof}

\begin{proof}[Proof of \autoref{smallr}]
	\setcounter{case}{0}
	\par By \autoref{uppervector}, we have \[\rho_G^-(r) \leq p^t \min\left\{ 2\left\lceil\frac{r}{p^t}\right\rceil - 1, p\right\},\] so it remains to show that \begin{equation}\label{smallrlower}\rho_G^-(r) \geq p^t \min\left\{ 2\left\lceil\frac{r}{p^t}\right\rceil - 1, p\right\}.\end{equation}

	\par If $r \leq p$, then this follows directly from \autoref{invariance} and the Cauchy-Davenport~Theorem. Thus, we may assume $r > p$.

	\par By \autoref{invariance}, we may assume that $d = 2$, so $G = (\Z / p\Z)^2$. If $p = 2$, then the theorem follows easily from enumerating all possible values of $r$ and all sets $A \subseteq G$, so assume that $p > 2$. Let \[r' = \begin{cases}
	p\left(\left\lceil r/p\right\rceil - 1\right) + 1 & \mbox{if $r \leq p(p-1)/2$} \\
	p(p-1)/2 + 1 & \mbox{if $r > p(p-1)/2$}
	\end{cases}.\] Since $r \geq r'$, replacing $r$ with $r'$ cannot increase the left-hand side of \eqref{smallrlower}, and it is easy to check that this replacement leaves the right-hand side unchanged. Therefore, we may assume that $r = np + 1$ where $1 \leq n \leq (p-1)/2$. Take a subset $A \subset G$ with $|A| = r$; we will show that \[|A - A| \geq (2n+1)p = p^t \min\left\{ 2\left\lceil\frac{r}{p^t}\right\rceil - 1, p\right\}.\]

	\par Identify $G$ with the two-dimensional vector space $\F_p^2$ over the field $\F_p$. We will now count the two-element subsets of $A$ in two ways. By definition, the number of two-element subsets of $A$ is the binomial coefficient $\binom{np+1}{2}$. On the other hand, every two-element subset of $A$ is contained in a unique line (that is, affine subspace of $G$ of dimension $1$), so we can count these subsets according to the lines containing them. This yields \begin{equation}\label{linecounting}\sum_{\ell \subset G} \binom{|A \cap \ell|}{2} = \binom{np+1}{2}\end{equation} where the sum is over all lines $\ell \subset G$. Every line in $G$ is parallel to exactly one line $\ell' \subset G$ containing $0$, so \eqref{linecounting} can be rewritten as \[\sum_{\substack{\ell' \subset G \\ \ell' \ni 0}} \sum_{\substack{\ell \subset G \\ \ell \parallel \ell'}} \binom{|A \cap \ell|}{2} = \binom{np+1}{2}\] where the outer sum is over all lines $\ell' \subset G$ containing $0$, and the inner sum is over all lines $\ell \subset G$ parallel to $\ell'$. Since there are exactly $p+1$ lines in $G$ containing $0$, there is a particular line $\ell_0 \subset G$ containing $0$ such that \[\sum_{\substack{\ell \subset G \\ \ell \parallel \ell_0}} \binom{|A \cap \ell|}{2} \geq \frac{1}{p+1} \binom{np+1}{2}.\] We may assume, by applying an $\F_p$-linear change of coordinates, that $\ell_0$ is the line $\{(0, y) \mid y \in \F_p\} \subset \F_p^2 = G$. For any $x \in \F_p$, define the line \[\ell_{x} = \{(x, y) \mid y \in \F_p\}.\] Then, the lines in $G$ parallel to $\ell_0$ are exactly the lines $\ell_x$ for $x \in \F_p$. Let \[m = \max_{x \in \F_p} |A \cap \ell_x|.\] Since \[\sum_{x \in \F_p} |A \cap \ell_x| = |A| = np+1,\] we have $m \geq \lceil (np+1)/p\rceil = n+1$. We consider three cases, depending on whether $m \geq (p+1)/2$, or $m = n+1$, or $n+2 \leq m \leq (p-1)/2$.

	\begin{case}[$m \geq (p+1)/2$]
		Take $x \in \F_p$ such that $|A \cap \ell_x| = m$. Since $\ell_x$ is a translate of $\ell_0$, which is isomorphic as a group to $\Z / p\Z$, the Cauchy-Davenport~Theorem applies to the difference $(A \cap \ell_x) - (A \cap \ell_x) \subseteq \ell_0$, yielding \[|(A - A) \cap \ell_0| \geq |(A \cap \ell_x) - (A \cap \ell_x)| \geq \min\{2m-1, p\} = p.\] (Essentially, we are applying the Cauchy-Davenport~Theorem only to the second coordinates of the elements of $A \cap \ell_x$, which lie in $\Z / p\Z$.) That is, the line $\ell_0$ is a subset of $A - A$.
		\par Now, take \textit{any} line $\ell' \subset G$ containing $0$. There is a line $\ell$ parallel to $\ell'$ such that $|A \cap \ell| \geq \lceil (np+1)/p \rceil = n+1$. Since $\ell$ is a translate of $\ell'$, which is isomorphic as a group to $\Z / p\Z$, the Cauchy-Davenport~Theorem again applies to the difference $(A \cap \ell) - (A \cap \ell) \subseteq \ell'$, yielding \[|(A - A) \cap \ell'| \geq |(A \cap \ell) - (A \cap \ell)| \geq \min\{2(n+1)-1, p\} = 2n+1.\]

		\par Since $G \setminus \{0\}$ is equal to the disjoint union \[\bigsqcup_{\substack{\ell' \subset G \\ \ell' \ni 0}}(\ell' \setminus \{0\})\] over all lines $\ell' \subset G$ containing $0$, we conclude
		\begin{align*}
		|A - A| &= 1 + \sum_{\substack{\ell' \subset G \\ \ell' \ni 0}} (|(A - A) \cap \ell'| - 1) \\
		&\geq 1 + (p-1) + p\cdot((2n+1) - 1) \\
		&= (2n+1)p
		\end{align*} which is the desired inequality.
	\end{case}

	\begin{case}[$m = n+1$]
		Let $S = \{x \in \F_p \mid |A \cap \ell_x| = n+1\}$ and let $s = |S|$. For each $x \in \F_p \setminus S$ we have $|A \cap \ell_x| \leq n$, so \begin{align*}
		\frac{1}{p+1} \binom{np+1}{2} &\leq \sum_{x \in \F_p} \binom{|A \cap \ell_x|}{2} \\
		&= s \binom{n+1}{2} + \sum_{x \in \F_p \setminus S} \binom{|A \cap \ell_x |}{2} \\
		&\leq s\binom{n+1}{2} + \sum_{x \in \F_p \setminus S} \frac{n-1}{2} |A \cap \ell_x| \\
		&= s \binom{n+1}{2} + \frac{n-1}{2} ((np + 1) - (n+1)s),
		\end{align*}
		Simplifying this inequality and using the bound $n \leq (p-1)/2$, we obtain \begin{align*}
		s &\geq \frac{p+1-n}{p+1} \cdot \frac{np+1}{n+1} \\
		&\geq \frac{p+1-(p-1)/2}{p+1} \cdot \frac{p(p-1)/2+1}{(p-1)/2+1} \\
		&= \frac{p-1}{2} + \frac{p^2 + 7}{2(p+1)^2} \\
		&> \frac{p-1}{2}.
		\end{align*} Thus $s \geq (p+1)/2$, so by the Cauchy-Davenport~Theorem, we have $|S - S| \geq \min\{2s - 1, p\} = p$, so $S - S = \F_p$.
		\par Now, take any $x \in \F_p$. Since $x \in S - S$, there is $y \in \F_p$ such that $y, x+y \in S$. By the Cauchy-Davenport~Theorem again, we have \[|(A - A) \cap \ell_x| \geq |A \cap \ell_{x+y} - A \cap \ell_y| \geq \min\{2(n+1) -1, p\} = 2n + 1.\] Summing over all $x \in \F_p$ yields \[|A - A| = \sum_{x \in \F_p} |(A - A) \cap \ell_x| \geq (2n+1)p\] as desired.
	\end{case}

	\begin{case}[$n+2 \leq m \leq (p-1)/2$]
		For $1 \leq k \leq p$, define
		\begin{align*}
		\Lambda_k &= \{x \in \F_p \mid |A \cap \ell_x| \geq k\} \\
		M_k &= \{x \in \F_p \mid |(A - A) \cap \ell_x| \geq k\} \\
		\lambda_k &= |\Lambda_k| \\
		\mu_k &= |M_k|
		\end{align*}
		By definition, we have $p \geq \lambda_1 \geq \cdots \geq \lambda_m > 0$ and $p \geq \mu_1 \geq \cdots \geq \mu_p \geq 0$. We have \[\sum_{k=1}^m \lambda_k = \sum_{x \in \F_p} |A \cap \ell_x| = |A| = ap+1\] because each line $\ell_x$ contributes exactly $|A \cap \ell_x|$ to the sum. Similarly \[\sum_{k=1}^p \mu_k = \sum_{x \in \F_p} |(A-A) \cap \ell_{x}| = |A - A|.\]

		\par We claim that $M_{i+j-1} \supseteq \Lambda_i - \Lambda_j$ for $1 \leq i, j \leq m$. To show this, take $x_1 \in \Lambda_i$ and $x_2 \in \Lambda_j$; we will show that $x_1 - x_2 \in M_{i+j-1}$. By the Cauchy-Davenport~Theorem, we have
		\begin{align*}
		|(A - A) \cap \ell_{x_1 - x_2}| &\geq |A \cap \ell_{x_1} - A \cap \ell_{x_2}| \\
		&\geq \min\{|A \cap \ell_{x_1}| + |A \cap \ell_{x_2}| - 1, p\} \\
		&\geq \min\{i+j-1, p\} \\
		&= i+j-1
		\end{align*}
		where the last equality follows from the bound $i, j \leq m \leq (p-1)/2$. That is, we have $x_1 - x_2 \in M_{i+j-1}$, as desired.
		\par By the Cauchy-Davenport~Theorem again, we conclude \begin{equation}\label{lambdaineq}\mu_{i+j-1} = |M_{i + j - 1}| \geq |\Lambda_i - \Lambda_j| \geq \min\{\lambda_i + \lambda_j - 1, p\}\end{equation} for $1 \leq i, j \leq m$.
		\par Therefore, the conditions of \autoref{sumlemma2} are satisfied, so
		\[
			|A - A| = \sum_{k=1}^p \mu_k \geq (2n+1)p
		\]
		as desired.
		\qedhere
	\end{case}
\end{proof}

\section{Completing the proof of \autoref{mainthm}} \label{sectionmainthm}

\par Before proceeding to the proof of \autoref{mainthm}, we prove a general lemma about sets in vector spaces over finite fields.

\begin{lemma}\label{intersectionlemma}
	Let $p$ be a prime and let $m$ be an integer. Let $G$ be a vector space over the field $\F_p$ of dimension $d \geq 3$, and let $S$ be a subset of $G$ such that \[|S \cap H| \geq mp^{d-2}\] for each vector hyperplane $H$ (that is, vector subspace of dimension $d - 1$) in $G$. Then $|S| \geq mp^{d-1}$.
\end{lemma}
\begin{proof}[Proof of \autoref{intersectionlemma}]
	 Assume for the sake of contradiction that $|S| < mp^{d - 1}$. We first claim that there is a $(d-2)$-dimensional vector subspace $V_0 \subset G$ with $|S \cap V_0| \leq mp^{d-3}$. To show this, take a $(d-2)$-dimensional vector subspace $V \subset G$ uniformly at random. It is clear that $V$ has $p^{d-2} - 1$ nonzero elements, that $G$ has $p^d-1$ nonzero elements, and that each nonzero element of $G$ is in $V$ with equal probability. Therefore, the probability that $x \in V$ for a fixed $x \in G \setminus \{0\}$ is \[\frac{p^{d-2} - 1}{p^{d} - 1}.\] Clearly, the probability that $0 \in V$ is $1$. Therefore, by the linearity of expectation, the expected value of $|S \cap V|$ is given by
	 \begin{align*}
	 \mathbb{E}[|S \cap V|] &= 1 + (|S| - 1) \frac{p^{d-2} - 1}{p^{d} - 1} \\
	 &< 1 + (mp^{d-1} - 1) \frac{p^{d-2} - 1}{p^{d} - 1} \\
	 &= m p^{d-3} + \frac{(p^2 - 1)(p-m)p^{d-3}}{p^{d} - 1} \\
	 &< m p^{d-3} + 1.
	 \end{align*}
	 Since $mp^{d-3}$ is an integer, we conclude that there is a particular $(d-2)$-dimensional vector subspace $V_0 \subset G$ with $|S \cap V_0| \leq mp^{d-3}$.

	 \par Finally, consider the integer $N$ defined by the sum \[N = \sum_{H} |S \cap H|\] where $H$ ranges over all vector hyperplanes with $V_0 \subset H \subset G$. Such hyperplanes $H$ are in bijection with lines through the origin in the two-dimensional quotient space $G / V_0$, so there are $p+1$ of them. Therefore, by the assumption of the theorem, we have \[N \geq \sum_{H} mp^{d-2} = (p+1)mp^{d-2}.\] On the other hand, the sum defining $N$ counts every element of $S \setminus V_0$ once and every element of $S \cap V_0$ exactly $p+1$ times, so \[N = |S| + p |S \cap V_0|.\] Therefore, we have \[|S| = N - p|S \cap V_0| \geq (p+1) mp^{d-2} - p \cdot mp^{d-3} = mp^{d-1},\] which contradicts our assumption that $|S| < mp^{d-1}$.
\end{proof}

\par We are now ready to restate and prove \autoref{mainthm}.

\mainthm*

\begin{proof}
	\par We proceed by induction on $r$. If $t < 2$, then the result follows from \autoref{smallr}, so we may assume $t \geq 2$. By \autoref{invariance}, we may also assume that $d = t+1$. Let $m = \min\{2 \left\lceil r/p^t \right \rceil - 1, p\}$. We wish to show that $\rho_G^-(r) = m p^t$. By \autoref{uppervector}, we have $\rho_G^-(r) \leq mp^t$, so it remains to show that $\rho_G^-(r) \geq m p^t$. Let $A$ be a subset of $G$ with $|A| = r$; we will show that $|A - A| \geq mp^t$.

	\par Consider $G$ as a vector space of dimension $d = t + 1 \geq 3$ over $\F_p$. By \autoref{intersectionlemma} applied to $S = A - A$, it suffices to show that $|(A - A) \cap H| \geq mp^{t-1}$ for each vector hyperplane $H \subset G$. For this, note that there are exactly $p$ distinct translates $H + x$, where $x \in G$, and that the entire space $G$ is the disjoint union of these $p$ translates. Therefore, there exists $x_0 \in G$ such that $|A \cap (H + x_0)| \geq \lceil r / p \rceil$. By the inductive hypothesis, \[|(A - A) \cap H| \geq |(A \cap (H + x_0)) - (A \cap (H + x_0))| \geq \rho_{H}^-(\lceil r/p \rceil) = mp^{t-1}\] as desired.
\end{proof}

\section{Applications to signed sumsets} \label{bajnokmatzkeproof}
In this section, we prove \autoref{bajnokmatzkeconjecture}. In particular, we will show that it is a consequence of the following more general result. The notations $\rho_\pm(G, m, r)$ and $r_\pm A$ used in this section are defined in \cite{signed_sumsets_elementary}.
\begin{lemma}\label{signedsumsetlemma}
	Let $G$ be a finite abelian group of order $N$. Then \[\rho_\pm(G, m, 2) \geq \min\{\rho_G^-(m), \rho_G^-(2m) - 1\}\] for $1 \leq m \leq N/2$.
\end{lemma}
\begin{proof}
	\setcounter{case}{0}
	Let $A \subseteq G$ be a subset with $|A| = m$. We will show that \[2_\pm A \geq \min\{\rho_G^-(m), \rho_G^-(2m) - 1\}.\]
	We consider two cases, depending on whether or not $A \cap (-A) = \emptyset$.
	\begin{case}[$A \cap (-A) \neq \emptyset$]
		Choose $x \in A \cap (-A)$. By definition, the signed sumset $2_\pm A$ contains $0 = x + (-x)$ and it contains the difference of any two distinct elements of $A$. Therefore, we have $A - A \subseteq 2_\pm A$. It follows that \[|2_\pm A| \geq |A - A| \geq \rho_G^-(m) \geq \min\{\rho_G^-(m), \rho_G^-(2m) - 1\},\] as desired.
	\end{case}
	\begin{case}[$A \cap (-A) = \emptyset$]
		Let $B = A \cup (-A)$. Then $|B| = 2|A|$. By definition, the signed sumset $2_\pm A$ contains $(B - B) \setminus \{0\}$, so \begin{align*}
		|2_\pm A| &\geq |B - B| - 1 \\
		&\geq \rho_G^-(2m)-1 \\
		&\geq \min\{\rho_G^-(m), \rho_G^-(2m) - 1\},\end{align*} as desired. \qedhere
	\end{case}
\end{proof}

Now, we shall restate and prove \autoref{bajnokmatzkeconjecture}.
\bajnokmatzkeconjecture*

\begin{proof}
	\begin{enumerate}[(a)]
		\item By \autoref{signedsumsetlemma} and \autoref{mainthm}, we have \begin{align*}
		\rho_\pm((\Z / p\Z)^2, m, 2) &\geq \min\{\rho_G^-(m), \rho_G^-(2m) - 1\} \\
		&= \min\left\{(2c+1)p, \left(4c+2\left\lceil\frac{2v}{p}\right\rceil + 1\right)p - 1\right\} \\
		&= (2c+1)p.
		\end{align*} The reverse inequality $\rho_\pm((\Z / p\Z)^2, m, 2) \leq (2c+1)p$ follows from \cite[Theorem~5]{signed_sumsets}.
		\item By \autoref{signedsumsetlemma} and \autoref{mainthm}, we have \begin{align*}
		\rho_\pm((\Z / p\Z)^2, m, 2) &\geq \min\{\rho_G^-(m), \rho_G^-(2m) - 1\} \\
		&= \min\{p^2, p^2 - 1\} \\
		&= p^2 - 1.
		\end{align*}
		The reverse inequality $\rho_\pm((\Z / p\Z)^2, m, 2) \leq p^2 - 1$ follows from \cite[Proposition~8]{signed_sumsets}.
	\end{enumerate}
\end{proof}

\begin{appendices}
\numberwithin{lemma}{section}

\section{Proof of \autoref{sumlemma2}} \label{appendixproof}
In this appendix, we prove \autoref{sumlemma2}. The following lemma is essential to our proof of \autoref{sumlemma2}.

\begin{lemma}\label{sumlemma}
	Let $m > 1$, and let $\lambda = (\lambda_1, \ldots, \lambda_m)$ be a sequence of integers with $\lambda_1 \geq \cdots \geq \lambda_m > 0$ and $\lambda_1 > 1$. Define the sequence $\mu = (\mu_1, \ldots, \mu_{2m - 1})$ by \[\mu_{k} = \max_{k = i + j - 1} (\lambda_i + \lambda_j - 1)\] for $1 \leq k \leq 2m-1$, where the maximum is over all $1 \leq i, j \leq m$ with $k = i + j - 1$. Then \[\sum_{k=1}^{2m-1} \mu_k \geq 3\left(\sum_{k=1}^m \lambda_k\right) - 3.\]
\end{lemma}

\begin{proof}
	Let \[F(\lambda) = \{(x, y) \in \Z^2 \mid 0 \leq y \leq m-1, 0 \leq x \leq \lambda_{y+1} - 1\} \subset \Z^2\] be the Ferrers diagram of $\lambda$; that is, a set with $m$ rows of points where the $k$th row from the bottom contains $\lambda_k$ points for $1 \leq k \leq m$. Similarly, let \[F(\mu) = \{(x, y) \in \Z^2 \mid 0 \leq y \leq 2m-2, 0 \leq x \leq \mu_{y+1} - 1\} \subset \Z^2\] be the Ferrers diagram of $\mu$.

	\par We claim that $F(\mu)$ contains the sumset $F(\lambda) + F(\lambda)$. To show this, take two elements $(x, y)$ and $(x', y')$ in $F(\lambda)$; we wish to show that $(x+x', y+y') \in F(\mu)$. By the definition of $F(\lambda)$ we have
	\begin{align*}
	0 &\leq y + y' \leq (m-1) + (m-1) = 2m-2 \\
	0 &\leq x + x' \leq (\lambda_{y+ 1} - 1) + (\lambda_{y' + 1} - 1) \leq \mu_{y + y' + 1} - 1
	\end{align*}
	so $(x+x', y + y') \in F(\mu)$ as desired.

	\par By assumption, both $m > 1$ and $\lambda_1 > 1$, so $F(\lambda)$ contains the three non-collinear points $(0, 0)$, $(1, 0)$, and $(0, 1)$. Therefore, by Freiman's~dimension~lemma \cite[Theorem~5.20]{tao}, \[\sum_{k=1}^{2m-1} \mu_k = |F(\mu)|\geq |F(\lambda) + F(\lambda)| \geq 3|F(\lambda)| - 3 = 3\left(\sum_{k=1}^m \lambda_k\right) - 3\] as desired.
\end{proof}

We shall now restate and prove \autoref{sumlemma2}.

\sumlemma*

\begin{proof}[Proof of \autoref{sumlemma2}]
	\setcounter{case}{0}
	We may assume that \[\mu_k = \max_{k = i + j - 1}\min \{\lambda_i + \lambda_j - 1, p\}\] for all $k$. Let $h$ be the maximum value of $i + j - 1$ over all integers $1 \leq i, j \leq m$ with $\lambda_i + \lambda_j - 1 > p$, or $0$ if no such $i$ and $j$ exist. Then $\mu_k = p$ for $k \leq h$ and $\mu_{i + j - 1} \geq \lambda_i + \lambda_j - 1$ for $1 \leq i, j \leq m$ as long as $i + j - 1 > h$.

	Proceed by induction on $m$. We consider three cases, depending on whether $h = 0$ or $h =1$ or $h \geq 2$.

	\begin{case}[$h = 0$]
		Then \autoref{sumlemma} applies, so
		\begin{align*}
		\sum_{k = 1}^{2m-1} \mu_k &\geq 3\left(\sum_{k=1}^{m}\lambda_k\right) - 3 \\
		&\geq 3(np+1) - 3 \\
		&\geq (2n+1)p
		\end{align*}
		as desired.
	\end{case}

	\begin{case}[$h = 1$]
		\par First assume $n = 1$ and $m = 3$. Then
		\begin{align*}
		\sum_{k=1}^{2m-1} \mu_k &= \mu_1 + \mu_2 + \mu_3 + \mu_4 + \mu_5 \\
		&\geq p + (\lambda_1 + \lambda_2 - 1) + (\lambda_1 + \lambda_3 - 1) + (\lambda_2 + \lambda_3 - 1) + 1 \\
		&\geq p + 2(\lambda_1 + \lambda_2 + \lambda_3) - 2 \\
		&\geq p + 2(p+1)-2 \\
		&= 3p
		\end{align*}
		as desired.
		\par Next assume $n = 1$ and $m \geq 4$. The assumption that $h = 1$ implies that $2 \lambda_1 - 1 > p$, so $\lambda_1 > (p+1)/2$. Therefore $\mu_k \geq \lambda_1 + \lambda_k - 1 > (p+1)/2$ for $1 < k < m$ and $\mu_k \geq \lambda_m + \lambda_{k-m+1} - 1 \geq \lambda_{k-m+1}$ for $k \geq m$, so
		\begin{align*}
		\sum_{k=1}^{2m-1} \mu_k &> p + \sum_{k=2}^{m-1} \frac{p+1}{2} +\sum_{k=m}^{2m-1} \lambda_{k - m + 1} \\
		&= p + (m-2)\frac{p+1}{2} + (np+1) \\
		&> 3p
		\end{align*} as desired.
		\par It remains to consider the case that $n  \geq 2$. Because $h = 1$, \autoref{sumlemma} applies to the sequences $(\lambda_1, \cdots, \lambda_m)$ and $(2p-1, \mu_2, \cdots, \mu_{2m -1})$. Therefore
		\begin{align*}
		\sum_{k=1}^{2m-1} \mu_k &= p + \sum_{k=2}^{2m-1} \mu_k \\
		&= -p + 1 + \left(2p - 1 + \sum_{k=2}^{2m-1} \mu_k\right) \\
		&\geq -p + 1 + 3(np + 1) - 3 \\
		&\geq (2n+1)p
		\end{align*}
		as desired.
	\end{case}

	\begin{case}[$h \geq 2$]
		Define the sequence $\lambda' = (\lambda'_1, \ldots, \lambda'_{m-1})$ by $\lambda'_k = \lambda_{k+1}$ for $1 \leq k \leq m-1$. Then, define $\mu' = (\mu'_1, \ldots, \mu'_{2m-3})$ by \[\mu'_{k} = \max_{k = i + j - 1} \min\{\lambda'_i + \lambda'_j - 1, p\}\] for $1 \leq k \leq 2m-3$, where the maximum is over all $1 \leq i, j \leq m-1$ with $k = i + j - 1$.
		We have \[\sum_{k=1}^{m-1} \lambda'_k = \left(\sum_{k=1}^{m} \lambda_k\right) - \lambda_1 \geq (n-1)p + 1,\] so by the inductive hypothesis we have \[\sum_{k=1}^{2m-3} \mu'_k \geq (2n - 1)p.\] On the other hand, we have \[\mu_{k+2} =\max_{k+2 = i + j - 1} (\lambda_i + \lambda_j - 1) \geq \max_{k = i + j - 1} (\lambda'_i + \lambda'_j - 1) = \mu'_k\] for $1 \leq k \leq 2m-3$, where the inequality follows from replacing $(i, j)$ with $(i-1, j-1)$. Therefore \[
		\sum_{k=1}^{2m-1} \mu_k = 2p + \sum_{k=1}^{2m-3} \mu'_{k} \\
		\geq (2n + 1)p
		\]
		as desired.
		\qedhere
	\end{case}
\end{proof}
\end{appendices}
\section*{Acknowledgments}
This research was conducted under the supervision of Joseph Gallian at the University of Minnesota Duluth REU, funded by NSF Grant 1358659 and NSA Grant H98230-13-1-0273. The author thanks Joseph Gallian, who ran the REU, brought this question to his attention, and provided helpful comments on the manuscript. He thanks his advisors Levent Alpoge and Benjamin Gunby for valuable discussions and advice.


Bohemian Matrix Geometry

Abstract: A Bohemian matrix family is a set of matrices all of whose entries are drawn from a fixed, usually discrete and hence bounded, subset of a field of characteristic zero. Originally these were integers -- hence the name, from the acronym BOunded HEight Matrix of Integers (BOHEMI) -- but other kinds of entries are also interesting. Some kinds of questions about Bohemian matrices can be answered by numerical computation, but sometimes exact computation is better. In this paper we explore some Bohemian families (symmetric, upper Hessenberg, or Toeplitz) computationally, and answer some open questions posed about the distributions of eigenvalue densities.

\section{Introduction}

 \begin{figure}
     \centering
     \includegraphics[width=0.95\textwidth]{Sampledpop_5_0_1_bone_8N5000000.png}
    \caption{Eigenvalues of $5\cdot 10^6$ dimension $m=8$ matrices with entries chosen uniformly at random among the population $P=(-1,0,1)$.  We see that the uniform distribution as $m\to\infty$ result of~\cite{tao2006random} is evident already.  As $m$ increases, the ``holes'' close up, and the relative percentage of the real eigenvalues (which extend past the $\sqrt{m}$ disk radius) becomes negligible. }
     \label{fig:uniform}
     \Description{A fuzzy-edged light-grey disk, bisected with a dark line with dark bumps at $0$ and $\pm 1$.  Reminiscent of the moon occulted by a dark shadow.  Smaller holes are placed symmetrically on on near-circular arcs. }
 \end{figure}
A \textsl{Bohemian matrix family} is a set of matrices all of whose entries are drawn from a fixed finite population, usually integers, algebraic integers, or Gaussian integers.
The name ``Bohemian'' was invented in 2015 at the Fields Institute Thematic Year in Symbolic Computation; the mnemonic is useful because it highlights searching for commonality among features of matrices with discrete populations.
Our original interest was for \textsl{software testing}, and as a testing ground for optimization over (in search of improved computational bounds for certain quantities, such as the growth factor in Gaussian elimination with complete pivoting, or the departure from normality).  Bohemian matrices are a \textsl{specialization} in the sense of P\'olya, and have led now to several workshops, at \href{https://nhigham.com/2018/10/15/bohemian-matrices-in-manchester/}{Manchester in 2018}, at ICIAM in 2019, and at SIAM in 2021. There have been several publications since, including~\cite{Chan2020}, \cite{fasi2020determinants}, \cite{DudaFonsecaXuYe+2021+505+514}, \cite{Sendra2022}, and the very interesting~\cite{bogoya2022upper} which explores a connection to the asymptotic spectral theory of Toeplitz matrices~\cite{Schmidt1960}, which is very much alive today: see e.g.~\cite{bottcher2012introduction} and~\cite{barrera2018eigenvalues}.

The study of matrices with rational integer entries is very old, and the literature too vast to survey coherently here.  We instead point to the early survey by Olga Taussky--Todd~\cite{Taussky1960} as an entry point. We are also going to be working with Gaussian integer and algebraic integer entries; see for instance~\cite{butson1962generalized} for important work on generalized Hadamard matrices where the entries are roots of unity.

The study of \textsl{random} matrices where the entries are drawn from discrete distributions is also very advanced; see~\cite{tao2006random,tao2017random} for instance. Those papers established that dense square matrices of dimension $m$ whose entries are drawn from a discrete population, say $-1$, $0$, and $1$, have eigenvalues that are asymptotically \emph{uniformly distributed} on a disk of radius $\sqrt{m}$.  See Figure~\ref{fig:uniform}.

However, if the matrices are \emph{structured}, other pictures arise, and little is known about the asymptotic distributions of their eigenvalues.  For instance, in~\cite{Corless:2021:WhatCan} we find \emph{skew-symmetric tridiagonal matrices} with unexpectedly \emph{square} distributions, or even diamond-shaped, as in Figure~\ref{fig:diamond}.
We will explain some of these shapes in this paper, and prove that they will \emph{not} fill out to disk shapes as $m \to \infty$.  We will also explain some other interesting features that arise in certain Bohemian families, including upper Hessenberg Toeplitz Bohemians.

\begin{figure}
    \centering
    \includegraphics[width=0.95\textwidth]{muted_palette.png}
    \caption{Eigenvalues of \emph{all} dimension $m=31$ skew-symmetric tridiagonal matrices with entries drawn from $P = (-1,i,1,-i)$, the fourth roots of unity. Picture courtesy Aaron Asner. We explain the unexpected eigenvalue geometry in this paper.}
\Description{A pinkish fractal diamond shape with a hole in the center outlined in yellow and red with a green and blue cross surrounding the hole.  The fractal edges on the outside are mostly green. The fractal edges are reminiscent of a saw blade. The sharpest peaks are at the four main corners $(\pm\sqrt{2},0)$, $(0,\pm\sqrt{2})$.}
    \label{fig:diamond}
\end{figure}

There is a significant connection to number theoretic works, as well. Kurt Mahler~\cite{mahler1963two} was interested in the distribution of zeros of polynomials with given \textsl{length} (the one-norm of the vector of coefficients) and \textsl{height} (the infinity-norm of the vector of coefficients). This is connected with the Littlewood conjecture for polynomials~\cite{littlewood1968} (How large on the unit circle must a polynomial with $-1$,$1$ coefficients be?).  The numerical visualization of zeros of polynomials with coefficients $0$ or $1$  was apparently first done in~\cite{Odlyzko1992}, who proved that the limiting set was connected; later work explained the ``holes"~\cite{borwein1997polynomials} and visualizations by Peter Borwein and Loki J\"orgenson made several other questions clearer~\cite{borwein2001visible}.  See also the web pages of \href{https://math.ucr.edu/home/baez/roots/}{John Carlos Baez} and of \href{https://jdc.math.uwo.ca/roots/}{Dan Christensen}. Their article, \textsl{The Beauty of Roots}, published on Baez' website at the previous link, explains quite a few of the visible structures. Then we will see a connection to Kate Stange's work on Schmidt Tessellations,  \href{https://math.katestange.net/illustration/schmidt-arrangements/}{https://math.katestange.net/illustration/schmidt-arrangements/}.  See also~\cite{harriss2020algebraic} and~\cite{dorfsman2021searching} who connect Galois theory and visualization of roots of polynomials (and therefore, although they do not point this out, of eigenvalues of Bohemian matrices).

It is only a small jump from polynomials of bounded height to \textsl{matrices} of bounded height; but the questions become (to our minds) even more interesting.

\subsection{Organization of the paper}
In section~\ref{sec:questions} we mention a few research questions about Bohemian matrices that may be interesting to the computer algebra community; in~\ref{sec:structures} we discuss specific matrix structures and give our main theorems, which describe and explain the constraints that these matrix structures place on the spectra. In particular, we give a new theorem about eigenvalues of upper Hessenberg Toeplitz matrices which gives an essentially complete explanation of the ``fractal'' edges seen in some of the figures. This is based on the well-known asymptotic spectral theory of Toeplitz matrices, but extended to the case where we have an uncountable number of such matrices in the limit as the dimension goes to infinity.  This new theorem extends a result of Schmidt and Spitzer, which is concerned with Toeplitz matrices whose ``symbol'' is a Laurent polynomial and with certain semi-algebraic curves that arise from that Laurent polynomial, to matrices whose symbol is a Laurent \emph{series}.

Together these theorems explain the appearance of some of these figures.
We also explain some of the ``algebraic number starscape" appearance~\cite{harriss2020algebraic} and connect to Schmidt tesselations~\cite{Stange2017} by making an \textsl{approximate} computation of eigenvalues, and displaying the results in~Figure \ref{fig:Rayleigh}.

\section{Some questions of interest\label{sec:questions}}
Every polynomial written in the monomial basis can be embedded as a Frobenius companion matrix into a matrix of the same \textsl{height} (the height of a matrix $\mathbf{A}$, as opposed to a polynomial, is the infinity norm of the matrix reshaped into a vector). Therefore every question about roots of polynomials of bounded height translates directly into a question about eigenvalues of Bohemian matrices.  It will become clear as we go that this is one-way, that is,  there are questions of Bohemian matrices that do not translate into questions about bounded height polynomials.

One question is ``which matrices in the family have the largest \textsl{characteristic height}?''  The characteristic height is the height of the characteristic polynomial; as previously noted, the characteristic height might be exponentially larger than the matrix height.  This is so for certain upper Hessenberg Toeplitz matrices~\cite{Chan2020}, where a lower bound containing a Fibonacci number is given for the maximum characteristic height in the family studied in that paper.

The characteristic height is connected to the numerical conditioning of the characteristic polynomial; indeed one may take the Lebesgue constant for the polynomial~\cite[ch.~8]{CorlessFillion2013} on the interval $-1 \le x \le 1$ to be the characteristic height.

Typically, one asks these questions in an asymptotic form; one wants answers valid in the limit as the dimension~$m$ goes to infinity.  Examples of this include work by Tao and Vu, who show that for general unstructured matrices the distribution of eigenvalues divided by $\sqrt{m}$ is asymptotically uniform on the unit disk~\cite{tao2006random,tao2017random}. This is \textsl{not} true for structured matrices; see e.g.~\cite{Corless:2021:WhatCan,Corless2021} where skew-symmetric tridiagonal matrices (independently of dimension, so no scaling is needed) are seen to be confined to a diamond shape. We explain that mystery in this paper, using a century-old theorem, which deserves to be better-known.

\section{The Effect of Matrix Structure\label{sec:structures}}
The first Bohemian results were on real symmetric matrices or Hermitian matrices~\cite{Tracy1993}. We look at other structures here, in order to get another view.  We begin with complex symmetric matrices.
\subsection{Complex Symmetric Matrices}
A complex symmetric matrix $\ensuremath{\mat{A}}$ satisfies $\ensuremath{\mat{A}}^T = \ensuremath{\mat{A}}$, where ${}^T$ is the real transpose operation.  These occur, for instance in B\'ezout matrices for polynomials with complex coefficients.  Unlike Hermitian matrices, the eigenvalues of complex symmetric matrices need not be real.  Indeed, any matrix may be brought by similarity transformation to a complex symmetric matrix~\cite[Thm 4.4.9]{horn2012matrix}. In many cases this can be done by unitary similarity; see for instance, the characterizations of when this can be done, in~\cite{Liu2013}.

Here let us examine a specific complex symmetric family, with population $-1\pm i$ where $i = (0,1)$ is the square root of $-1$. At dimension $m$, such a matrix has $m(m+1)/2$ free entries, each of which can be either of $-1 \pm i$.  This gives $2^{m(m+1)/2}$ such matrices; this growth is (much) faster than exponential.  Still, examining eigenvalues of small dimension examples can tell us much. If we take $m=6$, then the number of such matrices is only $2^{21}$, slightly more than $2$ million.  The eigenvalues of all these matrices can be computed in a reasonable time, and plotted.  As depicted in Figure~\ref{fig:symmetric6}, they seem confined to a strip in the left-half plane.

We now prove that this will always be true at any dimension.

\begin{theorem}\label{thm:bent}
If the symmetric matrix $\ensuremath{\mat{A}}$ has dimension $m$, entries drawn from $-1\pm i$, and eigenvalue $\lambda$, then $-m \le \Re(\lambda) \le 0$ and $-m \le \Im(\lambda) \le m$.
\end{theorem}
\begin{proof}
Write $\ensuremath{\mat{A}} = -\ensuremath{\mat{E}} + i\ensuremath{\mat{M}}$ where $\ensuremath{\mat{E}} = \mathbf{e}\mathbf{e}^T$ is the rank-one matrix that has all $1$s, and $\ensuremath{\mat{M}}$ is symmetric and has entries only $\pm 1$. We use the Bendixon--Bromwich--Hirsch theorem~\cite[Fact 5, p.~16-2]{hogben2013handbook} (original references~\cite{Bendixson1902,1902,Bromwich1906}) as follows. Note that $(\ensuremath{\mat{A}} + \ensuremath{\mat{A}}^*)/2 = -\ensuremath{\mat{E}}$ is the Hermitian part of $\ensuremath{\mat{A}}$, while $(\ensuremath{\mat{A}} - \ensuremath{\mat{A}}^*)/(2i) = \ensuremath{\mat{M}}$ is the skew-Hermitian part. The Bendixon--Bromwich--Hirsch theorem says that if the eigenvalues of $-\ensuremath{\mat{E}}$ are written $\mu_1 \ge \mu_2 \ge \ldots \ge \mu_m$ (they are all real because $\ensuremath{\mat{E}}$ is Hermitian) and the eigenvalues of $\ensuremath{\mat{M}}$ are written $\nu_1 \ge \nu_2 \ge \ldots \ge \nu_m$, then $\mu_m \le \Re(\lambda) \le \mu_1$ and $\nu_m \le \Im(\lambda) \le \nu_1$.  But a short computation shows that the eigenvalues of $-\ensuremath{\mat{E}}$ are $-m$ and $0$ with multiplicity $m-1$, and the Gerschgorin disk theorem shows that the eigenvalues of $\ensuremath{\mat{M}}$ lie in the union of circles centred at $1$ of radius $m-1$ and centred at $-1$ of radius $m-1$.  This establishes the theorem.
\end{proof}

\begin{remark}
We could have stated and proved that theorem with greater generality. That is, the population could equally well have been $a \pm bi$ for real numbers $a$ and $b$ and the conclusions would have been the same, apart from scaling.  However, we only need the \emph{idea}, for the next theorem.
\end{remark}

\begin{figure}
    \centering

    \includegraphics[width=0.95\textwidth]{tophalf.png}
    \caption{All eigenvalues with $\Im(\lambda) \ge 0$ of symmetric dimension $m=6$ matrices with entries $-1\pm i$. The set is symmetric about the real axis. We see the eigenvalues apparently confined to the strip $-6 \le \Re(\lambda) \le 0$, and bounded below and above by $-6 \le \Im(\lambda) \le 6$. There are several other unexplained features of this eigenvalue distribution.}
    \label{fig:symmetric6}
\end{figure}

We now use this method to explain why skew-symmetric tridiagonal matrices with population $1$ and $i$ (the population considered in~\cite{Corless:2021:WhatCan} and~\cite{Corless2021}) are confined to a diamond shape.

\subsubsection{Squares, Diamonds, and Lozenges}
\begin{theorem}
\label{thm:square}
Let $\ensuremath{\mat{A}}$ be a square skew-symmetric matrix of dimension $m$ and population $-1 \pm i$.  Then its eigenvalues $\lambda$ satisfy $-2 \le \Re(\lambda) \le 2$ and $-2 \le \Im(\lambda) \le 2$, and are thus confined to a square.
\end{theorem}
\begin{proof}
A matrix $\ensuremath{\mat{A}}$ from this family can be written as $\ensuremath{\mat{A}} = \S + i \ensuremath{\mat{T}}$ where the superdiagonal of $\S$ is $-1$ and the superdiagonal of $\ensuremath{\mat{T}}$ is $\pm 1$. Both are skew-symmetric: $\S^T = -\S$ and $\ensuremath{\mat{T}}^T = -\ensuremath{\mat{T}}$. The Hermitian part of $\ensuremath{\mat{A}}$ is $(\ensuremath{\mat{A}} + \ensuremath{\mat{A}}^H)/2 = i\ensuremath{\mat{T}}$ and the skew-Hermitian part is $(\ensuremath{\mat{A}} - \ensuremath{\mat{A}}^H)/(2i) = -i\S$.  [Both are Hermitian, and have real eigenvalues.]  Application of the Gerschgorin circle theorem to each of these shows that the eigenvalues of either matrix are confined to the interval $-2 \le \mu \le 2$.  By the theorem of Bendixon--Bromwich--Hirsch cited earlier, the eigenvalues of $\ensuremath{\mat{A}}$ are confined to the \textsl{square} $-2 \le \Re(\lambda) \le 2$, $-2 \le \Im(\lambda) \le 2$.
\end{proof}

\begin{remark}
Skew-symmetric tridiagonal matrices with population $1$ and $i$ are confined to a diamond $|\Re(\lambda)|+|\Im(\lambda)|\le \sqrt{2}$.  To see this, multiply the matrix by $-1+i$, which rotates its eigenvalues by $\pi/4$ and stretches them by $\sqrt{2}$; but now the matrix population is $-1\pm i$ and it's still skew-symmetric, and hence confined to the square as described above.  Rotate the square back by $\pi/4$ and shrink by $\sqrt{2}$, and the result follows.
\end{remark}

We have therefore explained the non-round shape of the eigenvalue distribution of these matrices.
\subsection{Upper Hessenberg Matrices}
An upper Hessenberg matrix is a matrix of the form
\begin{equation}
    \begin{bmatrix}
    h_{1,1} & h_{1,2} & h_{1,3} & \ldots & h_{1,m} \\
    h_{2,1} & h_{2,2} &  \ddots & & \vdots \\
    0 & h_{3,2} & h_{3,3} & \ddots &  \vdots \\
    \vdots & & \ddots & \ddots & \vdots \\
    0 & \ldots & 0 & u_{m,m-1} & u_{m,m}
    \end{bmatrix}\>.
\end{equation}
That is, it is zero below the first subdiagonal.  If any entry of the first subdiagonal is zero, then the matrix is said to be reducible, because the matrix then separates into blocks containing distinct eigenvalues. Here we restrict our attention to irreducible matrices and indeed we specify that all the subdiagonal entries $h_{j+1,j} = -1$.  If the subdiagonal entries all have $|h_{j+1,j}| = 1$ we say that the matrix is \textsl{unit} upper Hessenberg.  If all the diagonal entries are zero, we say that it is Zero Diagonal.

\begin{remark}
Suppose that all $h_{i,j}$ are roots of unity.  Consider the $5$ by $5$ case, for definiteness. Take four roots of unity, as yet unspecified: call them $s_2$, $s_3$, $s_4$, $s_5$. Form the diagonal matrix $\ensuremath{\mat{D}} = \diag(1,s_2, s_3, s_4, s_5)$ and perform the similarity transform $\ensuremath{\mat{D}} \H \ensuremath{\mat{D}}^{-1}$.  The result is
\begin{equation}
    \left[\begin{array}{ccccc}
h_{1,1} & \frac{h_{1,2}}{s_{2}} & \frac{h_{1,3}}{s_{3}} & \frac{h_{1,4}}{s_{4}} & \frac{h_{1,5}}{s_{5}}
\\
 s_{2} h_{2,1} & h_{2,2} & \frac{s_{2} h_{2,3}}{s_{3}} & \frac{s_{2} h_{2,4}}{s_{4}} & \frac{s_{2} h_{2,5}}{s_{5}}
\\
 0 & \frac{s_{3} h_{3,2}}{s_{2}} & h_{3,3} & \frac{s_{3} h_{3,4}}{s_{4}} & \frac{s_{3} h_{3,5}}{s_{5}}
\\
 0 & 0 & \frac{s_{4} h_{4,3}}{s_{3}} & h_{4,4} & \frac{s_{4} h_{4,5}}{s_{5}}
\\
 0 & 0 & 0 & \frac{s_{5} h_{5,4}}{s_{4}} & h_{5,5}
\end{array}\right]\>.
\end{equation}
Now choose $s_2 = \overline{h_{2,1}}$, $s_3 = s_2\overline{h_{3,2}}$, $s_4 = s_3 \overline{h_{4,3}}$, and $s_5 = s_4 \overline{h_{5,4}}$.  This forces the subdiagonal entries to be $1$, leaves the diagonal as it was before, and shuffles the upper triangle to be possibly different roots of unity to what they were before.  Since the elements of the upper triangle were independent, the resulting formulae will range over the entire set of possibilities as we make the $h_{i,j}$ range over the entire set of possibilities.  It is for this specific population that we started studying \textsl{unit} upper Hessenberg matrices.
\end{remark}

Many populations have zero as their mean value (e.g. $\{-1,1\}$ or indeed roots of unity; or $\{-1,0,1\}$).  In that case, the eigenvalues are typically symmetric about zero and a simplified picture is obtained simply by setting all the diagonal entries to zero, in which case the Gerschgorin circles are all centred at $0$.  Sometimes we will have to transform back to the nonzero diagonal case, but a surprising amount of information is retained even with the simplification of insisting on a zero diagonal.

\begin{figure}
    \centering
    \includegraphics[width=0.95\textwidth]{Sampledpop_CubeRootsOfUnity_copper_5N5000000.png}
    \caption{Eigenvalues of a sample of $5$ million upper Hessenberg matrices of dimension $m=5$ matrices with population cube roots of unity. The image is visually indistinguishable from the density plot of all $14,348,907$ unit upper Hessenberg zero diagonal matrices of dimension $m=6$.}
    \label{fig:sampledupperHessenberg}
\end{figure}
\subsubsection{Rayleigh Quotients}
Recall the Rayleigh Quotient:
\begin{equation}
    r = \frac{\mathbf{y}^T \ensuremath{\mat{A}} \mathbf{x}}{\mathbf{y}^T \mathbf{x}}\>.
\end{equation}
If $\mathbf{x}$ is an approximate eigenvector, and $\mathbf{y}^T$ an approximate left eigenvector, then this quotient is a least-squares approximation to an eigenvalue of $\ensuremath{\mat{A}}$.  If we replace $\ensuremath{\mat{A}}$ by $\ensuremath{\mat{A}}^{-1}$ above, then this is an approximation to an eigenvalue of $\ensuremath{\mat{A}}^{-1}$, and typically the largest one; this of course is the reciprocal of the smallest eigenvalue of $\ensuremath{\mat{A}}$.

We will consider this not as an eigenvalue approximation, but as a process in its own right, and plot the results of a single iteration of this on a Bohemian family, with both $\mathbf{y}$ and $\mathbf{x}$ taken to be the first elementary vectors. Thus the result is the top left corner of the inverse of our Bohemian matrix.  See Figure~\ref{fig:Rayleigh}.
\begin{figure}
    \centering
    \includegraphics[width=0.95\textwidth]{threecopper.png}
    \caption{Density plot of the upper left corner element of $\ensuremath{\mat{A}}^{-1}$ where $\ensuremath{\mat{A}}$ is sampled randomly from the $8$ by $8$  upper Hessenberg Bohemian (\textsl{not} unit or zero diagonal) family with population cube roots of unity.  There are $3^{43} > 3.2\cdot 10^{20}$ such matrices; we sampled only $2\cdot 10^7$ of these and gave a density plot on a $2048$ by $2048$ grid, enhanced by anti-aliased point rendering.}
    \label{fig:Rayleigh}
\end{figure}
This can also be computed by the recurrence relation~\eqref{eq:recur}, as the ratio of two determinants, from Cramer's rule:
\begin{equation}
    r = \frac{Q_{m}(0;t_1,t_2,\ldots,t_{m-1})}{Q_{m-1}(0;t_1,t_2,\ldots,t_{m-2})}
\end{equation}
Perhaps surprisingly to a numerical analyst, this offers an effective way to perform this computation when the population consists of small Gaussian integers, which can be represented as complex ``flints'' and are not subject to rounding error when ring arithmetic is carried out in floats. In this case the only division occurs at the end, and so rounding error is trivial.  Even with roots of unity, the rounding errors are generally not of serious consequence.

What we are computing here is representable in (if cube roots of unity are used) $\mathbb{Q}(\sqrt{-3})$, and moreover the rational numbers involved will not have overly large values.  This suggests that the appearance in Figure~\ref{fig:Rayleigh} can be explained as Schmidt arrangements, as done by Katherine Stange.  See her blog at~\url{https://math.katestange.net/}, but note in particular~\cite{Stange2017} and her papers previously cited.

\subsection{Unit upper Hessenberg zero diagonal matrices}
We will use the following Theorem repeatedly, to ensure that we see all the eigenvalues of the family in the window of the plot.

\begin{theorem}\label{thm:bound}
Suppose that every entry of a unit upper Hessenberg zero diagonal matrix $\mathbf{H}$ has magnitude at most $B$: that is, $|h_{i,j}| \le B$.  Then every eigenvalue $\lambda$ of $\mathbf{H}$ is bounded by
\begin{equation}
    |\lambda| \le 1 + 2\sqrt{B}\>.
\end{equation}
\end{theorem}
This bound is independent of the dimension.  The proof uses an idea already present in~\cite{Schmidt1960}, and doubtless in other places. Namely one chooses a diagonal matrix $\ensuremath{\mat{D}} = \diag(1, r, r^2, \ldots, r^{m-1})$ with a free parameter $r>1$ and considers the similar matrix $\ensuremath{\mat{D}}\H\ensuremath{\mat{D}}^{-1}$ which has the same eigenvalues as $\H$.  Suppose, without loss of generality, the subdiagonal entries of the zero diagonal unit upper Hesssenberg $\H$ are all $-1$.  Then
\begin{equation}
\ensuremath{\mat{D}}\H\ensuremath{\mat{D}}^{-1} =     \begin{bmatrix}
    0 & h_{1,2}/r & h_{1,3}/r^2 & \ldots & h_{1,m}/r^{m-1} \\
    -r & 0 &  h_{2,3}/r & & h_{2,m}/r^{m-2} \\
    0 & -r & 0 & h_{3,4}/r &  \vdots \\
    \vdots & & \ddots & \ddots & \vdots \\
    0 & \ldots & 0 & -r & 0
    \end{bmatrix}\>.
\end{equation}
The Gerschgorin disk for the first row has radius at most $B/(r-1)$ by comparison with a geometric series; the second and all subsequent rows have the bound $r + B/(r-1)$ for the radius which is larger because $r>1$.  To minimize this bound, we write it as $1 + r-1 + B/(r-1)$ and use the AGM inequality to say that this is minimized when $r-1 = B/(r-1)$ or $r = 1+\sqrt{B}$; this gives the value of the Gershgorin radius as $1+2\sqrt{B}$, as desired.

\begin{remark}
This is the only Gerschgorin-like theorem that we are aware of that gives a bound for eigenvalues which is independent of the dimension and depends on the \textsl{square root} of the bound for the entries in the matrix instead of the more usual linear power of the bound.  Of course, if one multiplies a matrix $\ensuremath{\mat{A}}$ by a constant factor, then the eigenvalues must also be multiplied by that factor; but we cannot perform such a multiplication here and remain in the class of \textsl{unit} upper Hessenberg matrices.
\end{remark}

\subsection{Unit upper Hessenberg zero diagonal Toeplitz Matrices}
A Toeplitz matrix $\ensuremath{\mat{T}}$ has constant elements on every diagonal, that is, $t_{i,j} = t_{0,j-i}$. The authors of~\cite{Chan2020} found that the  Toeplitz subset of unit upper Hessenberg matrices maximized the \textsl{characteristic height}, and so decided to study that subset directly; it contains only exponentially many elements ($\#P^{m-1}$ entries, rather than $\#P^{O(m^2)}$) and has several other interesting features.  For large dimension, the spectral theory connects to the well-known asymptotic spectral theory for Toeplitz matrices. Although the population does not decay, we can use the method of~\ref{thm:bound} to transform it to one for which we may compute the so-called ``symbol".
\begin{figure}
    \centering
    \includegraphics[width=0.95\textwidth]{Exhaustivepop_1_3_5_7_cividis_11N1048576.png}
    \caption{Density plot of  eigenvalues of all $1,048,576$ upper Hessenberg Toeplitz matrices of dimension $11$ with zero diagonal, $-1$ subdiagonal, and population $\pm 1$, $\pm i$ (fourth roots of unity) otherwise.  Brighter colours correspond to higher density.}
    \label{fig:fourthroots}
\end{figure}
\begin{figure}
    \centering
    \includegraphics[width=0.95\textwidth]{Exhaustivepop_2_4_6_8_viridis_10N262144.png}
    \caption{Density plot of  eigenvalues of all $262,144$ upper Hessenberg Toeplitz matrices of dimension $10$ with zero diagonal, $-1$ subdiagonal, and population $\pm 1 \pm i$ (four corners of a square) otherwise.  Brighter colours correspond to higher density.}
    \label{fig:scottishcross}
\end{figure}

\subsubsection{The Fractal Edges}
At the edges of Figures~\ref{fig:fourthroots} and~\ref{fig:scottishcross} we see clear indication of fractal gasket-like structures. When the population is third roots of unity, we see Sierpinski gaskets; when the population only has two elements, we see pairs, and pairs of pairs, recursively; with five-element populations we see recursive pentagonal structures.  The phenomenon seems universal for upper Hessenberg Toeplitz matrices. We now give an explanation for this behaviour in this section.

The keys to understanding this are the spectral theory of Toeplitz matrices, the improved Gerschgorin bound of Theorem~\ref{thm:bound}, and to consider the characteristic polynomials.  For this structure, there is a recurrence relation for the characteristic polynomial, say $Q_n(z)$, of a unit upper Hessenberg zero diagonal matrix, namely
\begin{align}
    Q_{n+1}(z; t_1, t_2, \ldots, t_{n})
    =& z Q_n(z; t_1, t_2, \ldots, t_{n-1}) \nonumber \\
    &{}- \sum_{k=1}^{n} (-1)^k t_k Q_{n-k}(z; t_1, t_2, \ldots, t_{n-k-1})\>.\label{eq:recur}
\end{align}
There is a somewhat more complicated recurrence relation for a general upper Hessenberg matrix; see~\cite{Chan2020}.
Proofs can be found in many places, for instance~\cite{Cahill2002}.
The final term is $\pm t_n Q_0(z)$ and $Q_0(z) = 1$.

Using Theorem~\ref{thm:bound} with $r=2$ (this is also used in~\cite{bogoya2022upper}) we find the Toeplitz symbol to be one of the (uncountably many)
\begin{equation}
    -\frac{2}{e^{i\theta}} + \sum_{k\ge 1} \frac{t_k}{2^k}e^{ik\theta}\>.
\end{equation}
All of these share the same bound, however; and the eigenvalues will lie in the union of the convex hulls of the zeros of these symbols.

More than that, though, the eigenvalues of any Toeplitz matrix with a finite symbol are known to converge, as the matrix dimension goes to infinity, to the union of several algebraic curves described by the Schmidt--Spitzer theorem~\cite[Ch.~22]{hogben2013handbook}. An improved algorithm for computing these curves is given in~\cite{Bottcher2021}, which we have implemented. For convenience, we state the Schmidt--Spitzer theorem here.

\begin{theorem}
Given the Laurent polynomial
\begin{equation}
    f(z) = \sum_{\nu=-q}^h a_{\nu} z^\nu
\end{equation}
where $q>0$, $h>0$ and $a_{-q}a_h \ne 0$, and given $\lambda \in \mathbb{C}$, define the polynomial
\begin{equation}
    Q(\lambda;z) = z^q(f(z) - \lambda)\>.
\end{equation}
Denote the moduli of its $q+h$ zeros counted according to multiplicity by $\alpha_j$ for $1 \le j \le q+h$.  Assume that they have been ordered so that $\alpha_1 \le \alpha_2 \le \cdots \le \alpha_{q+h}$.  Then $\lambda \in \Lambda$, that is the set of Schmidt--Spitzer points, if and only if the $q$th largest and $(q+1)$st largest roots have the same magnitude: $\alpha_q = \alpha_{q+1}$. Recall that $q$ is fixed by the Laurent polynomial.
\end{theorem}
For us, $q=1$; we will comment further on this below.

What we observed experimentally, as demonstrated in Figure~\ref{fig:SchmidtSpitzer}, is that the Schmidt--Spitzer curves themselves seem to converge rapidly---for upper Hessenberg Toeplitz matrices, which have very special Toeplitz symbols---as we add new sequence elements $t_k$.

This convergence is seen to be general by the following theorem.
\begin{theorem}
Suppose a fixed infinite sequence $t_k \in P$is given, where each $|t_k|\le B$.
The Schmidt--Spitzer curves for the truncated Toeplitz symbols $a_{m,r}(z) = -r/z + \sum_{k=1}^{m-1}t_k z^k/r^k$ converge in the Hau{\ss}dorff metric to the set $\Lambda$ of piecewise analytic arcs inside $|z|< 1+2\sqrt{B}$ in the limit as $m\to \infty$.
\end{theorem}
\begin{proof}
The curves are all contained in the disk $|z| \le 1 + 2\sqrt{B}$ by Theorem~\ref{thm:bound}, and in the union over $r>1$ of the images $a_r(e^{i\theta})$ of the unit circle. The Laurent polynomial symbols $a_{m,r}(z)$ obtained by truncation to degree $m-1$ converge uniformly to an analytic function $a_r(z)$ as $m\to \infty$ in $|z| < 1+2\sqrt{B}$, by Theorem 2.7a in~\cite[Vol I]{Henrici}.  By \href{https://en.wikipedia.org/wiki/Hurwitz's_theorem_(complex_analysis)}{Hurwitz' theorem}~\cite{titchmarsh1939theory} the zeros of the sequence $a_{m,r}(z)-\lambda$ also converge to a (possibly multiple) zero of $a_r(z)-\lambda$, for any fixed $\lambda$, and every zero of $a_r(z)-\lambda$ has the appropriate number of zeros of the sequence converge to it. If $\xi$ is a zero of $a_r(z)-\lambda$, then $\xi/r$ is a zero of $a_r(z)-\lambda$ with $r=1$; call this $a(z)-\lambda$. If the two smallest roots ($q=1$) of $a(z)-\lambda$  have equal magnitude, then $\lambda \in \Lambda$, the limiting set of eigenvalues of the Toeplitz matrices; moreover, the set $\Lambda$ is not empty because the case all $t_j=0$ for $j>h$ is included in the convergence above, and one may perturb from that using analyticity. Hurwitz' theorem then gives the desired result, when applied to any $\lambda \in \Lambda$.
\end{proof}

\begin{remark}
The Schmidt--Spitzer theorem entails that, for a Laurent polynomial with a pole of order $q$, it is the zeros of $q$th smallest magnitude that matter. For our application, $q=1$ because the matrix is not only Toeplitz but also unit upper Hessenberg with zero diagonal. So it is the \emph{smallest} magnitude zeros that matter, and these are the first ones to converge. Indeed it can happen that the largest roots ``converge" to a complicated object at the boundary, which is the image of the circle of radius $r$.  Consider the example where all $t_k = 1$. The symbol is then, when $r=1$,
\begin{equation}
    a(z) = -\frac{1}{z} + \sum_{k\ge 1} z^k
\end{equation}
or $-1/z + z/(1-z)$. Only the smallest roots of $a(z)-\lambda$ converge.  The compactness, and the scaling by $r>1$,
really matter.

Applying the improved algorithm of~\cite{Bottcher2021}, we solve $a(z) - a(e^{i\theta}z) = 0$ and find
\begin{equation}
    z = \frac{{\mathrm e}^{\mathrm{i} \theta}+1\pm\sqrt{\left({\mathrm e}^{\mathrm{i} \theta}\right)^{2}-6 \,{\mathrm e}^{\mathrm{i} \theta}+1}}{4 \,{\mathrm e}^{\mathrm{i} \theta}}
\end{equation}
Drawing $\lambda = a(z)$ in the complex plane for $-\pi \le \theta \le \pi$ gives the correct half-circle determining the curve $\Lambda$ describing the asymptotic location of the eigenvalues of the Toeplitz matrices with this symbol.
\end{remark}
\begin{remark}
We have not investigated the case $q>1$, that is, Toeplitz matrices with more subdiagonals.  We suspect that the above theorem will go through, \emph{mutatis mutandis}, perhaps with slower convergence the more nonzero subdiagonals the matrices have.
\end{remark}

\begin{figure}
  \centering

  \begin{subfigure}[t]{.32\linewidth}
    \centering\includegraphics[width=.925\linewidth]{curve2.png}
    \caption{$t_1 = 1$}
  \end{subfigure}
  \begin{subfigure}[t]{.32\linewidth}
    \centering\includegraphics[width=.925\linewidth]{curve3.png}
    \caption{$t_1=1$, $t_2=-1$}
  \end{subfigure}
  \begin{subfigure}[t]{.32\linewidth}
    \centering\includegraphics[width=.925\linewidth]{curve4.png}
    \caption{$t_3=1$}
  \end{subfigure}

  \begin{subfigure}[t]{.32\linewidth}
    \centering\includegraphics[width=.925\linewidth]{curve5.png}
    \caption{$t_4=-1$}
  \end{subfigure}
  \begin{subfigure}[t]{.32\linewidth}
    \centering\includegraphics[width=.925\linewidth]{curve6.png}
    \caption{$t_5=-1$}
  \end{subfigure}
  \begin{subfigure}[t]{.32\linewidth}
    \centering\includegraphics[width=.925\linewidth]{curve7.png}
    \caption{$t_6=-1$}
  \end{subfigure}

  \begin{subfigure}[t]{.32\linewidth}
    \centering\includegraphics[width=.925\linewidth]{curve8.png}
    \caption{$t_7=-1$}
  \end{subfigure}
  \begin{subfigure}[t]{.32\linewidth}
    \centering\includegraphics[width=.925\linewidth]{curve9.png}
    \caption{$t_8=1$}
  \end{subfigure}
  \begin{subfigure}[t]{.32\linewidth}
    \centering\includegraphics[width=.925\linewidth]{curve10.png}
    \caption{$t_9=1$}
  \end{subfigure}
 \caption{\label{fig:SchmidtSpitzer}The Schmidt--Spitzer curves for Toeplitz matrices with symbol $a(z) = -1/z + \sum_{k=1}^{m-1} t_k z^k$ for a fixed sequence of $t_k$ and various $m$. As we increase $m$, and thus see a new member of the sequence, the curves are seen to converge quite rapidly. After $m=10$ they are visually indistinguishable from the final case shown here. The red dots are the eigenvalues of the dimension $m$ Toeplitz matrix with those entries. In the limit as $m\to\infty$ these are guaranteed to converge to the Schmidt--Spitzer curves but we see that they are essentially there from the beginning.}
\end{figure}

We have
\begin{equation}
    Q_{n+1}(z) = F_n(z) + t_n
\end{equation}
where $F_n(z) = zQ_n(z) - \sum_{k=1}^{n-1} (-1)^k t_k Q_{n-k}$ is a fixed polynomial depending only on previous $t_k$.
This final term $t_n$ perturbs that fixed polynomial in one of (in this case) three ways.  Now use a homotopy argument, replacing $t_n$ by $st_n$ where $0 \le s \le 1$, we see the roots of $Q_{n+1}$ arising by paths emanating in three directions from the roots of $F(z)$.
That is, \textsl{for each root of $F(z)$, three nearby roots of different $Q_{n+1}(z)$ arise}.
The roots of $F(z)$ are also near the zeros of the symbol.  This explains the fractal structure.

This recursive construction is not a linear one: the structures resembling Sierpinski gaskets seen in the close-up in Figure~\ref{fig:Sierpinski} are clearly not rigid triangles, but rather have been distorted into curved shapes. Nonetheless we believe the above explanation is one way of understanding why this structure arises.
\begin{figure}
    \centering
    \includegraphics[width=0.95\textwidth]{ZoomWhiteExhaustivepop_CubeRootsOfUnity_Greys_13N531441.png}
    \caption{A close-up (window $-2.5 \le \Re(\lambda) \le -1.5$, $0 \le \Im(\lambda) \le 1$) of an $800$ by $800$ density plot of the eigenvalues of all $531,441$ upper Hessenberg zero diagonal matrices with population cube roots of unity.  The resemblance to a Sierpinski gasket is striking.}
    \label{fig:Sierpinski}
\end{figure}

\section{On Visualization\label{sec:visualization}}
Most of the figures in this present paper use only the simplest techniques of visualization: Figures~\ref{fig:uniform} and~\ref{fig:diamond} show \textsl{colourized} density plots of eigenvalues in the complex plane, about which more in a moment. Figure~\ref{fig:symmetric6} is a simple plot.  Figure~\ref{fig:Sierpinski} is a greyscale density plot on an $800$ by $800$ grid.  Figures~\ref{fig:fourthroots} and~\ref{fig:scottishcross} are colourized  density plots, where the colouring scheme was chosen by using a cumulative frequency count in order to attempt to equalize the \textsl{apparent density} of eigenvalues using colour; this verges on true computer imaging techniques but is actually very crude.  The technique has some value because it is relatively faithful to the underlying mathematics: brighter colours correspond to higher eigenvalue density, and when the cividis or viridis colour palette is used, the colours are relatively even perceptually.  The copper palette of Figure~\ref{fig:sampledupperHessenberg}
retains the correlation of brightness to density, but has a smaller colour range.

The appearance of Figure~\ref{fig:Rayleigh}, however, depends on some rather more professional techniques, as described in~\cite{Piponi2009}.  The basic idea is to estimate spatial derivative information (using TensorFlow Gradient) and use that to enhance the figure, making the density visible even with relatively sparse data (for this figure, only $500,000$ matrices were used, and the computational cost was substantially lower than for the other figures).  The technique is called ``\href{https://en.wikipedia.org/wiki/Spatial_anti-aliasing#Signal_processing_approach_to_anti-aliasing}{anti-aliased point rendering}.'' The picture remains faithful to the underlying mathematics, however.

Figure~\ref{fig:stable} also uses this enhancement, this time because without it some features of the eigenvalues (relative increase in density near the edge $\Re(\lambda)=0$, for instance) are not so easy to see.

\section{Concluding remarks\label{sec:conclusion}}
The notion of a \textsl{Bohemian matrix} seems to be a remarkably productive one, with substantial connections to very active areas of research, including visualizations in number theory, combinatorial design, random matrices in physics, numerical analysis, and computer algebra.

Many combinatorial questions about Bohemians, such as ``how many different characteristic polynomials are there'' for a given Bohemian family (say unit upper Hessenberg with population $(-1,0,1)$ for concreteness), can be addressed computationally, but floating-point error is an issue.  One is forced to look at polynomials (and thus computer algebra, however implemented) because of the \textsl{multiple-eigenvalue} problem: in those circumstances, numerical computation of eigenvalues is ill-conditioned and one cannot really count things by ``clustering'' nearby eigenvalues.  One is often tempted, when thinking of random matrices, to say that ``multiple eigenvalues never happen'' but of course this is not true.  Supplying constraints (either on the population or the matrix structure) significantly enhances the probability that multiplicity will be encountered.

One topic some of us have looked at briefly is that of \textsl{stable} matrices.  Which Bohemian matrices have all their eigenvalues strictly in the left half-plane?  For those matrices $\ensuremath{\mat{A}}$, and those matrices only, the solutions to the linear differential equation $\dot y = \ensuremath{\mat{A}} y$ will ultimately decay to zero.  If the dimensions are large, then one may have to consider pseudospectra (and thus matrix non-normality) as well.

It can be unsatisfactory to compute the eigenvalues of a matrix $\ensuremath{\mat{A}}$ and check to see if they are all in the left half plane; rounding errors may drift some of them into the right half plane.  Computation of the characteristic polynomial, and subsequent use of the Routh--Hurwitz criterion, seems in order.  One would like to take advantage of the compression seen for several families: rather than computing eigenvalues of several million matrices, instead compute the roots of the (equivalent) several thousand characteristic polynomials. Better yet, apply the Routh--Hurwitz criterion, which is a rational criterion, to make the decision in an arena uncontaminated by rounding errors.

As an example, consider the symmetric matrices with population $-1\pm i$ of dimension $m=6$. We already know from Theorem~\ref{thm:bent} that all eigenvalues lie in $\Re(\lambda) \le 0$. But are there any of the $4,970$ characteristic polynomials of these $2^{21}$ matrices which have \textsl{all} of their roots strictly in the left half plane? Yes.  By applying Maple's Hurwitz tool to the characteristic polynomials (which were actually computed using Python and exported in a JSON container to Maple) we identified 1328 of these polynomials, all of whose roots were strictly in $\Re( \lambda) < 0$.  Indeed, the maximum real part was approximately $-1.03\cdot 10^{-5}$.  Corresponding to these $1328$ polynomials were $966,240$ matrices, or about $46\%$ of the total.

For upper Hessenberg matrices with population $(-1,-1\pm i)$ and dimension $m=4$, out of $1,594,323$ matrices we find $365,307$ distinct characteristic polynomials.  Of these, only $14,604$ (associated with $66,782$ matrices, about $4.2\%$ of the total) have all their roots strictly in the left half plane.  The maximum real part is about $-7.1\cdot10^{-5}$.  See Figure~\ref{fig:stable}. We enhanced the figure to show more clearly the increase in density near $\Re(\lambda)=0$.  For comparison, we plot the eigenvalues of the \emph{whole} family in Figure~\ref{fig:unstableandstable}. One sees immediately that the majority of matrices in this collection have eigenvalues in the right half-plane.

\begin{figure}
    \centering
    \includegraphics[width=0.95\textwidth]{cividisstableenhanced1024.png}
    \caption{A $1024$ by $1024$ grid density plot of the roots of all $14,604$ stable characteristic polynomials, enhanced by anti-aliased point rendering. The Bohemian family is upper Hessenberg, population $-1-i$, $-1$, $-1+i$, and dimension $m=4$. The plot is on $-L-1 \le \Re(\lambda) < L-1$, $-L \le \Im (\lambda) \le L$, where $L = 1 + 2\cdot 2^{1/4}$. }
    \label{fig:stable}
\end{figure}

\begin{figure}
    \centering
    \includegraphics[width=0.95\textwidth]{Exhaustivepop_4_5_6_cividis_4N1594323.png}
    \caption{A $1200$ by $1200$ grid unenhanced density plot of the eigenvalues of the whole family, to compare with the plot of Figure~\ref{fig:stable}. The Bohemian family is upper Hessenberg, population $-1-i$, $-1$, $-1+i$, and dimension $m=4$. The plot is on $-L-1 \le \Re(\lambda) < L-1$, $-L \le \Im( \lambda) \le L$, where $L = 1 + 2\cdot 2^{1/4}$. The spirals are completely unexplained. }
    \label{fig:unstableandstable}
\end{figure}

\begin{acks}
The Python code we used for many of the experiments was written largely by Eunice Y.~S.~Chan (with some help by Rob Corless) for another project; we thank her for her work on that code.  We also thank her for many discussions on Bohemian matrices and colouring algorithms.

We thank Mark Giesbrecht for hours of discussion on this topic.

We thank Neil J.~Calkin for valuable discussions about finding good questions to direct research.
We thank Ilias Kotsireas for pointing out several references relevant to the Hadamard matrix literature, and for helpful discussions.  We thank Nick Higham for an independent proof of Theorem~\ref{thm:bent}, and for searching out the original references to Hirsch, Bromwich, and Bendixon.  We also thank Owen Maresh (@graveolens) for pointing out the connection to Kate Stange's work.

Partially supported by NSERC grant RGPIN-2020-06438, and
partially supported by the grant PID2020-113192GB-I00 (Mathematical Visualization: Foundations, Algorithms and Applications) from the Spanish MICINN.
\end{acks}
\bibliographystyle{plain}

Symbolic Computation (cs.SC); Combinatorics (math.CO)

Bohemian Matrix Geometry