\documentclass[11pt]{amsart} \usepackage[margin=1.15in]{geometry} \usepackage{amssymb,mathtools} \usepackage{booktabs} \usepackage{tikz} \usepackage{listings} \DeclareTextSymbolDefault{\textquotedbl}{T1} \definecolor{linkblue}{RGB}{0,90,220} \usepackage[colorlinks,linkcolor=linkblue,citecolor=linkblue,urlcolor=linkblue]{hyperref} \usepackage{xurl} % Links into the repository of code and data. \reporef is the git ref they point to: main while % drafting; set it to the tag of a posted version (g7-v1, g8-v1, ...) when that version is posted. \newcommand{\repo}{https://github.com/alonamit1729/planar-distance-sets} \newcommand{\reporef}{g7-v1} \newcommand{\gfile}[2]{\href{\repo/blob/\reporef/#1}{\texttt{#2}}} \newcommand{\gdir}[2]{\href{\repo/tree/\reporef/#1}{\texttt{#2}}} \newcommand{\gurl}[1]{\begingroup\edef\x{\repo/#1}\expandafter\url\expandafter{\x}\endgroup} \lstset{basicstyle=\ttfamily\scriptsize,columns=fullflexible,keepspaces=true, breaklines=true,frame=none,xleftmargin=1em,upquote=true} \newtheorem{theorem}{Theorem} \newtheorem{proposition}[theorem]{Proposition} \newtheorem{lemma}[theorem]{Lemma} \newtheorem{corollary}[theorem]{Corollary} \theoremstyle{definition} \newtheorem{definition}[theorem]{Definition} \theoremstyle{remark} \newtheorem{remark}[theorem]{Remark} % A theorem that opens with a list: start the paragraph after the header and forbid a page % break before the list, so the header stays with the body. \makeatletter \newcommand{\listbody}{\leavevmode\@beginparpenalty=\@M\relax} \makeatother \newcommand{\R}{\mathbb{R}} \newcommand{\Z}{\mathbb{Z}} \newcommand{\Q}{\mathbb{Q}} \newcommand{\C}{\mathbb{C}} \newcommand{\diam}{\operatorname{diam}} \newcommand{\conv}{\operatorname{conv}} \title{The largest planar seven-distance sets} \author{Alon Amit} \author{Claude (Anthropic)} \date{4 December 2026} \begin{document} \begin{abstract} Let $g(k)$ be the largest number of points in the plane that determine at most $k$ distinct distances. We prove that $g(7)=16$, and that up to similarity there are exactly two sixteen-point sets with at most seven distances. Both are pieces of the triangular lattice, which confirms for $k=7$ the conjecture of Erdős and Fishburn that maximum $k$-distance sets with $k\ge7$ are pieces of the triangular lattice. The proof is computer-assisted and self-contained. The main steps of the proof are a complete list of the $228$ distance patterns of ten-point planar sets with at most six distances (a number first obtained by Szöllősi and Östergård), in which every pattern discarded along the way carries a polynomial identity that certifies its impossibility; an exact determination of all realisations of these patterns; a diameter-graph argument showing that every sixteen-point set with at most seven distances contains such a ten-point set, including a new elementary proof that thirteen points whose diameter graph is a $13$-cycle and which determine at most seven distances form a regular $13$-gon; and an exhaustive extension search in exact arithmetic. The same methods show that there are exactly sixteen fifteen-point sets with at most seven distances, one of which is not contained in a sixteen-point set, and exactly $84$ fourteen-point sets. As a by-product we recover $g(5)=12$ and $g(6)=13$ together with their maximum sets, and classify all sets of eleven to thirteen points with at most six distances. \end{abstract} \maketitle \section{Introduction} For a finite set $X\subset\R^2$ let $\Delta(X)=\{|x-y| : x,y\in X,\ x\neq y\}$ be the set of distances it determines, and let \[ g(k)=\max\{|X| : X\subset\R^2,\ |\Delta(X)|\le k\}. \] Erdős and Fishburn \cite{EF} introduced this function and determined it for $k\le5$: $g(1)=3$, $g(2)=5$, $g(3)=7$, $g(4)=9$ and $g(5)=12$. Wei \cite{W} proved $g(6)=13$, and Szöllősi and Östergård \cite{SO} classified the maximum six-distance sets. An interactive table of the known planar sets with $n$ points and exactly $d$ distances, for small $n$ and $d$, is online \cite{FD}. Erdős and Fishburn exhibited sixteen-point sets with seven distances, and conjectured that for $k\ge7$ every maximum $k$-distance set is similar to a subset of the triangular lattice \cite{EF}. Partial results towards $g(7)=16$ were obtained by Budianto \cite{B}, and Bao and Yu \cite{BY} determined, for $7\le k\le34$, the largest $k$-distance subsets of the triangular lattice that use the $k$ smallest lattice distances. We write points of the plane as complex numbers, put $\omega=e^{i\pi/3}$, and use triangular coordinates: $(a,b)\in\Z^2$ stands for the lattice point $a+b\omega$, whose squared length is $a^2+ab+b^2$. Let \[ H=\{(a,b)\in\Z^2 : a^2+ab+b^2\in\{0,1,3\}\}, \] the thirteen lattice points at squared distance $0$, $1$ or $3$ from the origin, and \[ E_1=H\cup\{(-2,0),(-2,2),(0,-2)\},\qquad E_2=H\cup\{(-2,0),(0,2),(2,-2)\}. \] Both sets have sixteen points and the same seven squared distances $1,3,4,7,9,12,13$. They are not similar: the squared distance $4$ occurs $20$ times in $E_1$ and $18$ times in $E_2$ (Figure~\ref{fig:E}). \begin{theorem}\label{thm:main} \listbody \begin{enumerate} \item Every set of points in the plane that determines at most seven distinct distances has at most sixteen points. Hence $g(7)=16$. \item Every set of sixteen points in the plane that determines at most seven distinct distances is similar to $E_1$ or to $E_2$. \end{enumerate} \end{theorem} Since $E_1$ and $E_2$ are pieces of the triangular lattice, the conjecture of Erdős and Fishburn stated above holds for $k=7$. The same methods also classify the fifteen-point sets with seven distances: there are \href{https://affinemess.com/fixed-distances.html\#n15d7}{sixteen of them} up to similarity, and one is not contained in a sixteen-point set (Theorem~\ref{thm:15} in Section~\ref{sec:fifteen}). There are \href{https://affinemess.com/fixed-distances.html\#n14d7}{$84$ fourteen-point sets} with seven distances (Theorem~\ref{thm:14} in Section~\ref{sec:fourteen}). Running the extension search with six distances in place of seven classifies the sets of at least eleven points with at most six distances (Theorem~\ref{thm:six} in Section~\ref{sec:six}); this gives new, independent proofs of $g(5)=12$ and $g(6)=13$ and of the classifications of the maximum sets in \cite{Sh,W,SO}. \begin{figure}[t] \centering \begin{tikzpicture}[scale=0.62] \def\pts#1{\foreach \a/\b in {#1} {\fill (\a+0.5*\b, 0.8660254*\b) circle (3.2pt);}} \def\unit#1{\foreach \a/\b/\c/\d in {#1} {\draw[line width=0.9pt,black!70] (\a+0.5*\b, 0.8660254*\b) -- (\c+0.5*\d, 0.8660254*\d);}} \def\extra#1{\foreach \a/\b in {#1} {\filldraw[fill=white,line width=1pt] (\a+0.5*\b, 0.8660254*\b) circle (3.8pt);}} \begin{scope} \foreach \a in {-3,...,3} \foreach \b in {-3,...,3} { \pgfmathsetmacro{\x}{\a+0.5*\b}\pgfmathsetmacro{\y}{0.8660254*\b} \pgfmathparse{abs(\x)<3.3 && abs(\y)<2.7 ? 1 : 0} \ifnum\pgfmathresult=1 \fill[gray!45] (\x,\y) circle (1pt);\fi} \unit{0/0/1/0,0/0/0/1,0/0/-1/1,0/0/-1/0,0/0/0/-1,0/0/1/-1,1/0/0/1,1/0/1/-1,1/0/1/1,1/0/2/-1,0/1/-1/1,0/1/1/1,0/1/-1/2,-1/1/-1/0,-1/1/-1/2,-1/1/-2/1,-1/1/-2/2,-1/0/0/-1,-1/0/-2/1,-1/0/-1/-1,-1/0/-2/0,0/-1/1/-1,0/-1/-1/-1,0/-1/1/-2,0/-1/0/-2,1/-1/1/-2,1/-1/2/-1,-1/2/-2/2,-2/1/-2/0,-2/1/-2/2,-1/-1/-2/0,-1/-1/0/-2,1/-2/0/-2} \pts{0/0,1/0,0/1,-1/1,-1/0,0/-1,1/-1,1/1,-1/2,-2/1,-1/-1,1/-2,2/-1} \extra{-2/0,-2/2,0/-2} \node at (0,-2.6) {$E_1$}; \end{scope} \begin{scope}[xshift=8cm] \foreach \a in {-3,...,3} \foreach \b in {-3,...,3} { \pgfmathsetmacro{\x}{\a+0.5*\b}\pgfmathsetmacro{\y}{0.8660254*\b} \pgfmathparse{abs(\x)<3.3 && abs(\y)<2.7 ? 1 : 0} \ifnum\pgfmathresult=1 \fill[gray!45] (\x,\y) circle (1pt);\fi} \unit{0/0/1/0,0/0/0/1,0/0/-1/1,0/0/-1/0,0/0/0/-1,0/0/1/-1,1/0/0/1,1/0/1/-1,1/0/1/1,1/0/2/-1,0/1/-1/1,0/1/1/1,0/1/-1/2,0/1/0/2,-1/1/-1/0,-1/1/-1/2,-1/1/-2/1,-1/0/0/-1,-1/0/-2/1,-1/0/-1/-1,-1/0/-2/0,0/-1/1/-1,0/-1/-1/-1,0/-1/1/-2,1/-1/1/-2,1/-1/2/-1,1/-1/2/-2,1/1/0/2,-1/2/0/2,-2/1/-2/0,-1/-1/-2/0,1/-2/2/-2,2/-1/2/-2} \pts{0/0,1/0,0/1,-1/1,-1/0,0/-1,1/-1,1/1,-1/2,-2/1,-1/-1,1/-2,2/-1} \extra{-2/0,0/2,2/-2} \node at (0,-2.6) {$E_2$}; \end{scope} \end{tikzpicture} \caption{The two sixteen-point sets with seven distances. The thirteen black points form $H$; the three hollow points differ. Segments join the pairs at the shortest distance. Grey dots are other points of the triangular lattice.} \label{fig:E} \end{figure} The upper bound $g(7)\le16$ follows from the method of part (2) without knowing the two sets (Proposition~\ref{prop:extend}); Corollary~\ref{cor:17} gives a second, direct argument. \subsection*{Outline} The proof follows the strategy of Erdős and Fishburn and of Wei: remove points until the largest distance disappears, and study the remaining set, which has fewer distances. Section~\ref{sec:reduction} shows that every sixteen-point set with at most seven distances contains ten points with at most six distances, a \emph{core}. Sections~\ref{sec:patterns}--\ref{sec:realisations} determine all ten-point sets with at most six distances: they have one of $228$ distance patterns (a number first stated by Szöllősi and Östergård \cite{SO}), each pattern has finitely many realisations, and up to similarity there are $257$ such sets. Section~\ref{sec:extensions} finds every way of adding six points to a core without exceeding seven distances, and Section~\ref{sec:end} identifies the results. Three ingredients deserve mention. \begin{itemize} \item The list of $228$ patterns is derived by generating patterns one point at a time. A pattern is discarded only together with a \emph{certificate}: a polynomial identity which shows, by multiplying out, that no planar point set has this pattern (Section~\ref{sec:patterns}). There are $527{,}338$ certificates. The number $228$ agrees with Table~9 of \cite{SO}, which was obtained by Gröbner-basis computations; we do not use that table. \item The reduction to ten points needs one geometric lemma about thirteen points whose diameter graph is a cycle. We give an elementary proof (Lemma~\ref{lem:C13}). \item All computations are exact: integers, rational numbers and algebraic numbers represented in number fields, with signs of real algebraic numbers certified by isolating intervals with rational endpoints. No floating-point number takes part in a decision. The one exception is in Section~\ref{sec:fourteen}, where some combinations of points are excluded by certified interval arithmetic. \end{itemize} \subsection*{Software and data} Everything needed to check the proof is in the folder \gdir{seven-distances}{seven-distances} of the repository \cite{ACcode}. It contains a Jupyter notebook \gfile{seven-distances/two-shapes.ipynb}{two-shapes.ipynb} that carries out or checks every step of the proofs of Theorems~\ref{thm:main} and~\ref{thm:15} in about three and a half minutes using only Python and SymPy; the programs \gfile{seven-distances/fourteen/fourteen.py}{fourteen/fourteen.py} and \gfile{seven-distances/six/six_distances.py}{six/six\_distances.py} for Sections~\ref{sec:fourteen} and~\ref{sec:six}; the programs \gfile{seven-distances/certificates/generate.py}{certificates/generate.py} and \gfile{seven-distances/certificates/check.py}{certificates/check.py} discussed in Section~\ref{sec:patterns}, and the lists of patterns. The two large certificate files ($0.22$ GB compressed) are attached to the release \href{https://github.com/alonamit1729/planar-distance-sets/releases/tag/g7-certificates-v1}{\texttt{g7-certificates-v1}} of the same repository. A rendered version of the notebook, and a live copy that runs in a web browser with nothing to install, are online \cite{ACnb}. Section~\ref{sec:computation} lists exactly what the proof takes from the literature and from computation. \section{Distance patterns and certificates}\label{sec:defs} \subsection{Patterns} Let $p_0,\dots,p_{n-1}$ be distinct points in the plane. Colour each pair $\{i,j\}$ so that two pairs get the same colour exactly when $|p_i-p_j|$ is the same. The resulting colouring of the edges of the complete graph $K_n$, up to renaming the colours, is the \emph{distance pattern} of the points. Two colourings are \emph{equivalent} if one becomes the other after renumbering the vertices and renaming the colours. A pattern is \emph{realisable} if it is the pattern of some planar point set. Every sub-pattern (the colouring induced on a subset of the vertices) of a realisable pattern is realisable. Equivalence is decided by a canonical form, computed by individualisation and refinement in the manner of \texttt{nauty} \cite{MP}: the canonical form of a colouring is the lexicographically smallest colour sequence over the vertex orderings produced by a search tree whose branching does not depend on the given numbering. \subsection{Squared lengths and the Gram matrix} Let a pattern on $n$ points have colours $0,\dots,k-1$, and write $c(i,j)$ for the colour of the pair $\{i,j\}$. Introduce one variable $x_c$ for each colour, to stand for the squared distance of that colour. For a base point $b$ and $i,j\neq b$ put \[ G^b_{ij}=x_{c(b,i)}+x_{c(b,j)}-x_{c(i,j)}\quad(i\neq j),\qquad G^b_{ii}=2x_{c(b,i)}. \] If points $p_0,\dots,p_{n-1}$ realise the pattern and $x_c$ is the squared distance of colour $c$, then $G^b_{ij}=2\langle p_i-p_b,\,p_j-p_b\rangle$. So $G^b$ is twice the Gram matrix of $n-1$ vectors in $\R^2$, it has rank at most $2$, and every $3\times3$ minor of $G^b$ vanishes. The minors are cubic polynomials in the $x_c$ with integer coefficients. \subsection{Certificates} \begin{definition}\label{def:cert} A \emph{certificate} for a pattern with colours $0,\dots,k-1$ is an identity in the polynomial ring $\Z[x_0,\dots,x_{k-1}]$ of the form \begin{equation}\label{eq:cert} d\cdot\prod_{c}x_c^{e_c}\prod_{a\neq b}(x_a-x_b)^{e_{ab}} \;=\; \sum_{i}A_i\,M_i, \end{equation} where $d$ is a non-zero integer, the exponents $e_c,e_{ab}$ are non-negative integers, each $M_i$ is a $3\times3$ minor of one of the matrices $G^b$, and each $A_i$ is a polynomial with integer coefficients. \end{definition} \begin{lemma}\label{lem:cert} A pattern that has a certificate is not realisable. \end{lemma} \begin{proof} Suppose points realise the pattern, and substitute their squared distances for the $x_c$. Every minor $M_i$ vanishes, so the right side of \eqref{eq:cert} is $0$. On the left, $d\neq0$, every $x_c$ is positive because the points are distinct, and $x_a\neq x_b$ for $a\neq b$ because different colours stand for different distances. So the left side is not $0$. \end{proof} Checking a certificate means expanding both sides of \eqref{eq:cert} and comparing coefficients; the minors are recomputed from the pattern. Two examples, writing $M_b(r;s)$ for the minor of $G^b$ with rows $r$ and columns $s$: four points at mutual distance $x_0$ have the certificate $4x_0^3=M_0(123;123)$; and for the five-point pattern in which the four pairs through point $0$ have colour $0$ and the other six pairs colour $1$, one certificate is \[ 18\,x_0^3 = 13\,M_0(123;123)-3\,M_1(234;234)-22\,M_0(123;124). \] Here the multipliers are constants. Certificates with a product of degree $d$ on the left have multipliers of degree $d-3$. \section{Ten points with six distances: the 228 patterns}\label{sec:patterns} \subsection{Generation one point at a time} We construct lists $L_4,L_5,\dots,L_{10}$, where $L_n$ is a set of patterns on $n$ points with at most six colours (up to equivalence). Call a pattern $Q$ on $n$ points with at most six colours a \emph{candidate} at level $n$ if $n=4$, or if $n\ge5$ and every sub-pattern of $Q$ on $n-1$ points is equivalent to a member of $L_{n-1}$. The list $L_n$ consists of the candidates at level $n$ that are kept: a candidate is discarded only if it has a certificate. This scheme is the one used by Szöllősi and Östergård \cite{SO}, who discarded a candidate when a Gröbner basis showed that its equations have no solution with non-zero, pairwise different squared lengths, not even a complex one. We replace this criterion by certificates, which are easier to check and do not depend on the correctness of a Gröbner-basis implementation. \begin{proposition}[computer-assisted]\label{prop:lists} There are lists $L_4,\dots,L_{10}$ such that, for each $n$, every candidate at level $n$ either belongs to $L_n$ or has a certificate. The numbers are given in Table~\ref{tab:levels}; in particular $|L_{10}|=228$. \end{proposition} \begin{table}[ht] \centering \begin{tabular}{@{}lrrrrrrr@{}} \toprule $n$ & 4 & 5 & 6 & 7 & 8 & 9 & 10\\ \midrule candidates & 25 & 1{,}193 & 537{,}230 & 14{,}732 & 1{,}565 & 635 & 228\\ discarded, each with a certificate & 1 & 271 & 517{,}001 & 10{,}065 & 0 & 0 & 0\\ kept: $|L_n|$ & 24 & 922 & 20{,}229 & 4{,}667 & 1{,}565 & 635 & 228\\ \quad with at most five colours & 23 & 678 & 1{,}620 & 398 & 157 & 57 & 19\\ \quad with six colours & 1 & 244 & 18{,}609 & 4{,}269 & 1{,}408 & 578 & 209\\ \midrule certificates with product of degree 3 & 1 & 237 & 380{,}254 & 10{,}065 & & & \\ \phantom{certificates with product of degree} 4 & & 34 & 135{,}749 & & & & \\ \phantom{certificates with product of degree} 5 & & & 998 & & & & \\ \bottomrule \end{tabular} \medskip \caption{The generation of patterns with at most six colours. At four points the only discarded pattern is the one-coloured one. The rows of candidates and kept patterns agree with Table~9 of \cite{SO}.} \label{tab:levels} \end{table} \begin{proposition}\label{prop:A} Every set of ten points in the plane with at most six distances has one of the $228$ patterns of $L_{10}$. \end{proposition} \begin{proof} We show by induction on $n=4,\dots,10$ that every set $X$ of $n$ points with at most six distances has its pattern in $L_n$. The pattern of $X$ is realisable, so it has no certificate (Lemma~\ref{lem:cert}). For $n=4$ it is a candidate by definition, hence in $L_4$. For $n\ge5$, every subset of $n-1$ points of $X$ has at most six distances, so by induction its pattern is in $L_{n-1}$; thus the pattern of $X$ is a candidate, and having no certificate, it is in $L_n$ by Proposition~\ref{prop:lists}. \end{proof} \subsection{How Proposition~\ref{prop:lists} is verified}\label{sec:verify-lists} Proposition~\ref{prop:lists} contains two computational claims: that the candidates at each level are listed completely, and that each discarded candidate has a valid certificate. \emph{Certificates.} The program \gfile{seven-distances/certificates/check.py}{check.py} reads a pattern and a certificate, recomputes the relevant minors from the pattern, expands both sides of \eqref{eq:cert} as dictionaries of integer coefficients and compares them. Its core is about fifty lines of Python using only integer arithmetic; it is printed in Appendix~\ref{app:check}. All $527{,}338$ certificates pass it; the check takes about $45$ core-minutes. The $272$ certificates at four and five points are in the repository, and the notebook checks them together with random samples of $400$ and $200$ certificates at six and seven points on every run. \emph{Candidates.} The program \gfile{seven-distances/certificates/generate.py}{generate.py} lists the candidates at level $n$ from $L_{n-1}$. For each $Q\in L_{n-1}$ it adds a new point and colours the $n-1$ new pairs one at a time, using the colours of $Q$ and new colours up to six in all, with new colours introduced in order. After each new pair it tests every sub-pattern that has just become complete: for sub-patterns on at most six points by looking up a table of all labelled colourings equivalent to members of $L_4$, $L_5$, $L_6$, and on more points by canonical form. A partial colouring is abandoned as soon as such a test fails. Nothing is lost by this pruning, because the lists are closed under taking sub-patterns: a sub-pattern on $s$ points of a candidate at level $n$ is in $L_s$ (by induction on $n-s$). Every candidate $P$ at level $n$ is found, because deleting any vertex $v$ of $P$ leaves a member $Q$ of $L_{n-1}$, and the colours of the pairs at $v$ form one of the colourings tried for $Q$. The program then checks that each candidate is in $L_n$ or is the pattern of a certificate. The whole run for $n=5,\dots,10$ takes about $13$ minutes on two cores, and reproduces the first three rows of Table~\ref{tab:levels} exactly. The candidates had first been listed by a different program, which shares no code with \gfile{seven-distances/certificates/generate.py}{generate.py} and takes its canonical forms from \texttt{nauty}. At six points, where $98\%$ of the certificates are, a third enumeration that tries every colouring of the five new pairs without any pruning gives the same $537{,}230$ candidates. \emph{How the certificates were found.} This plays no role in the proof, since each certificate is checked on its own, but for the record they were found as follows. For each candidate, the degree-$d$ part of the ideal generated by the minors was computed by linear algebra modulo a large prime, all products of $d$ factors $x_c$ and $x_a-x_b$ were tested for membership at once ($d=3,4,5$), and the multipliers were then solved for exactly over $\Q$ and scaled to integers. \section{Realisations of the 228 patterns}\label{sec:realisations} Let $P\in L_{10}$ have $k$ colours, and fix the colour of the pair $\{0,1\}$ as the unit: its squared length is $1$, and the other $k-1$ squared lengths are unknowns. A \emph{solution} of $P$ is an assignment of non-zero, pairwise different complex values to these unknowns at which the $84$ principal minors of $G^0$ vanish (the minors with rows and columns $\{i,j,l\}$, $1\le i1$. For the regular $15$-gon minus $v_0$, $\sum_v v=-v_0$, so $7r^2+q\cdot v_0=8$; but $7r^2+q\cdot v_0\le7r^2+r<8$. Both are impossible, so $X$ has no point besides the vertices. For the last sentence, $|X|=h\le15$ would force $X$ to be a regular $15$-gon; so $h\le13$, and $m\le h$ by Lemma~\ref{lem:diam}(1). \end{proof} \subsection{Thirteen points with a cyclic diameter graph} \begin{figure}[t] \centering \begin{tikzpicture}[scale=1.6] \def\P#1{({90+360*(#1)/13}:1)} \def\L#1{({90+360*(#1)/13}:1.17)} \begin{scope} \foreach \k in {0,...,12} \draw[gray!45,line width=0.4pt] \P{\k} -- \P{\k+6}; \fill[linkblue!12] \P{0} -- \P{6} -- \P{7} -- cycle; \draw[line width=0.9pt] \P{0} -- \P{7}; \draw[line width=0.9pt,-{latex}] \P{0} -- \P{6}; \draw[line width=0.9pt] \P{6} -- \P{7}; \draw[black!60,line width=0.5pt] \foreach \k in {0,...,12} {\P{\k} -- \P{\k+1}}; \foreach \k in {0,...,12} {\fill \P{\k} circle (0.9pt); \node[font=\scriptsize] at \L{\k} {$p_{\k}$};} \draw[line width=0.5pt] ([shift={(-83.077:0.42)}]0,1) arc[start angle=-83.077, end angle=-96.923, radius=0.42]; \draw[line width=0.4pt] (0.02,0.63) -- (0.17,0.56); \node[font=\scriptsize,anchor=west,inner sep=1pt] at (0.17,0.56) {$\gamma_0$}; \node[font=\scriptsize,fill=white,inner sep=1pt] at (-0.2,-0.22) {$w_0$}; \node[font=\small] at (0,-1.38) {(a)}; \end{scope} \begin{scope}[xshift=2.75cm] \draw[black!60,line width=0.5pt] \foreach \k in {0,...,12} {\P{\k} -- \P{\k+1}}; \foreach \k/\c in {1/25,2/40,3/55,4/70,5/85,6/100} { \draw[draw=linkblue!\c,line width=0.9pt] \P{0} -- \P{\k}; \draw[draw=linkblue!\c,line width=0.9pt] \P{0} -- \P{13-\k}; } \foreach \k in {0,...,12} {\fill \P{\k} circle (0.9pt); \node[font=\scriptsize] at \L{\k} {$p_{\k}$};} \node[font=\small] at (0,-1.38) {(b)}; \end{scope} \begin{scope}[xshift=5.5cm] \draw[black!35,line width=0.4pt] \foreach \k in {0,...,12} {\P{\k} -- \P{\k+1}}; \foreach \k in {0,...,12} \draw[gray!30,line width=0.4pt] \P{\k} -- \P{\k+6}; \draw[draw=linkblue!40,line width=0.9pt] \P{6} -- \P{0}; \draw[draw=linkblue!40,line width=0.9pt,-{latex}] \P{6} -- (-0.1077,0.1131); \draw[draw=linkblue!55,line width=0.9pt] \P{0} -- \P{7}; \draw[draw=linkblue!55,line width=0.9pt,-{latex}] \P{0} -- (0.1316,-0.0840); \draw[draw=linkblue!70,line width=0.9pt] \P{7} -- \P{1}; \draw[draw=linkblue!70,line width=0.9pt,-{latex}] \P{7} -- (-0.1479,0.0501); \draw[draw=linkblue!85,line width=0.9pt] \P{1} -- \P{8}; \draw[draw=linkblue!85,line width=0.9pt,-{latex}] \P{1} -- (0.1556,-0.0132); \draw[draw=linkblue!100,line width=0.9pt] \P{8} -- \P{2}; \draw[draw=linkblue!100,line width=0.9pt,-{latex}] \P{8} -- (-0.1542,-0.0244); \draw[line width=0.5pt] ([shift={(-96.92:0.3)}]0.0000,1.0000) arc[start angle=-96.92, end angle=-83.08, radius=0.3]; \node[font=\scriptsize,fill=white,inner sep=0.3pt] at (0.0000,0.5300) {$\gamma_{0}$}; \draw[line width=0.5pt] ([shift={(96.92:0.3)}]0.2393,-0.9709) arc[start angle=96.92, end angle=110.77, radius=0.3]; \node[font=\scriptsize,fill=white,inner sep=0.3pt] at (0.1268,-0.5146) {$\gamma_{7}$}; \draw[line width=0.5pt] ([shift={(-69.23:0.3)}]-0.4647,0.8855) arc[start angle=-69.23, end angle=-55.38, radius=0.3]; \node[font=\scriptsize,fill=white,inner sep=0.3pt] at (-0.2463,0.4693) {$\gamma_{1}$}; \draw[line width=0.5pt] ([shift={(124.62:0.3)}]0.6631,-0.7485) arc[start angle=124.62, end angle=138.46, radius=0.3]; \node[font=\scriptsize,fill=white,inner sep=0.3pt] at (0.3515,-0.3967) {$\gamma_{8}$}; \foreach \k in {0,...,12} {\fill \P{\k} circle (0.9pt); \node[font=\scriptsize] at \L{\k} {$p_{\k}$};} \node[font=\small] at (0,-1.38) {(c)}; \end{scope} \end{tikzpicture} \caption{The setting of Lemma~\ref{lem:C13}, drawn for the regular $13$-gon. (a) The diameters join each $p_y$ to $p_{y+6}$ and $p_{y+7}$ and form a star; the shaded isosceles triangle $p_0p_6p_7$ has legs of length $1$, apex angle $\gamma_0$ and base the side $p_6p_7$, and $w_0=p_6-p_0$. (b) The chords from $p_0$ of steps $1,\dots,6$ in each direction (darker for larger step); their lengths increase with the step (Step~2), up to the diameters of step $6$. (c) Walking along the cycle of diameters $p_6\to p_0\to p_7\to p_1\to p_8\to\cdots$, one meets the apex angles in the order $\gamma_0,\gamma_7,\gamma_1,\gamma_8,\dots$: this is the cyclic sequence of Step~4, in which $\gamma_y$ is followed by $\gamma_{y+7}$.} \label{fig:C13} \end{figure} \begin{lemma}\label{lem:C13} Let $Y$ be a set of thirteen points in the plane that determines at most seven distances and whose diameter graph is a cycle through all thirteen points. Then $Y$ is the vertex set of a regular $13$-gon. \end{lemma} \begin{proof} Scale so that the diameter is $1$. By Lemma~\ref{lem:diam}(1), $Y$ is in strictly convex position; label its points $p_0,\dots,p_{12}$ counterclockwise around the boundary of $\conv Y$, indices modulo $13$. We use repeatedly that from each vertex $p_y$ the rays to $p_{y+1},p_{y+2},\dots,p_{y+12}$ appear in counterclockwise order and span an angle less than $\pi$. \emph{Step 1: the diameters.} Let $\{p_x,p_y\}$ be a diameter. Removing $p_x$ and $p_y$ from the cycle leaves a path through the other eleven points. Each edge of the path is a diameter disjoint from $\{p_x,p_y\}$, so by Lemma~\ref{lem:diam}(2) it crosses the segment $p_xp_y$ and has its endpoints on opposite sides of the line $p_xp_y$. Hence the path alternates between the two sides, which therefore contain six and five of its points. The two sides of this line contain the two boundary arcs strictly between $p_x$ and $p_y$, so $y-x\equiv\pm6\pmod{13}$. Each point has two neighbours in the cycle, so $p_y$ is joined exactly to $p_{y+6}$ and $p_{y+7}=p_{y-6}$. \emph{Step 2: monotone chains.} For every $y$ and $1\le k\le5$, \begin{equation}\label{eq:chain} |p_y-p_{y+k}|<|p_y-p_{y+k+1}|. \end{equation} Indeed, $p_{y+k+7}$ is at distance $1$ from both $p_{y+k}$ and $p_{y+k+1}$, so it lies on the perpendicular bisector $\ell$ of the side $p_{y+k}p_{y+k+1}$. The line $\ell$ meets the polygon in the segment from the midpoint of that side to $p_{y+k+7}$, whose interior lies in the interior of the polygon (the two endpoints are not on a common side). So the vertices $p_{y+k+8},\dots,p_{y+k+13}=p_{y+k}$ lie strictly on the same side of $\ell$ as $p_{y+k}$. Among them is $p_y$ (as $8\le13-k\le12$), and points on that side are closer to $p_{y+k}$ than to $p_{y+k+1}$. Call $\{p_y,p_{y+k}\}$ ($1\le k\le6$) a chord of \emph{step} $k$; every pair is a chord of exactly one step. By \eqref{eq:chain}, for each $y$ the six numbers $|p_y-p_{y+k}|$, $k=1,\dots,6$, are distinct distances of $Y$, in increasing order, the last being $1$. So $Y$ has six or seven distances. If it has exactly six, $\delta_1<\dots<\delta_6=1$, then every chord of step $k$ has length $\delta_k$. If it has seven, $\delta_1<\dots<\delta_7=1$, then $|p_y-p_{y+k}|$, the $k$-th smallest of six distinct elements of $\{\delta_1,\dots,\delta_7\}$, is $\delta_k$ or $\delta_{k+1}$, so \begin{equation}\label{eq:twovalues} \text{for each } k\le5, \text{ the chords of step } k \text{ take at most two values.} \end{equation} \emph{Step 3: apex angles.} For each $y$ let $\gamma_y$ be the angle at $p_y$ of the isosceles triangle $p_yp_{y+6}p_{y+7}$, whose legs have length $1$. Its base is a side of the polygon, hence shorter than $1$, so $0<\gamma_y<\pi/3$. Let $w_y=p_{y+6}-p_y$, a unit vector. By the ordering of rays, $p_{y+7}-p_y=e^{i\gamma_y}w_y$. Since $p_{(y+7)+6}=p_y$, also $p_{y+7}-p_y=-w_{y+7}$, so \begin{equation}\label{eq:w} w_{y+7}=-e^{i\gamma_y}\,w_y\qquad(y\in\Z/13). \end{equation} The side from $p_j$ to $p_{j+1}$ is the base of the triangle with apex $p_{j+7}$: \[ p_{j+1}-p_j=(p_{j+1}-p_{j+7})-(p_j-p_{j+7})=(e^{i\gamma_{j+7}}-1)\,w_{j+7} =2\sin\tfrac{\gamma_{j+7}}2\cdot ie^{i\gamma_{j+7}/2}\,w_{j+7}. \] So the side $p_jp_{j+1}$ has length $s(\gamma_{j+7})$, where $s(t)=2\sin(t/2)$, and direction $\tau_j=ie^{i\gamma_{j+7}/2}w_{j+7}$. By \eqref{eq:w}, $w_{j+1}=w_{j+14}=-e^{i\gamma_{j+7}}w_{j+7}$ and $w_{j+8}=-e^{i\gamma_{j+1}}w_{j+1}=e^{i(\gamma_{j+1}+\gamma_{j+7})}w_{j+7}$, hence \[ \tau_{j+1}/\tau_j=\exp\Bigl(i\bigl(\gamma_{j+1}+\tfrac12(\gamma_{j+7}+\gamma_{j+8})\bigr)\Bigr). \] The exterior angle of the polygon at $p_{j+1}$ lies in $(0,\pi)$ and is congruent modulo $2\pi$ to the exponent, which also lies in $(0,\pi)$ because every $\gamma<\pi/3$. So the exterior angle at $p_j$ is \begin{equation}\label{eq:ext} \varepsilon_j=\gamma_j+\tfrac12(\gamma_{j+6}+\gamma_{j+7}). \end{equation} Summing over $j$ gives $2\pi=2\sum_y\gamma_y$, so $\sum_y\gamma_y=\pi$. \emph{Step 4: equal sides.} If all sides are equal, all $\gamma_y$ are equal (as $s$ is injective on $(0,\pi/3)$), so by \eqref{eq:ext} all exterior angles are equal. A convex polygon with equal sides and equal angles is regular, and we are done. This covers the case of six distances, so from now on $Y$ has seven distances and not all sides are equal. The sides are chords of step $1$, so they take exactly two values, and the $\gamma_y$ take two values $\alpha<\beta$. Let $n_\alpha$ and $n_\beta$ be the numbers of $\gamma_y$ equal to $\alpha$ and to $\beta$; then $n_\alpha,n_\beta\ge1$, $n_\alpha+n_\beta=13$ and $n_\alpha\alpha+n_\beta\beta=\pi$, so $\alpha<\pi/13<\beta$. Arrange the angles in the cyclic sequence $\gamma_0,\gamma_7,\gamma_{14},\dots$, in which $\gamma_y$ is followed by $\gamma_{y+7}$. Words such as $\alpha\beta\alpha$ below refer to consecutive terms of this cyclic sequence. \emph{Step 5: two chord formulas.} For the chord of step $5$ from $p_x$, note that $p_{x+5}-p_x=w_x+w_{x+6}+w_{x+12}$. By \eqref{eq:w}, $w_{x+6}=-e^{-i\gamma_{x+6}}w_x$ and $w_{x+12}=-e^{-i\gamma_{x+12}}w_{x+6}$, so with $A=\gamma_{x+6}$ and $B=\gamma_{x+12}$, two consecutive terms of the sequence, \[ |p_x-p_{x+5}|^2=\bigl|1-e^{-iA}+e^{-i(A+B)}\bigr|^2 =1-8\sin\tfrac A2\,\sin\tfrac B2\,\cos\tfrac{A+B}2=:f(A,B). \] For the chord of step $2$ from $p_{j-1}$, the vector $p_{j+1}-p_{j-1}$ is the sum of the sides from $p_{j-1}$ to $p_j$ and from $p_j$ to $p_{j+1}$. They have lengths $s(\gamma_{j+6})$ and $s(\gamma_{j+7})$, and the angle between them is $\varepsilon_j$. With $(A,B,C)=(\gamma_{j+6},\gamma_j,\gamma_{j+7})$, three consecutive terms of the sequence, \[ |p_{j-1}-p_{j+1}|^2=s(A)^2+s(C)^2+2s(A)s(C)\cos\bigl(B+\tfrac{A+C}2\bigr)=:F(A,B,C). \] As $x$ and $j$ run over $\Z/13$, these formulas cover all pairs and all triples of consecutive terms. \emph{Step 6: not both $\alpha\alpha$ and $\beta\beta$.} Suppose both words $\alpha\alpha$ and $\beta\beta$ occur. Then $n_\alpha,n_\beta\ge2$, so $2\alpha+\beta\sin\psi$ whenever $0<\psi<\phi$ and $\psi+\phi<\pi$; here $\psi+\phi$ is $2\alpha+\beta$ and $\alpha+2\beta$ respectively. So the chords of step $5$ take the three different values $f(\alpha,\alpha)>f(\alpha,\beta)>f(\beta,\beta)$, contradicting \eqref{eq:twovalues}. Since $13$ is odd, the sequence cannot alternate, so exactly one of the words $\alpha\alpha$, $\beta\beta$ occurs. \emph{Step 7: properties of $F$.} Clearly $F(A,B,C)$ is symmetric in $A$ and $C$, and \begin{equation}\label{eq:Fa} F(A,B,A)=2s(A)^2\bigl(1+\cos(A+B)\bigr)=4s(A)^2\cos^2\tfrac{A+B}2. \end{equation} Moreover, at any point with $A+C<\pi$ and $\varepsilon:=B+\frac{A+C}2\le\frac\pi2$, \[ \frac{\partial F}{\partial C}=2\cos\tfrac C2\bigl(s(C)+s(A)\cos\varepsilon\bigr)-s(A)s(C)\sin\varepsilon \ \ge\ s(C)\Bigl(2\cos\tfrac C2-2\sin\tfrac A2\Bigr)\ >\ 0, \] because $\cos\varepsilon\ge0$, $\sin\varepsilon\le1$ and $\frac C2<\frac\pi2-\frac A2$. By symmetry the same holds for $\partial F/\partial A$. \emph{Step 8: no two $\beta$'s adjacent.} Then every $\beta$ is between two $\alpha$'s, so $n_\beta\le6$ and $n_\alpha\ge7$. The word $\alpha\beta\alpha$ occurs. The $\alpha$'s form $n_\beta$ runs of consecutive terms; as $n_\alpha>n_\beta$, some run has length at least $2$, and it is followed by a $\beta$, so $\alpha\alpha\beta$ occurs. If all runs had length $2$ we would have $13=3n_\beta$; so some run has length $1$ or at least $3$, and $\beta\alpha\beta$ or $\alpha\alpha\alpha$ occurs. Now \[ F(\alpha,\beta,\alpha)= 1 and len(factor) in (1, 2) assert all(isinstance(c, int) and 0 <= c < k for c in factor) if len(factor) == 1: form = var(factor[0]) # x_c else: assert factor[0] != factor[1] form = add(var(factor[0]), var(factor[1]), -1) # x_a - x_b for _ in range(exponent): left = multiply(left, form) # right side: sum of multiplier * minor right = {} for b, rows, cols, multiplier in cert["terms"]: assert isinstance(b, int) and 0 <= b < n for triple in (rows, cols): assert len(set(triple)) == 3 and b not in triple assert all(isinstance(i, int) and 0 <= i < n for i in triple) a = {} for coefficient, exponents in multiplier: assert isinstance(coefficient, int) and len(exponents) == k assert all(isinstance(e, int) and e >= 0 for e in exponents) a = add(a, {tuple(exponents): coefficient}) right = add(right, multiply(a, minor(b, rows, cols))) assert left == right, "the identity does not hold" return True \end{lstlisting} \end{document}