Lower bounds for sumsets of multisets in Z_p^2

Abstract: The classical Cauchy-Davenport theorem implies the lower bound n+1 for the number of distinct subsums that can be formed from a sequence of n elements of the cyclic group Z_p (when p is prime and n<p). We generalize this theorem to a conjecture for the minimum number of distinct subsums that can be formed from elements of a multiset in (Z_p)^m; the conjecture is expected to be valid for multisets that are not "wasteful" by having too many elements in nontrivial subgroups. We prove this conjecture in (Z_p)^2 for multisets of size p+k, when k is not too large in terms of p.

\section{Introduction}

Determining the number of elements in a particular abelian group that can be written as sums of given sets of elements is a topic that goes back at least two centuries. The most famous result of this type, involving the cyclic group ${\mathbb Z}_p$ of prime order $p$, was established by Cauchy in 1813~\cite{Cauchy} and rediscovered by Davenport in 1935~\cite{Dav1,Dav2}:

\begin{lemma}[Cauchy--Davenport Theorem]
Let $A$ and $B$ be subsets of ${\mathbb Z}_p$, and define $A+B$ to be the set of all elements of the form $a+b$ with $a\in A$ and $b\in B$. Then $\#(A+B) \ge \min\{ p, \#A + \#B - 1\}$.
\end{lemma}

\noindent The lower bound is easily seen to be best possible by taking $A$ and $B$ to be intervals, for example.  It is also easy to see that the lower bound of $\#A + \#B - 1$ does not hold for general abelian groups ${\mathbf G}$ (take $A$ and $B$ to be the same nontrivial subgroup of ${\mathbf G}$). There is, however, a well-known generalization obtained by Kneser in 1953~\cite{Kne}, which we state in a slightly simplified form that will be quite useful for our purposes (see \cite[Theorem 4.1]{Nat} for an elementary proof):

\begin{lemma}[Kneser's Theorem]
Let $A$ and $B$ be subsets of a finite abelian group ${\mathbf G}$, and let $m$ be the largest cardinality of a proper subgroup of ${\mathbf G}$.  Then $\#(A+B) \ge \min\{ \#{\mathbf G}, \#A + \#B - m\}$.
\end{lemma}

Given a sequence $A = (a_1,\dots,a_k)$ of (not necessarily distinct) elements of an abelian group ${\mathbf G}$, a related result involves its {\em sumset} $\Sigma A$, which is the set of all sums of any number of elements chosen from $A$ (not to be confused with $A+A$, which it contains but usually properly):
\[
\Sigma A = \bigg\{ \sum_{j\in J} a_j \colon J\subseteq \{1,\dots,k\} \bigg\}.
\]
(Note that we allow $J$ to be empty, so that the group's identity element is always an element of $\Sigma A$.) When ${\mathbf G}={\mathbb Z}_p$, one can prove the following result by writing $\Sigma A = \{0, a_1\} + \cdots + \{ 0,a_k \}$ and applying the Cauchy--Davenport theorem inductively:

\begin{lemma}
\label{CD pre lemma}
Let $A=(a_1,\dots,a_k)$ be a sequence of nonzero elements of ${\mathbb Z}_p$. Then $\#\Sigma A \ge \min\{p,k + 1\}$.
\end{lemma}

\noindent This result can also be proved directly by induction on $k$, and in fact such a proof will discover why the order $p$ of the cyclic group must be prime (intuitively, the sequence $A$ could lie completely within a nontrivial subgroup). For a formal proof, see \cite[Lemma 2]{DEF}. Again the lower bound is easily seen to be best possible, by taking $a_1=\cdots=a_k$.

It is a bit misleading to phrase such results in terms of sequences, since the actual order of the elements in the sequence is irrelevant (given that we are considering only abelian groups). We prefer to use {\em multisets}, which are simply sets that are allowed to contain their elements with multiplicity. If we let $m_x$ denote the multiplicity with which the element $x$ occurs in the multiset $A$, then the definition of $\Sigma A$ can be written in the form
\[
\Sigma A = \bigg\{ \sum_{x\in{\mathbf G}} \delta_x x \colon 0\le \delta_x \le m_x \bigg\},
\]
where $\delta_x x$ denotes the group element $x+\cdots+x$ obtained by adding $\delta_x$ summands all equal to~$x$.

When using multisets, we should choose our notation with care: the hypotheses of such results tend to involve the total number of elements of the multiset $A$ counting multiplicity, while the conclusions involve the number of distinct elements of $\Sigma A$. Consequently, throughout this paper, we use the following notational conventions:
\begin{itemize}
 \item $|S|$ denotes the total number of elements of the multiset $S$, counted with multiplicity;
 \item $\#S$ denotes the number of distinct elements of the multiset $S$, or equivalently the number of elements of $S$ considered as a (mere) set.
\end{itemize}
In this notation, Lemma~\ref{CD pre lemma} can be restated as:

\begin{lemma}
\label{CD lemma}
Let $A$ be a multiset contained in ${\mathbb Z}_p$ such that $0\notin A$. Then $\#\Sigma A \ge \min\{p,|A| + 1\}$.
\end{lemma}

\noindent The purpose of this paper is to improve, as far as possible, this lower bound for multisets contained in the larger abelian group $\F_p^2$.  We cannot make any progress without some restriction upon our multisets: if a multiset is contained within a nontrivial subgroup of $\F_p^2$ (of cardinality $p$), then so is its sumset, in which case the lower bound $\min\{p,|A| + 1\}$ from Lemma~\ref {CD lemma} is the best we can do. Therefore we restrict to the following class of multisets. We use the symbol $\text{\bf 0}=(0,0)$ to denote the identity element of~$\F_p^2$.

\begin{definition}
\label{valid definition}
A multiset $A$ contained in $\F_p^2$ is called {\em valid} if:
\begin{itemize}
\item $\text{\bf 0}\notin A$; and
\item every nontrivial subgroup contains fewer than $p$ points of $A$, counting multiplicity.
\end{itemize}
\end{definition}

\noindent The exact number $p$ in the second condition has been carefully chosen: any nontrivial subgroup of $\F_p^2$ is isomorphic to ${\mathbb Z}_p$, and so Lemma~\ref{CD lemma} applies to these nontrivial subgroups. In particular, any multiset $A$ containing $p-1$ nonzero elements of a nontrivial subgroup will automatically have that entire subgroup contained in its sumset $\Sigma A$, so allowing $p$ nonzero elements in a nontrivial subgroup would always be ``wasteful''.

We believe that the following lower bound should hold for sumsets of valid multisets:

\begin{conjecture}
\label{2d conjecture}
Let $A$ be a valid multiset contained in $\F_p^2$ such that $p \le |A| \le 2p-3$. Then $\#\Sigma A \ge (|A|+2-p)p$. In other words, if $|A| = p+k$ with $0\le k\le p-3$, then $\#\Sigma A \ge (k+2)p$.
\end{conjecture}

It is easy to see that this conjectured lower bound would be best possible: if $A$ is the multiset that contains the point $(1,0)$ with multiplicity $p-1$ and the point $(0,1)$ with multiplicity $k+1$, then the set $\Sigma A$ is precisely $\big\{ (s,t)\colon s\in{\mathbb Z}_p,\, 0\le t\le k+1 \big\}$, which has $(k+2)p$ distinct elements. Conjecture~\ref {2d conjecture} is actually part of a larger assertion (see Conjecture~\ref{any d conjecture}) concerning lower bounds for sumsets in ${\mathbb Z}_p^m$.

One of our results completely resolves the first two cases of this conjecture:

\begin{theorem}
\label{conjecture true for k tiny}
Let $p$ be a prime.
\begin{enumerate}
\item If $A$ is any valid multiset contained in $\F_p^2$ with $|A| = p$, then $\#\Sigma A \ge 2p$.
\item Suppose that $p\ge5$. If $A$ is any valid multiset contained in $\F_p^2$ with $|A| = p+1$, then $\#\Sigma A \ge 3p$.
\end{enumerate}
\end{theorem}

It turns out that proving part (b) of the theorem requires a certain amount of computation for a finite number of primes (see the remarks following the proof of the theorem in Section~\ref{thm proofs section}). Extending the conjecture to larger values of $k$ would require, by our methods, more and more computation to take care of small primes $p$ as $k$ grows. However, we are able to establish the conjecture when $p$ is large enough with respect to $k$, or equivalently when $k$ is small enough with respect to $p$:

\begin{theorem}
\label{conjecture true for k small in terms of p}
Let $p$ be a prime, and let $2\le k\le \sqrt{p/(2\log p+1)}-1$ be an integer. If $A$ is any valid multiset contained in $\F_p^2$ with $|A| = p+k$, then $\#\Sigma A \ge (k+2)p$.
\end{theorem}

A contrapositive version of Theorem~\ref{conjecture true for k small in terms of p} is also enlightening:

\begin{corollary}
\label{main corollary}
Let $p$ be a prime, and let $2\le k\le \sqrt{p/(2\log p+1)}-1$ be an integer. Let $A$ be a multiset contained in $\F_p^2 \setminus \{\text{\bf 0}\}$ with $|A| = p+k$. If $\#\Sigma A < (k+2)p$, then there exists a nontrivial subgroup of $\F_p^2$ that contains at least $p$ points of $A$, counting multiplicity.
\end{corollary}

Our methods of proof stem from two main ideas. First, we will obviously exploit the structure of $\F_p^2$ as a direct sum of cyclic groups of prime order, within which we can apply the known Lemma~\ref{CD lemma} after using projections. Section~\ref{direct projects section} contains several elementary lemmas in this vein (see in particular Lemma~\ref{sweep to the left lemma}). It is important for us to utilize the flexibility coming from the fact that $\F_p^2$ can be decomposed as the direct sum of two subgroups in many different ways. Second, our methods work best when there exists a single subgroup that contains many elements of the given multiset; however, by selectively replacing pairs of elements with their sums, we can increase the number of elements in a subgroup in a way that improves our lower bounds upon the sumset (see Lemma~\ref {any j lemma}). These methods, which appear in Section~\ref {thm proofs section}, combine to provide the proofs of Theorems \ref {conjecture true for k tiny} and~\ref{conjecture true for k small in terms of p}. Finally, Section~\ref{conjecture section} contains a generalization of Conjecture~\ref{2d conjecture} to higher-dimensional direct sums of ${\mathbb Z}_p$, together with examples demonstrating that the conjecture would be best possible.

\section{Sumsets in abelian groups and direct products}
\label{direct projects section}

All of the results in this section are valid for general finite abelian groups and have correspondingly elementary proofs, although the last two lemmas seem rather less standard than the first few. In this section, ${\mathbf G}$, ${\mathbf H}$, and ${\mathbf K}$ denote finite abelian groups, and $e$ denotes a group's identity element.

\begin{lemma}
\label{a la carte lemma}
Let $B_0,B_1,B_2,\dots,B_j$ be multisets in ${\mathbf G}$, and set $A = B_0 \cup B_1 \cup \dots \cup B_j$. For each $1\le i\le j$, specify an element $x_i \in \Sigma B_i$, and set $C = B_0 \cup \{ x_1, \dots ,x_j\}$. Then $\Sigma C \subseteq \Sigma A$.
\end{lemma}

\begin{proof}
For each $1\le i\le j$, choose a submultiset $D_i \subseteq B_i$ such that the sum of the elements of $D_i$ equals $x_i$. By definition, every element $y$ of $\Sigma C$ equals the sum of the elements of some subset $E$ of $B_0$, plus $\sum_{i\in I} x_i$ for some $I\subseteq \{1,\dots,j\}$. But then $y$ equals the sum of the elements of $E \cup \bigcup_{i\in I} D_i$, which is an element of $\Sigma A$ since $E \cup \bigcup_{i\in I} D_i \subseteq B_0 \cup \bigcup_{1\le i\le j} B_i = A$.
\end{proof}

\begin{lemma}
\label{kneser bound}
Let $A_1,A_2,\dots,A_j$ be multisets in ${\mathbf G}$, and set $A = A_1 \cup \dots \cup A_j$.  If $m$ is the largest cardinality of a proper subgroup of ${\mathbf G}$, then either $\Sigma A = {\mathbf G}$ or $\#\Sigma A \ge (\sum_{i=1}^j \# \Sigma A_i) - (j-1)m$.
\end{lemma}

\begin{proof}
Since $\Sigma A = \Sigma A_1 + \Sigma A_2 + \cdots + \Sigma A_j$ (viewed as ordinary sets), this follows immediately by inductive application of Kneser's theorem.
\end{proof}

For the remainder of this section, we will be dealing with groups that can be decomposed into a direct sum.

\begin{definition}
A subgroup ${\mathbf H}$ of ${\mathbf G}$ is called an {\em internal direct summand} if there exists a subgroup ${\mathbf K}$ of ${\mathbf G}$ such that ${\mathbf G}$ is the internal direct sum of ${\mathbf H}$ and ${\mathbf K}$, or in other words, such that ${\mathbf H} \cap {\mathbf K} = \{e\}$ and ${\mathbf H} + {\mathbf K} = {\mathbf G}$. Equivalently, ${\mathbf H}$ is an internal direct summand of ${\mathbf G}$ if there exists a {\em projection homomorphism} $\pi_{\mathbf H}\colon {\mathbf G} \to {\mathbf H}$ that is the identity on ${\mathbf H}$. Note that this projection homorphism does depend on the choice of ${\mathbf K}$ but is uniquely determined by $\pi_{\mathbf H}^{-1}(e) = {\mathbf K}$.
\end{definition}

\begin{lemma}
\label{pi commutes with Sigma lemma}
For any homomorphism $f\colon {\mathbf G}\to {\mathbf H}$, and any subset $X$ of ${\mathbf G}$, we have $f(\Sigma X) = \Sigma (f(X))$. In particular, if ${\mathbf H}$ is an internal direct summand of ${\mathbf G}$, then $\pi_{\mathbf H}(\Sigma X) = \Sigma(\pi_{\mathbf H}(X))$ for any subset $X$ of ${\mathbf G}$.
\end{lemma}

\begin{proof}
Given $y\in f(\Sigma X)$, there exists $x\in \Sigma X$ such that $f(x)=y$. Hence we can find $x_1,\dots,x_j\in X$ such that $x_1+\cdots+x_j = x$, and so $f(x_1+\cdots+x_j) = y$. But $f$ is a homomorphism, and so $f(x_1)+\cdots+f(x_j) = y$, so that $y \in \Sigma(f(X))$. This shows that $f(\Sigma X) \subseteq \Sigma(f(X))$; the proof of the reverse inclusion is similar.
\end{proof}

\begin{lemma}
\label{pi split lemma}
Let ${\mathbf G} = {\mathbf H} \oplus {\mathbf K}$, and let $D$ and $E$ be multisets contained in ${\mathbf H}$ and ${\mathbf K}$, respectively. For any $z\in {\mathbf G}$,
\[
z \in \Sigma(D\cup E) \quad\text{if and only if}\quad \pi_{\mathbf H}(z) \in\Sigma D \text{ and } \pi_{\mathbf K}(z) \in\Sigma E.
\]
\end{lemma}

\begin{proof}
Since $z = \pi_{\mathbf H}(z) + \pi_{\mathbf K}(z)$, the ``if'' direction is obvious. For the converse, note that
\[
\pi_{\mathbf H}(z) \in \pi_{\mathbf H}\big( \Sigma (D\cup E) \big)  = \Sigma\big( \pi_{\mathbf H}(D \cup E) \big)
\]
by Lemma~\ref {pi commutes with Sigma lemma}. On the other hand, $\pi_{\mathbf H}(D) = D$ and $\pi_{\mathbf H}(E) = \{e\}$, and so
\[
\pi_{\mathbf H}(z) \in \Sigma\big( \pi_{\mathbf H}(D) \cup \pi_{\mathbf H}(E) \big) = \Sigma \big( D \cup \{e\} \big) = \Sigma D
\]
(since the sumset is not affected by whether $e$ is an allowed summand). A similar argument shows that $\pi_{\mathbf K}(z) \in \Sigma E$, which completes the proof of the lemma.
\end{proof}

\begin{lemma}
\label{direct product lemma}
Let ${\mathbf H}$ and ${\mathbf K}$ be subgroups of ${\mathbf G}$ satisfying ${\mathbf H} \cap {\mathbf K} = \{e\}$. Let $D$ and $E$ be multisets contained in ${\mathbf H}$ and ${\mathbf K}$, respectively. Then $\#\Sigma(D\cup E) = \#\Sigma D \cdot \#\Sigma E$.
\end{lemma}

\begin{proof}
Notice that every element of $\Sigma(D\cup E)$ is contained in ${\mathbf H}+{\mathbf K}$; therefore we may assume without loss of generality that ${\mathbf G} = {\mathbf H} \oplus {\mathbf K}$. In particular, we may assume that ${\mathbf H}$ and ${\mathbf K}$ are internal direct summands of ${\mathbf G}$, so that the projection maps $\pi_{\mathbf H}$ and $\pi_{\mathbf K}$ exist and every element $z\in {\mathbf G}$ has a unique representation $z=x+y$ where $x\in {\mathbf H}$ and $y\in {\mathbf K}$; note that $x=\pi_{\mathbf H}(z)$ and $y=\pi_{\mathbf K}(z)$ in this representation.

To establish the lemma, it therefore suffices to show that $z = \pi_{\mathbf H}(z) + \pi_{\mathbf K}(z) \in \Sigma(D\cup E)$ if and only if $\pi_{\mathbf H}(z) \in\Sigma D \text{ and } \pi_{\mathbf K}(z) \in\Sigma E$; but this is exactly the statement of Lemma~\ref{pi split lemma}.
\end{proof}

The next lemma is a bit less standard yet still straightforward: in a direct product of two abelian groups, it characterizes the elements of a sumset that lie in a given coset of one of the direct summands.

\begin{lemma}
\label{orthogonal structure lemma}
Let ${\mathbf H}$ and ${\mathbf K}$ be subgroups of ${\mathbf G}$ satisfying ${\mathbf H} \cap {\mathbf K} = \{e\}$. Let $D$ and $E$ be multisets contained in ${\mathbf H}$ and ${\mathbf K}$, respectively. For any $y\in {\mathbf K}$:
\begin{enumerate}
 \item if $y\in \Sigma E$, then $({\mathbf H}+\{y\}) \cap \Sigma(D\cup E) = \Sigma D + \{y\}$;
 \item if $y\notin \Sigma E$, then $({\mathbf H}+\{y\}) \cap \Sigma(D\cup E) = \emptyset$.
\end{enumerate}
\end{lemma}

\begin{proof}
As in the proof of Lemma~\ref {direct product lemma}, we may assume without loss of generality that ${\mathbf G} = {\mathbf H} \oplus {\mathbf K}$. Suppose that $z$ is an element of $({\mathbf H}+\{y\}) \cap \Sigma(D\cup E)$. Since $z\in {\mathbf H}+\{y\}$, we may write $z=x+y$ for some $x\in{\mathbf H}$, whence $\pi_{\mathbf K}(z) = \pi_{\mathbf K}(x) + \pi_{\mathbf K}(y) = e+y = y$. On the other hand, since $z\in \Sigma(D\cup E)$, we see that $y \in \Sigma E$ by Lemma~\ref{pi split lemma}. In other words, the presence of any element $z\in ({\mathbf H}+\{y\}) \cap \Sigma(D\cup E)$ forces $y\in \Sigma E$, which establishes part (b) of the lemma.

We continue under the assumption $y\in \Sigma E$ to prove part (a). The inclusions $\Sigma D + \{y\} \subseteq {\mathbf H}+\{y\}$ and $\Sigma D + \{y\} \subseteq \Sigma(D\cup E)$ are both obvious, and so $\Sigma D + \{y\} \subseteq ({\mathbf H}+\{y\}) \cap \Sigma(D\cup E)$. As~for the reverse inclusion, let $z \in ({\mathbf H}+\{y\}) \cap \Sigma(D\cup E)$ as above; then $\pi_{\mathbf H}(z) \in \Sigma D$ by Lemma~\ref{pi split lemma}, whence $z = \pi_{\mathbf H}(z) + \pi_{\mathbf K}(z) = \pi_{\mathbf H}(z) + y \in \Sigma D + \{y\}$ as required.
\end{proof}

Finally we can establish the lemma that we will make the most use of when we return to the setting ${\mathbf G}=\F_p^2$ in the next section.

\begin{lemma}
\label{sweep to the left lemma}
Let ${\mathbf G} = {\mathbf H} \oplus {\mathbf K}$, and let $C$ be a multiset contained in ${\mathbf G}$. Let $D=C\cap {\mathbf H}$, let $F = C \setminus D$, and let $E = \pi_{\mathbf K}(F)$. Then $\#\Sigma C \ge \#\Sigma D \cdot \#\Sigma E$.
\end{lemma}

\begin{proof}
Lemma~\ref {direct product lemma} tells us that $\#\Sigma (D\cup E) = \#\Sigma D \cdot \#\Sigma E$, and so it suffices to show that $\#\Sigma C \ge \#\Sigma (D\cup E)$. We accomplish this by showing that
\begin{equation}
\# \big( ({\mathbf H} + \{y\}) \cap \Sigma C \big) \ge \# \big( ({\mathbf H} + \{y\}) \cap \Sigma (D\cup E) \big)
\label{one line at a time}
\end{equation}
for all $y\in{\mathbf K}$.

For any $y\in{\mathbf K} \setminus \Sigma E$, Lemma~\ref{orthogonal structure lemma} tells us that $({\mathbf H} + \{y\}) \cap \Sigma (D\cup E) = \emptyset$, in which case the inequality~\eqref{one line at a time} holds trivially. For any $y \in \Sigma E$, Lemma~\ref{orthogonal structure lemma} tells us that $({\mathbf H} + \{y\}) \cap \Sigma (D\cup E) = \Sigma D + \{y\}$, and so the right-hand side of the inequality~\eqref{one line at a time} equals $\#\Sigma D$.

On the other hand, since $\Sigma E = \Sigma (\pi_{\mathbf K}(F)) = \pi_{\mathbf K}(\Sigma F)$ by Lemma~\ref{pi commutes with Sigma lemma}, there exists at least one element $z\in \Sigma F$ satisfying $\pi_{\mathbf K}(z)=y$; as ${\mathbf G} = {\mathbf H} \oplus {\mathbf K}$, this is equivalent to saying that $z \in {\mathbf H} + \{y\}$. Since $\Sigma D \subseteq {\mathbf H}$, we have $\Sigma D + \{z\} \subseteq {\mathbf H} + \{y\}$ as well. But the inclusion $\Sigma D + \{z\} \subseteq \Sigma D + \Sigma F = \Sigma C$ is trivial, and therefore $\Sigma D + \{z\} \subseteq ({\mathbf H} + \{y\}) \cap \Sigma C$; in particular, the left-hand side of the inequality~\eqref{one line at a time} is at least $\#\Sigma D$. Combined with the observation that the right-hand side equals $\#\Sigma D$, this lower bound establishes the inequality~\eqref{one line at a time} and hence the lemma.
\end{proof}

These lemmas might be valuable for studying sumsets in more general abelian groups. They will prove to be particularly useful for studying sumsets in $\F_p^2$, however, essentially because there are many ways of writing $\F_p^2$ as an internal direct sum of two subgroups (which are simply lines through $\text{\bf 0}$).

\section{Lower bounds for sumsets}
\label{thm proofs section}

In this section we establish Theorems~\ref {conjecture true for k tiny} and~\ref {conjecture true for k small in terms of p}; the proofs employ two combinatorial propositions which we defer to the next section. It would be possible to prove these two theorems at the same time, at the expense of a bit of clarity; however, we find it illuminating to give complete proofs of Theorem~\ref {conjecture true for k tiny} (the cases $|A|=p$ and $|A|=p+1$) first, as the proofs will illustrate the methods used to prove the more general Theorem~\ref {conjecture true for k small in terms of p}. Seeing the limitations of the proof of Theorem~\ref {conjecture true for k tiny} will also motivate the formulation of our main technical tool, Lemma~\ref {any j lemma}.

Throughout this section, $A$ will denote a valid multiset contained in $\F_p^2$. For any $x\in\F_p^2$, we let $\lin x$ denotes the subgroup of $\F_p^2$ generated by $x$ (that is, the line passing through both the origin $\text{\bf 0}$ and $x$), and we let $m_x$ denote the multiplicity with which $x$ appears in $A$, so that $|A| = \sum_{x\in\F_p^2} m_x$. The fact that $A$ is valid means that $m_\text{\bf 0}=0$ and $\sum_{t\in\lin x} m_t < p$ for every $x\in\F_p^2\setminus\{\orig\}$.

Our first lemma quantifies the notion that we can establish sufficiently good lower bounds for the cardinality of $\Sigma A$ if we know that there are enough elements of $A$ lying in one subgroup of~$\F_p^2$. Naturally, the method of proof is to partition $A$ into the elements lying in that subgroup and all remaining elements, project the remaining elements onto a complementary subgroup, and then use Lemma~\ref{CD lemma} in each subgroup separately.

\begin{lemma}
\label{conjecture true if enough on line lemma}
Let $A$ be any valid multiset contained in $\F_p^2$.
Suppose that for some $x\in\F_p^2\setminus\{\orig\}$,
\begin{equation}
\label{symmetric bound}
\sum_{y\in\lin x} m_y \ge |A| - (p-1).
\end{equation}
Then $\#\Sigma A \ge (|A|+2-p)p$.
\end{lemma}

\begin{remark}
The conclusion is worse than trivial if $|A| < p-1$; also, the fact that $A$ is valid means that the left-hand side of equation~\eqref{symmetric bound} is at most $p-1$, and so the lemma is vacuous if $|A| > 2p-2$. Therefore in practice the lemma will be applied only to multisets $A$ satisfying $p-1 \le |A| \le 2p-2$.
\end{remark}

\begin{proof}
Let $D = A \cap \lin x$; note that $|D| \le p-1$ since $A$ is a valid multiset, and note also that $|D| = \sum_{y\in\lin x} m_y \ge |A| - (p-1)$ by assumption. Set $F = A \setminus D$. Choose any nontrivial subgroup ${\mathbf K}$ of $\F_p^2$ other than $\lin x$, and set $E = \pi_{\mathbf K}(F)$. Then by Lemma~\ref{sweep to the left lemma}, we know that $\#\Sigma A \ge \#\Sigma D \cdot \#\Sigma E$. By Lemma~\ref {CD lemma} and the fact that $\text{\bf 0}\notin D\cup E$, we obtain
\begin{align}
\#\Sigma A &\ge \min \big\{ p, 1 + |D| \big\} \cdot \min \big\{ p, 1 + |E| \big\} \notag \\
&= \min \big\{ p, 1 + |D| \big\} \cdot \min \big\{ p, 1 + |A| - |D| \big\},
\label{actually special case}
\end{align}
since $|E| = |F| = |A|-|D|$. The inequalities $|D| \le p-1$ and $|A| - |D| \le p-1$ ensure that $p$ is the larger element in both minima, and so we have simply
\[
\#\Sigma A \ge (1+|D|)(1+|A|-|D|) = \tfrac14|A|^2 + |A| + 1 - \big( |D| - \tfrac12|A| \big)^2.
\]
The pair of inequalities $|D| \le p-1$ and $|A| - |D| \le p-1$ is equivalent to the inequality $\big| |D| - \tfrac12|A| \big| \le p-1- \tfrac12|A|$; therefore
\[
|\Sigma A| \ge \tfrac14|A|^2 + |A| + 1 - \big( p-1- \tfrac12|A| \big)^2 = (|A|+2-p)p,
\]
as claimed.
\end{proof}

This lemma alone is sufficient to establish Theorem~\ref{conjecture true for k tiny}.

\begin{proof}[Proof of Theorem~\ref{conjecture true for k tiny}(a)]
When $|A|=p$, the right-hand side of the inequality~\eqref {symmetric bound} equals 1, and so the inequality holds for any $x\in A$. Therefore Lemma~\ref {conjecture true if enough on line lemma} automatically applies, yielding $\#\Sigma A \ge (|A|+2-p)p = 2p$ as desired. (In fact essentially the same proof gives the more general statement: if $A$ is a multiset contained in $\F_p^2\setminus\{\text{\bf 0}\}$ but not contained in any proper subgroup, and $|A|\ge p$, then $\#\Sigma A \ge 2|A|$.)
\end{proof}

\begin{proof}[Proof of Theorem~\ref{conjecture true for k tiny}(b)]
We are assuming that $|A| = p+1$. Suppose first that there exists a nontrivial subgroup of $\F_p^2$ that contains at least two points of $A$ (including possibly two copies of the same point). Choosing any nonzero element $x$ in that subgroup, we see that the inequality~\eqref {symmetric bound} is satisfied, and so Lemma~\ref {conjecture true if enough on line lemma} yields $\#\Sigma A \ge (|A|+2-p)p = 3p$ as desired.

From now on we may assume that there does not exist a nontrivial subgroup of $\F_p^2$ that contains at least two points of $A$. Since there are only $p+1$ nontrivial subgroups of $\F_p^2$, it must be the case that $A$ consists of exactly one point from each of these $p+1$ subgroups; in particular, the elements of $A$ are distinct. We can verify the assertion for $p\le11$ by exhaustive computation (see the remarks after the end of this proof), so from now on we may assume that $p\ge13$.

Suppose first that all sums of pairs of distinct elements from $A$ are distinct. All these sums are elements of $\Sigma A$, and thus $\#\Sigma A \ge \binom{p+1}2 >3p$ since $p\ge13$.

The only remaining case is when two pairs of distinct elements from $A$ sum to the same point of $\F_p^2$. Specifically, suppose that there exist $x_1,y_1,x_2,y_2\in A$ such that $x_1+y_1=x_2+y_2$. Partition $A = B_0 \cup B_1 \cup B_2$ where $B_1=\{x_1,y_1\}$ and $B_2=\{x_2,y_2\}$ and hence $B_0 = A \setminus \{x_1,y_1,x_2,y_2\}$; note that this really is a partition of $A$, as the fact that $x_1+y_1=x_2+y_2$ forces all four elements to be distinct. Moreover, if we define $z=x_1+y_1=x_2+y_2$, then we know that $z\ne\text{\bf 0}$ since $x_1$ and $y_1$ are in different subgroups.

Define $C$ to be the multiset $B_0 \cup \{ z, z \}$; by Lemma~\ref {a la carte lemma}, we know that $\#\Sigma A \ge \#\Sigma C$. Define $D = C \cap \lin z$; we claim that $|D| = 3$. To see this, note that $A$ has exactly one point in every nontrivial subgroup, and in particular $A$ has exactly one point in $\lin z$. Furthermore, that point cannot be $x_1$ for example, since then $y_1 = z-x_1$ would also be in that subgroup; similarly that point cannot be $x_2$, $y_1$, or $y_2$. We conclude that $B_0$ has exactly one point in $\lin z$, whence $C$ has exactly three points in $\lin z$.

Now define $F = C \setminus D$, so that $|F| = |C| - |D| = (|B_0|+2)-3 = (|A|-4+2)-3 = p-4$. Let ${\mathbf K}$ be any nontrivial subgroup other than $\lin z$, and set $E = \pi_{\mathbf K}(F)$. The lower bounds $\#\Sigma D \ge 4$ and $\#\Sigma E \ge p-3$ then follow from Lemma~\ref {CD lemma}. By Lemma~\ref{sweep to the left lemma}, we conclude that $\#\Sigma C \ge \#\Sigma D \cdot \#\Sigma E = 4(p-3) > 3p$ since $p\ge13$.
\end{proof}

\begin{remark}
The computation that verifies Theorem~\ref{conjecture true for k tiny}(b) for $p\le11$ should be done a little bit intelligently, since there are $10^{12}$ subsets $A$ of ${\mathbb Z}_{11}^2$ (for example) consisting of exactly one nonzero element from each nontrivial subgroup. We describe the computation in the hardest case $p=11$. Let us write the elements of ${\mathbb Z}_{11}^2$ as ordered pairs $(s,t)$ with $s$ and $t$ considered modulo~$11$. By separately dilating the two coordinates of ${\mathbb Z}_{11}^2$ (which does not alter the cardinality of $\Sigma A$), we may assume without loss of generality that $A$ contains both $(1,0)$ and $(0,1)$. We also know every such $A$ contains a subset of the form $\{ (i,i), (j,2j), (k,3k), (\ell,4\ell) \}$ for some integers $1\le i,j,k,\ell \le 10$. Therefore the cardinality of every such $\Sigma A$ is at least as large as the cardinality of one of the subsumsets $\Sigma \big( \{ (1,0), (0,1), (i,i), (j,2j), (k,3k), (\ell,4\ell) \} \big)$.

There are $10^4$ such subsumsets, and direct computation shows that all of them have more than $33$ distinct elements except for the sixteen cases $\Sigma \big( \{ (1,0), (0,1), \pm(1,1), \pm(1,2), \pm(1,3), \pm(1,4) \} \big)$, which each contain $32$ distinct elements. It is then easily checked that any subsumset of the form $\Sigma \big( \{ (1,0), (0,1), \pm(1,1), \pm(1,2), \pm(1,3), \pm(1,4), (m,5m) \} \big)$ with $1\le m\le10$ contains more than 33 distinct elements. This concludes the verification of Theorem~\ref{conjecture true for k tiny}(b) for $p=11$, and the cases $p\le7$ are verified even more quickly.
\end{remark}

We now foreshadow the proof of Theorem~\ref{conjecture true for k small in terms of p} by reviewing the structure of the proof of Theorem~\ref{conjecture true for k tiny}(b). In that proof, we quickly showed that the desired lower bound held if there were enough elements of $A$ in the same subgroup. Also, the desired lower bound certainly held if there were enough distinct sums of pairs of elements of~$A$. If however no subgroup contained enough elements of $A$ and there were only a few distinct sums of pairs of elements of $A$, then we showed that we could find multiple pairs of elements summing to the same point in $\F_p^2$. Replacing those elements in $A$ with multiple copies of their joint sum, we found that the corresponding subgroup now contained enough elements to carry the argument through.

The following lemma quantifies the final part of this strategy, where we replace $j$ pairs of elements of $A$ with their joint sum and then use our earlier ideas to bound the cardinality of the sumset from below.

\begin{lemma}
\label{any j lemma}
Let $A$ be any valid multiset contained in $\F_p^2$, and let $z\in\F_p^2\setminus\{\orig\}$. For any integer $j$ satisfying
\begin{equation}
0\le j \le \tfrac12 \sum_{t\in\F_p^2\setminus\lin z} \min\{m_t,m_{z-t}\},
\label{allows choosing pairs}
\end{equation}
we have
\[
\#\Sigma A \ge \min\bigg\{ p, 1 + j + \sum_{y\in\lin z} m_y \bigg\} \min\bigg\{ p, 1 + |A| - 2j - \sum_{y\in\lin z} m_y \bigg\}.
\]
\end{lemma}

\begin{remark}
This can be seen as a generalization of Lemma~\ref {conjecture true if enough on line lemma}, as equation~\eqref {actually special case} is the special case $j=0$ of this lemma.
\end{remark}

\begin{proof}
Partition $A = B_0 \cup B_1 \cup \cdots \cup B_j$, where for each $1\le i\le j$, the multiset $B_i$ has exactly two elements, neither contained in $\lin z$, that sum to $z$ (the complimentary submultiset $B_0$ is unrestricted). The upper bound~\eqref{allows choosing pairs} for $j$ is exactly what is required for such a partition to be possible; the factor of $\frac12$ arises because the sum on the right-hand side of~\eqref{allows choosing pairs} double-counts the pairs $(t,z-t)$ and $(z-t,t)$. Then set $C$ equal to $B_0$ with $j$ additional copies of $z$ inserted. By Lemma~\ref{a la carte lemma}, we know that $\#\Sigma A \ge \#\Sigma C$.

Now let $D$ be the intersection of $C$ with the subgroup $\lin z$, and let $F = C \setminus D$. Let ${\mathbf K}$ be any nontrivial subgroup other than $\lin z$, and set $E = \pi_{\mathbf K}(F)$. By Lemma~\ref{sweep to the left lemma}, we know that $\#\Sigma C \ge \#\Sigma D \cdot \#\Sigma E$. However, the number of elements of $D$ (counting multiplicity) is $j$ more than the number of elements of $B_0 \cap \lin z$; this is the same as $j$ more than the number of elements of $A \cap \lin z$ (since no elements of $B_1,\dots,B_j$ lie on $\lin z$), or in other words $j + \sum_{y\in\lin z} m_y$. Similarly, the number of elements of $E$ (equivalently, of $F$) is equal to the number of elements of $B_0 \setminus \lin z$; this is the same as $2j$ less than the number of elements of $A \setminus \lin z$, or in other words $|A| - 2j - \sum_{y\in\lin z} m_y$. The lower bounds $\#\Sigma D \ge \min\big\{ p, 1 + j + \sum_{y\in\lin z} m_y \big\}$ and $\#\Sigma E \ge \min\big\{ p, 1 + |A| - 2j - \sum_{y\in\lin z} m_y \big\}$ then follow from Lemma~\ref {CD lemma}; the chain of inequalities $\#\Sigma A \ge \#\Sigma C \ge \#\Sigma D \cdot \#\Sigma E$ establishes the lemma.
\end{proof}

We are now ready to use Lemma~\ref{any j lemma} to establish Conjecture~\ref{2d conjecture} when $|A|=p+k$, for all but finitely many primes $p$ depending on~$k$. Let $H_k = 1 + \tfrac12 + \cdots + \tfrac1k$ denote the $k$th harmonic number.

\begin{theorem}
\label{conjecture true for p large in terms of k}
Let $k\ge2$ be any integer, and let $A$ be any valid multiset contained in $\F_p^2$ such that $|A| = p+k$. If $p\ge 4(k+1)^2 H_k - 2k$, then $\#\Sigma A \ge (k+2)p$.
\end{theorem}

\begin{remark}

Using the elementary bound $H_k \le \gamma + \log(k+1)$, where $\gamma$ denotes the Euler--Mascheroni constant, we see that Theorem~\ref{conjecture true for p large in terms of k} holds as long as $p \ge 4(k+1)^2 (\gamma + \log(k+1))$. Theorem~\ref{conjecture true for k small in terms of p} can thus be readily deduced from Theorem~\ref {conjecture true for p large in terms of k} as follows: If $k+1 \le \sqrt{p/(2\log p+1)}$ then $p \ge 4(k+1)^2 (\tfrac14 + \tfrac12 \log p)$.  In this case we certainly have $p \ge (1 + 2\log 2) (k+1)^2$, whence $\log p \ge \frac45 + 2 \log(k+1)$ and $\tfrac14 + \tfrac12 \log p \ge \gamma + \log(k+1)$.

\end{remark}

\begin{proof}
If there are $k+1$ elements of $A$ in some nontrivial subgroup, then we are done by Lemma~\ref {conjecture true if enough on line lemma}. Therefore we may assume that there are at most $k$ points in each subgroup; in particular, $m_x\le k$ for all $x\in\F_p^2$. We now argue that if $\Sigma A$ is small, then there must be lots of pairs of elements of $A$ that add to the same element of $\F_p^2$, at which point we will be able to invoke Lemma~\ref {any j lemma}. We may assume that $\Sigma A \ne \F_p^2$, for otherwise we are done immediately.

For each $1 \le i \le k$, we define the level set $A_i = \{x \in \F_p^2 : m_x \ge i\}$. Notice that $A$ can be written precisely as the multiset union $A_1 \cup A_2 \cup \cdots \cup A_k$, and so $\sum_{i=1}^k \#A_i = |A| = p+k$. Let $B_i$ be the multiset formed by the sums of pairs of elements of $A_i$ not in the same subgroup:
\[
B_i = \big\{ x + y \colon x,y\in A_i,\, \lin x\ne\lin y \big\}.
\]
Note that $\text{\bf 0} \notin B_i$ (the restriction $\lin x\ne\lin y$ ensures that $x \ne -y$) and that every element of $B_i$ occurs with even multiplicity (the restriction $\lin x\ne\lin y$ ensures that $x \ne y$).  It is not hard to estimate the relative sizes of $\#A_i$ and $|B_i|$: for each $x \in A_i$ there are at most $k$ elements of $A$ lying in the subgroup $\lin x$.  Since each such $x$ occurs with multiplicity at least $i$ in $A$, there are at most $k/i$ distinct values of $y$ excluded by the condition $\lin x \ne \lin y$.  Hence
$|B_i| \ge \#A_i (\#A_i - k/i)$, which implies that
\begin{equation}\label{bound on a_i}
\#A_i \le \frac{k}{i} + \sqrt{|B_i|}.
\end{equation}
Since $\sum_{i=1}^k \#A_i$ is fixed, this shows that $|B_i|$ cannot be very small on average.  At the same time, $\#B_i$ cannot get very large: if $\sum_{i=1}^k \#B_i \ge (2k+1)p$, then (under our assumption that $\Sigma A \ne \F_p^2$) Lemma~\ref{kneser bound} already yields
\[
\#\Sigma A \ge \sum_{i=1}^k \#\Sigma A_i - (k-1)p > \sum_{i=1}^k \#B_i - (k-1)p \ge (k+2)p.
\]
where the middle inequality holds because $B_i \subseteq \Sigma A_i$. We may therefore assume henceforth that
\begin{equation} \label{bound on b_i}
\sum_{i=1}^k \#B_i < (2k+1)p.
\end{equation}

Let us now introduce the weighted height parameter
\begin{equation} \label{eta def}
\eta = \max_{1\le i \le k} \left\{ \frac{i|B_i|}{2\#B_i} : \#B_i > 0 \right\}.
\end{equation}
We shall show shortly that $\eta > k+1$.  Assuming so, then for some $1 \le i \le k$, we have
\[
\frac{|B_i|}{2\#B_i} > \frac{k+1}{i},
\]
so by the pigeonhole principle, there exists some $z \in B_i$ (in particular $z\ne\text{\bf 0}$) occurring with multiplicity greater than $2(k+1)/i$; since this multiplicity is an even integer, it must be at least $2(k+2)/i.$  For each solution $x+y = z$ corresponding to an occurrence of $z$ in $B_i$, we have by construction that $x,y \notin \lin z$ and $m_x, m_y \ge i$, so for this particular choice of~$z$,
\[
\tfrac12 \sum_{t \in \F_p^2 \setminus\lin z } \min\{m_t, m_{z-t}\} \ge k+2.
\]
Furthermore, $\sum_{y\in\lin z} m_y \le k$ by assumption. Therefore we are free to apply Lemma~\ref{any j lemma} with $j = (k+2) - \sum_{y\in\lin z} m_y,$
which gives the lower bound
\[
\#\Sigma A \ge \min\{p,k+3\} \min\bigg\{p,p - k - 3  + \sum_{y\in\lin z} m_y\bigg\} \ge (k+3)(p-k-3) \ge (k+2)p
\]
(the last step used the inequality $p \ge (k+3)^2$, which certainly holds under the hypotheses of the theorem).

It remains only to verify that $\eta > k+1$. Summing the inequality~\eqref{bound on a_i} over all $1\le i\le k$ yields
\[
p+k = \sum_{i=1}^k \#A_i \le k H_k + \sum_{i=1}^k \sqrt{|B_i|} \le kH_k + \sqrt{2\eta} \sum_{i=1}^k \sqrt{\frac{\#B_i}{i}},
\]
using the definition~\eqref{eta def} of~$\eta$. We estimate the rightmost sum using Cauchy--Schwarz together with the inequality~\eqref{bound on b_i}:
\[
\sum_{i=1}^k \sqrt{\frac{\#B_i}{i}} \le \bigg(\sum_{i=1}^k \#B_i\bigg)^{1/2}\bigg(\sum_{i=1}^k \frac1i\bigg)^{1/2} < \sqrt{(2k+1) p H_k}.
\]
Combining the previous two inequalities gives $p+k - kH_k < \sqrt{ \eta(4k+2) p H_k}$, so that
\[
\eta > \frac{(p+k-kH_k)^2}{(4k+2) pH_k} > \frac{p(p+2(k-kH_k))}{(4k+2) pH_k} = \frac{(p+2k)-2kH_k}{(4k+2)H_k} \ge \frac{4(k+1)^2H_k-2kH_k}{(4k+2)H_k}
\]
by the hypothesis on the size of~$p$. In other words,
\[
\eta > \frac{2(k+1)^2-k}{2k+1} = k+1+\frac1{2k+1},
\]
which completes the proof of the theorem.
\end{proof}

\section{A wider conjecture}
\label{conjecture section}

As mentioned earlier, Conjecture~\ref{2d conjecture} is just one part of a more far-reaching conjecture concerning sumsets of multisets in ${\mathbb Z}_p^m$. Before formulating that wider conjecture, we must expand the definition of a valid multiset to ${\mathbb Z}_p^m$.

\begin{definition}
\label{more valid definition}
Let $p$ be an odd prime, and let $m$ be a positive integer. A multiset $A$ contained in ${\mathbb Z}_p^m$ is {\em valid} if:
\begin{itemize}
\item $\text{\bf 0}\notin A$; and
\item for each $1\le d\le m$, every subgroup of ${\mathbb Z}_p^m$ that is isomorphic to ${\mathbb Z}_p^d$ contains fewer than $dp$ points of $A$, counting multiplicity.
\end{itemize}
\end{definition}

\noindent When $m=1$, a multiset contained in ${\mathbb Z}_p$ is valid precisely when it does not contain $0$; when $m=2$ and $|A| < 2p$, this definition of valid agrees with Definition~\ref{valid definition} for multisets contained in $\F_p^2$. Note that in particular, Definition~\ref{more valid definition}(b) implies that every valid multiset contained in ${\mathbb Z}_p^m$ has at most $mp-1$ elements, counting multiplicity. We now give an example showing that this upper bound $mp-1$ can in fact be achieved. Throughout this section, let $\{x_1,\dots,x_m\}$ denote a generating set for ${\mathbb Z}_p^m$, and let ${\mathbf K}_d = \lin{x_1,\dots,x_d}$ denote the subgroup of ${\mathbb Z}_p^m$ generated by $\{x_1,\dots,x_d\}$, so that ${\mathbf K}_d \cong {\mathbb Z}_p^d$.

\begin{example}
\label{valid example}
Let $A_1$ be the multiset consisting of $p-1$ copies of $x_1$; for $2\le j\le m$ let $A_j = \{ x_j + ax_1 \colon 0\le a\le p-1 \}$; and define $B_m = \bigcup_{j=1}^m A_j$. Then $|B_m| = (p-1) + (m-1)p = mp-1$ and $\text{\bf 0}\notin B_m$. To verify that $B_m$ is a valid subset of ${\mathbb Z}_p^m$, let ${\mathbf H}$ be any subgroup of ${\mathbb Z}_p^m$ that is isomorphic to ${\mathbb Z}_p^d$; we need to show that $B_m$ contains fewer than $dp$ points of ${\mathbf H}$.

First suppose that $x_1\notin{\mathbf H}$, which implies that $bx_1\notin{\mathbf H}$ for every nonzero multiple $bx_1$ of~$x_1$. Then for each $2\le j\le m$, at most one of the elements of $A_j$ can be in ${\mathbf H}$, since the difference of any two such elements is a nonzero multiple of $x_1$. Therefore $|B_m\cap{\mathbf H}| = \ell$ for some $1\le\ell\le m-1$, and in fact all $\ell$ of these elements are of the form $x_j+ax_1$ for $\ell$ distinct values of~$j$. Since no such element is in the subgroup spanned by the others, we conclude that $d\ge\ell$, and so the necessary inequality $|B_m\cap{\mathbf H}|=\ell\le d<dp$ is amply satisfied.

Now suppose that $x_1\in{\mathbf H}$. Then for each $2\le j\le m$, either all or none of the elements of $A_j$ are in ${\mathbf H}$. By reindexing the $x_i$, we may choose an integer $1\le\ell\le m$ such that ${\mathbf H}$ contains $A_1 \cup \cdots \cup A_\ell$ and is disjoint from $A_{\ell+1} \cup \cdots \cup A_m$. In particular, $|B_m\cap{\mathbf H}| = (p-1)+(\ell-1)p = \ell p-1$. But ${\mathbf H}$ contains $\{x_1,\dots,x_\ell\}$ and hence $d\ge\ell$, so that $\ell p-1\le dp-1$ as required.
\end{example}

We may now state our wider conjecture; Conjecture~\ref{2d conjecture} is the special case $q=1$ of part (a) of this conjecture.

\begin{conjecture}
\label {any d conjecture}
Let $p$ be an odd prime. Let $m$ be a positive integer, and let $A$ be a valid multiset of ${\mathbb Z}_p^m$ with $|A|\ge p$. Write $|A| = qp+k$ with $0\le k\le p-1$.
\begin{enumerate}
\item If $0\le k\le p-3$, then $\#\Sigma A \ge (k+2)p^q$.
\item If $k=p-2$, then $\#\Sigma A \ge p^{q+1}-1$.
\item If $k=p-1$, then $\#\Sigma A \ge p^{q+1}$.
\end{enumerate}
In particular, if $|A| = mp-1$ then $\Sigma A = {\mathbb Z}_p^m$.
\end{conjecture}

We remark that the quantity $dp$ in Definition~\ref{more valid definition}, bounding the number of elements in a valid multiset that can lie in a rank-$d$ subgroup, has been carefully chosen in light of this conjecture: by Conjecture~\ref {any d conjecture}(c), any valid multiset $A$ with at least $dp-1$ elements counting multiplicity must satisfy $\#\Sigma A \ge p^d$. In particular, if $A$ is a valid multiset contained in a subgroup ${\mathbf H} < {\mathbb Z}_p^m$ that is isomorphic to ${\mathbb Z}_p^d$, then $|A|\ge dp-1$ implies that $\Sigma A = {\mathbf H}$. Therefore allowing $dp$ elements in such a subgroup would always be ``wasteful''. Of course, the validity of Definition~\ref{more valid definition} for rank-$d$ subgroups depends crucially upon the truth of Conjecture~\ref {any d conjecture}(c) for $q=d-1$.

The conjecture is restricted to multisets $A$ with $|A|\ge p$ because we already know the truth for smaller multisets, for which the definition of ``valid'' is simply the condition that $\text{\bf 0} \notin A$: when $|A|\le p-1$, the best possible lower bound is $\#\Sigma A \ge |A|+1$ as in Lemma~\ref {CD lemma}. We remark that Peng~\cite[Theorem 2]{P1} has proved Conjecture~\ref {any d conjecture}(c) in the case $m=2$ and $q=1$, under even a slightly weaker hypothesis; in other words, he has shown that if $A$ is a valid multiset contained in $\F_p^2$ with $|A| = 2p-1$, then $\Sigma A = \F_p^2$. (We remark that Mann and Wou~\cite{MW} have proved in the case that $A$ is actually a set---that is, a multiset with distinct elements---that $\#A = 2p-2$ suffices to force $\Sigma A = \F_p^2$.) Peng considers the higher-rank groups ${\mathbb Z}_p^m$ as well, but the multisets he allows (see \cite[Theorem 1]{P2}) form a much wider class than our valid multisets, and so his conclusions are much weaker than Conjecture~\ref{any d conjecture} for $q\ge2$. Finally, we mention that we have completely verified Conjecture~\ref{any d conjecture} by exhaustive computation for the groups ${\mathbb Z}_p^2$ with $p\le 7$ and also for the group ${\mathbb Z}_3^3$.

It is easy to see that all of the lower bounds in Conjecture~\ref{any d conjecture}(a), if true, would be best possible. Given $q\ge1$ and $0\le k\le p-3$, let $A'$ be any valid multiset contained in ${\mathbf K}_q$ with $|A'| = qp-1$ (such as the one given in Example~\ref{valid example} with $m=q$), and let $A$ be the union of $A'$ with $k+1$ copies of $x_{q+1}$. Then $\Sigma A = \{ y + ax_{q+1}\colon y\in \Sigma A',\, 0\le a\le k+1\}$ and thus $\#\Sigma A' = (k+2)\#\Sigma A \le (k+2)p^q$ since $\Sigma A$ is contained in~${\mathbf K}_q$. Similarly, the fact that there exists a valid multiset contained in ${\mathbf K}_{q+1}$ with $qp+(q-1)=(q+1)p-1$ elements (such as the one given in Example~\ref{valid example} with $m=q+1$) shows that the lower bound in Conjecture~\ref{any d conjecture}(c) would be best possible, since the sumset of this multiset would still be contained in ${\mathbf K}_{q+1}$ and thus would have at most $p^{q+1}$ distinct elements.

The lower bound in Conjecture~\ref{any d conjecture}(b) might seem counterintuitive, especially in comparison with the pattern established in Conjecture~\ref{any d conjecture}(a). However, we can give an explicit example showing that the lower bound $p^{q+1}-1$ for $\#\Sigma A$ cannot be increased:

\begin{example}
\label{border example}
When $p$ is an odd prime, define $B'_m$ to be the set $B_m$ from Example~\ref{valid example} with one copy of $x_1$ removed, so that $B'_m$ contains $x_1$ with multiplicity only $p-2$. Since $B_m$ is a valid multiset contained in ${\mathbb Z}_p^m$, so is $B'_m$. We have $|B'_m| = |B_m|-1 = (mp-1)-1 = (m-1)p + (m-2)$, and we claim that $-x_1\notin \Sigma B'_m$; this will imply that $\#\Sigma B'_m \le p^m-1$, and so the lower bound for $\#\Sigma A$ in Conjecture~\ref{any d conjecture}(b) cannot be increased. (In fact it is not hard to show that every other element of ${\mathbb Z}_p^m$ is in $\Sigma B'_m$, and so $\#\Sigma B'_m$ is exactly equal to $p^m-1$.)

Suppose for the sake of contradition that $-x_1\in \Sigma B'_m$, and let $C$ be a submultiset of $B'_m$ such that $-x_1 = \sum_{y\in C}y$. For each $2\le j\le m$, define $\ell_j = |C\cap A_j|= \#\big( C \cap \{ x_j + ax_1\colon 0\le a\le p-1 \} \big)$. Then
\[
-x_1 = \sum_{y\in C} y = t x_1 + \ell_2 x_2 + \ell_3 x_3 + \cdots + \ell_m x_m
\]
for some integer~$t$. It follows from this equation that each $\ell_j$ must equal either $0$ or $p$. However, if $\ell_j = p$ then
\[
\sum_{y \in C\cap A_j} y = \sum_{0\le a\le p-1} (x_j + ax_1) = px_j + \frac{p(p-1)}2 x_1 = \text{\bf 0}
\]
(since $p$ is odd). So in either case, if $s = |C\cap A_1|$ is the multiplicity with which $x_1$ appears in $C$, then
\[
-x_1 = \sum_{y\in C} y = s x_1 + \sum_{j=2}^m \sum_{y\in C\cap A_j} y = s x_1 + \text{\bf 0} + \cdots + \text{\bf 0}.
\]
This is a contradiction, however, since $s$ must lie between $0$ and $p-2$. Therefore $-x_1$ is indeed not an element of $\Sigma B'_m$, as claimed.
\end{example}

The line of questioning in this section turns out to be uninteresting when $p=2$: when the multiset $A$ does not contain $\text{\bf 0}$, the condition that no rank-$1$ subgroup of ${\mathbb Z}_2^m$ contain $2$ points of $A$ is simply equivalent to $A$ not containing any element with multiplicity greater than~$1$. It is easy to check that if $A$ consists of any $q$ points in ${\mathbb Z}_2^m$ that do not lie in any subgroup isomorphic to ${\mathbb Z}_2^{q-1}$, then $\Sigma A$ fills out the entire rank-$q$ subgroup generated by~$A$. In other words, the analogous definition of ``valid'' for multisets in ${\mathbb Z}_2^m$ would simply be a set of $q$ points that generate a rank-$q$ subgroup of ${\mathbb Z}_2^m$, and we would always have $\#\Sigma A = 2^{|A|} = 2^{\#A}$ for valid (multi)sets in~${\mathbb Z}_2^m$.

\section*{Acknowledgments}

The collaboration leading to this paper was made possible thanks to Jean--Jacques Risler, Richard Kenyon, and especially Ivar Ekeland; the authors also thank the University of British Columbia and the Institut d'\'Etudes Politiques de Paris for their undergraduate exchange program.
The first author thanks Andrew Granville for conversations that explored this topic and eventually led to the formulation of the conjectures herein.


On the maximum number of isosceles right triangles in a finite point set

Abstract: Let $Q$ be a finite set of points in the plane. For any set $P$ of points in the plane, $S_{Q}(P)$ denotes the number of similar copies of $Q$ contained in $P$. For a fixed $n$, Erdős and Purdy asked to determine the maximum possible value of $S_{Q}(P)$, denoted by $S_{Q}(n)$, over all sets $P$ of $n$ points in the plane. We consider this problem when $Q=\triangle$ is the set of vertices of an isosceles right triangle. We give exact solutions when $n\leq9$, and provide new upper and lower bounds for $S_{\triangle}(n)$.

\section{Introduction}

In the 1970s Paul Erd\H{o}s and George Purdy \cite{D,E,F} posed the
question, \textquotedblleft Given a finite set of points $Q$, what is
the maximum number of similar copies $S_{Q}(n)$ that can be
determined by $n$ points in the plane?\textquotedblright. This problem remains open in general. However, there has been some progress regarding the order of magnitude of this maximum as a function of $n$.  Elekes and Erd\H{o}s \cite{B} noted that $S_{Q}\left(  n\right) \leq n\left(
n-1\right)  $ for any pattern $Q$ and they also gave a quadratic lower bound
for $S_{Q}(n)$ when $\left\vert Q\right\vert =3$ or when all the
coordinates of the points in $Q$ are algebraic numbers. They also
proved a slightly subquadratic lower bound for all other patterns
$Q$. Later, Laczkovich and Ruzsa \cite{LR97} characterized precisely
those patterns $Q$ for which $S_{Q}\left(  n\right) =\Theta(n^{2})$. In spite of this, the coefficient of the quadratic term is not known for any non-trivial pattern; it is not even known if $\lim_{n\rightarrow \infty}S_Q(n)/n^2$ exists!

Apart from being a natural question in Discrete Geometry, this
problem also arose in connection to optimization of algorithms
designed to look for patterns among data obtained from scanners,
digital cameras, telescopes, etc. (See \cite{Bra, BrMoPa, BP05} for
further references.)

Our paper considers the case when $Q$ is the set of vertices of an isosceles right triangle.
The case when $Q$ is the set of vertices of an equilateral triangle has been considered in
\cite{A}. To avoid redundancy, we refer to an isosceles right
triangle as an ${\mathsf{IRT}}$ for the remainder of the paper. We
begin with some definitions.
Let $P$ denote a finite set of points in the plane. We
define $S_{\triangle}(P)$ to be the number of triplets in $P$ that are the vertices of an ${\mathsf{IRT}}$. Furthermore, let
\[
S_{\triangle}(n)=\max_{|P|=n}S_{\triangle}(P).
\]
As it was mentioned before, Elekes and Erd\H{o}s established that $S_{\triangle}(n)=\Theta(n^2)$ and it is implicit from their work that $1/18 \leq \liminf_{n\rightarrow\infty
S_{\triangle}(n)/n^{2} \leq 1$. The main goal of this paper is to
derive improved constants that bound the function
$S_{\triangle}(n)/n^{2}$.  Specifically, in Sections \ref{sec:
lower} and \ref{sec: upper}, we prove the following result:
\begin{theorem}
\[
0.433064 < \liminf_{n\rightarrow\infty
\frac{S_{\triangle}(n)}{n^{2}}\leq\frac{2}{3} < 0.66667.
\]
\end{theorem}
We then proceed to determine, in Section \ref{sec: small cases}, the
exact values of $S_{\triangle }(n)$ when $3\leq n\leq9$.  Several
ideas for the proofs of these bounds come from the equivalent bounds
for equilateral triangles in \cite{A}.

\section{Lower Bound\label{sec: lower}}

We use the following definition.
For $z\in P$, let $R_{\pi/2}(z,P)$ be the $\pi/2$
counterclockwise rotation of $P$ with center $z$. Furthermore, let $\deg
_{\pi/2}(z)$ be the number of isosceles right triangles in $P$ such that $z$
is the right-angle vertex of the triangle.
If $z\in P$, then $\deg_{\pi/2}(z)$ can be computed by simply rotating our
point set $P$ by $\pi/2$ about $z$ and counting the number of points in the
intersection other than $z$. Therefore,
\begin{equation}
\deg_{\pi/2}(z)=|P\cap R_{\pi/2}(z,P)|-1. \label{degpi/2
\end{equation}
Due to the fact that an ${\mathsf{IRT}}$ has only one right angle, then
\[
S_{\triangle}(P) = \sum_{z\in P} \deg_{\pi/2}(z).
\]
That is, the sum computes the number of ${\mathsf{IRT}}$s in $P$. From this identity
an initial $5/12$ lower bound can be derived for $\liminf_{n\rightarrow \infty}S_\triangle(n)/n^2$ using the set
\[
P=\left\{  (x,y)\in\mathbb{Z}^{2}:0\leq x\leq \sqrt{n},0\leq y\leq \sqrt{n}\right\}.
\]
We now improve this bound.

The following theorem generalizes our method for finding a lower bound.  We denote by $\Lambda$ the lattice generated by the points
$(1,0)$ and $(0,1)$; furthermore, we refer to points in $\Lambda$ as \emph{lattice points}. The next result provides a formula for the leading term of $S_{\triangle}(P)$ when our
points in $P$ are lattice points enclosed by a given shape. This theorem, its
proof, and notation, are similar to Theorem 2 in \cite{A}, where the
authors obtained a similar result for equilateral triangles in place of
${\mathsf{IRT}}$s.

\begin{theorem}
\label{integral} Let K be a compact set with finite perimeter and area 1.
Define $f_{K}:\mathbb{C}\rightarrow\mathbb{R}^{+}$ as $f_{K}(z)=Area(K\cap
R_{\pi/2}(z,K))$ where $z\in K$. If $K_{n}$ is a similar copy of $K$
intersecting $\Lambda$ in exactly $n$ points, then
\[
S_{\triangle}(K_{n}\cap\Lambda)=\left(  \int_{K}f_{K}(z)\,dz\right)
n^{2}+O(n^{3/2}).
\]

\end{theorem}

\begin{proof}
Given a compact set $L$ with finite area and perimeter, we have that
\[
\left\vert rL\cap\Lambda\right\vert ={\mathrm{Area}(rL)}
+O(r)=r^{2}\mathrm{Area}(L)+O(r),
\]
where $rL$ is the scaling of $L$ by a factor $r$. Therefore,
\begin{align*}
S_{\triangle}(K_{n}\cap\Lambda)  &  =\sum_{z\in
K_{n}\cap\Lambda}|(\Lambda \cap K_{n})\cap
R_{\pi/2}(z,(K_{n}\cap \Lambda))|-1\\
&  =\sum_{z\in K_{n}\cap\Lambda}\mathrm{Area}(K_{n}\cap R_{\pi/2
(z,K_{n}))+O(\sqrt{n}).
\end{align*}
We see that each error term in the sum is bounded by the perimeter
of $K_{n}$, which is finite by hypothesis. Thus,
\begin{align*}
S_{\triangle}(K_{n}\cap\Lambda)  &  =n^{2}\sum_{z\in K_{n}\cap\Lambda}\frac
{1}{n^{2}}\mathrm{Area}(K_{n}\cap R_{\pi/2}(z,K_{n}))+O(n^{3/2})\\
&  =n^{2}\sum_{z\in K_{n}\cap\Lambda}\frac{1}{n}\mathrm{Area}(\frac{1
{\sqrt{n}}\left(  K_{n}\cap R_{\pi/2}(z,K_{n})\right)  )+O(n^{3/2})\\
&  =n^{2}\sum_{z\in K_{n}\cap\Lambda}\frac{1}{n}\mathrm{Area}\left(  \frac
{1}{\sqrt{n}}K_{n}\cap R_{\pi/2}\left(  \frac{z}{\sqrt{n}},\frac{1}{\sqrt{n
}K_{n}\right)  \right)  +O(n^{3/2})\text{.
\end{align*}
The last sum is a Riemann approximation for the function $f_{(1/\sqrt{n
)K_{n}}$ over the region $(1/\sqrt{n})K_{n}$, thus
\[
S_{\triangle}(K_{n}\cap\Lambda)=n^{2}\left(  \int_{\frac{1}{\sqrt{n}}K_{n
}f_{\frac{1}{\sqrt{n}}K_{n}}(z)\,dz+O\left(  \frac{1}{\sqrt{n}}\right)
\right)  +O(n^{3/2}).
\]
Since
\[
\mathrm{Area}\left(  \frac{1}{\sqrt{n}}K_{n}\right)  =\frac{1}{n
\mathrm{Area}(K_{n})=\frac{1}{n}(n+O(\sqrt{n}))=1+O\left(  \frac{1}{\sqrt{n
}\right)  =\mathrm{Area}(K)+O\left(  \frac{1}{\sqrt{n}}\right)  ,
\]
it follows that,
\[
\int_{\frac{1}{\sqrt{n}}K_{n}}f_{\frac{1}{\sqrt{n}}K_{n}}(z)\,dz=\int_{K
f_{K}(z)\,dz+O\left(  \frac{1}{\sqrt{n}}\right)  \text{.
\]
As a result,
\begin{align*}
S_{\triangle}(K_{n}\cap\Lambda)  &  =n^{2}\int_{\frac{1}{\sqrt{n}}K_{n
}f_{\frac{1}{\sqrt{n}}K_{n}}(z)\,dz+O(n^{3/2})\\
&  =n^{2}\int_{K}f_{K}(z)\,dz+O(n^{3/2})\text{.}\qedhere
\end{align*}

\end{proof}

The importance of this theorem can be seen immediately.  Although our $5/12$ lower bound for $\liminf_{n\rightarrow\infty} S_{\triangle}(n)/n^{2}$ was derived by summing the degrees of each point in a square lattice, the same result can be obtained by letting $K$ be the square $\{ (x,y):|x| \leq \frac{1}{2}, |y| \leq \frac{1}{2} \}$. It follows that $f_K(x,y)=(1-|x|-|y|)(1-||x|-|y||)$ and
\[
S_{\triangle}(K_{n}\cap\Lambda)=\left(  \int_{K}f_{K}(z)\,dz\right)
n^{2}+O(n^{3/2}) = \frac{5}{12}n^{2}+O(n^{3/2})\text{.
\]

An improved lower bound will follow
provided that we find a set $K$ such that the value for the
integral in Theorem \ref{integral} is larger than $5/12$. We get a larger value for the integral by letting $K$ be
 the circle $\{ z \in \mathbb{C} : |z|\leq 1/\sqrt{\pi} \}$. In this case
\begin{equation} \label{circle function}
f_K(z)=\frac{2}{\pi} \arccos (\frac{\sqrt{2 \pi}}{2} |z|)-|z|\sqrt{\frac{2}{\pi}-|z|^2}
\end{equation}
and
\[
S_{\triangle}(K_{n}\cap\Lambda)=\left(  \int_{K}f_{K}(z)\,dz\right)
n^{2}+O(n^{3/2}) = \left(  \frac{3}{4}-\frac{1}{\pi}\right)n^{2}+O(n^{3/2})\text{.
\]

It was conjectured in \cite{A} that not only does $\lim_{n\rightarrow \infty} E(n)/n^2$ exist, but it is attained by the uniform lattice in the shape of a circle.  ($E(n)$ denotes the maximum number of equilateral triangles determined by $n$ points in the plane.)  The corresponding conjecture in the case of the isosceles right triangle turns out to be false.  That is, if $\lim_{n\rightarrow \infty}S_{\triangle}(n)/n^2$ exists, then it must be strictly greater than $3/4-1/\pi$.  Define $\overline{\Lambda}$ to be the translation of $\Lambda$ by the vector $(1/2,1/2)$. The following lemma will help us to improve our lower bound.

\begin{lemma} \label{Lem: lambda}
If $(j,k)\in \mathbb{R}^2$ and $\Lambda^\prime=\Lambda$ or $\Lambda^\prime=\overline{\Lambda}$, then
\[
R_{\pi/2}((j,k),\Lambda^\prime) \cap \Lambda^\prime=\left\{
\begin{array}{l}
\Lambda^\prime \text{ if } (j,k)\in \Lambda \cup \overline{\Lambda}, \\
\varnothing \text{ else.}
\end{array}
\right.
\]

\end{lemma}

\begin{proof}
Observe that
\[R_{\pi/2} ((j,k),(s,t)) =
\begin{pmatrix}
0 & -1\\
1& 0\\
\end{pmatrix}
\begin{pmatrix}
s-j\\
t-k\\
\end{pmatrix}
+\begin{pmatrix}
j\\
k\\
\end{pmatrix}
=
\begin{pmatrix}
k-t+j\\
s-j+k\\
\end{pmatrix}.
\]
First suppose $(s,t)\in \Lambda$. Since $s,t\in \mathbb{Z}$, then $(k-t+j,s-j+k)\in \Lambda$ if and only if $k-j\in \mathbb{Z}$ and $k+j\in \mathbb{Z}$. This can only happen when either both $j$ and $k$ are half-integers (i.e., $(j,k)\in \overline{\Lambda}$), or both $j$ and $k$ are integers (i.e., $(j,k)\in \Lambda$).  Now suppose $(s,t)\in \overline{\Lambda}$.  In this case, because both $s$ and $t$ are half-integers, we conclude that $(k-t+j, s-j+k)\in \overline{\Lambda}$ if and only if both $k-j\in \mathbb{Z}$ and $k+j\in \mathbb{Z}$. Once again this occurs if and only if $(j,k)\in \Lambda \cup \overline{\Lambda}$.
\end{proof}

Recall that if $K$ denotes the circle of area 1, then $(3/4-1/\pi)n^2$ is the leading term of  $S_{\triangle}(K_n\cap \Lambda)$.  The previous lemma implies that, if we were to adjoin a point $z\in \mathbb{R}^2$ to $K_n\cap \Lambda$ such that $z$ has half-integer coordinates and is located near the center of the circle formed by the points of $K_n\cap \Lambda$, then $\deg_{\pi/2}(z)$ will approximately equal $|K_n\cap \Lambda|$.  We obtain the next theorem by further exploiting this idea.

\begin{theorem}
\[.43169\approx \frac{3}{4}-\frac{1}{\pi} < .433064 < \liminf_{n\rightarrow \infty}\frac{S_{\triangle}(n)}{n^2}\]
\end{theorem}

\begin{proof}
Let $K$ be the circle of area 1, $A= K_{m_1}\cap \Lambda$, and $B = K_{m_2}\cap\overline{\Lambda}$.  Moreover, position $B$ so that its points are centered on the circle formed by the points in $A$ (See Figure \ref{Fig: Centered}). We let $n=m_1+m_2=|A \cup B|$ and $m_2=x\cdot m_1$, where $0<x<1$ is a constant to be determined.
\begin{figure}[h]
\centering
\includegraphics{AUBandPlot.eps}
\caption{(a) Set $B$ (gray points) centered on set $A$ (black
points),  (b) Plot of the $n^2$ coefficient of $S_\triangle(A \cup
B)$ as $x$ ranges from 0 to 1.} \label{Fig: Centered}
\end{figure}

We proceed to maximize the leading coefficient of
$S_{\triangle}(A\cup B)$ as $x$ varies from 0 to $1$.  By Lemma
\ref{Lem: lambda}, there cannot exist an \irt$\:$whose right-angle
vertex lies in $A$ while one $\pi/4$ vertex lies in $A$ and the
other lies in $B$.  Similarly, there cannot exist an \irt whose
right angle-vertex lies in $B$ while one $\pi/4$ vertex lies in $A$
and the other lies in $B$.  Therefore, each \irt with vertices in
$A\cup B$ must fall under one of the following four cases:
\bigskip
\\
\noindent \textit{Case 1: All three vertices in $A$}.  Using Theorem \ref{integral}, it follows that there are $(3/4 - 1/\pi)m_1^2 + O(m_1^{3/2})$ {\irt}s in this case. Since $m_1=n/(1+x)$, the number of {\irt}s in terms of $n$ equals
\begin{equation}\label{Case 1}
\left(\frac{3}{4} - \frac{1}{\pi}\right)\frac{n^2}{(1+x)^2} + O(n^{3/2}).
\end{equation}
\\
\noindent \textit{Case 2: All three vertices in $B$}.  By Theorem \ref{integral}, there are $(3/4 - 1/\pi)m_2^2 + O(m_2^{3/2})$ {\irt}s in this case.  This time $m_2=nx/(1+x)$ and the number of {\irt}s in terms of $n$ equals
\begin{equation}\label{Case 2}
\left(\frac{3}{4} - \frac{1}{\pi}\right)\frac{n^2x^2}{(1+x)^2} + O(n^{3/2}).
\end{equation}
\\
\noindent \textit{Case 3: Right-angle vertex in $B$, $\pi/4$ vertices in $A$}.  The relationship given by Lemma \ref{Lem: lambda} allows us to slightly adapt the proof of Theorem \ref{integral} in order to compute the number of {\irt}s in this case.  The integral approximation to the number of {\irt}s in this case is given by

\[\sum_{z\in K_{m_2}\cap \overline{\Lambda}} |(K_{m_1}\cap\Lambda)\cap R_{\pi/2}(z,(K_{m_1}\cap\Lambda))| = m_1^2\left(\int_{\frac{1}{\sqrt{m_1}}K_{m_2}} f_{\frac{1}{\sqrt{m_1}}K_{m_1}}(z)\,dz \right) + O(m_1^{3/2}).\]
But
\[\mathrm{Area}\left(\frac{1}{\sqrt{m_1}}K_{m_2}\right) = \mathrm{Area}\left(\sqrt{\frac{m_2}{m_1}}K\right) + O(\sqrt{m_1}),\]
so
\[m_1^2\left(\int_{\frac{1}{\sqrt{m_1}}K_{m_2}} f_{\frac{1}{\sqrt{m_1}}K_{m_1}}(z)\,dz \right) + O(m_1^{3/2}) = m_1^2\left(\int_{\sqrt{\frac{m_2}{m_1}}K} f_{K}(z)\,dz \right) + O(m_1^{3/2}).\]
Expressing this value in terms of $n$ gives
\begin{equation}\label{Case 3}
\left(\int_{\sqrt{x}K} f_{K}(z)\,dz \right)\frac{n^2}{(1+x)^2} + O(n^{3/2}).
\end{equation}
\\
\noindent \textit{Case 4: Right-angle vertex in $A$, $\pi/4$ vertices in $B$}.  As in Case 3, the number of {\irt}s is given by

\begin{equation}\label{Eqn: integral}
\sum_{z\in K_{m_1}\cap \Lambda} |(K_{m_2}\cap\overline{\Lambda})\cap R_{\pi/2}(z,(K_{m_2}\cap \overline{\Lambda}))| = m_2^2\left(\int_{\frac{1}{\sqrt{m_2}}K_{m_1}} f_{\frac{1}{\sqrt{m_2}}K_{m_2}}(z)\,dz \right) + O(m_2^{3/2}).
\end{equation}

Now recall that $f_{(1/\sqrt{m_2})K_{m_2}}(z) = \mathrm{Area}\left((1/\sqrt{m_2})K_{m_2}\cap R_{\pi/2}(z,(1/\sqrt{m_2})K_{m_2})\right)$.  It follows that $f_{(1/\sqrt{m_2})K_{m_2}}(z_0) = 0$ if and only if $z_0$ is farther than $\sqrt{2/\pi}$ from the center of $(1/\sqrt{m_2})K_{m_2}$.  Thus for small enough values of $m_2$, the region of integration in Equation (\ref{Eqn: integral}) is actually $(\sqrt{2/m_2})K_{m_2}$, so it does not depend on $m_1$. We consider two subcases.

First, if $x \leq 1/2$ (i.e., $m_2 \leq m_1/2$), then
\[\sqrt{\frac{2}{\pi}} = \frac{1}{\sqrt{m_2}}\frac{\sqrt{2m_2}}{\sqrt{\pi}} \leq \frac{1}{\sqrt{m_2}}\frac{\sqrt{2}}{\sqrt{\pi}}\frac{\sqrt{m_1}}{\sqrt{2}} = \frac{1}{\sqrt{m_2}}\sqrt{\frac{m_1}{\pi}}.\]
The left side of the above inequality is the radius of $(\sqrt{2/m_2})K_{m_2}$, meanwhile the right side is the radius of $(1/\sqrt{m_2})K_{m_1}$, thus the region of integration where $f_{\frac{1}{\sqrt{m_2}}K_{m_2}}$ is nonzero equals $(\sqrt{2/m_2})K_{m_2}$.  Hence, the number of {\irt}s equals

\begin{align}\nonumber
m_2^2\left(\int_{\sqrt{\frac{2}{m_2}}K_{m_2}} f_{\frac{1}{\sqrt{m_2}}K_{m_2}}(z)\,dz \right) + O(m_2^{3/2}) &= m_2^2\left(\int_{\sqrt{2}K} f_{K}(z)\,dz \right) + O(m_2^{3/2})\\ \label{Case 4A} &= \left(\int_{\sqrt{2}K} f_{K}(z)\,dz \right)x^2 n^2 + O(n^{3/2}).
\end{align}

Now we consider the case $x>1/2$ (i.e., $m_2> m_1/2$).  In this case, $f_{\frac{1}{\sqrt{m_2}}K_{m_2}}$ is nonzero for all points in $\frac{1}{\sqrt{m_2}}K_{m_1}$. Thus the number of {\irt}s in this case equals
\begin{align}\nonumber
m_2^2\left(\int_{\frac{1}{\sqrt{m_2}}K_{m_1}} f_{\frac{1}{\sqrt{m_2}}K_{m_2}}(z)\,dz \right) + O(m_2^{3/2}) &= m_2^2\left(\int_{\sqrt{\frac{m_1}{m_2}}K} f_{K}(z)\,dz \right) + O(m_2^{3/2})\\ \label{Case 4B}
&=\left(\int_{\sqrt{\frac{1}{x}}K} f_{K}(z)\,dz \right)\frac{n^2x^2}{(1+x)^2} + O(n^{3/2})
\end{align}

By Equation (\ref{circle function}), we have that for $t>0$,
\begin{align*}
\int_{tK}f_{K}(z)\,dz =&2\pi \int_{0}^{t/\sqrt{\pi }}\left( \frac{2}{\pi }
\arccos ( \frac{\sqrt{2\pi }}{2}r) -r\sqrt{\frac{2}{\pi }-r^{2}}
\right) r\,dr \\
=&\frac{1}{2\pi }\left( 4t^2\arccos ( \frac{t}{\sqrt{2}}) +2\arcsin
( \frac{t}{\sqrt{2}}) -t(t^{2}+1)\sqrt{2-t^{2}}\right).
\end{align*}
Therefore, putting all four cases together (i.e., expressions
(\ref{Case 1}), (\ref{Case 2}), (\ref{Case 3}), and either
(\ref{Case 4A}) or (\ref{Case 4B})), we obtain that the $n^2$
coefficient of $S_\triangle (A\cup B)$ equals
\begin{equation*}
\frac{1}{4\pi (x+1)^{2}}\left(8x\arccos \sqrt{\frac{x}{2}}+4\arcsin \sqrt{\frac{
}{2}}+(5\pi -4)x^{2}+ (3\pi -4)-2(x+1)\sqrt{2x-x^{2}}\right)
\end{equation*}
if $0<x\leq1/2$, or
\begin{multline*}
\frac{1}{4\pi (x+1)^{2}}\left(8x\left( \arccos \sqrt{\frac{x}{2}}+\arccos \sqrt{
\frac{1}{2x}}\right) +4\arcsin \sqrt{\frac{x}{2}}+4x^{2}\arcsin \sqrt{\frac{1
}{2x}}+ \right.\\ \left.
(3\pi -4)(x^{2}+1)-2(x+1)\left( \sqrt{2x-x^{2}}+\sqrt{2x-1}\right) \right)
\end{multline*}
if $1/2<x<1$. Letting $x$ vary from 0 to 1, it turns out that this
coefficient is maximized (see Figure \ref{Fig: Centered}) when $x\approx
.0356067$ (this corresponds to when the radius of $B$ is
approximately 18.87\% of the radius of $A$).  Letting $x$ equal this
value gives $0.433064$ as a decimal approximation to the maximum
value attained by the $n^2$ coefficient.
\end{proof}

At this point, one might be tempted to further increase the
quadratic coefficient by placing a third set of lattice points
arranged in a circle and centered on the circle formed by $B$.  It
turns out that forming such a configuration does not improve the
results in the previous theorem.  This is due to Lemma
\ref{Lem: lambda}.  More specifically, given our construction from
the previous theorem, there is no place to adjoin a point $z$ to the
center of $A\cup B$ such that $z\in \Lambda$ or $z\in
\overline{\Lambda}$.  Hence, if we were to add the point $z$ to the
center of $A\cup B$, then any new {\irt}s would have their
right-angle vertex located at $z$ with one $\pi/4$ vertex in $A$ and
the other $\pi/4$ vertex in $B$.  Doing so can produce at most $2m_2
= 2xm_1\approx .0712m_1$ new {\irt}s (recall that $x\approx
.0356066$ in our construction).  On the other hand, adding $z$ to
the perimeter of $A$, gives us $m_1f_{K}(1/\sqrt{\pi}) \approx
.1817m_1$ new {\irt}s.

\section{Upper Bound\label{sec: upper}}

We now turn our attention to finding an upper
bound for $S_{\triangle
}(n)/n^{2}$. It is easy to see that $S_{\triangle}(n)\leq n^{2}-n$,
since any pair of points can be the vertices of at most 6 ${\mathsf{IRT}}$s. Our next theorem
improves this bound. The idea is to
prove that there exists a point in $P$ that does not belong to many
${\mathsf{IRT}}$s. First, we need the following definition.

For every $z\in P$, let $R_{\pi/4}^{+}(z,P)$ and
$R_{\pi/4}^{-}(z,P)$ be the dilations of $P$, centered at $z$, by a factor of
$\sqrt{2}$ and $1/\sqrt{2}$, respectively; followed by a $\pi/4$
counterclockwise rotation with center $z$. Furthermore, let $\deg_{\pi/4
^{+}(z)$ and $\deg_{\pi/4}^{-}(z)$ be the number of isosceles right triangles
$zxy$ with $x,y\in P$ such that $zxy$ is ordered in counterclockwise order,
and $zy$, respectively $zx$, is the hypotenuse of the triangle $zxy$.

Much like the case of $\deg_{\pi/2}$, $\deg_{\pi/4}^{+}$ and $\deg_{\pi/4
^{-}$ can be computed with the following identities,
\[
\deg_{\pi/4}^{+}\left(  z\right)  =\left\vert P\cap R_{\pi/4}^{+}(z,P)\right\vert
-1\text{ and }\deg_{\pi/4}^{-}\left(  z\right)  =\left\vert P\cap R_{\pi/4
^{-}(z,P)\right\vert -1\text{.
\]

\begin{theorem}
\label{theorem3}For $n\geq3$,
\[
S_{\triangle}(n)\leq\left\lfloor \frac{2}{3}(n-1)^{2}-\frac{5}{3}\right\rfloor
.
\]

\end{theorem}

\begin{proof}
By induction on $n$. If $n=3$, then $S_{\triangle}(3)\leq1 = \left\lfloor \left(
2\cdot4-5\right)  /3\right\rfloor$. Now suppose the theorem holds for
$n=k$. We must show this implies the theorem holds for $n=k+1$. Suppose that
there is a point $z\in P$ such that $\deg_{\pi/2}(z)+\deg_{\pi/4
^{+}(z)+\deg_{\pi/4}^{-}(z)\leq\lfloor(4n-5)/3\rfloor$. Then by induction,
\begin{align*}
S_{\triangle}(k+1)  &  \leq\deg_{\pi/2}(z)+\deg_{\pi/4}^{+}(z)+\deg_{\pi
/4}^{-}(z)+S_{\triangle}(k)\\
&  \leq\left\lfloor \frac{4k-1}{3}\right\rfloor +\left\lfloor \frac{2
{3}(k-1)^{2}-\frac{5}{3}\right\rfloor =\left\lfloor \frac{2}{3}k^{2}-\frac
{5}{3}\right\rfloor .
\end{align*}
The last equality can be verified by considering the three possible residues
of $k$ when divided by 3. Hence, our theorem is proved if we can find a point
$z\in P$ with the desired property.

Let $x,y\in P$ be points such that $x$ and $y$ form the diameter of $P$. In
other words, if $w\in P$, then the distance from $w$ to any other point in $P$
is less than or equal to the distance from $x$ to $y$. We now prove that
either $x$ or $y$ is a point with the desired property mentioned above. We
begin by analyzing $\deg_{\pi/4}^{-}$. We use the same notation from Theorem 1 in \cite{A}.

Define $N_{x}=P \cap R_{\pi/4}^{-}(x,P)\backslash\{x\}$ and $N_{y}=P \cap R_{\pi/4
^{-}(y,P)\backslash\{y\}$. It follows from our identities that, $\deg_{\pi
/4}^{-}(x)=\vert N_{x}\vert $ and $\deg_{\pi/4}^{-}(y)=\vert
N_{y}\vert $. Furthermore, by the Inclusion-Exclusion Principle for
finite sets, we have $\vert N_{x}\vert +\vert N_{y}\vert =\vert N_{x}\cup
N_{y}\vert +\vert N_{x}\cap N_{y}\vert .$
We shall prove by contradiction that $|N_{x}\cap N_{y}|\leq1$. Suppose that there
are two points $u,v\in N_{x}\cap N_{y}$. This means that there are points
$u_{x},v_{x},u_{y},v_{y}\in P$ such that the triangles $xu_{x}u,xv_{x
v,yu_{y}u,yv_{y}v$ are ${\mathsf{IRT}}$s oriented counterclockwise with right
angle at either $u$ or $v$.

\begin{figure}[h]
\begin{center}
\includegraphics[scale=.91]{thelem4.eps}
\end{center}
\caption{Proof of Theorem 4.
\label{theoremlemma4
\end{figure}

But notice that the line segments $u_{x}u_{y}$ and $v_{x}v_{y}$ are simply the
$(\pi/2$)-counterclockwise rotations of $xy$ about centers $u$ and $v$
respectively. Hence, $u_{x}u_{y}v_{x}v_{y}$ is a parallelogram with two sides
having length $xy$ as shown in Figure \ref{theoremlemma4}(a). This is a
contradiction since one of the diagonals of the parallelogram is longer than
any of it sides. Thus, $|N_{x}\cap N_{y}|\leq1$. Furthermore, $x\notin N_{y}$ and $y\notin N_{x}$, so $|N_{x}\cup N_{y}|\leq n-2$ and thus
\[
\deg_{\pi/4}^{-}(x)+\deg_{\pi/4}^{-}(y)=\left\vert N_{x} \cup N_{y} \right\vert
+\left\vert N_x \cap N_{y}\right\vert \leq n-2+1=n-1\text{.
\]
This also implies that
\[
\deg_{\pi/4}^{+}(x)+\deg_{\pi/4}^{+}(y)\leq n-1,
\]
since we can follow the exact same argument applied to the reflection of $P$
about the line $xy$.

We now look at $\deg_{\pi/2}(x)$ and $\deg_{\pi/2}(y)$. First we need the
following lemma.

\begin{lemma}
For every $p\in P$, at most one of $R_{\pi/2}(x,p)$ or $R_{\pi/2}(y,p)$
belongs to $P$.
\end{lemma}

\begin{proof}
Let $p_{x}=R_{\pi/2}(x,p)$ and $p_{y}=R_{\pi/2}(y,p)$ (see Figure
\ref{theoremlemma4}(b)). Note that the distance $p_{x}p_{y}$ is exactly the
distance $xy$ but scaled by $\sqrt{2}$. This contradicts the fact that $xy$ is
the diameter of $P$.
\end{proof}

Let us define a graph $G$ with vertex set $V(G)=P\backslash\{x,y\}$ and where
$uv$ is an edge of $G$, (i.e., $uv\in E(G)$) if and only if $v=R_{\pi/2}(x,u)$
or $v=R_{\pi/2}(y,u)$.

\begin{lemma} \label{inequalitylemma
\[
0\leq\deg_{\pi/2}(x)+\deg_{\pi/2}(y)-|E(G)|\leq1\text{.
\]

\end{lemma}

\begin{proof}
The left inequality follows from the fact each edge counts an ${\mathsf{IRT}}$
in either $\deg_{\pi/2}(x)$ or $\deg_{\pi/2}(y)$ and possibly in both.
However, if $uv$ is an edge of $G$ so that $v=R_{\pi/2}(x,u)$ and $u=R_{\pi
/2}(y,v)$, then $xuyv$ is a square, so this can only happen for at most one edge.
\end{proof}

Now, let $\deg_{G}(u)$ be the number of edges in $E(G)$ incident to $u$.  We prove the following lemma.

\begin{lemma}
\label{deglemma} For every $u\in V(G)$, $\deg_{G}(u)\leq2$.
\end{lemma}

\begin{proof}
Suppose $uv_{1}\in E(G)$, see Figure \ref{Fig: lemma56}(a). Without loss of
generality we can assume that $u=R_{\pi/2}(y,v_{1})$. If $v_{3}=R_{\pi
/2}(y,u)\in P$, then we conclude that $xv_{3}>xy$ or $xv_1 >xy$, because $\angle xyv_{3
\geq\pi/2$ or $\angle xyv_1 \geq \pi/2$. This contradicts the fact that $xy$ is the diameter of $P$.
Similarly, if $v_{2}$ and $v_{4}$ are defined as $u=R_{\pi/2}(x,v_{4})$ and
$v_{2}=R_{\pi/2}(x,u)$, then at most one of $v_{2}$ or $v_{4}$ can be in $P$.
\end{proof}

\begin{figure}[h]
\begin{center}
\includegraphics[scale=.91]{lemma56.eps}
\end{center}
\caption{Proof of Lemmas \ref{deglemma} and \ref{pathlemma}.
\label{Fig: lemma56
\end{figure}

We still need one more lemma for our proof.

\begin{lemma}
\label{pathlemma} All paths in $G$ have length at most 2.
\end{lemma}

\begin{proof}
We prove this lemma by contradiction. Suppose we can have a path of length 3
or more. To assist us, let us place our points on a cartesian coordinate
system with our diameter $xy$ relabeled as the points $(0,0)$ and $(r,0)$,
furthermore, assume $p,q\geq0$ and that the four vertices of the path of length $3$ are $(p,-q)$, $(q,p)$, $(r-p,q-r)$, and $(r-q,r-p)$. Our aim is to show that the distance between
$(r-q,r-p)$ and $(r-p,q-r)$ contradicts that $r$ is the diameter of $P$. Now,
if paths of length 3 were possible, then the distance between every pair of
points in Figure \ref{Fig: lemma56}(b) must be less than or equal to $r$.
Since $d((p,-q),(q,p))\leq r$ then $p^{2}+q^{2}\leq r^{2}/2$.

Now let us analyze the square of the distance from $(r-q,r-p)$ to $(r-p,q-r)$. Because $2(p^2+q^2)\geq (p+q)^2$, it follows that
\begin{align*}
d^{2}((r-q,r-p),(r-p,q-r))  &  =(-q+p)^{2}+(2r-p-q)^{2}\\
&  =4r^{2}-4r(p+q)+2(p^{2}+q^{2})\\
& \geq 4r^{2}-4\sqrt{2}r\sqrt{p^2+q^2}+2(p^{2}+q^{2})=\left(2r-\sqrt{2(p^2+q^2)}\right)^2.
\end{align*}
But $\sqrt{2(p^2+q^2)} \leq r$, so $(2r-\sqrt{2(p^2+q^2)})\geq r$ and thus
\[
d^{2}((r-q,r-p),(r-p,q-r))\geq r^{2}.
\]
Equality occur if and only if
$p=r/2$ and $q=r/2$; otherwise, $d((r-q,r-p),(r-p,q-r))$ is strictly
greater than $r$, contradicting the fact that the diameter of $P$ is $r$.
Therefore if $p\neq r/2$ or $q\neq r/2$ then there is no path of length
3. In the case that $p=r/2$ and $q=r/2$ the points $(q,p)$ and $(r-q,r-p)$ become the same and so do the points $(p,-q)$ and $(r-p,q-r)$. Thus we are left with a path of length 1.
\end{proof}

It follows from Lemmas \ref{deglemma} and \ref{pathlemma} that all paths of
length 2 are disjoint. In other words, $G$ is the union of disjoint paths of
length less than or equal to 2. Let $a$ denote the number of paths of length 2
and $b$ denote the number of paths of length 1, then
\[
\left\vert E(G)\right\vert =2a+b\text{ \textup{and} }3a+2b\leq n-2.
\]
Recall from Lemma \ref{inequalitylemma} that either $\deg_{\pi/2}(x)+\deg_{\pi/2}(y)=\left\vert E(G)\right\vert$ or $\deg_{\pi/2}(x)+\deg_{\pi/2}(y)=\left\vert E(G)\right\vert + 1$.  If $\deg_{\pi/2}(x)+\deg_{\pi/2}(y)=\left\vert E(G)\right\vert$, then
\[
2\left\vert E(G)\right\vert =4a+2b\leq n-2+a\leq n-2+\frac{n-2}{3},\]
so $\deg_{\pi/2}(x)+\deg_{\pi/2}(y)=\left\vert E(G)\right\vert \leq\frac{2}{3}\left(  n-2\right).$
  Moreover, if $\deg_{\pi/2}(x)+\deg_{\pi/2}(y)=\left\vert E(G)\right\vert +1$,
then $b\geq1$ and we get a minor improvement,
\[
2\left\vert E(G)\right\vert =4a+2b\leq n-2+a\leq n-4+\frac{n-2}{3},
\]
so $\deg_{\pi/2}(x)+\deg_{\pi/2}(y)=\left\vert E(G)\right\vert +1\leq \left(  2n-7\right)/3 < \frac
{2}{3}\left(  n-2\right) $.

We are now ready to put everything together. Between the two points $x$ and
$y$, we derived the following bounds:
\begin{align*}
\deg_{\pi/2}(x)+\deg_{\pi/2}(y)  &  \leq\frac{2}{3}(n-2),\\
\deg_{\pi/4}^{+}(x)+\deg_{\pi/4}^{+}(y)  &  \leq(n-1)\text{, and}\\
\deg_{\pi/4}^{-}(x)+\deg_{\pi/4}^{-}(y)  &  \leq(n-1)\text{.
\end{align*}
Because the degree of a point must take on an integer value, it must be the
case that either $x$ or $y$ satisfies $\deg_{\pi/2}+\deg_{\pi/4}^{+}+\deg
_{\pi/4}^{-}\leq\left\lfloor (4n-5)/3\right\rfloor $.
\end{proof}

\section{Small Cases\label{sec: small cases}}

In this section we determine the exact values of $S_{\triangle}(n)$ when $3\leq
n\leq9$.

\begin{theorem}
\label{smallcases} For $3\leq n\leq9$, $S_{\triangle}(3)=1$, $S_{\triangle
}(4)=4$, $S_{\triangle}(5)=8$, $S_{\triangle}(6)=11$, $S_{\triangle}(7)=15$,
$S_{\triangle}(8)=20$, and $S_{\triangle}(9)=28$.
\end{theorem}

\begin{figure}[h]
\begin{center}
\includegraphics[
height=2.75in ] {optimalsets.eps}
\caption{Optimal sets achieving equality for $S_{\triangle}(n)$.
\label{Fig: optimal}
\end{center}
\end{figure}

\begin{proof}
We begin with $n=3$. Since $3$ points uniquely determine a triangle, and there is an \irt$\:$with 3 points (Figure \ref{Fig: smallcases}(a)), this
situation becomes trivial and we therefore conclude that
$S_{\triangle}(3)=1.$

Now let $n=4$. In Figure \ref{Fig: smallcases}(b) we show a
point-set $P$ such that $S_{\triangle}(P)=4$. This implies that
$S_{\triangle}(4)\geq4$. However, $S_{\triangle}(4)$ is also bounded
above by $\tbinom{4}{3}=4$. Hence, $S_{\triangle}(4)=4$.

To continue with the proof for the remaining values of $n$, we need the
following two lemmas.

\begin{lemma}
\label{p=4} Suppose $|P|=4$ and $S_{\triangle}(P)\geq2$. The sets in Figure
\ref{Fig: smallcases}(b)--(e), not counting symmetric repetitions, are the
only possibilities for such a set $P$.
\end{lemma}

\begin{proof}
Having $S_{\triangle}(P)\geq2$ implies that we must always have more
than one ${\mathsf{IRT}}$ in $P$. Hence, we can begin with a single
${\mathsf{IRT}}$ and examine the possible ways of adding a point and
producing more ${\mathsf{IRT}}$s. We accomplish this task in Figure
\ref{Fig: smallcases}(a). The 10 numbers in the figure indicate the
location of a point, and the total number of ${\mathsf{IRT}}$s after
its addition to the set of black dots. All other locations not
labeled with a number do not increase the number of
${\mathsf{IRT}}$s. Therefore, except for symmetries, all the
possibilities for $P$ are shown in Figures \ref{Fig:
smallcases}(b)--(e).
\end{proof}

\begin{figure}[ph]
\centering \includegraphics[height = 7.5in]{smallcases1.eps}
\caption{{}Proof of Theorem 5. Each circle with a number indicates
the location of a point and the total number of ${\mathsf{IRT}}$s
resulting from its addition to the base set of black dots.
\label{Fig: smallcases
\end{figure}

\begin{lemma}
\label{sumlemma} Let $P$ be a finite set with $|P|=n$. Suppose that
$S_{\triangle}(A)\leq b$ for all $A\subseteq P$ with $|A|=k$. Then
\[
S_{\triangle}(P)\leq\left\lfloor \frac{n\left(  n-1\right)  \left(
n-2\right)  b}{k\left(  k-1\right)  \left(  k-2\right)  }\right\rfloor .
\]

\end{lemma}

\begin{proof}
Suppose that within $P$, every $k$-point configuration contains at most $b$
${\mathsf{IRT}}$s. The number of ${\mathsf{IRT}}$s in $P$ can then be counted
by adding all the ${\mathsf{IRT}}$s in every $k$-point subset of $P$. However,
in doing so, we end up counting a fixed ${\mathsf{IRT}}$ exactly $\tbinom
{n-3}{k-3}$ times. Because $S_{\triangle}(A)\leq b$ we get,
\[
\binom{n-3}{k-3}S_{\triangle}(P) = \sum_{\substack{A\subseteq P\\\left\vert A\right\vert
=k}}S_{\triangle}(A)\leq\binom{n}{k}b.
\]
Notice that $S_{\triangle}(P)$ can only take on integer values so,
\[
S_{\triangle}(P)\leq\left\lfloor \frac{\binom{n}{k}b}{\binom{n-3}{k-3
}\right\rfloor =\left\lfloor \frac{n\left(  n-1\right)  \left(  n-2\right)
b}{k\left(  k-1\right)  \left(  k-2\right)  }\right\rfloor .\qedhere
\]
\end{proof}

Now suppose $|P|=5$. If $S_{\triangle}(A)\leq1$ for all $A\subseteq P$ with
$|A|=4$, then by Lemma \ref{sumlemma}, $S_{\triangle}(P)\leq2$. Otherwise, by
Lemma \ref{p=4}, $P$ must contain one of the 4 sets shown in Figures
\ref{Fig: smallcases}(b)--\ref{Fig: smallcases}(e). The result now follows by examining the
possibilities for producing more ${\mathsf{IRT}}$s by placing a fifth point in
the 4 distinct sets. In Figures \ref{Fig: smallcases}(b),
\ref{Fig: smallcases}(c), \ref{Fig: smallcases}(d), and \ref{Fig: smallcases
(e) we accomplish this task. In the same way as we did in Lemma \ref{p=4},
every number in a figure indicates the location of a point, and the total number of
${\mathsf{IRT}}$s after its addition to the set of black dots. It
follows that the maximum value achieved by placing a fifth point is $8$ and so
$S_{\triangle}(5)=8$. The point-set that uniquely achieves equality is shown
in Figure \ref{Fig: smallcases}(f). Moreover, there is exactly one set $P$
with $S_{\triangle}(P)=6$ (shown in Figure \ref{Fig: smallcases}(g)), and two sets $P$ with $S_{\triangle}(P)=5$
(Figures \ref{Fig: smallcases}(h) and \ref{Fig: smallcases}(i)).

Now suppose $|P|=6$. If $S_{\triangle}(A)\leq4$ for all $A\subseteq P$ with
$|A|=5$, then by Lemma \ref{sumlemma}, $S_{\triangle}(P)\leq8$. Otherwise, $P$
must contain one of the sets in Figures \ref{Fig: smallcases}(f)--\ref{Fig: smallcases}(i). We now check all possibilities for adding more
${\mathsf{IRT}}$s by joining a sixth point to our 4 distinct sets. This is
shown in Figures \ref{Fig: smallcases}(f)--\ref{Fig: smallcases}(i). It follows that the maximum
value achieved is $11$ and so $S_{\triangle}(6)=11$. The point-set that
uniquely achieves equality is shown in Figure \ref{Fig: smallcases}(j). Also,
except for symmetries, there are exactly 3 sets $P$ with $S_{\triangle}(P)=10$
(Figures \ref{Fig: smallcases}(k)--\ref{Fig: smallcases}(m)) and only one set $P$ with
$S_{\triangle}(P)=9$ (Figure \ref{Fig: smallcases}(n)).

Now suppose $|P|=7$. If $S_{\triangle}(A)\leq8$ for all $A\subseteq P$ with
$|A|=6$, then by the Lemma \ref{sumlemma}, $S_{\triangle}(P)\leq14$.
Otherwise, $P$ must contain one of the sets in Figures \ref{Fig: smallcases
(j)--\ref{Fig: smallcases}(n). We now check all possibilities
for adding more ${\mathsf{IRT}}$s by joining a seventh point to our 5 distinct
configurations. We complete this task in Figures \ref{Fig: smallcases
(j)--\ref{Fig: smallcases}(n). Because the maximum value achieved is $15$, we deduce that
$S_{\triangle}(7)=15$. In this case, there are exactly two point-sets that
achieve 15 ${\mathsf{IRT}}$s.

The proof for the values $n=8$ and $n=9$ follows along the same
lines, but there are many more intermediate sets to be considered.
We omit the details. All optimal sets are shown in Figure \ref{Fig:
optimal}.
\end{proof}

Inspired by our method used to prove exact values of
$S_\triangle(n)$, a computer algorithm was devised to construct the
best 1-point extension of a given base set.  This algorithm,
together with appropriate heuristic choices for some initial sets,
lead to the construction of point sets with many ${\mathsf{IRT}}$s
giving us our best lower bounds for $S_\triangle(n)$ when $10\leq
n\leq25$.  These lower bounds are shown in Table 1 and the
point-sets achieving them in Figure \ref{Fig: bestconst}.

\begin{table}[ph] \centering

\begin{tabular}{||c||c|c|c|c|c|c|c|c||}
\multicolumn{9}{c}{}\\

\hline
$n$ & 10 & 11 & 12 & 13 & 14 & 15 & 16 & 17\\
\hline
$S_{\triangle}(n)\geq$ & 35 & 43 & 52 & 64 & 74 & 85 & 97 & 112\\
\hline
\multicolumn{9}{c}{}\\
\hline
 $n$ & 18 & 19 & 20 & 21 & 22 & 23 & 24 & 25\\
\hline
$S_{\triangle}(n)\geq$ & 124 & 139 & 156 & 176 & 192 & 210 & 229 & 252\\
\hline
\end{tabular}
\caption{Best lower bounds for
$S_\triangle (n).$\label{tab: small values}
\end{table}

\begin{figure}
[pht]
\begin{center}
\includegraphics[
height=1.69in

{bestconstr.eps
\caption{Best constructions $A_{n}$ for $n\leq25$. Each set $A_{n}$
is obtained as the union of the starting set (in white) and the
points with label $\leq n$. The value $S_{\triangle}(A_n)$ is given by
Table
\ref{tab: small values}.
\label{Fig: bestconst
\end{center}
\end{figure}

\bigskip
\noindent \textbf{Acknowledgements.} We thank Virgilio Cerna who, as
part of the CURM mini-grant that supported this project, helped to
implement the program that found the best lower bounds for smaller
values of $n$. We also thank an anonymous referee for some useful
suggestions and improvements to the presentation.