\documentclass[11pt]{article} \usepackage[T1]{fontenc} \usepackage{amsmath,amssymb,amsthm,booktabs,geometry,hyperref} \geometry{margin=1in} \emergencystretch=2em \hypersetup{pdftitle={The seventh ternary density Hales--Jewett number},pdfauthor={P. Graham},pdfsubject={Computer-assisted proof of the exact value 1302},colorlinks=true,urlcolor=blue,citecolor=blue,linkcolor=blue} \newtheorem{theorem}{Theorem} \newtheorem{lemma}{Lemma} \newcommand{\cube}[1]{\{0,1,2\}^{#1}} \title{The seventh ternary density Hales--Jewett number} \author{P. Graham\\ \small\url{https://orcid.org/0009-0007-8493-1505}} \date{First published October 20, 2026; this version October 29, 2026 (v5)\\[2pt] \small Zenodo archive (\texttt{checks}, \texttt{data}): \url{https://doi.org/10.5281/zenodo.23752609}} \begin{document} \maketitle \begin{abstract} Let $c_{n,3}$ be the largest size of a subset of $\{0,1,2\}^n$ containing no combinatorial line, a triple obtained by varying a nonempty set of coordinates through the same letter while fixing the rest. We give a computer-assisted proof that $c_{7,3}=1302$, confirming Polymath1's tentative conjecture and closing its bounds $1302\leq c_{7,3}\leq1348$, recorded by Tao in 2009 and O'Bryant in 2015. The witness realizes Polymath1's known lower bound. Three auxiliary SAT bounds, slicing and global alphabet symmetry give sixteen main slice obligations. Refutations of all nineteen formulas were accepted by FRAT-rs, and in a separate earlier production campaign by drat-trim's \texttt{lrat-check}. Formal verification applies to certificate checking: cake\_lpr, verified in HOL4 and compiled with CakeML, accepted refutations of all nineteen formulas across two regeneration campaigns. The SAT encodings, cap induction, symmetry reduction, case cover and counting interpretation are justified by the written proof and separate executable checks; they are outside that formal verification. \end{abstract} The proofs, the search code, the certificate checkers and the text were produced by AI models (from OpenAI and Anthropic), working under the author's direction. This work has not yet been reviewed by experts. \section{Introduction} The density Hales--Jewett theorem of Furstenberg and Katznelson~\cite{fk}, with a later combinatorial proof by Polymath1~\cite{annals}, concerns large subsets of word spaces and the combinatorial lines they must contain. A combinatorial line varies a nonempty set of coordinates through the same letter while fixing the rest. The finite extremal values are not determined by the asymptotic theorem. For a fixed dimension $n$, write $c_{n,3}$ for the maximum size of a line-free subset of the ternary word cube $\cube n$, and abbreviate $c_n=c_{n,3}$, with $c_0=1$. The Polymath1 project, writing as D.H.J. Polymath, had determined these numbers through dimension six and established the lower bound 1302 in dimension seven by March 2009~\cite{tao2009}; its 2010 paper gives a full account~\cite[Theorem 1.4 and Sections 2--3]{polymath}. Section 2 of its 2010 paper calls this the bound ``which we tentatively conjecture to be the correct bound''~\cite{polymath}. OEIS A156989, accessed October 20, 2026, lists the established terms through dimension six, ending at 450~\cite{oeis}. The historical gap between Polymath1's bounds is explicitly documented. In a March 4, 2009 Polymath1 post, Tao writes: ``The current best-known bounds for $c_7$ are $1302\leq c_7\leq1348$.''~\cite{tao2009} O'Bryant's 2015 paper repeats ``$1302\leq c_{7,3}\leq1348$'' in its list of density Hales--Jewett numbers~\cite[Section 3.3, p.~7]{obryant}. We close this gap by proving the matching unrestricted upper bound. The upper-bound proof was first posted in version 1, cited below. The Polymath1 paper gives the 1302 lower bound and the slicing inequality, but does not state 1348; the latter bound is recorded in Tao's contemporary account, without an individual discoverer identified here. \paragraph{Relation to earlier versions.} Version 1, posted October 20, 2026~\cite{previousone}, first presented the theorem and upper-bound proof. Version 2, also posted October 20~\cite{previous}, corrected the attribution of the 2009 bounds and described the witness as a realization of Polymath1's known lower bound. Version 3, posted October 21~\cite{previousthree}, completed cake\_lpr coverage without changing the theorem or formulas; Section~\ref{certificates} distinguishes the checking campaigns. Version 4, posted October 22~\cite{previousfour}, dated Polymath1's values through dimension six explicitly to March 2009, corrected the Shelah citation, and withdrew the earlier qualified first-proof claim. This version, version 5, corrects wording of credits, the review-status disclosure, descriptions of adjacent work, and the version and checker history. It clarifies the scope of formal verification and the proved-cap notation; the theorem, formulas and computational checks are unchanged. \begin{theorem}\label{main} Every subset of $\cube 7$ with no combinatorial line has at most 1302 points, and a line-free subset of size 1302 exists. Equivalently, $c_{7,3}=1302$. \end{theorem} The contribution claimed here is the upper bound for arbitrary subsets. The known lower bound and the conjectured value belong to Polymath1. The global alphabet permutation only orders slice labels without loss of generality; the set need not be invariant under it. The argument proves the caps $c_1\leq2$, $c_4\leq52$ and $c_5\leq150$ by auxiliary SAT refutations, and obtains $c_2\leq6$, $c_3\leq18$ and $c_6\leq450$ by slicing. The elementary base $c_1\leq2$ is included as a SAT obligation for uniform certificate checking: the full three-point cube is itself a line. A set of size at least 1303 has largest first-coordinate slice size $s\geq\lceil1303/3\rceil=435$, while the six-dimensional cap gives $s\leq450$. Ordering the three slice sizes therefore leaves sixteen cases. Each SAT instance imposes total size at least 1303 and exact largest-slice size $a_0=s\geq a_1\geq a_2$. Separate production and regeneration campaigns provide the certificate checks summarized in Section~\ref{certificates}. That section identifies each checker's coverage, the recorded CNF identity matches, and the measured costs. The trusted base consists of the written cap induction, global symmetry and case-coverage arguments; the counting interpretation and its separately written, unverified audit program, which imports no encoder code; the proof checkers within the coverage stated; and the unverified exhaustive witness checkers. Each hypothetical set determines all auxiliary variables simultaneously by actual point counts. The auditor matches every clause symbolically to a clause family whose counting justification is written in Section~\ref{encoding}; it does not sample sets. Its success supports the required extension from any set counterexample to a satisfying assignment, subject to those written lemmas and the correctness of the auditor. Separate implementation is a safeguard, not a proof of correctness or independent human review. The complete theorem, including this reduction, is not formalized. The small-dimensional caps are proved within the computation, rather than imported as unchecked premises from Polymath1. Recent work addresses adjacent questions: Mouhib's symmetric and one-weight coloring bounds~\cite{mouhib}, Conlon--Farnsworth--Robertson's coloring questions~\cite{color}, Shelah's improved bounds on the Hales--Jewett numbers~\cite{shelah}, and Dahia's formalization of the density Hales--Jewett theorem~\cite{dahia}. These are different endpoints and are not premises of this proof. This result determines one finite extremal value, not a new proof or improved general bound for the density theorem. \section{Lines, caps and symmetry} Any line-free set of at least 1303 points has a line-free 1303-point subset. Our formulas directly exclude every set of size at least 1303, which is stronger than excluding sets of size exactly 1303. A wildcard pattern is a word in $\{0,1,2,*\}^n$ with at least one wildcard. Its line consists of $w(0),w(1),w(2)$, replacing all wildcards simultaneously. There are $4^n-3^n$ lines; thus the seven-dimensional audit checks 14,197 lines. A coordinate subcube is obtained by fixing some coordinates. A line-free set meets a $d$-dimensional subcube in at most $c_{d,3}$ points. Splitting on one coordinate gives \begin{equation}\label{split} c_{d,3}\leq 3c_{d-1,3}.\end{equation} We continue to use the shorthand $c_d=c_{d,3}$. \begin{lemma}\label{sym} A single permutation $\pi$ of the alphabet, applied simultaneously in every coordinate, preserves lines, line-freeness, cardinality and coordinate-subcube bounds. It permutes the three first-coordinate slice sizes arbitrarily. \end{lemma} \begin{proof} Apply $\pi$ to each constant of a wildcard pattern, leaving its wildcard positions unchanged. The image of $w(a)$ is the resulting pattern evaluated at $\pi(a)$. Since $\pi$ is bijective, the image of the three-point line is exactly a line. The same map is bijective on all words and carries coordinate subcubes to subcubes of the same dimension. A first-coordinate slice labeled $a$ becomes the slice labeled $\pi(a)$. Choosing $\pi$ to send the three slice labels to their order by size proves the last assertion, including ties. \end{proof} Permuting symbols in the first coordinate alone is not the symmetry used here. For example, swapping 0 and 1 in that coordinate sends the line $\{00,11,22\}$ to $\{10,01,22\}$, which is not a combinatorial line. Earlier proof descriptions used this invalid local explanation. Lemma~\ref{sym} corrects it; the case formulas and the case cover are unchanged. \section{The finite reduction} The three auxiliary obligations are denoted $L_1,L_4,L_5$. They exclude line-free sets of sizes at least 3, 53 and 151 in dimensions 1, 4 and 5, respectively. Their formula inputs are: \begin{center} \begin{tabular}{llll}\toprule Obligation & Dimension & Required size & Proper-subcube caps used\\\midrule $L_1$ & 1 & 3 & none\\ $L_4$ & 4 & 53 & $2,6,18$\\ $L_5$ & 5 & 151 & $2,6,18,52$\\\bottomrule \end{tabular} \end{center} The refutations establish $c_1\leq2$, then $c_4\leq52$, then $c_5\leq150$, in that order. Between them, (\ref{split}) establishes $c_2\leq6$, $c_3\leq18$ and $c_6\leq450$. There is no use of a cap of the dimension currently being proved. Thus no published small-dimensional optimality result is needed as an unchecked premise. Suppose a line-free $A\subseteq\cube 7$ has $|A|\geq1303$. Write $a_v=|A\cap\{x_1=v\}|$. Lemma~\ref{sym} permits $a_0\geq a_1\geq a_2$. Since each slice is six-dimensional, \[ 435=\lceil1303/3\rceil\leq a_0\leq450. \] For each integer $s$ in this interval the main formula encodes line-freeness, size at least 1303, the proper-subcube caps $2,6,18,52,150,450$, and \[ a_0=s\geq a_1\geq a_2. \] All sixteen formulas are unsatisfiable. Every counterexample to the upper bound would, after the global relabeling, satisfy one of them. Their refutations therefore imply $c_7\leq1302$. \section{Encoding and independent semantic audit}\label{encoding} Point $x=(x_1,\ldots,x_n)$ has variable index $1+\sum_i x_i3^{n-i}$, interpreted as $x\in A$. Every line contributes the clause consisting of its three negated point variables. Hierarchical unary totalizers count points in coordinate subcubes and in intermediate unions of two child subcubes. Auxiliary variable $(S,j)$ means $|A\cap S|\geq j$, where $S$ is a product of nonempty subsets of the alphabet. Thresholds are truncated only beyond an available cap; the first forbidden threshold is explicitly false. A root threshold forces $|A|\geq K$. Units force $a_0=s$ and threshold implications force the slice order. The encoder and independent auditor are supplied as \texttt{checks/encode.py} and \texttt{checks/reduction.py}. For clarity, the audit checks the clause-family conditions used in the written upper-bound argument: every hypothetical counterexample extends to a satisfying assignment by the stated threshold interpretation. It does not rely on a solver's interpretation of auxiliary variables. For a box $S=M_1\times\cdots\times M_n$, let $d$ be its number of unrestricted coordinates. If $d