Largest small polygons: A sequential convex optimization approach

Abstract: A small polygon is a polygon of unit diameter. The maximal area of a small polygon with $n=2m$ vertices is not known when $m\ge 7$. Finding the largest small $n$-gon for a given number $n\ge 3$ can be formulated as a nonconvex quadratically constrained quadratic optimization problem. We propose to solve this problem with a sequential convex optimization approach, which is an ascent algorithm guaranteeing convergence to a locally optimal solution. Numerical experiments on polygons with up to $n=128$ sides suggest that the optimal solutions obtained are near-global. Indeed, for even $6 \le n \le 12$, the algorithm proposed in this work converges to known global optimal solutions found in the literature.

\section{Introduction}
The {\em diameter} of a polygon is the largest Euclidean distance between pairs of its vertices. A polygon is said to be {\em small} if its diameter equals one. For a given integer $n \ge 3$, the maximal area problem consists in finding the small $n$-gon with the largest area. The problem was first investigated by Reinhardt~\cite{reinhardt1922} in 1922. He proved that
\begin{itemize}
\item when $n$ is odd, the regular small $n$-gon is the unique optimal solution;
\item when $n=4$, there are infinitely many optimal solutions, including the small square;
\item when $n \ge 6$ is even, the regular small $n$-gon is not optimal.
\end{itemize}

The maximal area is known for even $n \le 12$. In 1961, Bieri~\cite{bieri1961} found the largest small $6$-gon, assuming the existence of an axis of symmetry. In 1975, Graham~\cite{graham1975} independently constructed the same $6$-gon, represented in Figure~\ref{figure:6gon:U6}. In 2002, Audet, Hansen, Messine, and Xiong~\cite{audet2002} combined Graham's strategy with global optimization methods to find the largest small $8$-gon, illustrated in Figure~\ref{figure:8gon:U8}. In 2013, Henrion and Messine~\cite{henrion2013} found the largest small $10$- and $12$-gons by also solving globally a nonconvex quadratically constrained quadratic optimization problem. They also found the largest small axially symmetrical $14$- and $16$-gons. In 2017, Audet~\cite{audet2017} showed that the regular small polygon has the maximal area among all equilateral small polygons. In 2020, Audet, Hansen, and Svrtan~\cite{audet2020} determined analytically the largest small axially symmetrical $8$-gon.

The diameter graph of a small polygon is defined as the graph with the vertices of the polygon, and an edge between two vertices exists only if the distance between these vertices equals one. Graham~\cite{graham1975} conjectured that, for even $n \ge 6$, the diameter graph of a small $n$-gon with maximal area has a cycle of length $n-1$ and one additional edge from the remaining vertex. The case $n=6$ was proven by Graham himself~\cite{graham1975} and the case $n=8$ by Audet, Hansen, Messine, and Xiong~\cite{audet2002}. In 2007, Foster and Szabo~\cite{foster2007} proved Graham's conjecture for all even $n \ge 6$. Figure~\ref{figure:4gon}, Figure~\ref{figure:6gon}, and Figure~\ref{figure:8gon} show diameter graphs of some small polygons. The solid lines illustrate pairs of vertices which are unit distance apart.

In addition to exact results and bounds, uncertified largest small polygons have been obtained both by metaheurisitics and nonlinear optimization. Assuming Graham's conjecture and the existence of an axis of symmetry, Mossinghoff~\cite{mossinghoff2006b} in 2006 constructed large small $n$-gons for even $6 \le n \le 20$. In 2018, using a formulation based on polar coordinates, Pinter~\cite{pinter2018} presented numerical solutions estimates of the maximal area for even $6 \le n \le 80$. However, the solutions obtained by Pinter are not optimal for $n\ge 32$.

The maximal area problem can be formulated as a nonconvex quadratically constrained quadratic optimization problem. In this work, we propose to solve it with a sequential convex optimization approach, also known as the concave-convex procedure~\cite{marks1978,lanckriet2009}. This approach is an ascent algorithm guaranteeing convergence to a locally optimal solution. Numerical experiments on polygons up to $n=128$ sides suggest that the optimal solutions obtained are near-global. Indeed, without assuming Graham's conjecture nor the existence of an axis of symmetry in our quadratic formulation, optimal $n$-gons obtained with the algorithm proposed in this work verify both conditions within the limit of numerical computations. Moreover, for even $6 \le n \le 12$, this algorithm converges to known global optimal solutions. The algorithm is implemented as a MATLAB-based package, OPTIGON, which is available on GitHub~\cite{optigon}. OPTIGON requires that CVX~\cite{cvx2} be installed.

The remainder of this paper is organized as follows. In Section~\ref{sec:ngon}, we recall principal results on largest small polygons. Section~\ref{sec:nqcqo} presents the quadratic formulation of the maximal area problem and the sequential convex optimization approach to solve it. We report in Section~\ref{sec:results} computational results. Section~\ref{sec:conclusion} concludes the paper.

\begin{figure}[h]
	\centering
	\subfloat[$(\geo{R}_4,0.5)$]{
		\begin{tikzpicture}[scale=4]
		\draw[dashed] (0,0) -- (0.5000,0.5000) -- (0,1) -- (-0.5000,0.5000) -- cycle;
		\draw (0,0) -- (0,1);
		\draw (0.5000,0.5000) -- (-0.5000,0.5000);
		\end{tikzpicture}
	}
	\subfloat[$(\geo{R}_3^+,0.5)$]{
		\begin{tikzpicture}[scale=4]
		\draw[dashed] (0.5000,0.8660) -- (0,1) -- (-0.5000,0.8660);
		\draw (0,1) -- (0,0) -- (0.5000,0.8660) -- (-0.5000,0.8660) -- (0,0);
		\end{tikzpicture}
	}
	\caption{Two small $4$-gons $(\geo{P}_4,A(\geo{P}_4))$}
	\label{figure:4gon}
\end{figure}

\begin{figure}[h]
	\centering
	\subfloat[$(\geo{R}_6,0.649519)$]{
		\begin{tikzpicture}[scale=4]
		\draw[dashed] (0,0) -- (0.4330,0.2500) -- (0.4330,0.7500) -- (0,1) -- (-0.4330,0.7500) -- (-0.4330,0.2500) -- cycle;
		\draw (0,0) -- (0,1);
		\draw (0.4330,0.2500) -- (-0.4330,0.7500);
		\draw (0.4330,0.7500) -- (-0.4330,0.2500);
		\end{tikzpicture}
	}
	\subfloat[$(\geo{R}_5^+,0.672288)$]{
		\begin{tikzpicture}[scale=4]
		\draw[dashed] (0,0) -- (0.5000,0.3633) -- (0.3090,0.9511) -- (0,1) -- (-0.3090,0.9511) -- (-0.5000,0.3633) -- cycle;
		\draw (0,1) -- (0,0) -- (0.3090,0.9511) -- (-0.5000,0.3633) -- (0.5000,0.3633) -- (-0.3090,0.9511) -- (0,0);
		\end{tikzpicture}
	}
	\subfloat[$(\geo{U}_6,0.674981)$]{
		\begin{tikzpicture}[scale=4]
		\draw[dashed] (0,0) -- (0.5000,0.4024) -- (0.3438,0.9391) -- (0,1) -- (-0.3438,0.9391) -- (-0.5000,0.4024) -- cycle;
		\draw (0,1) -- (0,0) -- (0.3438,0.9391) -- (-0.5000,0.4024) -- (0.5000,0.4024) -- (-0.3438,0.9391) -- (0,0);
		\end{tikzpicture}
		\label{figure:6gon:U6}
	}
	\caption{Three small $6$-gons $(\geo{P}_6,A(\geo{P}_6))$}
	\label{figure:6gon}
\end{figure}

\begin{figure}[h]
	\centering
	\subfloat[$(\geo{R}_8,0.707107)$]{
		\begin{tikzpicture}[scale=4]
		\draw[dashed] (0,0) -- (0.3536,0.1464) -- (0.5000,0.5000) -- (0.3536,0.8536) -- (0,1) -- (-0.3536,0.8536) -- (-0.5000,0.5000) -- (-0.3536,0.1464) -- cycle;
		\draw (0,0) -- (0,1);
		\draw (0.3536,0.1464) -- (-0.3536,0.8536);
		\draw (0.5000,0.5000) -- (-0.5000,0.5000);
		\draw (0.3536,0.8536) -- (-0.3536,0.1464);
		\end{tikzpicture}
	}
	\subfloat[$(\geo{R}_7^+,0.725320)$]{
		\begin{tikzpicture}[scale=4]
		\draw[dashed] (0,0) -- (0.4010,0.1931) -- (0.5000,0.6270) -- (0.2225,0.9749) -- (0,1) -- (-0.2225,0.9749) -- (-0.5000,0.6270) -- (-0.4010,0.1931) -- cycle;
		\draw (0,1) -- (0,0) -- (0.2225,0.9749) -- (-0.4010,0.1931) -- (0.5000,0.6270) -- (-0.5000,0.6270) -- (0.4010,0.1931) -- (-0.2225,0.9749) -- (0,0);
		\end{tikzpicture}
	}
	\subfloat[$(\geo{U}_8,0.726868)$]{
		\begin{tikzpicture}[scale=4]
		\draw[dashed] (0,0) -- (0.4091,0.2238) -- (0.5000,0.6404) -- (0.2621,0.9650) -- (0,1) -- (-0.2621,0.9650) -- (-0.5000,0.6404) -- (-0.4091,0.2238) -- cycle;
		\draw (0,1) -- (0,0) -- (0.2621,0.9650) -- (-0.4091,0.2238) -- (0.5000,0.6404) -- (-0.5000,0.6404) -- (0.4091,0.2238) -- (-0.2621,0.9650) -- (0,0);
		\end{tikzpicture}
		\label{figure:8gon:U8}
	}
	\caption{Three small $8$-gons $(\geo{P}_8,A(\geo{P}_8))$}
	\label{figure:8gon}
\end{figure}

\section{Largest small polygons}\label{sec:ngon}
Let $A(\geo{P})$ denote the area of a polygon $\geo{P}$. Let $\geo{R}_n$ denote the regular small $n$-gon. We have
\[
A(\geo{R}_n) =
\begin{cases}
\frac{n}{2}\left(\sin \frac{\pi}{n} - \tan \frac{\pi}{2n}\right) &\text{if $n$ is odd,}\\
\frac{n}{8}\sin \frac{2\pi}{n} &\text{if $n$ is even.}\\
\end{cases}
\]
We remark that $A(\geo{R}_n) < A(\geo{R}_{n-1})$ for all even $n\ge 6$~\cite{audet2009}. This suggests that $\geo{R}_n$ does not have maximum area for any even $n\ge 6$. Indeed, when $n$ is even, we can construct a small $n$-gon with a larger area than $\geo{R}_n$ by adding a vertex at distance $1$ along the mediatrix of an angle in $\geo{R}_{n-1}$. We denote this $n$-gon by $\geo{R}_{n-1}^+$ and we have
\[
A(\geo{R}_{n-1}^+) = \frac{n-1}{2} \left(\sin \frac{\pi}{n-1} - \tan \frac{\pi}{2n-2}\right) + \sin \frac{\pi}{2n-2} - \frac{1}{2}\sin \frac{\pi}{n-1}.
\]

\begin{theorem}[Reinhardt~\cite{reinhardt1922}]
For all $n \ge 3$, let $A_n^*$ denote the maximal area among all small $n$-gons and let $\ub{A}_n := \frac{n}{2}\left(\sin \frac{\pi}{n} - \tan \frac{\pi}{2n}\right)$.
\begin{itemize}
\item When $n$ is odd, $A_n^* = \ub{A}_n$ is only achieved by $\geo{R}_n$.
\item $A_4^* = 0.5 < \ub{A}_4$ is achieved by infinitely many $4$-gons, including $\geo{R}_4$ and~$\geo{R}_3^+$ illustrated in Figure~\ref{figure:4gon}.
\item When $n\ge 6$ is even, $A(\geo{R}_n) < A_n^* < \ub{A}_n$.
\end{itemize}
\end{theorem}

The maximal area~$A_n^*$ is known for even $n \le 12$. Using geometric arguments, Graham~\cite{graham1975} determined analytically the largest small $6$-gon, represented in Figure~\ref{figure:6gon:U6}. Its area $A_6^* \approx 0.674981$ is about $3.92\%$ larger than $A(\geo{R}_6) \approx 0.649519$. The approach of Graham, combined with methods of global optimization, has been followed by~\cite{audet2002} to determine the largest small $8$-gon, represented in Figure~\ref{figure:8gon:U8}. Its area $A_8^* \approx 0.726868$ is about $2.79\%$ larger than $A(\geo{R}_8) \approx 0.707107$. Henrion and Messine~\cite{henrion2013} found that $A_{10}^* \approx 0.749137$ and $A_{12}^* \approx 0.760730$.

For all even $n\ge 6$, let $\geo{U}_n$ denote the largest small $n$-gon.
\begin{theorem}[Graham~\cite{graham1975}, Foster and Szabo~\cite{foster2007}]
\label{thm:area:diam}
For even $n \ge 6$, the diameter graph of $\geo{U}_n$ has a cycle of length $n-1$ and one additional edge from the remaining vertex.
\end{theorem}
\begin{conjecture}
\label{thm:area:sym}
For even $n \ge 6$, $\geo{U}_n$ has an axis of symmetry corresponding to the pending edge in its diameter graph.
\end{conjecture}
From Theorem~\ref{thm:area:diam}, we note that $\geo{R}_{n-1}^+$ has the same diameter graph as the largest small $n$-gon $\geo{U}_n$. Conjecture~\ref{thm:area:sym} is only proven for $n=6$ and this is due to Yuan~\cite{yuan2004}. However, the largest small polygons obtained by~\cite{audet2002} and~\cite{henrion2013} are a further evidence that the conjecture may be true.

\section{Nonconvex quadratically constrained quadratic optimization} \label{sec:nqcqo}
We use cartesian coordinates to describe an $n$-gon $\geo{P}_n$, assuming that a vertex $\geo{v}_i$, $i=0,1,\ldots,n-1$, is positioned at abscissa $x_i$ and ordinate $y_i$. Placing the vertex $\geo{v}_0$ at the origin, we set $x_0 = y_0 = 0$. We also assume that the $n$-gon $\geo{P}_n$ is in the half-plane $y\ge 0$ and the vertices $\geo{v}_i$, $i=1,2,\ldots,n-1$, are arranged in a counterclockwise order as illustrated in Figure~\ref{figure:model}, i.e., $y_{i+1}x_i \ge x_{i+1}y_i$ for all $i=1,2,\ldots,n-2$. The maximal area problem can be formulated as follows
\begin{subequations}\label{eq:ngon:area}
	\begin{align}
	\max_{\rv{x},\rv{y},\rv{u}} \quad & \sum_{i=1}^{n-2} u_i\\
	\subj \quad & (x_j - x_i)^2 + (y_j - y_i)^2 \le 1 &\forall 1\le i < j \le n-1,\label{eq:ngon:d}\\
	& x_i^2 + y_i^2 \le 1 &\forall 1 \le i \le n-1,\label{eq:ngon:r}\\
	& y_i \ge 0 &\forall 1 \le i \le n-1,\label{eq:ngon:y}\\
	& 2u_i \le y_{i+1}x_i - x_{i+1}y_i &\forall 1 \le i \le n-2,\label{eq:ngon:u}\\
	& u_i \ge 0 &\forall 1 \le i \le n-2.
	\end{align}
\end{subequations}
At optimality, for all $i=1,2,\ldots,n-2$, $u_i = (y_{i+1}x_i - x_{i+1}y_i)/2$, which corresponds to the area of the triangle $\geo{v}_0\geo{v}_i\geo{v}_{i+1}$.
It is important to note that, unlike what was done in~\cite{audet2002,henrion2013}, this formulation does not make the assumption of Graham's conjecture, nor of the existence of an axis of symmetry.

\begin{figure}[h]
\centering
\begin{tikzpicture}[scale=4]
\draw[dashed] (0,0) node[below]{$\geo{v}_0(0,0)$} -- (0.4370,0.4370) node[right]{$\geo{v}_1(x_1,y_1)$} -- (0.1564,0.9877) node[right]{$\geo{v}_2(x_2,y_2)$} -- (-0.1564,0.9877) node[above]{$\geo{v}_3(x_3,y_3)$} -- (-0.4540,0.8911) node[left]{$\geo{v}_4(x_4,y_4)$} -- (-0.5507,0.2806) node[left]{$\geo{v}_5(x_5,y_5)$} -- cycle;
\draw[->] (-0.25,0)--(0.25,0)node[below]{$x$};
\draw[->] (0,0)--(0,0.5)node[left]{$y$};
\end{tikzpicture}
\caption{Definition of variables: Case of $n=6$ vertices}
\label{figure:model}
\end{figure}

Problem~\eqref{eq:ngon:area} is a nonconvex quadratically constrained quadratic optimization problem and can be reformulated as a difference-of-convex optimization (DCO) problem of the form
\begin{subequations}\label{eq:dco}
	\begin{align}
	\max_{\rv{z}} \quad & g_0(\rv{z}) - h_0(\rv{z})\\
	\subj \quad& g_i(\rv{z}) - h_i(\rv{z}) \ge 0 &\forall 1 \le i \le m,
	\end{align}
\end{subequations}
where $g_0,\ldots,g_m$ and $h_0,\ldots,h_m$ are convex quadratic functions. We note that the feasible set
\[
\Omega := \{\rv{z} \colon g_i(\rv{z}) - h_i(\rv{z}) \ge 0, i =1,2,\ldots,m\}
\]
is compact with a nonempty interior, which implies that $g_0(\rv{z}) - h_0(\rv{z}) < \infty$ for all $\rv{z} \in \Omega$.

For a fixed $\rv{c}$, we have $\lb{g}_i(\rv{z};\rv{c}) := g_i(\rv{c}) + \nabla g_i(\rv{c})^T (\rv{z} - \rv{c}) \le g_i(\rv{z})$ for all $i=0,1,\ldots,m$. Then the following problem
\begin{subequations}\label{eq:dcocvx}
	\begin{align}
	\max_{\rv{z}} \quad & \lb{g}_0(\rv{z};\rv{c}) - h_0(\rv{z})\\
	\subj \quad& \lb{g}_i(\rv{z};\rv{c}) - h_i(\rv{z}) \ge 0 &\forall 1 \le i \le m
	\end{align}
\end{subequations}
is a convex restriction of the DCO problem~\eqref{eq:dco} as stated by Proposition~\ref{thm:cvxrestr}. Constraint~\eqref{eq:ngon:u} is equivalent to
\[
(y_{i+1}-x_i)^2+(x_{i+1}+y_i)^2+8u_i \le (y_{i+1}+x_i)^2+(x_{i+1}-y_i)^2
\]
for all $i=1,2,\ldots,n-2$. For a fixed $(\rv{a},\rv{b}) \in \mathbb{R}^{n-1} \times \mathbb{R}^{n-1}$, if we replace~\eqref{eq:ngon:u} in~\eqref{eq:ngon:area} by
\[
(y_{i+1}-x_i)^2+(x_{i+1}+y_i)^2+8u_i \le 2(b_{i+1}+a_i)(y_{i+1}+x_i)-(b_{i+1}+a_i)^2
+ 2(a_{i+1}-b_i)(x_{i+1}-y_i)-(a_{i+1}-b_i)^2
\]
for all $i=1,2,\ldots,n-2$, we obtain a convex restriction of the maximal area problem.

\begin{proposition}\label{thm:cvxrestr}
If $\rv{z}$ is a feasible solution of~\eqref{eq:dcocvx} then $\rv{z}$ is a feasible solution of~\eqref{eq:dco}.
\end{proposition}
\begin{proof}
Let $\rv{z}$ be a feasible solution of~\eqref{eq:dcocvx}, i.e., $\lb{g}_i(\rv{z};\rv{c}) - h_i(\rv{z}) \ge 0$ for all $i=1,2,\ldots,m$. Then $g_i(\rv{z}) - h_i(\rv{z}) \ge \lb{g}_i(\rv{z};\rv{c}) - h_i(\rv{z}) \ge 0$ for all $i=1,2,\ldots,m$. Thus, $\rv{z}$ is a feasible solution of~\eqref{eq:dco}.
\end{proof}

\begin{proposition}\label{thm:ascent}
If $\rv{c}$ is a feasible solution of~\eqref{eq:dco} then \eqref{eq:dcocvx} is a feasible problem. Moreover, if $\rv{z}^*$ is an optimal solution of~\eqref{eq:dcocvx} then $g_0(\rv{c}) - h_0(\rv{c}) \le g_0(\rv{z}^*) - h_0(\rv{z}^*)$.
\end{proposition}
\begin{proof}
Let $\rv{c}$ be a feasible solution of~\eqref{eq:dcocvx}, i.e., $g_i(\rv{c}) - h_i(\rv{c}) \ge 0$ for all $i=1,2,\ldots,m$. Then there exists $\rv{z} = \rv{c}$ such that $\lb{g}_i(\rv{c};\rv{c}) - h_i(\rv{c}) = g_i(\rv{c}) - h_i(\rv{c}) \ge 0$ for all $i=1,2,\ldots,m$. Thus, \eqref{eq:dcocvx} is a feasible problem. Moreover, if $\rv{z}^*$ is an optimal solution of~\eqref{eq:dcocvx}, we have $g_0(\rv{c}) - h_0(\rv{c}) = \lb{g}_0(\rv{c};\rv{c}) - h_0(\rv{c}) \le \lb{g}_0(\rv{z}^*;\rv{c}) - h_0(\rv{z}^*) \le g_0(\rv{z}^*) - h_0(\rv{z}^*)$.
\end{proof}

From Proposition~\ref{thm:ascent}, the optimal small $n$-gon $(\rv{x},\rv{y})$ obtained by solving a convex restriction of Problem~\eqref{eq:ngon:area} constructed around a small $n$-gon $(\rv{a},\rv{b})$ has a larger area than this one. Proposition~\ref{thm:local} states that if $(\rv{a},\rv{b})$ is the optimal $n$-gon of the convex restriction constructed around itself, then it is a local optimal $n$-gon for the maximal area problem.

\begin{proposition}\label{thm:local}
Let $\rv{c}$ be a feasible solution of~\eqref{eq:dco}. We suppose that $\lb{\Omega}(\rv{c}) := \{\rv{z}\colon \lb{g}_i(\rv{z};\rv{c}) - h_i(\rv{z}) \ge 0, i =1,2,\ldots,m\}$ satisfies Slater condition. If $\rv{c}$ is an optimal solution of~\eqref{eq:dcocvx} then $\rv{c}$ is a critical point of~\eqref{eq:dco}.
\end{proposition}

\begin{proof}
If $\rv{c}$ is an optimal solution of~\eqref{eq:dcocvx} then there exist $m$ scalars $\mu_1, \mu_2,\ldots,\mu_m$ such that
\[
\begin{aligned}
\nabla\lb{g}_0 (\rv{c};\rv{c}) + \sum_{i=1}^m \mu_i\nabla \lb{g}_i(\rv{c};\rv{c}) &= \nabla h_0(\rv{c}) + \sum_{i=1}^m \mu_i\nabla h_i(\rv{c}),\\
\lb{g}_i(\rv{c};\rv{c}) &\ge h_i(\rv{c}) &\forall i=1,2,\ldots,m,\\
\mu_i &\ge 0 &\forall i=1,2,\ldots,m,\\
\mu_i\lb{g}_i(\rv{c};\rv{c}) &= \mu_i h_i(\rv{c}) &\forall i=1,2,\ldots,m.
\end{aligned}
\]
Since $\lb{g}_i (\rv{c};\rv{c}) = g_i(\rv{c})$ and $\nabla \lb{g}_i (\rv{c};\rv{c}) = \nabla g_i(\rv{c})$ for all $i=0,1,\ldots,m$, we conclude that $\rv{c}$ is a critical point of~\eqref{eq:dco}.
\end{proof}

We propose to solve the DCO problem~\eqref{eq:dco} with a sequential convex optimization approach given in Algorithm~\ref{algo:ccp}, also known as concave-convex procedure. A proof of showing that a sequence $\{\rv{z}_k\}_{k=0}^\infty$ generated by Algorithm~\ref{algo:ccp} converges to a critical point $\rv{z}^*$ of the original DCO problem~\eqref{eq:dco} can be found in~\cite{marks1978,lanckriet2009}.

\begin{algorithm}
	\caption{Sequential convex optimization}
	\label{algo:ccp}
	\begin{algorithmic}[1]
		\STATE Initialization: choose a feasible solution $\rv{z}_0$ and a stopping criteria $\varepsilon > 0$.
		\STATE $\rv{z}_1 \in \arg\max \{\lb{g}_0(\rv{z};\rv{z}_0) - h_0(\rv{z})\colon \lb{g}_i(\rv{z};\rv{z}_0) - h_i(\rv{z}) \ge 0, i =1,2,\ldots,m\}$
		\STATE $k := 1$
		\WHILE{$\frac{\|\rv{z}_k - \rv{z}_{k-1}\|}{\|\rv{z}_k\|} > \varepsilon$}
		\STATE $\rv{z}_{k+1} \in \arg\max \{\lb{g}_0(\rv{z};\rv{z}_k) - h_0(\rv{z})\colon \lb{g}_i(\rv{z};\rv{z}_k) - h_i(\rv{z}) \ge 0, i =1,2,\ldots,m\}$
		\STATE $k := k+1$
		\ENDWHILE
	\end{algorithmic}
\end{algorithm}

\section{Computational results}\label{sec:results}
Problem~\eqref{eq:ngon:area} was solved in MATLAB using CVX~2.2 with MOSEK~9.1.9 and \texttt{default precision} (tolerance $\epsilon = 1.49 \times 10^{-8}$). All the computations were carried out on an \texttt{Intel(R) Core(TM) i7-3540M CPU @ 3.00 GHz} computing platform. Algorithm~\ref{algo:ccp} was implemented as a MATLAB package: OPTIGON, which is freely available at \url{https://github.com/cbingane/optigon}. OPTIGON requires that CVX be installed. CVX is a MATLAB-based modeling system for convex
optimization, which turns MATLAB into a modeling language, allowing constraints and objectives to be specified using standard MATLAB expression syntax~\cite{cvx2}.

We chose the following values as initial solution:
\[
\begin{aligned}
a_0 &= 0, &b_0 &= 0,\\
a_i &= \frac{\sin \frac{2i\pi}{n-1}}{2\cos \frac{\pi}{2n-2}} = -a_{n-i}, & b_i &= \frac{1-\cos \frac{2i\pi}{n-1}}{2\cos \frac{\pi}{2n-2}} = b_{n-i} &\forall i=1,\ldots,n/2-1,\\
a_{n/2} &= 0, &b_{n/2} &= 1,
\end{aligned}
\]
which define the $n$-gon $\geo{R}_{n-1}^+$, and the stopping criteria $\varepsilon = 10^{-5}$. Table~\ref{table:area} shows the optimal values $A_n^*$ of the maximal area problem for even numbers $n=6,8,\ldots,128$, along with the areas of the initial $n$-gons $\geo{R}_{n-1}^+$, the best lower bounds $\lb{A}_n$ found in the literature, and the upper bounds~$\ub{A}_n$. We also report the number $k$ of iterations in Algotithm~\ref{algo:ccp} for each~$n$. The results support the following keypoints:
\begin{enumerate}
\item For $6 \le n\le 12$, $\lb{A}_n - A_n^* \le 10^{-8}$, i.e., Algorithm~\ref{algo:ccp} converges to the best known optimal solutions found in the literature.
\item For $32 \le n \le 80$, $\lb{A}_n < A(\geo{R}_{n-1}^+) < A_n^*$, i.e., the solutions obtained by Pinter~\cite{pinter2018} are suboptimal.
\item For all $n$, the solutions obtained with Algorithm~\ref{algo:ccp} verify, within the limit of the numerical computations, Theorem~\ref{thm:area:diam} and Conjecture~\ref{thm:area:sym}, i.e.,
\[
\begin{aligned}
x_{n/2} &=0, &y_{n/2} &=1,\\
\|\geo{v}_{n/2-1}\| &=1, &\|\geo{v}_{n/2+1}\| &=1,\\
\|\geo{v}_{i+n/2}-\geo{v}_i\| &=1, &\|\geo{v}_{i+n/2+1}-\geo{v}_i\| &=1 &\forall i=1,2,\ldots,n/2-2,\\
\|\geo{v}_{n-1}-\geo{v}_{n/2-1}\| &=1,\\
x_{n-i} &=-x_i, &y_{n-i} &= y_i &\forall i=1,2,\ldots,n/2-1.
\end{aligned}
\]
We illustrate the largest small $16$-, $32$- and $64$-gons in Figure~\ref{figure:Un}. Furthermore,  we remark that Theorem~\ref{thm:area:diam} and Conjecture~\ref{thm:area:sym} are verified by each polygon of the sequence generated by Algorithm~\ref{algo:ccp}. All $6$-gons generated by the algorithm are represented in Figure~\ref{figure:ccp:U6} and the coordinates of their vertices are given in Table~\ref{table:ccp:U6}.
\end{enumerate}

\begin{table}[t]
	\footnotesize
	\centering
	\caption{Maximal area problem}
	\label{table:area}
	\resizebox{!}{10cm}{
		\begin{tabular}{@{}rlll|lr@{}}
			\toprule
			$n$ & $A(\geo{R}_{n-1}^+)$ & $\lb{A}_n$ & $\ub{A}_n$ & $A_n^*$ & \# ite. $k$	\\
			\midrule
			6	&	0.6722882584	&	0.6749814429~\cite{bieri1961,graham1975,mossinghoff2006b}	&	0.6961524227	&	0.6749814387	&	5	\\
			8	&	0.7253199909	&	0.7268684828~\cite{audet2002,mossinghoff2006b}	&	0.7350842599	&	0.7268684802	&	10	\\
			10	&	0.7482573378	&	0.7491373459~\cite{henrion2013,mossinghoff2006b}	&	0.7531627703	&	0.7491373454	&	16	\\
			12	&	0.7601970055	&	0.7607298734~\cite{henrion2013,mossinghoff2006b}	&	0.7629992851	&	0.7607298710	&	24	\\
			14	&	0.7671877750	&	0.7675310111~\cite{mossinghoff2006b}	&	0.7689359584	&	0.7675310093	&	33	\\
			16	&	0.7716285345	&	0.7718613220~\cite{mossinghoff2006b}	&	0.7727913493	&	0.7718613187	&	43	\\
			18	&	0.7746235089	&	0.7747881651~\cite{mossinghoff2006b}	&	0.7754356273	&	0.7747881619	&	55	\\
			20	&	0.7767382147	&	0.7768587560~\cite{mossinghoff2006b}	&	0.7773275822	&	0.7768587517	&	68	\\
			22	&	0.7782865351	&	0.7783773308~\cite{pinter2018}	&	0.7787276939	&	0.7783773228	&	81	\\
			24	&	0.7794540033	&	0.7795240461~\cite{pinter2018}	&	0.7797927529	&	0.7795240330	&	95	\\
			26	&	0.7803559816	&	0.7804111201~\cite{pinter2018}	&	0.7806217145	&	0.7804111058	&	109	\\
			28	&	0.7810672517	&	0.7811114192~\cite{pinter2018}	&	0.7812795297	&	0.7811114002	&	122	\\
			30	&	0.7816380102	&	0.7816739255~\cite{pinter2018}	&	0.7818102598	&	0.7816739044	&	136	\\
			32	&	0.7821029651	&	0.7818946320~\cite{pinter2018}	&	0.7822446490	&	0.7821325276	&	148	\\
			34	&	0.7824867354	&	0.7823103007~\cite{pinter2018}	&	0.7826046775	&	0.7825113660	&	159	\\
			36	&	0.7828071755	&	0.7826513767~\cite{pinter2018}	&	0.7829063971	&	0.7828279054	&	169	\\
			38	&	0.7830774889	&	0.7829526627~\cite{pinter2018}	&	0.7831617511	&	0.7830950955	&	177	\\
			40	&	0.7833076096	&	0.7832011589~\cite{pinter2018}	&	0.7833797744	&	0.7833226804	&	183	\\
			42	&	0.7835051276	&	0.7834135187~\cite{pinter2018}	&	0.7835674041	&	0.7835181187	&	185	\\
			44	&	0.7836759223	&	0.7835966860~\cite{pinter2018}	&	0.7837300377	&	0.7836871900	&	184	\\
			46	&	0.7838246055	&	0.7837554636~\cite{pinter2018}	&	0.7838719255	&	0.7838344336	&	179	\\
			48	&	0.7839548353	&	0.7838942710~\cite{pinter2018}	&	0.7839964516	&	0.7839634510	&	172	\\
			50	&	0.7840695435	&	0.7840161496~\cite{pinter2018}	&	0.7841063371	&	0.7840771278	&	162	\\
			52	&	0.7841711020	&	0.7841233641~\cite{pinter2018}	&	0.7842037903	&	0.7841778072	&	150	\\
			54	&	0.7842614465	&	0.7842192995~\cite{pinter2018}	&	0.7842906181	&	0.7842674010	&	138	\\
			56	&	0.7843421691	&	0.7843044654~\cite{pinter2018}	&	0.7843683109	&	0.7843474779	&	128	\\
			58	&	0.7844145892	&	0.7843807534~\cite{pinter2018}	&	0.7844381066	&	0.7844193386	&	118	\\
			60	&	0.7844798073	&	0.7844492943~\cite{pinter2018}	&	0.7845010402	&	0.7844840717	&	109	\\
			62	&	0.7845387477	&	0.7845111362~\cite{pinter2018}	&	0.7845579827	&	0.7845425886	&	101	\\
			64	&	0.7845921910	&	0.7834620877~\cite{pinter2018}	&	0.7846096710	&	0.7845956631	&	94	\\
			66	&	0.7846408000	&	0.7845910589~\cite{pinter2018}	&	0.7846567322	&	0.7846439473	&	88	\\
			68	&	0.7846851407	&	0.7846139029~\cite{pinter2018}	&	0.7846997026	&	0.7846880001	&	82	\\
			70	&	0.7847256986	&	0.7846403575~\cite{pinter2018}	&	0.7847390429	&	0.7847283036	&	77	\\
			72	&	0.7847628920	&	0.7847454020~\cite{pinter2018}	&	0.7847751508	&	0.7847652718	&	72	\\
			74	&	0.7847970830	&	0.7845564840~\cite{pinter2018}	&	0.7848083708	&	0.7847992622	&	68	\\
			76	&	0.7848285863	&	0.7847585719~\cite{pinter2018}	&	0.7848390031	&	0.7848305850	&	64	\\
			78	&	0.7848576763	&	0.7845160579~\cite{pinter2018}	&	0.7848673094	&	0.7848595143	&	61	\\
			80	&	0.7848845934	&	0.7848252941~\cite{pinter2018}	&	0.7848935195	&	0.7848862871	&	58	\\
			82	&	0.7849095487	&	--	&	0.7849178354	&	0.7849111119	&	55	\\
			84	&	0.7849327284	&	--	&	0.7849404352	&	0.7849341725	&	52	\\
			86	&	0.7849542969	&	--	&	0.7849614768	&	0.7849556352	&	50	\\
			88	&	0.7849744002	&	--	&	0.7849811001	&	0.7849756425	&	48	\\
			90	&	0.7849931681	&	--	&	0.7849994298	&	0.7849943223	&	46	\\
			92	&	0.7850107163	&	--	&	0.7850165772	&	0.7850117894	&	44	\\
			94	&	0.7850271482	&	--	&	0.7850326419	&	0.7850281477	&	42	\\
			96	&	0.7850425565	&	--	&	0.7850477130	&	0.7850434878	&	40	\\
			98	&	0.7850570245	&	--	&	0.7850618708	&	0.7850578951	&	39	\\
			100	&	0.7850706272	&	--	&	0.7850751877	&	0.7850714422	&	38	\\
			102	&	0.7850834323	&	--	&	0.7850877290	&	0.7850841941	&	36	\\
			104	&	0.7850955008	&	--	&	0.7850995538	&	0.7850962152	&	35	\\
			106	&	0.7851068883	&	--	&	0.7851107156	&	0.7851075587	&	34	\\
			108	&	0.7851176450	&	--	&	0.7851212630	&	0.7851182747	&	33	\\
			110	&	0.7851278167	&	--	&	0.7851312404	&	0.7851284086	&	32	\\
			112	&	0.7851374450	&	--	&	0.7851406881	&	0.7851380017	&	31	\\
			114	&	0.7851465680	&	--	&	0.7851496430	&	0.7851470916	&	30	\\
			116	&	0.7851552203	&	--	&	0.7851581386	&	0.7851557129	&	29	\\
			118	&	0.7851634339	&	--	&	0.7851662060	&	0.7851639010	&	29	\\
			120	&	0.7851712379	&	--	&	0.7851738734	&	0.7851716781	&	28	\\
			122	&	0.7851786591	&	--	&	0.7851811668	&	0.7851790741	&	27	\\
			124	&	0.7851857221	&	--	&	0.7851881101	&	0.7851861129	&	26	\\
			126	&	0.7851924497	&	--	&	0.7851947255	&	0.7851928211	&	26	\\
			128	&	0.7851988626	&	--	&	0.7852010332	&	0.7851992126	&	25	\\
			\bottomrule
		\end{tabular}
	}
\end{table}

\begin{figure}
	\centering
	\subfloat[$(\geo{U}_{16},0.771861)$]{
	\begin{tikzpicture}[scale=5]
	\draw[dashed] (0,0) -- (0.2163,0.0539) -- (0.3801,0.1794) -- (0.4793,0.3573) -- (0.5000,0.5595) -- (0.4390,0.7532) -- (0.3070,0.9060) -- (0.1320,0.9912) -- (0,1) -- (-0.1320,0.9912) -- (-0.3070,0.9060) -- (-0.4390,0.7532) -- (-0.5000,0.5595) -- (-0.4793,0.3573) -- (-0.3801,0.1794) -- (-0.2163,0.0539) -- cycle;
	\draw (0,0)--(0,1);
	\draw (0,0)--(0.1320,0.9912);\draw (0,0)--(-0.1320,0.9912);
	\draw (0.2163,0.0539)--(-0.1320,0.9912);\draw (0.2163,0.0539)--(-0.3070,0.9060);
	\draw (0.3801,0.1794)--(-0.3070,0.9060);\draw (0.3801,0.1794)--(-0.4390,0.7532);
	\draw (0.4793,0.3573)--(-0.4390,0.7532);\draw (0.4793,0.3573)--(-0.5000,0.5595);
	\draw (0.5000,0.5595)--(-0.5000,0.5595);\draw (0.5000,0.5595)--(-0.4793,0.3573);
	\draw (0.4390,0.7532)--(-0.4793,0.3573);\draw (0.4390,0.7532)--(-0.3801,0.1794);
	\draw (0.3070,0.9060)--(-0.3801,0.1794);\draw (0.3070,0.9060)--(-0.2163,0.0539);
	\draw (0.1320,0.9912)--(-0.2163,0.0539);
	\end{tikzpicture}
}
\subfloat[$(\geo{U}_{32},0.782133)$]{
	\begin{tikzpicture}[scale=5]
	\draw[dashed] (0,0) -- (0.1083,0.0131) -- (0.2043,0.0450) -- (0.2910,0.0947) -- (0.3661,0.1606) -- (0.4266,0.2401) -- (0.4702,0.3301) -- (0.4950,0.4271) -- (0.5000,0.5271) -- (0.4850,0.6261) -- (0.4507,0.7200) -- (0.3984,0.8052) -- (0.3302,0.8783) -- (0.2491,0.9363) -- (0.1587,0.9768) -- (0.0654,0.9979) -- (0,1) -- (-0.0654,0.9979) -- (-0.1587,0.9768) -- (-0.2491,0.9363) -- (-0.3302,0.8783) -- (-0.3984,0.8052) -- (-0.4507,0.7200) -- (-0.4850,0.6261) -- (-0.5000,0.5271) -- (-0.4950,0.4271) -- (-0.4702,0.3301) -- (-0.4266,0.2401) -- (-0.3661,0.1606) -- (-0.2910,0.0947) -- (-0.2043,0.0450) -- (-0.1083,0.0131) -- cycle;
	\draw (0,0)--(0,1);
	\draw (0,0)--(0.0654,0.9979);\draw (0,0)--(-0.0654,0.9979);
	\draw (0.1083,0.0131)--(-0.0654,0.9979);\draw (0.1083,0.0131)--(-0.1587,0.9768);
	\draw (0.2043,0.0450)--(-0.1587,0.9768);\draw (0.2043,0.0450)--(-0.2491,0.9363);
	\draw (0.2910,0.0947)--(-0.2491,0.9363);\draw (0.2910,0.0947)--(-0.3302,0.8783);
	\draw (0.3661,0.1606)--(-0.3302,0.8783);\draw (0.3661,0.1606)--(-0.3984,0.8052);
	\draw (0.4266,0.2401)--(-0.3984,0.8052);\draw (0.4266,0.2401)--(-0.4507,0.7200);
	\draw (0.4702,0.3301)--(-0.4507,0.7200);\draw (0.4702,0.3301)--(-0.4850,0.6261);
	\draw (0.4950,0.4271)--(-0.4850,0.6261);\draw (0.4950,0.4271)--(-0.5000,0.5271);
	\draw (0.5000,0.5271)--(-0.5000,0.5271);\draw (0.5000,0.5271)--(-0.4950,0.4271);
	\draw (0.4850,0.6261)--(-0.4950,0.4271);\draw (0.4850,0.6261)--(-0.4702,0.3301);
	\draw (0.4507,0.7200)--(-0.4702,0.3301);\draw (0.4507,0.7200)--(-0.4266,0.2401);
	\draw (0.3984,0.8052)--(-0.4266,0.2401);\draw (0.3984,0.8052)--(-0.3661,0.1606);
	\draw (0.3302,0.8783)--(-0.3661,0.1606);\draw (0.3302,0.8783)--(-0.2910,0.0947);
	\draw (0.2491,0.9363)--(-0.2910,0.0947);\draw (0.2491,0.9363)--(-0.2043,0.0450);
	\draw (0.1587,0.9768)--(-0.2043,0.0450);\draw (0.1587,0.9768)--(-0.1083,0.0131);
	\draw (0.0654,0.9979)--(-0.1083,0.0131);
	\end{tikzpicture}
}
\subfloat[$(\geo{U}_{64},0.784596)$]{
	\begin{tikzpicture}[scale=5]
	\draw[dashed] (0,0) -- (0.0531,0.0031) -- (0.1018,0.0108) -- (0.1492,0.0231) -- (0.1953,0.0400) -- (0.2398,0.0615) -- (0.2820,0.0874) -- (0.3216,0.1174) -- (0.3581,0.1513) -- (0.3911,0.1887) -- (0.4201,0.2291) -- (0.4451,0.2723) -- (0.4656,0.3178) -- (0.4815,0.3650) -- (0.4926,0.4136) -- (0.4988,0.4631) -- (0.5000,0.5129) -- (0.4963,0.5627) -- (0.4876,0.6118) -- (0.4741,0.6598) -- (0.4559,0.7062) -- (0.4332,0.7506) -- (0.4061,0.7924) -- (0.3750,0.8314) -- (0.3403,0.8670) -- (0.3022,0.8990) -- (0.2612,0.9270) -- (0.2178,0.9507) -- (0.1725,0.9700) -- (0.1257,0.9846) -- (0.0783,0.9944) -- (0.0319,0.9995) -- (0,1) -- (-0.0319,0.9995) -- (-0.0783,0.9944) -- (-0.1257,0.9846) -- (-0.1725,0.9700) -- (-0.2178,0.9507) -- (-0.2612,0.9270) -- (-0.3022,0.8990) -- (-0.3403,0.8670) -- (-0.3750,0.8314) -- (-0.4061,0.7924) -- (-0.4332,0.7506) -- (-0.4559,0.7062) -- (-0.4741,0.6598) -- (-0.4876,0.6118) -- (-0.4963,0.5627) -- (-0.5000,0.5129) -- (-0.4988,0.4631) -- (-0.4926,0.4136) -- (-0.4815,0.3650) -- (-0.4656,0.3178) -- (-0.4451,0.2723) -- (-0.4201,0.2291) -- (-0.3911,0.1887) -- (-0.3581,0.1513) -- (-0.3216,0.1174) -- (-0.2820,0.0874) -- (-0.2398,0.0615) -- (-0.1953,0.0400) -- (-0.1492,0.0231) -- (-0.1018,0.0108) -- (-0.0531,0.0031) -- cycle;
	\draw (0,0)--(0,1);
	\draw (0,0)--(0.0319,0.9995);\draw (0,0)--(-0.0319,0.9995);
	\draw (0.0531,0.0031)--(-0.0319,0.9995);\draw (0.0531,0.0031)--(-0.0783,0.9944);
	\draw (0.1018,0.0108)--(-0.0783,0.9944);\draw (0.1018,0.0108)--(-0.1257,0.9846);
	\draw (0.1492,0.0231)--(-0.1257,0.9846);\draw (0.1492,0.0231)--(-0.1725,0.9700);
	\draw (0.1953,0.0400)--(-0.1725,0.9700);\draw (0.1953,0.0400)--(-0.2178,0.9507);
	\draw (0.2398,0.0615)--(-0.2178,0.9507);\draw (0.2398,0.0615)--(-0.2612,0.9270);
	\draw (0.2820,0.0874)--(-0.2612,0.9270);\draw (0.2820,0.0874)--(-0.3022,0.8990);
	\draw (0.3216,0.1174)--(-0.3022,0.8990);\draw (0.3216,0.1174)--(-0.3403,0.8670);
	\draw (0.3581,0.1513)--(-0.3403,0.8670);\draw (0.3581,0.1513)--(-0.3750,0.8314);
	\draw (0.3911,0.1887)--(-0.3750,0.8314);\draw (0.3911,0.1887)--(-0.4061,0.7924);
	\draw (0.4201,0.2291)--(-0.4061,0.7924);\draw (0.4201,0.2291)--(-0.4332,0.7506);
	\draw (0.4451,0.2723)--(-0.4332,0.7506);\draw (0.4451,0.2723)--(-0.4559,0.7062);
	\draw (0.4656,0.3178)--(-0.4559,0.7062);\draw (0.4656,0.3178)--(-0.4741,0.6598);
	\draw (0.4815,0.3650)--(-0.4741,0.6598);\draw (0.4815,0.3650)--(-0.4876,0.6118);
	\draw (0.4926,0.4136)--(-0.4876,0.6118);\draw (0.4926,0.4136)--(-0.4963,0.5627);
	\draw (0.4988,0.4631)--(-0.4963,0.5627);\draw (0.4988,0.4631)--(-0.5000,0.5129);
	\draw (0.5000,0.5129)--(-0.5000,0.5129);\draw (0.5000,0.5129)--(-0.4988,0.4631);
	\draw (0.4963,0.5627)--(-0.4988,0.4631);\draw (0.4963,0.5627)--(-0.4926,0.4136);
	\draw (0.4876,0.6118)--(-0.4926,0.4136);\draw (0.4876,0.6118)--(-0.4815,0.3650);
	\draw (0.4741,0.6598)--(-0.4815,0.3650);\draw (0.4741,0.6598)--(-0.4656,0.3178);
	\draw (0.4559,0.7062)--(-0.4656,0.3178);\draw (0.4559,0.7062)--(-0.4451,0.2723);
	\draw (0.4332,0.7506)--(-0.4451,0.2723);\draw (0.4332,0.7506)--(-0.4201,0.2291);
	\draw (0.4061,0.7924)--(-0.4201,0.2291);\draw (0.4061,0.7924)--(-0.3911,0.1887);
	\draw (0.3750,0.8314)--(-0.3911,0.1887);\draw (0.3750,0.8314)--(-0.3581,0.1513);
	\draw (0.3403,0.8670)--(-0.3581,0.1513);\draw (0.3403,0.8670)--(-0.3216,0.1174);
	\draw (0.3022,0.8990)--(-0.3216,0.1174);\draw (0.3022,0.8990)--(-0.2820,0.0874);
	\draw (0.2612,0.9270)--(-0.2820,0.0874);\draw (0.2612,0.9270)--(-0.2398,0.0615);
	\draw (0.2178,0.9507)--(-0.2398,0.0615);\draw (0.2178,0.9507)--(-0.1953,0.0400);
	\draw (0.1725,0.9700)--(-0.1953,0.0400);\draw (0.1725,0.9700)--(-0.1492,0.0231);
	\draw (0.1257,0.9846)--(-0.1492,0.0231);\draw (0.1257,0.9846)--(-0.1018,0.0108);
	\draw (0.0783,0.9944)--(-0.1018,0.0108);\draw (0.0783,0.9944)--(-0.0531,0.0031);
	\draw (0.0319,0.9995)--(-0.0531,0.0031);
	\end{tikzpicture}
}
\caption{Three largest small $n$-gons $(\geo{U}_n,A_n^*)$}
\label{figure:Un}
\end{figure}

\begin{figure}[h]
	\centering
	\subfloat[$(\geo{R}_5^+,0.672288)$]{
		\begin{tikzpicture}[scale=4]
			\draw[dashed] (0,0) -- (0.5000,0.3633) -- (0.3090,0.9511) -- (0,1) -- (-0.3090,0.9511) -- (-0.5000,0.3633) -- cycle;
			\draw (0,1) -- (0,0) -- (0.3090,0.9511) -- (-0.5000,0.3633) -- (0.5000,0.3633) -- (-0.3090,0.9511) -- (0,0);
		\end{tikzpicture}
	}
\subfloat[$(\geo{P}_6^1,0.674941)$]{
	\begin{tikzpicture}[scale=4]
		\draw[dashed] (0,0) -- (0.5000,0.3975) -- (0.3397,0.9405) -- (0,1) -- (-0.3397,0.9405) -- (-0.5000,0.3975) -- cycle;
		\draw (0,1) -- (0,0) -- (0.3397,0.9405) -- (-0.5000,0.3975) -- (0.5000,0.3975) -- (-0.3397,0.9405) -- (0,0);
	\end{tikzpicture}
}
\subfloat[$(\geo{P}_6^2,0.674981)$]{
	\begin{tikzpicture}[scale=4]
		\draw[dashed] (0,0) -- (0.5000,0.4018) -- (0.3433,0.9392) -- (0,1) -- (-0.3433,0.9392) -- (-0.5000,0.4024) -- cycle;
		\draw (0,1) -- (0,0) -- (0.3433,0.9392) -- (-0.5000,0.4018) -- (0.5000,0.4018) -- (-0.3433,0.9392) -- (0,0);
	\end{tikzpicture}
}\\
	\subfloat[$(\geo{P}_6^3,0.674981)$]{
		\begin{tikzpicture}[scale=4]
			\draw[dashed] (0,0) -- (0.5000,0.4023) -- (0.3437,0.9391) -- (0,1) -- (-0.3437,0.9391) -- (-0.5000,0.4023) -- cycle;
			\draw (0,1) -- (0,0) -- (0.3437,0.9391) -- (-0.5000,0.4023) -- (0.5000,0.4023) -- (-0.3437,0.9391) -- (0,0);
		\end{tikzpicture}
	}
	\subfloat[$(\geo{P}_6^4,0.674981)$]{
		\begin{tikzpicture}[scale=4]
			\draw[dashed] (0,0) -- (0.5000,0.4023) -- (0.3438,0.9391) -- (0,1) -- (-0.3438,0.9391) -- (-0.5000,0.4023) -- cycle;
			\draw (0,1) -- (0,0) -- (0.3438,0.9391) -- (-0.5000,0.4023) -- (0.5000,0.4023) -- (-0.3438,0.9391) -- (0,0);
		\end{tikzpicture}
	}
	\subfloat[$(\geo{P}_6^5,0.674981)$]{
		\begin{tikzpicture}[scale=4]
			\draw[dashed] (0,0) -- (0.5000,0.4024) -- (0.3438,0.9391) -- (0,1) -- (-0.3438,0.9391) -- (-0.5000,0.4024) -- cycle;
			\draw (0,1) -- (0,0) -- (0.3438,0.9391) -- (-0.5000,0.4024) -- (0.5000,0.4024) -- (-0.3438,0.9391) -- (0,0);
		\end{tikzpicture}
	}
	\caption{All $6$-gons $(\geo{P}_6^k,A(\geo{P}_6^k))$ generated by Algorithm~\ref{algo:ccp}}
	\label{figure:ccp:U6}
\end{figure}

\begin{table}[t]
	\footnotesize
	\centering
	\caption{Vertices of $6$-gons generated by Algorithm~\ref{algo:ccp}}
	\label{table:ccp:U6}
		\resizebox{\linewidth}{!}{
	\begin{tabular}{@{}l|ccccc|l@{}}
		\toprule
		$6$-gon & \multicolumn{5}{c|}{Coordinates $(x_i,y_i)$} & Area \\
		\cmidrule{2-6} & $(x_1,y_1)$ & $(x_2,y_2)$ & $(x_3,y_3)$ &	$(x_4,y_4)$ & $(x_5,y_5)$	&\\
		\midrule
		$\geo{R}_5^+$ & $(0.500000,0.363271)$ & $(0.309017,0.951057)$ & $(0.000000,1.000000)$ &	$(-0.309017,0.951057)$ & $(-0.500000,0.363271)$	&	$0.6722882584$	\\
		$\geo{P}_6^1$ & $(0.500000,0.397460)$ & $(0.339680,0.940541)$ & $(0.000000,1.000000)$ &	$(-0.339680,0.940541)$ & $(-0.500000,0.397460)$	&	$0.6749414624$	\\
		$\geo{P}_6^2$ & $(0.500000,0.401764)$ & $(0.343285,0.939231)$ & $(0.000000,1.000000)$ &	$(-0.343285,0.939231)$ & $(-0.500000,0.401764)$	&	$0.6749808685$	\\
		$\geo{P}_6^3$ & $(0.500000,0.402283)$ & $(0.343715,0.939074)$ & $(0.000000,1.000000)$ &	$(-0.343715,0.939074)$ & $(-0.500000,0.402283)$	&	$0.6749814310$	\\
		$\geo{P}_6^4$ & $(0.500000,0.402345)$ & $(0.343766,0.939055)$ & $(0.000000,1.000000)$ &	$(-0.343766,0.939055)$ & $(-0.500000,0.402345)$	&	$0.6749814386$	\\
		$\geo{P}_6^5$ & $(0.500000,0.402352)$ & $(0.343773,0.939053)$ & $(0.000000,1.000000)$ &	$(-0.343773,0.939053)$ & $(-0.500000,0.402352)$	&	$0.6749814387$	\\
		\bottomrule
\end{tabular}
	}
\end{table}

\section{Conclusion}\label{sec:conclusion}
We proposed a sequential convex optimization approach to find the largest small $n$-gon for a given even number $n\ge 6$, which is formulated as a nonconvex quadratically constrained quadratic optimization problem. The algorithm, also known as the concave-convex procedure, guarantees convergence to a locally optimal solution.

Without assuming Graham's conjecture nor the existence of an axis of symmetry in our quadratic formulation, numerical experiments on polygons with up to $n=128$ sides showed that each optimal $n$-gon obtained with the algorithm proposed verifies both conditions within the limitation of the numerical computations. Futhermore, for even $6\le n\le 12$, the $n$-gons obtained correspond to the known largest small $n$-gons.

\section*{Acknowledgements}
The author thanks Charles Audet, Professor at Polytechnique Montreal, for helpful discussions on largest small polygons and helpful comments on early drafts of this paper.

\bibliographystyle{ieeetr}


Structural theorems on the distance sets over finite fields

Abstract: Let $\mathbb{F}_q$ be a finite field of order $q$. Iosevich and Rudnev (2005) proved that for any set $A\subset \mathbb{F}_q^d$, if $|A|\gg q^{\frac{d+1}{2}}$, then the distance set $\Delta(A)$ contains a positive proportion of all distances. Although this result is sharp in odd dimensions, it is conjectured that the right exponent should be $\frac{d}{2}$ in even dimensions. During the last 15 years, only some improvements have been made in two dimensions, and the conjecture is still wide open in higher dimensions. To fill the gap, we need to understand more about the structures of the distance sets, the main purpose of this paper is to provide some structural theorems on the distribution of square and non-square distances.

\section{Introduction}

Let $\mathbb{F}_q$ be a finite field of order $q$ which is a prime power. The distance between two points $x$ and $y$ in the space $\mathbb{F}_q^d$ is defined by \[||x-y||:=(x_1-y_1)^2+\cdots+(x_d-y_d)^2.\]
For $A\subset \mathbb{F}_q^d$, let $\Delta(A)$ denote the set of distances determined by pairs of points in $A$, i.e.
\[\Delta(A)=\{||x-y||\colon x, y\in A\}.\]
Studying the magnitude of $\Delta(E)$ has been received much attention since 2007 due to its connection to the Falconer distance conjecture in Geometric Measure Theory, which says that for any compact set $A\subset \mathbb{R}^d$ of Hausdorff dimension greater than $d/2$, the distance set $\Delta(A)$ is of positive Lebesgue measure. Recent progress on this conjecture can be found in \cite{Du1, Du3, Du2, alex-fal}.

In the finite field setting, Iosevich and Rudnev \cite{IR07} proved that for $A\subset \mathbb{F}_q^d$, if $|A|\ge 4q^{\frac{d+1}{2}}$, then $\Delta(A)=\mathbb{F}_q$. The exponent $\frac{d+1}{2}$ is sharp in odd dimensions, namely, $d\equiv 3\mod 4$ and $q\equiv 1\mod 4,$ or $d\equiv 1\mod 4$, we refer the reader to \cite{HIKR10} for constructions. In even dimensions, it is conjectured that the right exponent should be $\frac{d}{2}$ which is directly in line with the Falconer distance conjecture. In a very recent paper, Murphy, Petridis, Pham, Rudnev, and Stevens \cite{MPT} obtained the exponent $\frac{5}{4}$ in the plane over prime fields, which improves the exponent $\frac{4}{3}$ by Chapman, Erdogan, Hart, Iosevich, and Koh in \cite{CEHIK10}. In particular, they showed that for $A\subset \mathbb{F}_p^2$ with $|A|\gg p^{5/4}$, then there exists $x\in A$ such that
\begin{equation}\label{54}|\Delta_x(A)|\gg p,\end{equation}
where $\Delta_x(A):=\{||x-a||\colon a\in A\}$. This matches the breakthrough dimensional threshold $\frac{5}{4}$ on the Falconer distance conjecture given by Guth, Iosevich, Ou, and Wang in \cite{alex-fal}. For $4p<|A|\le p^{5/4}$, Murphy et al. also proved that there exists $x\in A$ with
\begin{equation}\label{dim}
    |\Delta_x(A)|\gg \frac{|A|^{4/3}}{p^{2/3}}.
\end{equation}
This statement is similar to a result of Liu in \cite{liu} for the continuous setting which states that for any compact set $A\subset \mathbb{R}^2$, if the Hausdorff dimension of $A$ is greater than $1$, then
\[\dim_H(\Delta_x(A))\ge \min \left\{\frac{4}{3}\dim_H(A)-\frac{2}{3}, ~1 \right\},\]
for some $x\in A$. We note that when the dimension of $A$ is very close to $1$, then Shmerkin \cite{hai} obtained better results, namely,
\[\dim_H(\Delta_x(A))\ge \frac{29}{42},\]
and
\[\dim_H(\Delta(A))\ge \frac{40}{57}.\]
Over finite fields, in higher even dimensions or $d\equiv 3\mod 4$ and $q\equiv 3\mod 4$, the best current exponent is still $\frac{d+1}{2}$ due to Iosevich and Rudnev \cite{IR07}, which is far from the conjecture $\frac{d}{2}$. In order make further progress, we need to understand more about structures of the distance sets, and in this paper, we focus on the distribution of pairs of points of square and non-square distances in a given set $A\subset \mathbb{F}_q^d$.

To state our main results, we need the following definition.
\begin{definition} Let $\eta$ denote the quadratic character of $\mathbb F_q$ with $\eta(0)=0.$ For $A\subset \mathbb F_q^d,$ we define
$$  \mathcal{SQ}(A):=|\{(x, y)\in A\times A: \eta(||x-y||)=1\}|,$$
and
$$ \mathcal{ZR}(A):=|\{(x, y)\in A\times A: \eta(||x-y||)=0\}|,$$

as the sets of pairs of square distances and zero-distance, respectively.
\end{definition}

For a given $A\subset \mathbb{F}_q^d$, if we consider the zero distance as a square, then either the number of pairs of square distances or the number of pairs of non-square distances is at least $|A|^2/2$.

In the first theorem, we show that when the size of $A$ is not small, most of the pairs of points in $A$ are of non-square distances. Precisely, we have
\newpage
\begin{theorem}\label{mainN0} Let $A\subset \mathbb F_q^d.$
 \begin{enumerate}
 \item If $d\equiv 3 \mod{4}$ and $ q\equiv 3 \mod{4},$ then
 $$\mathcal{SQ}(A)+\mathcal{ZR}(A) \le \frac{|A|^2}{2} +\frac{|A|^2}{2q}
 - \frac{|A|^2}{2 q^{\frac{d-1}{2}}} - \frac{|A|^2}{2 q^{\frac{d+1}{2}}}+ q^{\frac{d-1}{2}} |A|.$$
 \item If $d\equiv 1 \mod{4},$ or $d\equiv 3 \mod{4}$ and $q\equiv 1 \mod{4},$ then
 $$\mathcal{SQ}(A)+\mathcal{ZR}(A) \le \frac{|A|^2}{2} +\frac{|A|^2}{2q}+ \frac{q^{\frac{d+1}{2}} |A|}{2} -\frac{q^{\frac{d-1}{2}} |A|}{2}.$$
 \item If $d\equiv 2 \mod{4}$ and $ q\equiv 3 \mod{4},$ then
 $$\mathcal{SQ}(A)+\mathcal{ZR}(A) \le \frac{|A|^2}{2} +\frac{|A|^2}{2q}-\frac{|A|^2}{q^{\frac{d}{2}}}+ \frac{q^{\frac{d}{2}} |A|}{2} +\frac{q^{\frac{d-2}{2}}|A|}{2}.$$
 \item If $d\equiv 0 \mod{4},$ or $d\equiv 2 \mod{4}$ and $q\equiv 1 \mod{4},$ then
 $$ \mathcal{SQ}(A)+\mathcal{ZR}(A) \le \frac{|A|^2}{2} +\frac{|A|^2}{2q}+ \frac{q^{\frac{d}{2}} |A|}{2}-\frac{q^{\frac{d-2}{2}}|A|}{2}.$$
 \end{enumerate}
 \end{theorem}

We say that a set $A\subset \mathbb F_q^d$ is a \textit{square distance} set if for all $x,y\in A, ~||x-y||$ is either zero or a square number of $\mathbb F_q.$ It is clear that for such a set, one has $\mathcal{SQ}(A)+ \mathcal{ZR}(A)=|A|^2$ for any square distance set $A$ in $\mathbb F_q^d.$
Hence, if $A\subset \mathbb F_q^d$ is a square distance set, then $|A|^2$ is dominated by the upper bound of $\mathcal{SQ}(A)+ \mathcal{ZR}(A)$ given in Theorem \ref{mainN0}. By solving the inequalities in terms of $|A|$,  we recover the following results of Iosevich, Shparlinski, and Xiong \cite{iosevich}. We also refer the reader to \cite{i1, i2, i3, iosevich} for more discussions and the motivation of this problem.
 \begin{corollary}[Iosevich-Shparlinski-Xiong, \cite{iosevich}]\label{cor:1.3}
 Let $A$  be a square distance set in $\mathbb F_q^d.$
 \begin{enumerate}
 \item If $d\equiv 3 \mod{4}$ and $ q\equiv 3 \mod{4},$ then
 $$|A| \le \frac{2 q^{\frac{d+1}{2}}}{q-1+ (q+1) q^{-\frac{(d-1)}{2}}}.$$

 \item If $d\equiv 1 \mod{4},$ or $d\equiv 3 \mod{4}$ and $q\equiv 1 \mod{4},$ then
 $$ |A|\le q^{\frac{d+1}{2}}.$$
 \item If $d\equiv 2 \mod{4}$ and $ q\equiv 3 \mod{4},$ then
 $$|A| \le q^{\frac{d}{2}}+ \frac{2 (q^{\frac{d}{2}}-q)}{q-1+ 2 q^{-\frac{(d-2)}{2}}}.$$

 \item If $d\equiv 0 \mod{4},$ or $d\equiv 2 \mod{4}$ and $q\equiv 1 \mod{4},$ then
  $$ |A|\le q^{\frac{d}{2}}.$$
 \end{enumerate}
 \end{corollary}

In the next two theorems, we are interested in the distribution of non-zero square distances in a given set $A\subset \mathbb{F}_q^d$.
\begin{theorem}[odd dimensions]\label{mainNOdd} Let $A$ be a subset of $\mathbb F_q^d.$
 \begin{enumerate}
\item Let $d\equiv 3 \mod{4}$ and $ q\equiv 3 \mod{4}.$

 If $|A|\ge (q^{(d+1)/2} +q)/( 1+ q^{-(d-1)/2}),$ then
$$ \mathcal{SQ}(A)\le \frac{|A|^2}{2} + q^{\frac{d-1}{2}} |A| -\frac{|A|^2}{2q}- \frac{|A|^2}{2 q^{\frac{d-1}{2}}} - \frac{|A|^2}{2 q^{\frac{d+1}{2}}}.$$
If $|A|\le (q^{(d+1)/2} +q)/( 1+ q^{-(d-1)/2}),$ then
$$ \mathcal{SQ}(A) \le \frac{|A|^2}{2} + \frac{q^{\frac{d-1}{2}} |A|}{2}
  - \frac{|A|^2}{2 q^{\frac{d-1}{2}}} -\frac{|A|}{2}.$$

  \item  Let $d\equiv 1 \mod{4},$ or $d\equiv 3 \mod{4}$ and $q\equiv 1 \mod{4},$ then
 $$ \mathcal{SQ}(A) \le \frac{|A|^2}{2} - \frac{q^{\frac{d-1}{2}} |A|}{2}
  -\frac{|A|}{2}+ \min\left\{ \frac{q^{\frac{d+1}{2}} |A|}{2},~ \frac{q^{\frac{d-1}{2}} |A|}{2}+ \frac{|A|^2}{2},~\frac{|A|}{2}+ \frac{q^{\frac{d+1}{2}} |A|}{2}-\frac{|A|^2}{2q} \right\}.$$
 \end{enumerate}
 \end{theorem}
 \begin{theorem}[even dimensions] \label{mainNEven} Let $A$ be a subset of $\mathbb F_q^d.$

 \begin{enumerate}
 \item
 If  $d\equiv 2 \mod{4}$ and $ q\equiv 3 \mod{4},$ then

$$ \mathcal{SQ}(A)\le \frac{|A|^2}{2} + \frac{q^{\frac{d}{2}} |A|}{2} -\frac{|A|^2}{2q}- \frac{q^{\frac{d-2}{2}}|A|}{2}.$$

\item Let $d\equiv 0 \mod{4},$ or $d\equiv 2 \mod{4}$ and $q\equiv 1 \mod{4}.$

If $|A|\ge (q^{d/2} +q)/( 1+ q^{-(d-2)/2}),$ then
$$ \mathcal{SQ}(A)\le \frac{|A|^2}{2} + \frac{q^{\frac{d}{2}} |A|}{2}-\frac{|A|^2}{q^{\frac{d}{2}}} -\frac{|A|^2}{2q}+ \frac{q^{\frac{d-2}{2}}|A|}{2}.$$
If $|A|\le (q^{d/2} +q)/( 1+q^{-(d-2)/2}),$ then
$$ \mathcal{SQ}(A) \le \frac{|A|^2}{2} + \frac{q^{\frac{d}{2}} |A|}{2}
  - \frac{|A|^2}{2 q^{\frac{d}{2}}} -\frac{|A|}{2}.$$
\end{enumerate}
\end{theorem}
It has been proved in \cite{iosevich} that Corollary \ref{cor:1.3} (2) and (4) are sharp, so the upper bounds of Theorem \ref{mainN0} (2) and (4) are also best possible. It follows from Corollary \ref{cor:1.3} that if the set of non-zero distances is fully contained in the group of squares, then the size of $A$ can not be bigger than a certain threshold. After posting this paper to Arxiv, Prof. Igor Shparlinski raised the question of studying the case for an arbitrary subgroup of $\mathbb{F}_q\setminus \{0\}$. We hope to address this question in a sequel paper.

\section{Discrete Fourier analysis and preliminary lemmas}
In this section, we recall notations from Discrete Fourier analysis and properties.
Let $f$ be a complex valued function on $\mathbb F_q^n,$ then its Fourier transform denoted by $\widehat{f}$ is defined by
$$ \widehat{f}(m)=q^{-n} \sum_{x\in \mathbb F_q^n} \chi(-m\cdot x) f(x),$$
here $\chi$ is the principal additive character of $\mathbb F_q.$

With this definition, the Fourier inversion theorem reads as
$$ f(x)=\sum_{m\in \mathbb F_q^n} \chi(m\cdot x) \widehat{f}(m),$$
we also have the Plancherel theorem
$$ \sum_{m\in \mathbb F_q^n} |\widehat{f}(m)|^2 =q^{-n}\sum_{x\in \mathbb F_q^n} |f(x)|^2,$$
which can be proved easily by using the following orthogonal property
$$ \sum_{\alpha\in \mathbb F_q^n} \chi(\beta\cdot \alpha)
=\left\{\begin{array}{ll} 0\quad &\mbox{if}\quad \beta\ne (0,\ldots, 0),\\
q^n\quad &\mbox{if}\quad \beta=(0,\ldots,0). \end{array}\right.$$

In this paper, the quadratic character of $\mathbb F_q$ is denoted by $\eta$ with a convention that $\eta(0)=0.$ For $a\in \mathbb F_q^*,$ the Gauss sum $G_a$ is defined by
$$G_a=\sum_{s\in \mathbb F_q^*}\eta(s) \chi(as),$$
which can be rewritten as
$$ G_a=\sum_{s\in \mathbb F_q} \chi(as^2)=\eta(a) G_1.$$
It is not hard to see that $|G_a|=\sqrt{q}$. In the following lemma, we recall the explicit form of the Gauss sum $G_1$ from \cite[Theorem 5.15]{LN97}.
\begin{lemma}\label{ExplicitGauss}
Let $\mathbb F_q$ be a finite field with $ q= p^{\ell},$ where $p$ is an odd prime and $\ell \in {\mathbb N}.$
Then we have
$$G_1= \left\{\begin{array}{ll}  {(-1)}^{\ell-1} q^{\frac{1}{2}} \quad &\mbox{if} \quad p \equiv 1 \mod 4 \\
{(-1)}^{\ell-1} i^\ell q^{\frac{1}{2}} \quad &\mbox{if} \quad p\equiv 3 \mod 4.\end{array}\right. $$
\end{lemma}

\begin{corollary} \label{Corm}Let $n$ be a positive integer.
\begin{enumerate}
\item
If $n\equiv 0 \mod {4}$ and $q\equiv 3 \mod{4},$ then
$\eta(-1)G_1^n= -q^{\frac{n}{2}}.$
\item If $n\equiv 2 \mod{4},$ or $n\equiv 0 \mod{4}$ and $q\equiv 1 \mod{4}$, then
$\eta(-1)G_1^n= q^{\frac{n}{2}}.$
\item If $n\equiv 2 \mod{4}$ and $q\equiv 3 \mod{4}$, then
$ G_1^n= -q^{\frac{n}{2}}.$
\item
If $n\equiv 0 \mod {4},$ or $n\equiv 2 \mod{4}$ and $q\equiv 1 \mod{4},$ then
$G_1^n= q^{\frac{n}{2}}.$
\end{enumerate}
\end{corollary}

The following formula, which can be proved by completing the square and using a change of variables, will be used in our computations below
\begin{equation}\label{ComSqu}
 \sum_{s\in \mathbb F_q} \chi(as^2+bs)= \eta(a)G_1 \chi\left(\frac{b^2}{-4a}\right),\end{equation}
where $a\in \mathbb F_q^*$ and $b\in \mathbb F_q.$

Let $P\in \mathbb F_q[x_1,\ldots,x_n]$ be a polynomial, we define a variety $V_P$ as
$$V_P:=\{x\in \mathbb F_q^n: P(x)=0\}.$$
In the next lemma, we count the number of pairs of points $(x, y)$ in a given set in $\mathbb{F}_q^n$ such that $x-y\in V_P$.

\begin{lemma}\label{AlexF} Let $E$ be a set in $\mathbb{F}_q^n$. Then the number of pairs $(x,y)\in E\times E$ such that $P(x-y)=0$ is equal to
$$ q^{2n}\sum_{m\in \mathbb F_q^{n}} \widehat{V_P}(m)|\widehat{E}(m)|^2.$$
\end{lemma}
\begin{proof}
Let $N$ be the number of pairs $(x,y)$ such that $P(x-y)=0$, i.e.
$$ N=\sum_{x,y\in E} V_P(x-y).$$
By identifying the variety $V_P$ with the indicator function $1_{V_P}$ and using the Fourier inversion formula for the function $V_P(x-y)$ one has
$$ N=\sum_{x,y\in \mathbb F_q^n} E(x)E(y) \sum_{m\in \mathbb F_q^n} \widehat{V_P}(m) \chi(m\cdot (x-y)).$$
Then the lemma follows directly from the orthogonal property.
\end{proof}

As we shall see  in the proofs of our main results, given $A\subset \mathbb F_q^d,$ we shall relate the value $\mathcal{SQ}(A) + \mathcal{ZR}(A)$ to the Fourier decay of the cone in $\mathbb F_q^{d+1}.$
For a positive integer $n\ge 2,$ we recall that the cone $C_n$ is defined as
\begin{equation}\label{conDe}C_n:=\{x\in \mathbb F_q^n: x_n^2=x_1^2+x_2^2+\cdots+ x_{n-1}^2\}.\end{equation}

\begin{definition}
Let $x=(x_1,x_2,\ldots, x_n) \in \mathbb F_q^n.$ We define
$$ ||x||_{C_n}= x_1^2+x_2^2+\cdots+ x_{n-1}^2 - x_n^2.$$
\end{definition}
Using the notation $|| \cdot ||_{C_n}$,  the cone $C_n$ can be written by
$$ C_n=\{x\in \mathbb F_q^n: ||x||_{C_n}=0\}.$$
The next lemma contains the Fourier transform formula for $C_n$ which was computed explicitly in \cite{IMRN, KPP}.
\begin{lemma}\label{FTForm} Let $C_n$ be the cone in $\mathbb F_q^n$ defined in \eqref{conDe}.
Then, for any $m\in \mathbb F_q^n,$ we have
\begin{equation}\label{FFC}\widehat{C_n}(m)=q^{-1}\delta_{0}(m) +q^{-n-1} \eta(-1) G_1^{n} \sum_{s\ne 0} \eta^n(s) \chi\left( \frac{||m||_{C_n}}{-4s}\right).\end{equation}
 \end{lemma}

 \section{Preliminary settings on estimates of $\mathcal{SQ}(A)$ and $\mathcal{SQ}(A)+ \mathcal{ZR}(A)$}
 For efficient estimates, we decompose $\mathcal{SQ}(A)$ as the sum of $\mathcal{SQ}(A) + \mathcal{ZR}(A)/2$ and $-\mathcal{ZR}(A)/2,$ and we also consider
 $\mathcal{SQ}(A)+ \mathcal{ZR}(A)$ as the sum of $\mathcal{SQ}(A) + \mathcal{ZR}(A)/2$ and $\mathcal{ZR}(A)/2.$ Therefore, we begin by doing delicate estimates on both  $\mathcal{SQ}(A) + \mathcal{ZR}(A)/2$ and $\mathcal{ZR}(A)/2.$

 \subsection{$\mathcal{SQ}(A)+ \mathcal{ZR}(A)/2$ value}
 Let $A\subset \mathbb F_q^d.$
 Recall that $\mathcal{ZR}(A)$ and $\mathcal{SQ}(A)$ denote the numbers of pairs $(x, y)\in A\times A$ such that $||x- y||$ is zero and is a square number in $\mathbb F_q^*$, respectively; namely $||x- y||=0$ and $||x-y||=r^2$ for some $r\in \mathbb F_q^*.$ Since $ r^2=(-r)^2$ for $r\in \mathbb F_q^*,$  we can write
 $$ \mathcal{SQ}(A)= \frac{1}{2} \sum_{r\in \mathbb F_q^*} \sum_{x, y\in A: ||x-y||=r^2} 1.$$
 Since $\mathcal{ZR}(A)=\sum\limits_{x,y\in A: ||x-y||=0} 1$,  we have
 $$ \mathcal{SQ}(A)+ \frac{\mathcal{ZR}(A)}{2} =\frac{1}{2} \sum_{r\in \mathbb F_q} \sum_{x, y\in A: ||x-y||=r^2} 1.$$

 Now notice that for each fixed $r\in \mathbb F_q,$ there are exactly $q$ pairs $(s,s')\in \mathbb F_q\times \mathbb F_q$ such that
 $r=s-s'.$
 This implies that
 \begin{align*} \mathcal{SQ}(A)+ \frac{\mathcal{ZR}(A)}{2}&=  \frac{1}{2q} \sum_{s,s'\in \mathbb F_q}
 \sum_{x, y\in A: ||x-y||=(s-s')^2} 1\\
 &= \frac{1}{2q} \sum_{\substack{(x,s), (y, s')\in A\times \mathbb F_q:\\
 ||(x,s)- (y, s')||_{C_{d+1}}=0}} 1. \end{align*}
 Put $E=A\times \mathbb F_q \subset \mathbb F_q^{d+1}$ and $ \widetilde{x}=(x,s), \widetilde{y}=(y, s')\in \mathbb F_q^{d+1}.$ It follows
 $$\mathcal{SQ}(A)+ \frac{\mathcal{ZR}(A)}{2}= \frac{1}{2q} \sum_{\widetilde{x},\widetilde{y}\in E:\widetilde{x}-\widetilde{y}\in C_{d+1}}1.$$
 We now use Lemma \ref{AlexF} with $n=d+1$ to estimate the above summation. Then we see
 \begin{equation}\label{MainForm} \mathcal{SQ}(A)+ \frac{\mathcal{ZR}(A)}{2}= \frac{1}{2q} q^{2(d+1)} \sum_{\widetilde{m}\in \mathbb F_q^{d+1}} \widehat{C_{d+1}}(\widetilde{m}) |\widehat{E}(\widetilde{m})|^2.\end{equation}
We replace the above value $\widehat{C_{d+1}}(\widetilde{m})$ by  \eqref{FFC} of Lemma \ref{FTForm}. Then a direct computation gives us the following:
$$\mathcal{SQ}(A)+ \frac{\mathcal{ZR}(A)}{2}=\frac{|E|^2}{2q^2} +\frac{q^{d-1} \eta(-1) G_1^{d+1}}{2} \sum_{\widetilde{m}\in \mathbb F_q^{d+1}}  \sum_{s\ne 0} \eta^{d+1}{(s)} \chi\left(\frac{||\widetilde{m}||_{C_{d+1}}}{-4s}\right)
|\widehat{E}(\widetilde{m})|^2.$$
Notice that $|E|=|A|q$ and $\widehat{\mathbb F_q}(t)=1$ for $t=0,$ and $0$ otherwise. For $\widetilde{m}=(m,t)\in \mathbb F_q^d\times \mathbb F_q,$ we can check that
$$\widehat{E}(\widetilde{m})=\widehat{A\times \mathbb F_q} (m, t)=\widehat{A}(m) \widehat{\mathbb F_q}(t).$$
Therefore, we obtain
$$\mathcal{SQ}(A)+ \frac{\mathcal{ZR}(A)}{2}=\frac{|A|^2}{2} +\frac{q^{d-1} \eta(-1) G_1^{d+1}}{2} \sum_{m\in \mathbb F_q^{d}}  \sum_{s\ne 0} \eta^{d+1}{(s)} \chi\left(\frac{||m||}{-4s}\right)
|\widehat{A}(m)|^2.$$
By a simple change of variables, $1/(-4s) \to s,$ and the properties of $\eta$,
\begin{equation}\label{A+F}
\mathcal{SQ}(A)+ \frac{\mathcal{ZR}(A)}{2}=\frac{|A|^2}{2} +\frac{q^{d-1} \eta^d(-1) G_1^{d+1}}{2} \sum_{m\in \mathbb F_q^{d}}  \sum_{s\ne 0} \eta^{d+1}{(s)} \chi\left({s||m||}\right)|\widehat{A}(m)|^2.
\end{equation}
For better exposition, we will use the following notations.
\begin{definition} Let $A\subset \mathbb F_q^d.$ We define that
$$\Omega^+(A)=\sum_{m\in \mathbb F_q^d: \eta(||m||)=1} |\widehat{A}(m)|^2,$$
$$\Omega^-(A)=\sum_{m\in \mathbb F_q^d: \eta(||m||)=-1} |\widehat{A}(m)|^2,$$
and
$$\Omega^0(A)=\sum_{m\in \mathbb F_q^d: ||m||=0} |\widehat{A}(m)|^2.$$
\end{definition}
It is clear that $\Omega^+(A), \Omega^-(A)$, and $\Omega^0(A)$ are  non-negative real numbers. In addition, notice that if $A$ is a subset of $\mathbb F_q^d,$ then
\begin{equation}\label{triv} \Omega^0 (A)\ge |\widehat{A}(0,\ldots, 0)|^2 = q^{-2d} |A|^2.\end{equation}

 Recall that the sphere $S_0$ in $\mathbb F_q^d$ with zero radius, centered at the origin, is defined by
$$ S_0:=\{x\in \mathbb F_q^d: ||x||=0\}.$$ With this notation and the definition of the Fourier transform, we have
 $$\Omega^0(A)=\sum_{m\in S_0}|\widehat{A}(m)|^2=q^{-d}\sum_{x,y\in A} \widehat{S_0}(x-y).$$
By the same argument as in the proof of Lemma \ref{FTForm}, the Fourier transform of $S_0$, denoted by $\widehat{S_0},$ is given as follows (see, for example, \cite{IK10}): for $m\in \mathbb F_q^d,$
\begin{equation}\label{S0Fourier} \widehat{S_0}(m)=\frac{\delta_0(m)}{q} + q^{-d-1} \eta^d(-1) G_1^d \sum_{s\ne 0} \eta^d(s) \chi\left(\frac{||m||}{4s}\right).\end{equation}
In particular,  when $d\ge 3$ is odd, one has
$$ \Omega^0(A)=q^{-d-1}|A| +q^{-2d-1}\eta(-1)G_1^{d+1} \sum_{x,y\in A} \eta(||x-y||).$$
Since $\Omega^0(A)$ is a real number and $|G_1|=q^{1/2},$ we see that if $d\ge 3$ is odd, then
$$\Omega^0(A)\le q^{-d-1}|A| +q^{-\frac{3d+1}{2}} |A|^2.$$
One the other hand,  the Plancherel theorem gives the following estimate:
$$ \Omega^0(A) \le \sum_{m\in \mathbb F_q^d} |\widehat{A}(m)|^2 =q^{-d}|A|.$$
In conclusion, for any odd $d\ge 3$, we get
\begin{equation}\label{Omezero}
\Omega^0(A) \le \min\{q^{-d}|A|, ~q^{-d-1}|A| +q^{-\frac{3d+1}{2}} |A|^2\}.
\end{equation}
In odd dimensions $d\ge 3,$ we obtain the following formula.
\begin{proposition}\label{pro4.2} Let $A$ be a set in $\mathbb F_q^d.$
\begin{enumerate}
\item  If  $d\equiv 3 \mod{4}$ and $ q\equiv 3 \mod{4},$
then
$$\mathcal{SQ}(A)+ \frac{\mathcal{ZR}(A)}{2}=\frac{|A|^2}{2} -\frac{q^{\frac{3d+1}{2}}}{2}\Omega^0(A)+ \frac{q^{\frac{d-1}{2}}|A|}{2}.$$
\item If $d\equiv 1 \mod{4},$ or $d\equiv 3 \mod{4}$ and $q\equiv 1 \mod{4},$ then
$$\mathcal{SQ}(A)+ \frac{\mathcal{ZR}(A)}{2}=\frac{|A|^2}{2} +\frac{q^{\frac{3d+1}{2}}}{2}\Omega^0(A)- \frac{q^{\frac{d-1}{2}}|A|}{2}.$$
\end{enumerate}
\end{proposition}
\begin{proof} Since $d\ge 3$ is odd,  the inequality  \eqref{A+F} becomes
$$ \mathcal{SQ}(A)+ \frac{\mathcal{ZR}(A)}{2}=\frac{|A|^2}{2} +\frac{q^{d-1} \eta(-1) G_1^{d+1}}{2} \sum_{m\in \mathbb F_q^{d}}  \sum_{s\ne 0} \chi\left({s||m||}\right)|\widehat{A}(m)|^2. $$
By the orthogonality of $\chi$, we compute the sum over $s\ne 0$. Then we get
$$\mathcal{SQ}(A)+ \frac{\mathcal{ZR}(A)}{2}=\frac{|A|^2}{2}
+\frac{q^{d} \eta(-1) G_1^{d+1}}{2} \sum_{m\in  S_0} |\widehat{A}(m)|^2 -\frac{q^{d-1} \eta(-1) G_1^{d+1}}{2} \sum_{m\in \mathbb F_q^d} |\widehat{A}(m)|^2.$$
Since $\sum\limits_{m\in \mathbb F_q^d} |\widehat{A}(m)|^2=q^{-d}|A|$, we have
\begin{equation}
\mathcal{SQ}(A)+ \frac{\mathcal{ZR}(A)}{2}=\frac{|A|^2}{2}
+\frac{q^{d} \eta(-1) G_1^{d+1}}{2} \Omega^0(A) -\frac{\eta(-1) G_1^{d+1}|A|}{2q}.
\end{equation}
To prove the first part (1) of the proposition, it suffices to show that $\eta(-1)G_1^{d+1}= -q^{\frac{d+1}{2}}.$ Since $d\equiv 3 \mod{4}$ and $ q\equiv 3 \mod{4},$ the equation follows from Corollary \ref{Corm} (1) with $n=d+1.$
To prove the second part (2) of the proposition, it is enough to show that $\eta(-1)G_1^{d+1}= q^{\frac{d+1}{2}}.$ Notice that this equation  follows immediately from Corolalry \ref{Corm} (2) with $n=d+1.$
\end{proof}

In even dimensions $d\ge 2,$ we have
\begin{proposition} \label{pro4.3}
Let $A$ be a set in $\mathbb F_q^d.$
\begin{enumerate}
\item If $d\ge 2$ is even, then
$$\mathcal{SQ}(A)+ \frac{\mathcal{ZR}(A)}{2}=\frac{|A|^2}{2} +\frac{q^{d-1}  G_1^{d+2}}{2} \Omega^+(A)-\frac{q^{d-1}  G_1^{d+2}}{2} \Omega^-(A).$$
\item In particular, if  $d\equiv 2 \mod{4},$ then
$$\mathcal{SQ}(A)+ \frac{\mathcal{ZR}(A)}{2}=\frac{|A|^2}{2} +\frac{q^{\frac{3d}{2}}}{2}\Omega^+(A)-\frac{q^{\frac{3d}{2}}}{2}\Omega^-(A). $$
\end{enumerate}
\end{proposition}
\begin{proof}
Since $d\ge 2$ even,  \eqref{A+F} implies that
$$\mathcal{SQ}(A)+ \frac{\mathcal{ZR}(A)}{2}=\frac{|A|^2}{2} +\frac{q^{d-1}  G_1^{d+1}}{2} \sum_{m\in \mathbb F_q^{d}}  \sum_{s\ne 0} \eta{(s)} \chi\left({s||m||}\right)|\widehat{A}(m)|^2. $$
Note that the sum over $s\ne 0$ is $G_1 \eta(||m||).$ Since $\eta(||m||)=0$ for $||m||=0,$ the first statement (1) of the proposition follows. Proposition \ref{pro4.3} (2)  is a  direct consequence of Proposition \ref{pro4.3} (1) since  $G_1^{d+2}=q^{(d+2)/2}$ for $d\equiv 2 \mod{4}.$
\end{proof}

\subsection{$\mathcal{ZR}(A)/2$ value}
Recall that for $A\subset \mathbb F_q^d,$ we have
$$\mathcal{ZR}(A)=\sum_{x,y\in A: ||x-y||=0} 1.$$
By applying Lemma \ref{AlexF} with  $n=d$ and $V=S_0,$ we have
$$ \frac{\mathcal{ZR}(A)}{2}= \frac{q^{2d}}{2} \sum_{m\in \mathbb F_q^d} \widehat{S_0}(m) |\widehat{A}(m)|^2.$$
The following equality  can be easily obtained by a direct computation after replacing the above value $\widehat{S_0}(m)$ by the value in \eqref{S0Fourier}.
\begin{equation}\label{defA0}\frac{\mathcal{ZR}(A)}{2}= \frac{|A|^2}{2q}+ \frac{q^{d-1} \eta^d(-1) G_1^d }{2} \sum_{m\in \mathbb F_q^d}
\left(\sum_{s\ne 0} \eta^d(s) \chi\left(s||m||\right)  \right) |\widehat{A}(m)|^2,\end{equation}
where we also used a simple change of variables, $1/(4s)\to s,$ and the properties of the quadratic character $\eta$ of $\mathbb F_q.$\\

In odd dimensions $d\ge 3,$  the value $\mathcal{ZR}(A)/2$ is written as follows.

\begin{proposition}\label{pro4.4} Let $A$ be a set in $\mathbb F_q^d.$
\begin{enumerate}
\item  If  $d\equiv 3 \mod{4}$ and $ q\equiv 3 \mod{4},$
then
$$ \frac{\mathcal{ZR}(A)}{2}=\frac{|A|^2}{2q} -\frac{q^{\frac{3d-1}{2}}}{2}\Omega^+(A)+\frac{q^{\frac{3d-1}{2}}}{2}\Omega^-(A). $$
\item If $d\equiv 1 \mod{4},$ or $d\equiv 3 \mod{4}$ and $q\equiv 1 \mod{4},$ then
$$\frac{\mathcal{ZR}(A)}{2}=\frac{|A|^2}{2q} +\frac{q^{\frac{3d-1}{2}}}{2}\Omega^+(A)-\frac{q^{\frac{3d-1}{2}}}{2}\Omega^-(A).$$
\end{enumerate}
\end{proposition}
\begin{proof} Since $d$ is odd,  $\eta^d=\eta$ and so
the equality \eqref{defA0} becomes
\begin{align*} \frac{\mathcal{ZR}(A)}{2}&= \frac{|A|^2}{2q}+ \frac{q^{d-1} \eta(-1) G_1^d }{2} \sum_{m\in \mathbb F_q^d}
\left(\sum_{s\ne 0} \eta(s) \chi\left(s||m||\right)  \right) |\widehat{A}(m)|^2\\
&=\frac{|A|^2}{2q}+ \frac{q^{d-1} \eta(-1) G_1^{d+1} }{2} \sum_{m\in \mathbb F_q^d}
 \eta(||m||) |\widehat{A}(m)|^2.\end{align*}
Since $\eta{(||m||)}=0$ for $||m||=0,$  it follows by the definitions of $\Omega^+(A)$ and $\Omega^-(A)$ that
$$ \frac{\mathcal{ZR}(A)}{2} = \frac{|A|^2}{2q}+ \frac{q^{d-1} \eta(-1) G_1^{d+1} }{2} \Omega^+(A) - \frac{q^{d-1} \eta(-1) G_1^{d+1} }{2} \Omega^-(A).$$
Applying  Corollary \ref{Corm} (1) and (2) with $n=d+1$,  we complete the proof.
\end{proof}

In even dimensions $d\ge 2,$ we have
\begin{proposition} \label{pro4.5}
Let $A$ be a set in $\mathbb F_q^d.$
\begin{enumerate}
\item  If  $d\equiv 2 \mod{4}$ and $ q\equiv 3 \mod{4},$ then
$$ \frac{\mathcal{ZR}(A)}{2}= \frac{|A|^2}{2q} -\frac{q^{\frac{3d}{2}}}{2}
\Omega^0(A)+ \frac{q^{\frac{d-2}{2}}|A|}{2}.$$

\item If $d\equiv 0 \mod{4},$ or $d\equiv 2 \mod{4}$ and $q\equiv 1 \mod{4},$ then
$$\frac{\mathcal{ZR}(A)}{2}=\frac{|A|^2}{2q} +\frac{q^{\frac{3d}{2}}}{2}\Omega^0(A)- \frac{q^{\frac{d-2}{2}}|A|}{2}.$$
\end{enumerate}
\end{proposition}
\begin{proof}
Since $d$ is even, $\eta^d\equiv 1.$ Hence, the equality \eqref{defA0} and the orthogonality of $\chi$ yield
\begin{align*}\frac{\mathcal{ZR}(A)}{2}&= \frac{|A|^2}{2q}+ \frac{q^{d-1}  G_1^d }{2} \sum_{m\in \mathbb F_q^d}
\left(\sum_{s\ne 0}  \chi\left(s||m||\right)  \right) |\widehat{A}(m)|^2\\
&=\frac{|A|^2}{2q}+ \frac{q^{d}  G_1^d }{2}\Omega^0(A) -\frac{q^{d-1}  G_1^d }{2} \sum_{m\in \mathbb F_q^d} |\widehat{A}(m)|^2.\end{align*}
Notice by the Plancherel theorem that $\sum\limits_{m\in \mathbb F_q^d} |\widehat{A}(m)|^2=q^{-d}|A|.$ Then the proposition follows from the Gauss sum values given in  Corollary \ref{Corm} (3) and (4) with $n=d.$
\end{proof}

\section{Proofs of results on $\mathcal{SQ}(A)+\mathcal{ZR}(A)$ (Theorem \ref{mainN0})}
To get a good upper bound of $\mathcal{SQ}(A)+\mathcal{ZR}(A)$,  we will use the previously established estimates of $\mathcal{SQ}(A)+ \mathcal{ZR}(A)/2$ and $\mathcal{ZR}(A).$ In other words,  we will find an upper bound of the sum of $(\mathcal{SQ}(A)+\mathcal{ZR}(A)/2)$ and $\mathcal{ZR}(A)/2.$

 \subsection{ Proof of Theorem \ref{mainN0} (1)}
 Since we assume that $d\equiv 3 \mod{4}$ and $ q\equiv 3 \mod{4},$ Propositions \ref{pro4.2} (1) and \ref{pro4.4} (1) play a key role in proving this theorem. \\
By inequality \eqref{triv} and Proposition \ref{pro4.2} (1), we see that
\begin{equation}\label{TK1}
(\mathcal{SQ}(A)+ \mathcal{ZR}(A)/2)\le \frac{|A|^2}{2} -\frac{|A|^2}{2q^{\frac{d-1}{2}}}+ \frac{q^{\frac{d-1}{2}}|A|}{2}.
\end{equation}
Ignoring a negative term, Proposition \ref{pro4.4} (1) implies that
$$\frac{\mathcal{ZR}(A)}{2}\le \frac{|A|^2}{2q} +\frac{q^{\frac{3d-1}{2}}}{2}\Omega^-(A). $$
One can check that
$$\Omega^{-}(A)\le \sum_{m\in \mathbb F_q^d} |\widehat{A}(m)|^2 -\Omega^0(A) \le q^{-d}|A|-|\widehat{A}(0,\ldots, 0)|^2=q^{-d}|A|-q^{-2d}|A|^2.$$
Thus, we obtain
$$\frac{\mathcal{ZR}(A)}{2}\le \frac{|A|^2}{2q} +\frac{q^{\frac{d-1}{2}}|A|}{2} - \frac{|A|^2}{2q^{\frac{d+1}{2}}}.$$

Since $\mathcal{SQ}(A)+ \mathcal{ZR}(A) =(\mathcal{SQ}(A)+ \mathcal{ZR}(A)/2)+ {\mathcal{ZR}(A)}/{2},$ we complete the proof by adding the above two inequalities. \qed\\

\subsection{Proof of Theorem \ref{mainN0} (2)}
Since $d\equiv 1 \mod{4},$ or $d\equiv 3 \mod{4}$ and $q\equiv 1 \mod{4},$ we are able to use the following result of Proposition \ref{pro4.2} (2):
$$\mathcal{SQ}(A)+ \frac{\mathcal{ZR}(A)}{2}=\frac{|A|^2}{2} +\frac{q^{\frac{3d+1}{2}}}{2}\Omega^0(A)- \frac{q^{\frac{d-1}{2}}|A|}{2}.$$
Since $\Omega^0(A)$ is dominated by $\sum\limits_{m\in \mathbb F_q^d} |\widehat{A}(m)|^2 - \Omega^+(A)=q^{-d}|A|-\Omega^+(A),$  it follows that
$$\mathcal{SQ}(A)+ \frac{\mathcal{ZR}(A)}{2}\le \frac{|A|^2}{2} +\frac{q^{\frac{3d+1}{2}}}{2}(q^{-d}|A|-\Omega^+(A))- \frac{q^{\frac{d-1}{2}}|A|}{2}. $$

Proposition \ref{pro4.4} (2) implies that
$$\frac{\mathcal{ZR}(A)}{2}\le \frac{|A|^2}{2q} +\frac{q^{\frac{3d-1}{2}}}{2}\Omega^+(A).$$
Adding the above two estimates, we have
 $$\mathcal{SQ}(A)+\mathcal{ZR}(A) \le \frac{|A|^2}{2} +\frac{|A|^2}{2q} + \frac{q^{\frac{d+1}{2}} |A|}{2} -\frac{q^{\frac{d-1}{2}} |A|}{2}-\left( \frac{q^{\frac{3d+1}{2}}}{2}- \frac{q^{\frac{3d-1}{2}}}{2}\right)\Omega^+(A).$$
Since the term containing $\Omega^+(A)$ value is negative or zero, the theorem follows. \qed\\
\subsection{Proof of Theorem \ref{mainN0} (3)}
 Since $d\equiv 2 \mod{4}$ and $ q\equiv 3 \mod{4},$  the proof can use Propositions \ref{pro4.3} (2) and \ref{pro4.5} (1). \\
 Since $-\Omega^-(A)\le 0,$ Proposition \ref{pro4.3} (2) implies that
 \begin{equation}\label{ThangDoowon3}\mathcal{SQ}(A)+ \frac{\mathcal{ZR}(A)}{2}\le \frac{|A|^2}{2} +\frac{q^{\frac{3d}{2}}}{2}\Omega^+(A). \end{equation}
 Combining this estimate with the fact that $\Omega^+(A) \le q^{-d}|A|-\Omega^0(A)$, we obtain
 $$\mathcal{SQ}(A)+ \frac{\mathcal{ZR}(A)}{2}\le \frac{|A|^2}{2} +\frac{q^{\frac{3d}{2}}}{2} (q^{-d}|A|-\Omega^0(A)).$$
By Proposition \ref{pro4.5} (1), we have
 $$\frac{\mathcal{ZR}(A)}{2}= \frac{|A|^2}{2q} -\frac{q^{\frac{3d}{2}}}{2}
\Omega^0(A)+ \frac{q^{\frac{d-2}{2}}|A|}{2}.$$
By adding the above two inequalities, we have
 $$\mathcal{SQ}(A)+\mathcal{ZR}(A) \le \frac{|A|^2}{2} +\frac{|A|^2}{2q}-q^{\frac{3d}{2}}
\Omega^0(A)+ \frac{q^{\frac{d}{2}} |A|}{2} +\frac{q^{\frac{d-2}{2}}|A|}{2}.$$
Since $-\Omega^0(A)\le -|\widehat{A}(0,\ldots,0)|^2=-q^{-2d}|A|^2,$  we obtain the statement of the theorem. \qed\\
\subsection{Proof of Theorem \ref{mainN0} (4)}
Since $d\equiv 0 \mod{4},$ or $d\equiv 2 \mod{4}$ and $q\equiv 1 \mod{4},$ we may invoke Proposition \ref{pro4.3} (1) and \ref{pro4.5} (2). \\
First, Proposition \ref{pro4.3} (1) tells us that for even integer $d\ge 2,$
$$\mathcal{SQ}(A)+ \frac{\mathcal{ZR}(A)}{2}=\frac{|A|^2}{2} +\frac{q^{d-1}  G_1^{d+2}}{2} \Omega^+(A)-\frac{q^{d-1}  G_1^{d+2}}{2} \Omega^-(A):=\frac{|A|^2}{2}+ I + II.$$
Since $d$ is  even,  Lemma \ref{ExplicitGauss} implies that $G_1^{d+2}=\pm q^{(d+2)/2}$ which is a real number. Moreover, both $ \Omega^+(A)$ and $\Omega^-(A)$ are non-negative real numbers. Hence,
one of  $I$ and $II$ is exactly non-negative and the other is non-positive. Therefore, in the case when  $G_1^{d+2}= q^{(d+2)/2},$ we have
\begin{equation}\label{asseq1} \mathcal{SQ}(A)+ \frac{\mathcal{ZR}(A)}{2}\le \frac{|A|^2}{2}+ I=\frac{|A|^2}{2}+\frac{q^{\frac{3d}{2}}}{2} \Omega^+(A).\end{equation}
On the other hand, when  $G_1^{d+2}= -q^{(d+2)/2},$ we have
\begin{equation}\label{asseq2}\mathcal{SQ}(A)+ \frac{\mathcal{ZR}(A)}{2}\le\frac{|A|^2}{2}+ II=\frac{|A|^2}{2}+\frac{q^{\frac{3d}{2}}}{2} \Omega^-(A).\end{equation}
In any case, we have
$$\mathcal{SQ}(A)+ \frac{\mathcal{ZR}(A)}{2}\le\frac{|A|^2}{2}+\frac{q^{\frac{3d}{2}}}{2} (q^{-d} |A|-\Omega^0(A)),$$
since $\max\{\Omega^+(A), ~\Omega^-(A)\} \le  \sum\limits_{m\in \mathbb F_q^d} |\widehat{A}(m)|^2 -\Omega^0(A) = q^{-d}|A|-\Omega^0(A).$\\
By Proposition \ref{pro4.5} (2), we have
$$\frac{\mathcal{ZR}(A)}{2}=\frac{|A|^2}{2q} +\frac{q^{\frac{3d}{2}}}{2}\Omega^0(A)- \frac{q^{\frac{d-2}{2}}|A|}{2}.$$
Hence, adding the above two estimates, we obtain the required upper bound of $\mathcal{SQ}(A)+ \mathcal{ZR}(A).$ \qed\\
\section{Proofs of results on $\mathcal{SQ}(A)$ in odd dimensions (Theorem \ref{mainNOdd})}

\subsection{Proof of Theorem \ref{mainNOdd} (1)}
Since the assumtion that $d\equiv 3 \mod{4}$ and $ q\equiv 3 \mod{4}$ is the same as that of Theorem
\ref{mainN0} (1), we will make use certain estimates given in the proof of Theorem \ref{mainN0} (1).\\
As in \eqref{TK1}, we have
\begin{equation}\label{TK11}
    (\mathcal{SQ}(A)+ \mathcal{ZR}(A)/2)\le \frac{|A|^2}{2} -\frac{|A|^2}{2q^{\frac{d-1}{2}}}+ \frac{q^{\frac{d-1}{2}}|A|}{2}.
\end{equation}
Since $\Omega^-(A)$ is non-negative, Proposition \ref{pro4.4} (1) implies that
$$ -\mathcal{ZR}(A)/2\le  -\frac{|A|^2}{2q} +\frac{q^{\frac{3d-1}{2}}}{2} \Omega^+(A).  $$

As before, we can check that $\Omega^+(A)$ is bounded by   $q^{-d}|A|-q^{-2d} |A|^2$ . Thus, we have
\begin{equation} \label{TK2}
-\mathcal{ZR}(A)/2\le  -\frac{|A|^2}{2q} +\frac{q^{\frac{3d-1}{2}}}{2}(q^{-d}|A|-q^{-2d} |A|^2)= -\frac{|A|^2}{2q}+\frac{q^{\frac{d-1}{2}}|A|}{2}-\frac{|A|^2}{2q^{\frac{d+1}{2}}}.
\end{equation}

By the definition of $\mathcal{ZR}(A),$ it is clear that $\mathcal{ZR}(A)\ge |A|.$ Hence, we also have
\begin{equation}\label{TK3} -\mathcal{ZR}(A)/2\le -|A|/2.\end{equation}

Since we can write $\mathcal{SQ}(A)= (\mathcal{SQ}(A)+ \mathcal{ZR}(A)/2) -\mathcal{ZR}(A)/2,$ the estimates \eqref{TK11} and \eqref{TK2} imply that
$$\mathcal{SQ}(A)\le \frac{|A|^2}{2} + q^{\frac{d-1}{2}} |A| -\frac{|A|^2}{2q}- \frac{|A|^2}{2 q^{\frac{d-1}{2}}} - \frac{|A|^2}{2 q^{\frac{d+1}{2}}}.$$

Combining \eqref{TK11} and \eqref{TK3}, we also obtain that
$$ \mathcal{SQ}(A) \le \frac{|A|^2}{2} + \frac{q^{\frac{d-1}{2}} |A|}{2}
  - \frac{|A|^2}{2 q^{\frac{d-1}{2}}} -\frac{|A|}{2}.$$

Comparing the above two estimates of $\mathcal{SQ}(A),$ we obtain the statement of Theorem \ref{mainNOdd} (1).
\qed \\

\subsection{Proof of Theorem \ref{mainNOdd} (2)}
Since  $d\equiv 1 \mod{4},$ or $d\equiv 3 \mod{4}$ and $q\equiv 1 \mod{4},$  we will make use of Propositions \ref{pro4.2} (2) and \ref{pro4.4} (2).\\
Combining inequality \eqref{Omezero} and Proposition \ref{pro4.2} (2), we see that
$$\mathcal{SQ}(A)+ \frac{\mathcal{ZR}(A)}{2}\le\frac{|A|^2}{2} +\frac{q^{\frac{3d+1}{2}}}{2}\min\{q^{-d}|A|, ~q^{-d-1}|A| +q^{-\frac{3d+1}{2}} |A|^2\}- \frac{q^{\frac{d-1}{2}}|A|}{2}.$$
 As seen in \eqref{TK3},  we have
 $$  -\mathcal{ZR}(A)/2\le -|A|/2.$$
 Hence, the above two estimates imply that
\begin{equation}\label{OE1}
\mathcal{SQ}(A) \le \frac{|A|^2}{2} - \frac{q^{\frac{d-1}{2}} |A|}{2}
  -\frac{|A|}{2}+ \min\left\{ \frac{q^{\frac{d+1}{2}} |A|}{2},~ \frac{q^{\frac{d-1}{2}} |A|}{2}+ \frac{|A|^2}{2} \right\}.
\end{equation}
Next, we deduce another upper bound of $\mathcal{SQ}(A).$
Since $\Omega^0(A)=\sum\limits_{m\in \mathbb F_q^d} |\widehat{A}(m)|^2 -\Omega^+(A)-\Omega^-(A) =q^{-d}|A|-\Omega^+(A)-\Omega^-(A)\le q^{-d}|A|-\Omega^-(A),$ it follows by Proposition \ref{pro4.2} (2) that
\begin{equation}\label{Doowon2}\mathcal{SQ}(A)+ \frac{\mathcal{ZR}(A)}{2}\le \frac{|A|^2}{2} +\frac{q^{\frac{3d+1}{2}}}{2}(q^{-d}|A|-\Omega^-(A))- \frac{q^{\frac{d-1}{2}}|A|}{2}.\end{equation}
Since $-\Omega^+(A)\le 0,$  Proposition \ref{pro4.4} (2) implies that
$$-\frac{\mathcal{ZR}(A)}{2}\le -\frac{|A|^2}{2q} +\frac{q^{\frac{3d-1}{2}}}{2}\Omega^-(A).$$
Since $-\Omega^-(A)\le 0,$ adding the above two estimates gives us
$$\mathcal{SQ}(A)\le \frac{|A|^2}{2} + \frac{q^{\frac{d+1}{2}} |A|}{2} -\frac{q^{\frac{d-1}{2}} |A|}{2}-\frac{|A|^2}{2q}.$$
Combining this estimate with inequality \eqref{OE1}, we complete the proof of Theorem \ref{mainNOdd} (2).
\qed
\\
\section{Proofs of results on $\mathcal{SQ}(A)$ in even dimensions (Theorem \ref{mainNEven})}
We begin by proving an upper bound of $\mathcal{SQ}(A)$ for even $d\ge 2.$ We will use some certain estimates appearing in the proof of Theorem \ref{mainN0}(4).
\begin{lemma}\label{evenA+}
Let $A$ be a subset of $\mathbb F_q^d.$ If $d\ge 2 $ is even, then we have
$$ \mathcal{SQ}(A)\le \frac{|A|^2}{2} + \frac{q^{\frac{d}{2}}  }{2}|A|- \frac{|A|^2}{2q^{\frac{d}{2}}  }-\frac{ |A| }{2}.$$
\end{lemma}
\begin{proof}
As observed in the proof of Theorem \ref{mainN0} (4), either the inequality \eqref{asseq1} or the inequality \eqref{asseq2} happens. Without loss of generality, we can assume that  the inequality \eqref{asseq1} holds. By the same method, we can deal with the other case.  As seen before, we have
$\Omega^+(A)\le \sum_{m\in \mathbb F_q^d} |\widehat{A}(m)|^2 -\Omega^0(A)\le q^{-d}|A|-q^{-2d}|A|^2$.
Thus, we obtain by \eqref{asseq1} that for even $d\ge 2,$
\begin{equation}\label{evenEasy}\mathcal{SQ}(A)+ \frac{\mathcal{ZR}(A)}{2} \le \frac{|A|^2}{2}+\frac{q^{\frac{3d}{2}}}{2} ( q^{-d}|A|-q^{-2d}|A|^2 )=\frac{|A|^2}{2} + \frac{q^{\frac{d}{2}}  }{2}|A|- \frac{|A|^2}{2q^{\frac{d}{2}}}.\end{equation}
Since $\mathcal{ZR}(A)\ge|A|$ by the definition of $\mathcal{ZR}(A),$ we have
$$ -\frac{\mathcal{ZR}(A)}{2} \le -\frac{|A|}{2}.$$
 The lemma follows by adding the above two estimates.
\end{proof}

\subsection{Proof of Theorem \ref{mainNEven} (1)}
Since  $d\equiv 2 \mod{4}$ and $ q\equiv 3 \mod{4},$ we can also use certain estimates which were already established in the proof of Theorem \ref{mainN0} (3). As seen in \eqref{ThangDoowon3}, we have
$$\mathcal{SQ}(A)+ \frac{\mathcal{ZR}(A)}{2}\le \frac{|A|^2}{2} +\frac{q^{\frac{3d}{2}}}{2}\Omega^+(A).$$
 Using the fact that $\Omega^+(A)\le q^{-d}|A|-\Omega^0{A},$  we obtain
$$\mathcal{SQ}(A)+ \frac{\mathcal{ZR}(A)}{2}\le \frac{|A|^2}{2}+ \frac{q^{\frac{3d}{2}}}{2}(q^{-d}|A|-\Omega^0{A})$$
By Proposition \ref{pro4.5} (1), it follows that
 $$ -\frac{\mathcal{ZR}(A)}{2}= -\frac{|A|^2}{2q} +\frac{q^{\frac{3d}{2}}}{2}
\Omega^0(A)- \frac{q^{\frac{d-2}{2}}|A|}{2}.$$

Adding the above two estimates gives the statement of the theorem. \qed\\

\subsection{ Proof of Theorem \ref{mainNEven} (2)}
Since $d\equiv 0 \mod{4},$ or $d\equiv 2 \mod{4}$ and $q\equiv 1 \mod{4},$ we will use the estimate \eqref{evenEasy} and Proposition \ref{pro4.5} (2).\\
Since $d$ is even, it follows by \eqref{evenEasy} that
 \begin{equation}\label{ThangKoh4}\mathcal{SQ}(A)+ \frac{\mathcal{ZR}(A)}{2} \le \frac{|A|^2}{2} + \frac{q^{\frac{d}{2}}  }{2}|A|- \frac{|A|^2}{2q^{\frac{d}{2}}}.\end{equation}

Since $-\Omega^0(A) \le -|\widehat{A}(0,\ldots, 0)|^2 = -q^{-2d}|A|^2,$ Proposition \ref{pro4.5} (2) implies that
$$-\frac{\mathcal{ZR}(A)}{2}\le -\frac{|A|^2}{2q} -\frac{|A|^2}{2q^{\frac{d}{2}}}+ \frac{q^{\frac{d-2}{2}}|A|}{2}.$$
Thus, adding the above two estimates gives us an upper bound of $\mathcal{SQ}(A)$ as follows:
$$  \mathcal{SQ}(A)\le \frac{|A|^2}{2} + \frac{q^{\frac{d}{2}} |A|}{2}-\frac{|A|^2}{q^{\frac{d}{2}}} -\frac{|A|^2}{2q}+ \frac{q^{\frac{d-2}{2}}|A|}{2}.$$

Lemma \ref{evenA+} also gives the following upper bound of $\mathcal{SQ}(A)$:
$$ \mathcal{SQ}(A)\le \frac{|A|^2}{2} + \frac{q^{\frac{d}{2}}  }{2}|A|- \frac{|A|^2}{2q^{\frac{d}{2}}  }-\frac{ |A| }{2}.$$
The statement of the theorem follows by a direct comparison with two upper bounds of $\mathcal{SQ}(A).$ \qed\\

\section*{Acknowledgments}
Doowon Koh was supported by the National Research Foundation of Korea (NRF) grant funded by the Korea government (MIST) (No. NRF-2018R1D1A1B07044469). T. Pham would like to thank to the VIASM for the hospitality and for the excellent working condition.

Number Theory (math.NT); Combinatorics (math.CO)