\documentclass[10pt]{article} \usepackage[a4paper,left=19mm,right=19mm,top=20mm,bottom=24mm,footskip=11mm]{geometry} \usepackage[T1]{fontenc} \usepackage{amsmath,amsthm} \usepackage{stix2} \usepackage[protrusion=true,expansion=true,letterspace=60]{microtype} \usepackage{booktabs,array,tabularx} \usepackage{xcolor} \usepackage{titlesec} \usepackage[framemethod=default]{mdframed} \usepackage[hidelinks]{hyperref} % ---- type sizes of «The Dancing Sand Theorem» (body 10.6 pt, leading 1.46) ---- \makeatletter \renewcommand\normalsize{\@setfontsize\normalsize{10.6pt}{15.4pt}% \abovedisplayskip 7pt plus 2pt minus 3pt\belowdisplayskip\abovedisplayskip \abovedisplayshortskip 3pt plus 1pt\belowdisplayshortskip 4pt plus 2pt minus 1pt} \renewcommand\small{\@setfontsize\small{9.4pt}{12.4pt}} \renewcommand\footnotesize{\@setfontsize\footnotesize{8.6pt}{11pt}} \makeatother \normalsize \setlength{\parindent}{0pt} \setlength{\parskip}{1.6mm plus 0.6mm minus 0.2mm} \definecolor{rulegrey}{HTML}{888888} \definecolor{boxgrey}{HTML}{777777} \color[HTML]{111111} % ---- headings: 14 pt bold with a thin grey rule; 11.6 pt; 10.8 pt ---- \titleformat{\section}{\fontsize{14}{17}\selectfont\bfseries}{\thesection.}{0.35em}{}[\vspace{0.6mm}{\color{rulegrey}\titlerule[0.4pt]}] \titlespacing*{\section}{0pt}{6.5mm plus 1mm}{2.2mm} \titleformat{\subsection}{\fontsize{11.6}{14}\selectfont\bfseries}{\thesubsection}{0.5em}{} \titlespacing*{\subsection}{0pt}{4mm plus 1mm}{1.2mm} % ---- statements: bold head, upright body, as in the Dancing Sand ---- \newtheoremstyle{ds}{2.2mm}{2.2mm}{\upshape}{}{\bfseries}{.}{0.5em}{\thmname{#1}\thmnumber{ #2}\thmnote{ (#3)}} \newtheoremstyle{dsrem}{2.2mm}{2.2mm}{\upshape}{}{\bfseries}{.}{0.5em}{} \renewcommand\qedsymbol{$\blacksquare$} \mdfdefinestyle{headline}{topline=false,bottomline=false,rightline=false,linewidth=0.6pt,linecolor=boxgrey, innerleftmargin=4mm,innerrightmargin=0mm,innertopmargin=1.2mm,innerbottommargin=1.2mm, leftmargin=4mm,rightmargin=4mm,skipabove=3mm,skipbelow=3mm} % ---- page numbers: centred, 9.5 pt, none on the first page ---- \makeatletter \renewcommand\@oddfoot{\hfil{\fontsize{9.5}{11}\selectfont\color[HTML]{222222}\thepage}\hfil} \renewcommand\@evenfoot{\@oddfoot} \renewcommand\@oddhead{}\renewcommand\@evenhead{} \makeatother \theoremstyle{ds} \newtheorem{theorem}{Theorem} \renewcommand{\thetheorem}{\Alph{theorem}} \newtheorem{conjecture}[theorem]{Conjecture} \newtheorem{lemma}{Lemma} \newtheorem{proposition}[lemma]{Proposition} \newtheorem{corollary}[lemma]{Corollary} \newtheorem{definition}[lemma]{Definition} \newtheorem*{thmDp}{Theorem D$_p$ (the odd dance)} \newtheorem*{thmSmith}{Theorem (the Smith form of $M_p$)} \theoremstyle{dsrem} \newtheorem{remark}[lemma]{Remark} \newtheorem{example}[lemma]{Example} \emergencystretch=3em \newcommand{\Z}{\mathbb{Z}} \newcommand{\Q}{\mathbb{Q}} \newcommand{\F}{\mathbb{F}} \newcommand{\Syl}{\operatorname{Syl}} \newcommand{\coker}{\operatorname{coker}} \newcommand{\rank}{\operatorname{rank}} \newcommand{\Dist}{\operatorname{Dist}} \hypersetup{pdftitle={The Coloured Sand Theorem},pdfsubject={The p-part of the sandpile group of the Hamming graph, for every prime p dividing q and every dimension d},pdfauthor={Rafael Amichis Luengo}} \begin{document} \thispagestyle{empty} \begin{center} \vspace*{2mm} {\fontsize{25}{30}\selectfont\bfseries\textls[60]{THE COLOURED SAND THEOREM}\par} \vspace{4.5mm} {\fontsize{13.5}{17.5}\selectfont\itshape The $p$-part of the sandpile group of the Hamming graph,\\ for every prime $p$ dividing $q$ and every dimension $d$\par} \vspace{7mm} {\bfseries Rafael Amichis Luengo\par} \vspace{1.4mm} Madrid, Spain \,\textperiodcentered\, tretoef@gmail.com \,\textperiodcentered\, ORCID \href{https://orcid.org/0009-0008-6252-675X}{0009-0008-6252-675X}\par \vspace{0.6mm} 15 October 2026 \,\textperiodcentered\, version 6 \,\textperiodcentered\, doi:\href{https://doi.org/10.5281/zenodo.23327608}{10.5281/zenodo.23327608} (all versions)\par \end{center} \vspace{2mm} {\color{rulegrey}\hrule height 0.4pt} \section*{Abstract} Let $H(d,q)=K_q^{\,d}$ be the Hamming graph and $K(H(d,q))$ its sandpile group (critical group, Jacobian). For primes $p\nmid q$ its $p$-part was determined by Jacobson, Niedermaier and Reiner in 2003, who wrote that the other primes appear ``to be difficult, due to bad behavior of its $p$-primary structure''. {\boldmath\textbf{We determine the Sylow $p$-subgroup of $K(H(d,q))$ for every prime $p$ dividing $q$ and every $d$, by an explicit rule.}} After the splitting of Jacobson, Niedermaier and Reiner, the group is a sum of cokernels of operators $q(c+H)+U$ on the Boolean lattice (Theorem~A). These split over the indecomposable tilting modules $T(\lambda)$ of $SL_2$ in characteristic $p$ that occur in a tensor power of the natural module. The contribution of $T(\lambda)$ consists of explicit small cyclic factors and of $2^{|I|}$ large ones, where $I$ is the set of positions of the nonzero base-$p$ digits of $\lambda+1$ below the leading one. The large ones are obtained by pooling explicit integers, built from binomial valuations and base-$p$ carries, into a non-increasing sequence (Theorems~I and~J). The proof writes down explicit $\Z_p$-lattices for all tilting modules of $SL_2$, one move per base-$p$ digit; it reduces each contribution to the Smith form of an explicit $2^{|I|}\times2^{|I|}$ matrix, and computes that form as in our proof for the hypercube \cite{DST}, the case $p=2$. We also give closed formulas that need no pooling: for $p>d$ with ballot numbers (B), for the exponent with every prime (C), and for the number of cyclic factors (D). This proves Conjecture~I of version~3. {\boldmath\textbf{Every result of the paper, Theorems A--J, is checked in Lean~4 with Mathlib, for every prime, and the Lean project was rebuilt from its sources on GitHub's machines, on Mathlib's published build (\S\ref{sec:lean}).}} This work has not been refereed by a human expert. \vspace{3mm}{\color{rulegrey}\hrule height 0.4pt} \clearpage \subsection*{Summary of results} Throughout, $p$ is a prime, $q\ge2$, $e=v_p(q)$, and $\Syl_pA$ is the $p$-primary part of a finite abelian group $A$. \smallskip \begin{center}\small \begin{tabularx}{\textwidth}{@{}l X l l@{}} \toprule Result & What it says & Where & Lean\\ \midrule Theorem A & $\coker L(H(d,q))$ is a sum of pieces $X_q(m,c)=\coker(q(c+H)+U)$ (Jacobson--Niedermaier--Reiner) & \S1, \S2 & checked\\ Theorem B & $\Syl_pK(H(d,q))$ for $p>d$, $p\mid q$, with ballot numbers & \S3 & checked\\ Theorem C & the exponent of $\Syl_pK(H(d,q))$, every $p$, $q\ge3$ & \S4 & checked\\ Theorem D & the number of cyclic factors, $p\mid q$ & \S5 & checked\\ Theorem E & every piece of size $mp^k$; the others form an explicit group independent of $q$ and of the shift (Conjecture~I of version~3) & \S8, \S9 & checked\\ \textbf{Theorem J} & the whole $\Syl_pK(H(d,q))$, every $p\mid q$, every $d$, in closed form & \S8, \S9 & checked\\ \bottomrule \end{tabularx} \end{center} \smallskip \noindent\textbf{Status.} This is a preprint. For $d=2$ the whole group $K(H(2,q))$ was known before (Ducey, Gerhard and Watson \cite{DGW}); our results are new, to the best of our knowledge, for $d\ge3$ (see the section on provenance at the end). The proofs of Theorems A--H were re-derived by an independent reader with no access to our audits; that reading found one priority omission, three citation and presentation gaps and one wrong example in a remark, all corrected here (\S\ref{sec:changes}). The proofs of Theorems I and J were written by one reader, re-derived by a second and read cold by a third, who wrote the riskiest step, the floor of the Smith form for odd $p$, out in full; it found no error and no gap. The Lean certificate and version~5 were read cold by a fourth reader, who found three claims of version~5 wider than the Lean proof of that day: the cases Theorem~\ref{thBprime} for $p\nmid q$ and Theorems~F, G and~I for $p=2$ are now checked, and \S\ref{sec:lean} now says on which lattices Theorem~I and the blocks of Theorem~J are proved. The changes of version~6 were read cold by a fifth reader, who found no error in the mathematics or in the Lean statements; its corrections of wording are applied (\S\ref{sec:changes}). All these readers are instances of the AI system Claude; no human expert has read the proofs. Every result of the paper, Theorems A--J, is checked in Lean~4 with Mathlib for every prime (\S\ref{sec:lean}). \vspace{3mm}{\color{rulegrey}\hrule height 0.4pt} \section{Introduction} For a connected graph $\Gamma$ with Laplacian $L(\Gamma)$, the sandpile group $K(\Gamma)$ is the torsion subgroup of $\coker L(\Gamma)$, and $\coker L(\Gamma)\cong\Z\oplus K(\Gamma)$; its order is the number of spanning trees \cite{Big}. The Hamming graph $H(d,q)$ has vertex set $(\Z/q)^d$, two vertices being adjacent when they differ in exactly one coordinate; it is the Cartesian power $K_q^{\,d}$ of the complete graph. Its Laplacian eigenvalues are $qs$, $0\le s\le d$, with multiplicity $\binom ds(q-1)^s$. Jacobson, Niedermaier and Reiner \cite{JNR} determined the Sylow $p$-subgroup of $K(K_{n_1}\times\cdots\times K_{n_k})$ for every prime $p$ that divides none of the $n_i$ \cite[Theorem~2]{JNR}, and bounded the number of invariant factors \cite[Theorem~3]{JNR}. About the other primes they wrote: ``Describing the exact structure of the critical group $K(K_{n_1}\times\cdots\times K_{n_k})$ appears to be difficult, due to bad behavior of its $p$-primary structure for primes $p$ that divide some of $n_1,\dots,n_k$.'' Ducey and Jalil \cite{DJ} recovered the results of \cite{JNR} by another method. For $d=2$ the whole group $K(H(2,q))=K(K_q\times K_q)$ was determined by Ducey, Gerhard and Watson \cite[Theorem~1.1]{DGW}; it also follows from \cite[Theorem~13 and Example~11]{JNR}. Our results agree with it at $d=2$, and are new, to the best of our knowledge, for $d\ge3$. For $q=2$ the graph is the hypercube; its odd part is due to Bai \cite{Bai} and its $2$-part was determined in \cite{DST}. In this paper $q\ge2$ is arbitrary, $p$ is a prime dividing $q$, and $e:=v_p(q)\ge1$, except where we say otherwise. \subsection{The pieces} Let $B_m$ be the free abelian group on the subsets of $[m]=\{1,\dots,m\}$, graded by size: $B_m=\bigoplus_{s=0}^m B_m(s)$. Let $H$ act on $B_m(s)$ as the scalar $s$, and let $U$ and $D$ be the up and down operators, \[ U(S)=\sum_{x\notin S}S\cup\{x\},\qquad D(S)=\sum_{x\in S}S\setminus\{x\}. \] For integers $c\ge0$ put \[ X_q(m,c):=\coker\big(q(c+H)+U\ \text{ on } B_m\big). \] It is finite when $c\ge1$; for $c=0$ it is $\Z$ plus a finite group. \begin{theorem}[Jacobson--Niedermaier--Reiner {\cite[Theorem~13]{JNR}}]\label{thA} For every $q\ge2$ and $d\ge1$, as abelian groups, \[ \coker L\big(H(d,q)\big)\;\cong\;\bigoplus_{j=0}^{d} X_q(d-j,\,j)^{\oplus\binom dj (q-2)^j}. \] \end{theorem} This is the case $n_1=\dots=n_d=q$ of \cite[Theorem~13]{JNR}: there the pieces are upper triangular matrices $M(N;n_S)$ of size $2^{|S|}$ with identity blocks above the diagonal, and after reversing the order of the subsets of $S$ they are the matrices $q(c+H)+U$. We include the short proof below, in the form we use. For $q=2$ only $j=0$ survives and the theorem says $\coker L(Q_d)\cong X_2(d,0)$, the starting point of \cite{DST}. \begin{theorem}[the primes $p>d$]\label{thB} Let $d\ge1$, let $p>d$ be a prime dividing $q$, and $e=v_p(q)$. Then \[ \Syl_p K\big(H(d,q)\big)\;\cong\;\bigoplus_{v=1}^{d}\big(\Z/p^{ev}\big)^{n_v},\qquad n_v=\sum_{\substack{j+2k=d+1-v\\ (j,k)\neq(0,0)}}\binom{d}{j}\,(q-2)^{j}\,b(k,v), \] the sum over integers $j,k\ge0$ (the condition $(j,k)\ne(0,0)$ is automatic, since $j+2k=d+1-v\ge1$), where $b(k,v)=\frac{v}{v+2k}\binom{v+2k}{k}=[x^k]\,C(x)^v$ are the ballot numbers and $C(x)=\sum_n\frac1{n+1}\binom{2n}nx^n$ is the Catalan series. \end{theorem} Equivalently, with $c(z)=C(z^2)$ and $u=q-2$, $\sum_v n_v y^v=[z^{d+1}]\,(1+uz)^d\,\frac{yz\,c(z)}{1-yz\,c(z)}-y^{d+1}$. For instance, with $u=q-2$: \begin{align*} d=2:&\quad (\Z/p^{e})^{u^2+1}\oplus(\Z/p^{2e})^{2u},\\ d=3:&\quad (\Z/p^{e})^{u^3+3u}\oplus(\Z/p^{2e})^{3u^2+2}\oplus(\Z/p^{3e})^{3u},\\ d=4:&\quad (\Z/p^{e})^{u^4+6u^2+2}\oplus(\Z/p^{2e})^{4u^3+8u}\oplus(\Z/p^{3e})^{6u^2+3}\oplus(\Z/p^{4e})^{4u}. \end{align*} Theorem~\ref{thB} is the case $md$ this gives $E=ed$, as in Theorem~\ref{thB}. For $p\le d$ the maximum need not be at $s=d$: for $q=3$ and $d=10$ it is at $s=9$ and $E=11$. The case $e=0$ ($p\nmid q$) can also be read off from \cite[Theorem~2]{JNR}; we include it because the proof below covers it at no cost. \begin{theorem}[the number of cyclic factors]\label{thD} Let $p\mid q$. The number of cyclic factors of $\Syl_p K(H(d,q))$ is \[ N=\sum_{j=0}^{d}\binom dj(q-2)^j\Big(2^{\,d-j}-\rho_p(d-j)\Big)\;-\;1,\qquad \rho_p(m)=\sum_{s=0}^{m-1}r_p(m,s), \] where $r_p(m,s)=\sum_{i}\big(\binom mi-\binom m{i-1}\big)$, the sum over $0\le i\le t$ with $p\nmid k-i$, and $(t,k)=(s,s+1)$ if $2s\le m-1$, $(t,k)=(m-1-s,m-s)$ otherwise. \end{theorem} Here $\rho_p(m)$ is the rank over $\F_p$ of $U$ on $B_m$. For $q=p=3$ the theorem gives $N=1,4,12,34,96,274,\dots$, and $N=3^{d-1}+2^{d-1}-1$ for every $d$ (Corollary~\ref{corN}). For $q=p$ the value of $N$ equals the bound $\frac12(q^d+(q-2)^d)-1$ of \cite[Theorem~3]{JNR} for $d\le2$, is one less for $d=3$, and is strictly smaller for $4\le d\le8$ and $p\le11$ (where we compared). \begin{corollary}\label{corq} $\Syl_p K(H(d,q))$ depends on $q$ only through $e=v_p(q)$ and the multiplicities $\binom dj(q-2)^j$. \end{corollary} \subsection{The rest of the paper} Theorems~\ref{thBprime}--\ref{thP} (Sections~3, 6 and~7) compute the pieces $X_q(m,c)$ for $mm$} On $B_m$ one has $[D,U]=m-2H$: on a set $S$ of size $s$, $DU(S)=(m-s)S+\Sigma$ and $UD(S)=s\,S+\Sigma$ with the same sum $\Sigma=\sum_{y\in S,\,x\notin S}(S\setminus\{y\})\cup\{x\}$. For $0\le k\le m/2$ let $\Lambda_k=\ker D\cap B_m(k)$. By induction on $i$, for $v\in\Lambda_k$, \begin{equation}\label{DU} D\,U^iv=i\,(m-2k-i+1)\,U^{i-1}v . \end{equation} Over $\Q$ this is the classical $\mathfrak{sl}_2$-structure of the Boolean lattice \cite{Pro}: \[B_m\otimes\Q=\bigoplus_{k\le m/2}\ \bigoplus_{i=0}^{m-2k}U^i\Lambda_k^{\Q},\] $\dim\Lambda^{\Q}_k=\binom mk-\binom m{k-1}$, and $U^{m-2k+1}\Lambda_k=0$. We call $\Lambda_k,U\Lambda_k,\dots,U^{m-2k}\Lambda_k$ a \emph{string}; its ranks are $k,\dots,m-k$ and its length is $m-2k+1$. \begin{lemma}[strings over $\Z_{(p)}$]\label{strings} If $p>m$, then $B_m\otimes\Z_{(p)}=\bigoplus_{k\le m/2}\bigoplus_{i=0}^{m-2k}U^i\Lambda_k$, each $\Lambda_k$ is free of rank $\binom mk-\binom m{k-1}$, and $U^i\colon\Lambda_k\to U^i\Lambda_k$ is an isomorphism for $i\le m-2k$. \end{lemma} \begin{proof} All lattices below are over $R=\Z_{(p)}$. First, for $r\le m/2$ we show $B_m(r)=U B_m(r-1)\oplus\Lambda_r$, by induction on $r$ (for $r=0$, $\Lambda_0=B_m(0)$). By induction $B_m(r-1)=\bigoplus_{kk'$ (since $Dv_k=0$), lies in $U^{k'-k}\Lambda_k\subseteq UB_m(k'-1)$ if $kd$, every piece $X_q(d-j,j)$ has $m=d-js^*$, write $b=s^*+r$ and $L=s^*+r'$ with $1\le r'\le rp$ break: by \eqref{DU} the coefficient $i(m-2k-i+1)$ vanishes modulo $p$. The way they break is governed by the representation theory of $SL_2$ in characteristic $p$. \subsection{The dictionary} Let $V=\Z_p v_0\oplus\Z_p v_1$, where $\Z_p$ is the ring of $p$-adic integers, and let $f$ act on $V$ by $fv_0=v_1$, $fv_1=0$; give $v_0$ weight $1$ and $v_1$ weight $-1$. Identify $B_m\otimes\Z_p$ with $V^{\otimes m}$ by $S\mapsto v_{\mathbf 1_S}$. Then $U$ is the action of $f$ on the tensor power, a subset of size $s$ has weight $m-2s$, and so $H=(m-h)/2$ with $h$ the weight. The divided powers $U^{(r)}$ (add $r$ new elements, in all ways) are integral, and so is the analogous operator $e^{(r)}$ (remove $r$ elements). Hence $B_m\otimes\Z_p$ is a module over the distribution algebra $\mathrm{Dist}(SL_2)_{\Z_p}$, and \[ q(c+H)+U \;=\; q\big(c+\tfrac{m-h}{2}\big)+f \] is built from that action alone. We use three standard facts. \begin{enumerate} \item[(T1)] $V^{\otimes m}$ is a tilting module, and it decomposes over $\Z_p$ as $\bigoplus_\lambda T_{\Z_p}(\lambda)^{n_\lambda}$, where $T_{\Z_p}(\lambda)$ is the unique lift of the indecomposable tilting module $T(\lambda)$ over $\F_p$. The reason is that $\mathrm{Ext}^1(\Delta,\nabla)=0$, so decompositions over $\F_p$ lift; this is classical \cite[\S1.2]{And}, \cite[II.E.6, II.E.19--E.22]{Jan}. For $p=2$ the argument is written out, and checked in Lean, in \cite[Lemma~3.3, Corollary~3.4]{DST}. \item[(T2)] Let $\lambda\le p^2+p-1$. If $\lambda\le p-1$, or if $\lambda+1\equiv0\pmod p$ and $\lambda\le p^2-1$, then $T(\lambda)=\Delta(\lambda)$ is simple. Otherwise write \[ \lambda=p-1+r+pa,\qquad 1\le r\le p,\ 0\le a\le p-1, \] where $r=p$ (and then $a=p-1$) occurs only for $\lambda=p^2+p-1$. Then $T(\lambda)$ has exactly two Weyl factors, $\Delta(\lambda)$ and $\Delta(\lambda^-)$ with $\lambda^-:=\lambda-2r$, and it is a non-split extension $0\to\Delta(\lambda)\to T(\lambda)\to\Delta(\lambda^-)\to0$; so is its lift over $\Z_p$. Indeed, by Donkin's tensor product theorem \cite[Prop.~2.1]{Don} (for $SL_2$ in every characteristic see \cite[Prop.~3.4(a)]{STWZ} and \cite[Remark~1.1(ii)]{And}), $T(p-1+r'+pb)\cong T(p-1+r')\otimes T(b)^{[1]}$ for $0\le r'\le p-1$. For $r\le p-1$ take $r'=r$, $b=a\le p-1$, so that $T(a)=\Delta(a)$. For $\lambda=p^2+p-1$ take $r'=0$, $b=p$: then $T(p-1)$ is the Steinberg module and $T(p)$ has the Weyl factors $\Delta(p),\Delta(p-2)$. In both cases the product of characters, expanded by Brauer's formula with $\chi(-n-2)=-\chi(n)$, leaves exactly $\chi(\lambda)+\chi(\lambda-2r)$; the other terms cancel in pairs. \item[(T3)] Comparing characters, the multiplicities in $V^{\otimes m}$ are given, from the top down, by $n_\lambda=\beta(m,\lambda)-n_{\lambda^+}$. Here $\lambda^+$ is the weight whose bottom factor is $\lambda$, and $n_{\lambda^+}=0$ if there is none or if $\lambda^+>m$. (For $\lambda\le p^2+p-1$ the map $\lambda\mapsto\lambda^-$ is injective: $\lambda^-\equiv p-1-r\pmod p$ determines $r$, and then $a$.) \end{enumerate} For $\lambda\equiv m\pmod 2$, $0\le\lambda\le m$, write $\beta(m,\lambda)=\binom{m}{(m-\lambda)/2}-\binom m{(m-\lambda)/2-1}$ (the number of strings of length $\lambda+1$). \subsection{The blocks} Fix $m$, $c$ and $\lambda\equiv m\pmod2$, put $k=(m-\lambda)/2$ and \[ v_t=e+v_p(c+k+t)\qquad(0\le t\le\lambda), \] with $v_0=\infty$ when $c=k=0$. Put $A=\sum_{t=0}^{\lambda}v_t$. When $T(\lambda)$ has two Weyl factors, with $(r,a)$ as in (T2), put also \[ A'=\sum_{t=r}^{r+\lambda^-}v_t,\qquad \alpha=\sum_{t=(a+1)p}^{\lambda}v_t,\qquad \tau=1+[a=p-1], \] and \[ E_{11}=A-\alpha-a,\qquad E_{12}=A'-a+\tau,\qquad E_{22}=A'-a+\alpha. \] Here $A'$ is the sum over the levels of the bottom factor (it is $A_c(m,\lambda^-)$ in the notation of Theorem~\ref{glue}), and $\alpha$ is the sum over the last $r$ levels of the top factor. Define the abelian $p$-group $G_c(m,\lambda)$ by \[ G_c(m,\lambda)=\begin{cases} \Z/p^{A}, & \lambda\le p-1,\\[2pt] (\Z/p)^{a}\oplus\Z/p^{A-a}, & \lambda+1=(a+1)p\le p^2,\\[2pt] (\Z/p)^{2a}\oplus\Z/p^{x}\oplus\Z/p^{y}, & \text{two Weyl factors}, \end{cases} \] where $x=\min(E_{11},E_{12},E_{22})$ and $y=E_{11}+E_{22}-x$. When $c=k=0$ (the block containing the empty set) we put instead: $\Z_p$ for $\lambda\le p-1$; $\Z_p\oplus(\Z/p)^a$ in the second case; and $\Z_p\oplus(\Z/p)^{2a}\oplus\Z/p^{\min(E_{12},E_{22})}$ in the third. When $a+1r$, where it vanishes), so the image of $\tilde s_0$ in $T\otimes\F_p$ is a highest weight vector of weight $\mu$. It generates the image of a map $\Delta(\mu)\to T\otimes\F_p$, and the composite with $T\otimes\F_p\to\Delta(\mu)$ is the identity on the generator, so it is an isomorphism and the extension splits. This is impossible, because $T\otimes\F_p=T(\lambda)$ is indecomposable. So $x_0=u\,p^{-\nu}$ with $u$ a unit, and rescaling $y$ makes $u=1$. The lattice so described is $T$ itself, so it is stable under all $f^{(t)}$ and $e^{(t)}$; nothing more has to be checked. (For $f^{(t)}$ this is also visible directly: $f^{(t)}\tilde s_j-\binom{j+t}{t}\tilde s_{j+t}$ vanishes by the identity $\binom{j+r}{j}\binom{j+r+t}{t}=\binom{j+t}{t}\binom{j+t+r}{j+t}$.) Stability under every $e^{(t)}$ and $f^{(t)}$ is also checked by machine in Section~\ref{sec:ver}. \end{proof} \begin{lemma}[the blocks]\label{blocks} Embed $T_{\Z_p}(\lambda)$ in $B_m\otimes\Z_p$ at levels $k,\dots,k+\lambda$ ($m=\lambda+2k$). Then the cokernel of $q(c+H)+U$ on it is $G_c(m,\lambda)$. The same holds for the simple blocks. \end{lemma} \begin{proof} Put $N_t=q(c+k+t)$, so $v_p(N_t)=v_t$, and $M=q(c+H)+U$. In the basis of Lemma~\ref{forced}: \begin{itemize} \item $M\ell_i=N_i\ell_i+(i+1)\ell_{i+1}$; \item $M\tilde s_j=N_{j+r}\tilde s_j+(j+1)\tilde s_{j+1}$ for $j<\mu$; the $\ell$-component is $p^{-\nu}[(j+r+1)\binom{j+r}{j}-(j+1)\binom{j+r+1}{j+1}]\ell_{j+r+1}=0$; \item $M\tilde s_\mu=N_{\mu+r}\tilde s_\mu+u\,\ell_{\mu+r+1}$, where $\mu+r+1=(a+1)p$ and $u=p^{-\nu}\binom{\mu+r}{\mu}(a+1)p$. \end{itemize} By Lucas, $\binom{\mu+r}{\mu}$ is a unit: $\mu+r=(a+1)p-1$ has digits $(a,p-1)$, or $(p-1,p-1)$ when $r=p$. So $v_p(u)=v_p((a+1)p)-\nu$. This is $0$ when $r\le p-1$, and $1$ when $r=p$. The non-unit subdiagonal entries are: \begin{itemize} \item on the $\ell$-chain, the $i+1=tp$ with $1\le t\le a+1$, of valuation $1$ except the last, of valuation $\tau$; \item on the $\tilde s$-chain, the $j+1=tp\le\mu$, of valuation $1$. There are $a$ of them if $r\le p-1$, and $a-1$ if $r=p$. \end{itemize} Solving the unit subdiagonals, the cokernel is generated by the first vector of each segment between them, with one relation at the end of each segment. Write $g_t=\ell_{tp}$ and $h_t=\tilde s_{tp}$, and let $\alpha_t$, $\sigma_t$ be the sums of the $v$'s over the segments, so that $\sum_t\alpha_t=A$, $\sum_t\sigma_t=A'$ and the last $\alpha_t$ is $\alpha$. After rescaling the generators by units, the relations are: \begin{itemize} \item $p^{\alpha_t}g_t+p\,g_{t+1}$ on the $\ell$-chain, the last link having $p^{\tau}$ instead of $p$; \item $p^{\alpha}g_{a+1}$ at the end of the $\ell$-chain; \item $p^{\sigma_t}h_t+p\,h_{t+1}$ on the $\tilde s$-chain; \item at the end of the $\tilde s$-chain, $p^{\sigma}h_{\rm last}+p^{v_p(u)}g_{a+1}$. \end{itemize} If $r=p$, every entry has valuation $\ge1$; if $r\le p-1$ this holds after the elimination of $g_{a+1}$ described next. In both cases the relation matrix is then $pM'$ with $M'$ integral. If $r\le p-1$ the last relation has a unit coefficient on $g_{a+1}$. Eliminating $g_{a+1}$ turns the last link of the $\ell$-chain into $p^{\tau+\sigma_a}h_a$ and the end relation into $p^{\alpha+\sigma_a}h_a$. In $M'$ the links with coefficient $1$ form $a$ units on the $\ell$-chain and $a$ on the $\tilde s$-chain, in distinct rows and columns. Clearing them (column operations along each chain, then row operations) splits off $I_{2a}$. The $2\times2$ matrix that remains, on the rows of the last link of the $\ell$-chain and of the end relation $p^{\alpha+\sigma_a}h_a$, and on the columns $g_0,h_0$, is upper triangular with diagonal valuations $E_{11}-1$, $E_{22}-1$ and corner $E_{12}-1$. If $r=p$ the $\tilde s$-chain has $a-1$ unit links and its end relation has a unit coefficient on $g_{a+1}=g_p$ in $M'$. These give $2a$ units again, and clearing them leaves the same $2\times2$ matrix. So the relation matrix is equivalent to $pI_{2a}\oplus\begin{pmatrix}p^{E_{11}}&\ast\,p^{E_{12}}\\0&p^{E_{22}}\end{pmatrix}$, with a unit $\ast$. The Smith form of such a matrix is $(p^{x},p^{E_{11}+E_{22}-x})$ with $x$ the least of the three valuations, and this is $G_c(m,\lambda)$. When $c=k=0$, $N_0=0$: the column $g_0$ is zero and gives the free summand, and what remains on $h_0$ are the relations $p^{E_{12}}$ and $p^{E_{22}}$. The simple blocks are single chains. When $\lambda+1=(a+1)p\le p^2$ the chain has $a$ non-unit subdiagonal entries, $i+1=tp$ with $1\le t\le a\le p-1$, each of valuation $1$. The same elimination gives $(\Z/p)^a\oplus\Z/p^{A-a}$. When $a+1t\}$ and $h_t=\mathrm{next}(t)-t$. The subsets $D\subseteq I$ are the \emph{dancers}; put $o_D=\sum_{t\in D}d_tp^t$. Since $d_tp^t>\sum_{u{$}c<{$}l} \toprule c & block $\lambda=12$\\ \midrule 0 & $\Z_3\oplus(\Z/3)^8\oplus\Z/3^{7}\oplus\Z/3^{10}\oplus\Z/3^{12}$\\ 1,2 & $(\Z/3)^8\oplus(\Z/3^{9})^2\oplus(\Z/3^{13})^2$\\ 3 & $(\Z/3)^8\oplus\Z/3^{8}\oplus\Z/3^{10}\oplus\Z/3^{12}\oplus\Z/3^{14}$\\ \bottomrule \end{tabular} \end{center} Version~3 stated Conjecture~I after the cell $c=0$ alone and predicted the other seven cells; all held. Later, four cells with $q=9$ ($e=2$) were computed directly on $B_{12}$, and agree with Theorem~\ref{thJ} in every exponent below $19$, the precision of that computation; and $31$ further pieces $X_q(m,c)$, predicted from Theorem~\ref{thJ} before they were computed ($23$ with $p=3$ and $m\in\{12,13\}$, $8$ with $p=2$), agree exactly (\S\ref{sec:ver}). \end{example} \section{Proofs of Theorems I and J: the odd dance}\label{sec:dance} Throughout this section $p$ is odd, $A=\Z_p$, and $\Dist_A=A\otimes\Dist_\Z(SL_2)$ is the Kostant form, generated by the divided powers $E^{(r)},F^{(r)}$ and the $\binom{H}{r}$. A \emph{lattice} is a $\Dist_A$-module that is free of finite rank over $A$ and is the sum of its weight spaces, with integer weights. We put $u=-1$ (any unit $\equiv-1\pmod p$ would do) and, on a lattice, $X=FE$. As in Section~6, $\Delta_A(\mu)$ has the basis $e_s=F^{(s)}v$, $Fe_s=(s+1)e_{s+1}$. A lattice is \emph{graded by floors} when $F$ raises the floor by one; in $\Delta_A(\mu)$ the floor of $e_s$ is $s$. The plan is the one of \cite{DST} for $p=2$: explicit lattices built one base-$p$ digit at a time (\S9.1--9.2), elimination of unit pivots digit by digit (\S9.3), and the Smith form of the matrix that remains (\S9.4). \subsection{The twist and the split} \begin{lemma}\label{EFH} Let $X,Y$ be finite-dimensional $U_\Q(\mathfrak{sl}_2)$-modules and $\varphi\colon X\to Y$ linear with $\varphi F=F\varphi$ and $\varphi H=H\varphi$. Then $\varphi E=E\varphi$. Hence a weight-preserving $A$-isomorphism of lattices that commutes with $F$ is an isomorphism of lattices, and on a vector space with given $F$, $H$ there is at most one $E$ making it an $\mathfrak{sl}_2$-module. \end{lemma} \begin{proof} $\Delta:=\varphi E-E\varphi$ raises weights by $2$ and commutes with $F$, since $\varphi[E,F]-[E,F]\varphi=\varphi H-H\varphi=0$. By Weyl's complete reducibility, $X$ is spanned by vectors $F^jx$ with $Ex=0$, $x$ of weight $h\ge0$, $F^{h+1}x=0$, and $Y_\Q$ is a sum of simple modules $\Delta_\Q(c)$; on each of them $F^{h+1}$ is injective on the weight space $h+2$. As $F^{h+1}\Delta x=\Delta F^{h+1}x=0$, $\Delta x=0$, and $\Delta F^jx=F^j\Delta x=0$. \end{proof} \begin{definition}[the twist $\Phi_p$, digit $0$]\label{defPhi} For a lattice $N$ let $\Phi_p(N)=\bigoplus_{j=0}^{p-1}b_j\otimes N$ (written $b_jn$), and for $n$ of weight $w$: $H(b_jn)=(pw+p-1-2j)\,b_jn$; $F(b_jn)=b_{j+1}n$ for $j\le p-2$ and $F(b_{p-1}n)=pu\,b_0(Fn)$; $E(b_jn)=b_{j-1}\,g_jn$ for $j\ge1$, with $g_j=p^2X+j(pw+p-j)$, and $E(b_0n)=(p/u)\,b_{p-1}(En)$. On morphisms $\Phi_p(f)=1\otimes f$. If $n$ is on floor $f$, then $b_jn$ is on floor $pf+j$. \end{definition} \begin{proposition}\label{propPhi} (a) $\Phi_p(N)$ is a lattice, and $\Phi_p$ is an exact functor that preserves saturated sublattices. For $r\ge0$, with $c=\lfloor(j+r)/p\rfloor$, \begin{gather*} F^{(r)}(b_jn)=(pu)^c\tfrac{c!}{r!}\,b_{j+r-pc}F^{(c)}n,\\ E^{(r)}(b_jn)=(p/u)^{c'}\tfrac{c'!}{r!}\,b_{j-r+pc'}\,E^{(c')}\!\!\prod_{(a,i)\in S(j,r)}\!\!\big[p^2X+(i-pa)(p(w+1+a)-i)\big]n, \end{gather*} where $c'=\lfloor(r+p-1-j)/p\rfloor$ is the number of wraps and $S(j,r)$ is the set of pairs (wraps already made $a$, current index $i\ge1$) met in the first $r$ steps $j,j-1,\dots,1$, then $p-1,\dots,1$, and so on; all coefficients are $p$-integral. (b) $\Phi_p(N)\otimes\F_p\cong St\otimes(N\otimes\F_p)^{[1]}$, with $St=\Delta(p-1)$ the Steinberg module. (c) $\Phi_p(\Delta_A(\mu))\cong\Delta_A(p\mu+p-1)$, $\Phi_p(\nabla_A(\mu))\cong\nabla_A(p\mu+p-1)$. \end{proposition} \begin{proof} (a) The relation $[E,F]=H$ is checked on each $b_jn$: for $1\le j\le p-2$, $g_{j+1}-g_j=pw+p-1-2j$; on $b_0n$, $g_1-p^2X=pw+p-1$; on $b_{p-1}n$, $p^2(X+w)-g_{p-1}=pw-p+1$. These are the weights, and $E$, $F$ move weights by $\pm2$. The formula for $F^{(r)}$ follows from $F^r(b_jn)=(pu)^cb_{j+r-pc}F^cn$; the one for $E^{(r)}$ by walking $E$ down the indices, using that the Casimir $\Omega=4FE+(H+1)^2$ of $\Phi_p(N)$ is $p^2\Omega_N$ on every $b_jn$, so that $g_j$ is $(p^2\Omega_N-(p(w+1)-2j)^2)/4$. Integrality: $v_p(p^cc!/r!)=c+v_p(c!)-\lfloor r/p\rfloor-v_p(\lfloor r/p\rfloor!)\ge0$ because $c\ge\lfloor r/p\rfloor$ and $x\mapsto x+v_p(x!)$ is increasing (Legendre); the same for $E$ with $c'\ge\lfloor r/p\rfloor$. Exactness and saturation hold because $\Phi_p(N)=N^p$ as $A$-modules and $1\otimes f$ commutes with $F$, $H$, hence with $E$ (Lemma~\ref{EFH}). (b) Modulo $p$, with $r=ps+t$, $0\le t\le p-1$, the formulas of (a) reduce to $F^{(r)}(b_jn)\equiv[j+t\le p-1]\,\frac1{t!}\,b_{j+t}F^{(s)}n$ (using $(ps+t)!/(p^ss!)\equiv(-1)^st!$ and $u\equiv-1$) and $E^{(r)}(b_jn)\equiv[t\le j]\,(-1)^t\big(\frac{j!}{(j-t)!}\big)^2\frac1{t!}\,b_{j-t}E^{(s)}n$ (a full cycle of $g$'s is $\equiv\prod_{i=1}^{p-1}(-i^2)\equiv1$). These are the formulas of $St\otimes\bar N^{[1]}$ computed with the coproduct, in the basis $b'_j=F^jb'_0$ of $St$. (c) In the basis $x_R=b_je_s$, $R=ps+j$, one has $Fx_R=x_{R+1}$ for $j\le p-2$ and $Fx_{ps+p-1}=pu(s+1)x_{p(s+1)}$, while in $\Delta(p\mu+p-1)$, $Fe_R=(R+1)e_{R+1}$, with $R+1$ a unit unless $j=p-1$, where it is $p(s+1)$. A diagonal map with unit entries therefore commutes with $F$ and $H$, and Lemma~\ref{EFH} applies. The same for $\nabla$. \end{proof} \begin{definition}[the split $\Psi_r$, digit $r$, $1\le r\le p-1$]\label{defPsi} For a lattice $N$ let $\Psi_r(N)=\bigoplus_{j=0}^{p-1}(A_j\otimes N\oplus C_j\otimes N)$, with $H(A_jn)=(pw+p-1+r-2j)A_jn$, $H(C_jn)=(pw+p-1-r-2j)C_jn$; $F(A_jn)=A_{j+1}n$ and $F(C_jn)=C_{j+1}n$ for $j\le p-2$, \[ F(A_{p-1}n)=pu\,A_0(Fn)+p\,C_{p-r}n,\qquad F(C_{p-1}n)=pu\,C_0(Fn); \] and, with $g^A_j=p^2X+j(pw+p+r-j)$ and $g^C_j=p^2X+j(pw+p-r-j)$: \begin{align*} E(A_0n)&=(p/u)\,A_{p-1}(En)-(p-r)(p/u)\,C_{p-1-r}(En),\\ E(A_jn)&=A_{j-1}g^A_jn+r(p/u)\,C_{p+j-1-r}(En)\quad(1\le j\le r),\\ E(A_jn)&=A_{j-1}g^A_jn+rp^2\,C_{j-1-r}(Xn)\quad(r+1\le j\le p-1),\\ E(C_0n)&=r\,A_{r-1}n+(p/u)\,C_{p-1}(En),\\ E(C_jn)&=C_{j-1}g^C_jn+r\,A_{j+r-1}n\quad(1\le j\le p-r),\\ E(C_jn)&=C_{j-1}(g^C_j+rp)n+rpu\,A_{j+r-1-p}(Fn)\quad(p-r+1\le j\le p-1). \end{align*} On morphisms $\Psi_r(f)=1\otimes f$. If $n$ is on floor $f$, then $A_jn$ is on floor $pf+j$ and $C_jn$ on floor $pf+r+j$. \end{definition} \begin{proposition}\label{propPsi} (a) $\Psi_r(N)$ is a lattice, and $\Psi_r$ is an exact functor that preserves saturated sublattices. (b) $\Psi_r(N)\otimes\F_p\cong T(p-1+r)\otimes(N\otimes\F_p)^{[1]}$. (c) $\Psi_r(\Delta_A(\mu))$ has a sublattice $\Delta_A(p\mu+p-1+r)$ with quotient $\Delta_A(p\mu+p-1-r)$. \end{proposition} \begin{proof} (a) The relation $[E,F]=H$ is checked case by case on the ten index ranges of the definition (for instance, on $A_{p-1}n$ with $r\le p-2$ the $A$-coefficient of $EF-FE$ is $p^2EF+pr-g^A_{p-1}=pw-p+1+r$, the weight, and the $C$-coefficient is $0$). For $r=1$ the map $A_jn\mapsto\hat b_0\otimes b_jn+j\,\hat b_1\otimes b_{j-1}n$, $C_jn\mapsto\hat b_1\otimes b_jn$ is a unitriangular isomorphism $\Psi_1(N)\cong V\otimes\Phi_p(N)$ commuting with $F$ and $H$; by Lemma~\ref{EFH} it is an isomorphism, and $V\otimes\Phi_p(N)$ is a lattice. For $r\ge2$ the map $\iota\colon\Psi_r(N)\to V\otimes\Psi_{r-1}(N)$, $\iota(A_jn)=F^j\alpha(n)$, $\iota(C_jn)=F^j\gamma(n)$, with (primes for $\Psi_{r-1}$) \[ \alpha(n)=\hat b_0\otimes A'_0n+(p/u)\,\hat b_1\otimes C'_{p-r}(En),\qquad \gamma(n)=\hat b_0\otimes C'_1n+\hat b_1\otimes A'_{r-1}n-(pw+p-r)\,\hat b_1\otimes C'_0n, \] commutes with $F$ (it suffices to check $F^p\gamma(n)=pu\,\gamma(Fn)$ and $F^p\alpha(n)=pu\,\alpha(Fn)+p\,F^{p-r}\gamma(n)$) and with $H$, hence with $E$ over $\Q$. Its reduction modulo $p$ is injective: on suitable coordinates it is diagonal with entries $1$ and $r-1$, a unit. So the image is a saturated $U_\Q$-stable sublattice of a lattice, hence $\Dist_A$-stable, and $\Psi_r(N)$ is a lattice by induction on $r$. Exactness as for $\Phi_p$. (b) Induction on $r$; $r=1$ is $V\otimes St=T(p)$. For $r\ge2$, $\bar\iota$ embeds $\overline{\Psi_r(N)}$ in $V\otimes T(p-2+r)\otimes\bar N^{[1]}$; the Casimir acts on $\overline{\Psi_r(N)}$ with the single generalized eigenvalue $r^2$ (its eigenvalues on $\Psi_r(N)_\Q$ are $(p(b+1)\pm r)^2\equiv r^2$), and the generalized $r^2$-eigenspace of $V\otimes T(p-2+r)$ is $T(p-1+r)$, because $(r-2)^2\not\equiv r^2$ and $\Delta(p-1+r)$ is not simple ($E^{(s)}F^{(r)}v=\binom{p-1+s}{s}F^{(r-s)}v\equiv0$ for $1\le s\le r$, by Lucas). Dimensions agree. (c) Path counting: for $k\max\Delta$, as in \cite[Lemma~4.5]{DST}. With $m=\max\Delta$, $[q_{m+1}]_\Delta=-[q_m^{p-d_m}]_{\Delta\setminus\{m\}}$. For a power $N$ of $q$, $[q^N]_\Gamma$ is the sum over the set partitions of $\Gamma$ into $j\le N$ blocks of $N(N-1)\cdots(N-j+1)\prod_B[q]_B$. For $N=p-d_m\in[1,p-1]$ the single-block term has a unit factor; for $N=p$ (every later move) every falling factorial $(p)_j$, $1\le j\le p$, has valuation $1$. In both cases a partition into $j\ge2$ blocks has valuation larger than the single-block one, by induction. So the valuation is $m-(|\Delta|-1)-\min\Delta$ at $t=m+1$ and grows by exactly $1$ at each later move; the final power $d_k$ is a unit. \end{proof} \begin{proposition}[cost form]\label{costform} Let $M=M_p(\lambda,i,e)$ and $b\subseteq a\subseteq I$, and let $\gamma(\Delta)=\sum_{u\in I\setminus\Delta,\ u>\min\Delta}h_u$ ($\gamma(\emptyset)=0$). If $i\ge1$, then $v_p(M_{ab})=eK+\kappa_p(m,K)+R_m(a)-R_{m+K}(b)+\gamma(a\setminus b)$ with $m=i-1$. If $i=0$, the row $\emptyset$ is zero and, for $a\ne\emptyset$, $v_p(M_{ab})=eK+R^\sharp(a)-R^\sharp(b)+\gamma(a\setminus b)$. All entries with $b\subseteq a$ ($a\ne\emptyset$ when $i=0$) are nonzero. \end{proposition} \begin{proof} By Lemmas~\ref{windows} and~\ref{deficit}, $v_p(M_{ab})=-d_k\frac{p^k-1}{p-1}+\sum_{t\in\Delta}\big(1+d_t\frac{p^t-1}{p-1}\big)+\delta(\Delta)+e(K-o_\Delta)+\sum_{d=o_a}^{o_b+K-1}v_p(i+d)$, $\Delta=a\setminus b$, $\delta(\Delta)=k-|\Delta|-\min\Delta$. Legendre's formula $v_p(n!)=(n-s_p(n))/(p-1)$, the identity $s_p(x+o_E)=s_p(x)+\sum_{t\in E}d_t-(p-1)\kappa_p(x,o_E)$, $s_p(K)=d_k$, and $|\Delta|+\delta(\Delta)=\sum_{t\in a}h_t-\sum_{t\in b}h_t+\gamma(\Delta)$ \cite[Lemma~5.1]{DST} collapse this to the stated form. For $i=0$ use also $\kappa_p(K-1,o_E)=k-\min E$. \end{proof} \subsection{The Smith form of $M_p$} \begin{lemma}\label{integral} The real antitonic fits of the clocks $x$ and $x^\sharp$ of \S\ref{sec:conjI} take integer values. \end{lemma} \begin{thmSmith} For $i\ge1$ the Smith exponents of $M_p(\lambda,i,e)$ are $eK+\kappa_p(i-1,K)+\hat y_D$, $D\subseteq I$; for $i=0$ they are $\infty$ (once) and $eK+\hat y^\sharp_D$, $\emptyset\ne D\subseteq I$. \end{thmSmith} \begin{proof}[Proof of the Smith form and of Lemma~\ref{integral}] The proof of the case $p=2$, \cite[\S6--\S7]{DST}, goes through for odd $p$ with the changes listed below; every step not listed is used verbatim. A complete line-by-line version for odd $p$, written by the independent reader, is part of the record of this paper (file \texttt{THEOREM\_F\_ODD\_P.md}). \emph{(O1) The order.} Since $d_tp^t>\sum_{u{$}c<{$}l} \toprule d & $(n_1,n_2,\dots)$\\ \midrule 5 & $(12,10,16,53,5)$\\ 6 & $(38,37,36,117,24,16,6)$\\ 7 & $(86,105,127,285,85,63,41)$\\ 8 & $(250,211,286,1078,174,133,174,8)$\\ 9 & $(942,412,624,3339,449,292,495,133,84,37,9)$\\ 10 & $(3314,1388,1768,7310,1690,1364,1388,1392,316,190,74)$\\ 11 & $(11035,4345,5127,11339,10099,4994,4432,7162,704,419,416)$\\ \bottomrule \end{tabular} \end{center} Theorem~\ref{thG} gives every row exactly. In version~2 the row $d=9$ was outside the range: its piece $X_3(9,0)$ contains the block $\lambda=9$, which has $a=p-1$, and the version-2 formula, with glue $1/p$, gave $(942,414,623,3339,448,293,495,134,84,36,9)$. With the glue $1/p^2$ of Lemma~\ref{forced} and the minimum in the definition of $G_c(m,\lambda)$ the row comes out right. The rows $d=10$ and $d=11$ were computed piece by piece and assembled by Theorem~\ref{thA}; both were predicted before they were computed (the first two sealed predictions of item~9 of Section~\ref{sec:ver} contain them). \section{Formal verification in Lean}\label{sec:lean} The proofs are checked in the proof assistant Lean~4 with the Mathlib library. The text was cut into short self-contained pieces; Aristotle, an AI system made by Harmonic \cite{Har}, wrote the Lean proofs; on the author's machine each returned project was compared with the previous one, searched for forbidden constructs (\texttt{sorry}, new axioms, \texttt{native\_decide}), compiled module by module, and its main statements were restated by hand in a check file whose axioms were printed. Every certified piece uses only the standard axioms \texttt{propext}, \texttt{Classical.choice} and \texttt{Quot.sound}. \textbf{Version~3 is checked.} Theorems A--H, Lemmas~2--5, \ref{forced} and~\ref{blocks}, Corollaries~\ref{corq} and~\ref{corN}, and the Example of Section~6 are proved in Lean, in the generality of version~3 (Theorem~\ref{thBprime} for $p\mid q$, Theorems~\ref{glue} and~\ref{thG} for odd $p$; the other cases are checked by the pieces of the next paragraph), with nothing cited: the tilting lattices of Section~6, their tensor rules and the decomposition of $V^{\otimes m}\otimes\Z_p$ for $m\le p^2+p-1$ are proved from scratch, as is Wilson's rank formula in the range used by Theorem~\ref{thD}; Theorem~\ref{thP} uses the Lean proof of \cite{DST}. At that stage the pieces of version~3 had $110$ files, $20\,765$ lines and $1\,032$ lines beginning with \texttt{theorem} or \texttt{lemma}, with no \texttt{sorry}. \textbf{Theorems I and J are checked.} Their proof was cut into $19$ pieces, all certified: the twist $\Phi_p$ (Definition~\ref{defPhi}, Proposition~\ref{propPhi}) and its reduction modulo $p$; the split $\Psi_r$; the Casimir and the short exact sequences of the Remark after Lemma~\ref{dance}, and their splitting over $\Z_{(p)}$; the dance lattices $L(\lambda)$ and $V^{\otimes m}\otimes\Z_p\cong\bigoplus L(\lambda)^{n_\lambda(m)}$ for every $m$, without Donkin's theorem; the twist move (Proposition~\ref{twistmove}), the split move (Proposition~\ref{splitmove}) and the last level; Theorem~D$_p$ and Theorem~\ref{thI}; the deficit law, the windows, the cost form, the ceiling, the houses, Theorem~F at $p$, the integrality and the floor of every cell; the Smith form of the final matrix; and Theorem~\ref{thJ}. The statement checked for Theorem~\ref{thJ} is about the sandpile group itself: the torsion of the cokernel of Mathlib's Laplacian matrix of the Hamming graph $H(d,q)$, for every odd prime $p$, every $q\ge2$ with $p\mid q$ and every $d\ge0$. The multiplicities $n_\lambda(m)$ enter through the recursion given by the tensor rules, which is proved to describe $V^{\otimes m}\otimes\Z_p$; the description by characters at the end of Theorem~\ref{thJ} is a way to compute them and is not formalized. \textbf{Every prime.} Three further pieces check the cases that the pieces above left out: Theorem~\ref{thBprime} for $p\nmid q$ (the pieces above assume $p\mid q$); Theorem~\ref{thI} for $p=2$, stated on the groups $X^{(e)}(\lambda,i)$ of \cite{DST}, which on paper are the blocks $Y_2(\lambda,i,e)$ of Theorem~\ref{thP}; and Theorems~\ref{glue} and~\ref{thG} for $p=2$, with the bounds $m\le2$ and $m\le5$. With them, every result of the paper is checked for every prime. In Lean, Theorem~\ref{thI} and the block formulas of Theorems~\ref{thJ} and~\ref{thP} are proved for explicit dance lattices: $L(\lambda)$ for odd $p$, and the lattices of \cite{DST} for $p=2$; their identification with $T_{\Z_p}(\lambda)$ (Lemma~\ref{dance}(ii); \cite[Remark~(1) after Theorem~3.6]{DST}) is not formalized and is not needed for the statements on $K(H(d,q))$. Theorem~\ref{thBprime} is stated in Lean for the $\Z_p$-module $\operatorname{coker}(q(c+H)+U)$ on $B_m(\Z_p)$, free summand included; its form for $\Syl_pX_q(m,c)$ follows in a few lines and is checked too (\texttt{checks/CheckTheoremEPaperForm.lean}, written by the fifth reader). All $36$ pieces live in one Lean project, which also holds the Lean proof of \cite{DST}. Two groups of pieces defined the same names; the names were changed on one side only: in the three newer pieces of the first clash and in the files that use them ($14$ files in five pieces), and, for the second, in the piece that no other module imports (five files in one piece), and both renames were checked to be pure (undoing them gives back the original files byte for byte). The final check is six files; each loads all $36$ pieces together and repeats the hand restatements of a part of them. They compile with no error, and each of their $451$ \texttt{\#print axioms} commands answers with the standard axioms only. The pieces of this paper have $254$ files, $46\,787$ lines and $2\,370$ lines beginning with \texttt{theorem} or \texttt{lemma}, with no \texttt{sorry}. The whole Lean project was rebuilt from its sources, on Mathlib's published build, with the final check, in GitHub Actions run~38724562833 of the repository \url{https://github.com/tretoef-estrella/coloured-sand-theorem}, at commit \texttt{51c25f0}, on 15 October 2026. The Lean project is in the folder \texttt{lean/} of that repository; the Lean certificate, with the full statements, the dependency cone of the main theorems and the data of every piece, is deposited with this version in its Zenodo record. \section{Changes}\label{sec:changes} \subsection*{From version 4 to version 6 (version 5 was not published)} \begin{enumerate} \item The Lean proof is complete, for every prime (\S\ref{sec:lean}): Theorems~\ref{thI} and~\ref{thJ}, and three further pieces for Theorem~\ref{thBprime} with $p\nmid q$, Theorem~\ref{thI} with $p=2$, and Theorems~\ref{glue} and~\ref{thG} with $p=2$. The Lean project was rebuilt from its sources on GitHub's machines, on Mathlib's published build. The summary table, the abstract and the status paragraph say so. No statement and no proof of the paper changes. \item The Lean section says that Theorem~\ref{thI} and the block formulas of Theorem~\ref{thJ} are checked for explicit dance lattices ($L(\lambda)$ for odd $p$, and those of \cite{DST} for $p=2$), and that their identification with $T_{\Z_p}(\lambda)$ is not formalized; it describes the two renames correctly, and gives the size of the version-3 pieces by the same counting rule as the rest of the section. \item Bibliography: \cite{DST} with its concept DOI and the DOI of its version~11, labelled, and the DOI of its Lean certificate. \item The status paragraph and the section on provenance describe the cold readings of the Lean work. A fifth reader read the changes of this version (the Lean certificate~v2 and this paper) cold; its corrections are applied: the description of the two renames, the form in which Theorem~\ref{thBprime} is stated in Lean (and a check file for the paper's form), the lattices at $p=2$, the remark after Lemma~\ref{dance}, the words ``rebuilt from source'', the generality of the version-3 pieces, and the subsection on digits now fixes any prime. \item The layout of \cite{DST}. \end{enumerate} \subsection*{From version 3 to version 4} \begin{enumerate} \item New Theorems~\ref{thI} (Conjecture~I of version~3, every prime) and~\ref{thJ} (the whole group, every $d$), Sections~\ref{sec:conjI} and~\ref{sec:dance}, with their checks (\S\ref{sec:ver}, items~12--16) and the state of the Lean proof (\S\ref{sec:lean}). New title page and summary. \item Priority: the case $d=2$ was known (Ducey--Gerhard--Watson \cite[Theorem~1.1]{DGW}; it also follows from \cite[Theorem~13 and Example~11]{JNR}). Version~3 claimed Theorems B, C, D, G and H as new without excluding $d=2$. The existence of the $\Z_p$-forms of tilting modules and the lifting of decompositions are classical \cite[\S1.2]{And}, \cite[II.E]{Jan}; what is ours is their explicit form. \item Theorem~\ref{thD}: Wilson's diagonal form is used in the range $t\le\min(k,m-k)$, which is Wilson's own \cite[Theorem~2]{Wil}. Version~3 attributed it to the summary in \cite[(2)]{CSX}, which states only $t\le k\le m/2$ and misses the middle rank $2s=m-1$ of odd $m$. \item Remark after Theorem~\ref{thG}: version~3 said that for $p\nmid q$ the formula fails at $(q,p,d)=(4,3,4)$. This was wrong: evaluated at $e=0$, the formula of Theorem~\ref{thG} gives the right group there. \item Proof of Lemma~\ref{blocks}: the sentence ``every entry has valuation $\ge1$'' was placed before the elimination that makes it true. \item Theorem~\ref{thB}: the condition $(j,k)\ne(0,0)$ is automatic, since $j+2k=d+1-v\ge1$. \item The count of predictions: version~3 said $107$ ($44$ in version~1 and $63$ in version~3); two groups of version~3 were counted twice (once from the pieces and once from the full Laplacian), so they are $105$ distinct predicted groups. \item Version~3 said that Conjecture~I for $p=2$ follows from Theorem~\ref{thP}; that needed every big clock to exceed $p^k$, which was only checked by machine. It is now part of the proof of Theorem~\ref{thI}. \item Precise references for (T1) and (T2): \cite[II.E.6, II.E.19--E.22]{Jan}, \cite[Prop.~2.1]{Don}, \cite[Prop.~3.4(a)]{STWZ}, \cite[Remark~1.1(ii), \S1.2]{And}. \end{enumerate} \section*{Provenance, priority and use of AI}\label{sec:prov} The work was done for the author by Claude (Anthropic), an AI system, in several sessions. Version~1 (night of 12--13 October 2026): choice of the problem after a search of the literature, computations, Theorems B--E and Conjecture~F, with Theorem~A recognized as \cite[Theorem~13]{JNR} before publication. Versions~2 and~3 (the same night): Theorems~F, G and~H, Corollary~\ref{corN} and Conjecture~I. Version~3 was read cold by a separate instance with no access to our notes; its corrections are listed in Section~\ref{sec:changes}. Version~4 (13--14 October 2026): Theorems~I and~J were found and proved by a separate instance working as constructor, re-derived and re-computed by the instance that audits the project, and read cold by a third instance, with no access to the audit, which wrote the floor of the Smith form out in full, re-ran its own computations and searched the literature again. Version~6 (15 October 2026): the Lean proof was completed for every prime and the Lean project rebuilt from its sources on GitHub's machines; version~5 and the Lean certificate were read cold by a fourth instance, which had the paper, the certificate, the Lean project and the author's logs but not the working sessions; the changes of version~6 were read cold by a fifth instance with the same kind of material, which found no error in the mathematics or in the Lean statements. Their corrections are listed in Section~\ref{sec:changes}. Lean proofs are written by Aristotle \cite{Har} and compiled and audited on the author's machine (Section~\ref{sec:lean}). No human expert has read the proofs. The author takes responsibility for the paper. To the best of our knowledge, after a search of the works citing \cite{JNR}, \cite{DGW}, \cite{DJ}, \cite{CSX}, \cite{Bai} and the main works on tilting modules of $SL_2$, of arXiv, zbMATH, OpenAlex, Zenodo, HAL, CORE, MathOverflow and the Hexagon preprint server: Theorem~A is due to Jacobson, Niedermaier and Reiner; the case $d=2$ of every result is due to Ducey, Gerhard and Watson \cite{DGW}; the case $e=0$ of Theorem~\ref{thC} follows from \cite[Theorem~2]{JNR}; the tilting theory used (Donkin's tensor product theorem, the existence and uniqueness of $\Z_p$-forms of tilting modules, the count of Weyl factors, projectivity over the first Frobenius kernel) and the decomposition of tensor powers in the proof of Corollary~\ref{corN} are classical \cite{Don,Jan,And}. Theorems~B--J for $d\ge3$, Corollary~\ref{corN}, and the explicit lattices of Section~\ref{sec:dance} were not found in the literature. \begin{thebibliography}{STWZ23}\small \bibitem[And97]{And} H. H. Andersen, Filtrations and tilting modules, \emph{Ann. Sci. \'Ec. Norm. Sup\'er. (4)} 30 (1997), 353--366. \bibitem[Bai03]{Bai} H. Bai, On the critical group of the $n$-cube, \emph{Linear Algebra Appl.} 369 (2003), 251--261. \bibitem[Big99]{Big} N. L. Biggs, Chip-firing and the critical group of a graph, \emph{J. Algebraic Combin.} 9 (1999), 25--45. \bibitem[CSX15]{CSX} D. B. Chandler, P. Sin, Q. Xiang, The Smith group of the hypercube graph, arXiv:1511.00272. \bibitem[DGW16]{DGW} J. E. Ducey, J. Gerhard, N. Watson, The Smith and critical groups of the square rook's graph and its complement, \emph{Electron. J. Combin.} 23(4) (2016), \#P4.9; arXiv:1507.06583. \bibitem[DJ14]{DJ} J. E. Ducey, D. M. Jalil, Integer invariants of abelian Cayley graphs, \emph{Linear Algebra Appl.} 445 (2014), 316--325; arXiv:1308.2335. \bibitem[Don93]{Don} S. Donkin, On tilting modules for algebraic groups, \emph{Math. Z.} 212 (1993), 39--60. \bibitem[DST]{DST} R. Amichis Luengo, The Dancing Sand Theorem: the 2-part of the sandpile group of the hypercube, for every $n$, preprint (2026), version~11, hexagon:2610.00205; concept DOI 10.5281/zenodo.23188298 (all versions), version~11 10.5281/zenodo.23356712. Its proof is checked in Lean~4; Lean certificate: doi:10.5281/zenodo.23298436. \bibitem[Har]{Har} Harmonic, Aristotle, \url{https://aristotle.harmonic.fun}. \bibitem[Jan03]{Jan} J. C. Jantzen, \emph{Representations of Algebraic Groups}, 2nd ed., Math. Surveys Monogr. 107, Amer. Math. Soc., 2003. \bibitem[JNR03]{JNR} B. Jacobson, A. Niedermaier, V. Reiner, Critical groups for complete multipartite graphs and Cartesian products of complete graphs, \emph{J. Graph Theory} 44 (2003), 231--250. \bibitem[Pro82]{Pro} R. A. Proctor, Representations of $\mathfrak{sl}(2,\mathbb C)$ on posets and the Sperner property, \emph{SIAM J. Algebraic Discrete Methods} 3 (1982), 275--280. \bibitem[STWZ23]{STWZ} L. Sutton, D. Tubbenhauer, P. Wedrich, J. Zhu, $SL_2$ tilting modules in the mixed case, \emph{Selecta Math. (N.S.)} 29 (2023); arXiv:2105.07724. \bibitem[Wil90]{Wil} R. M. Wilson, A diagonal form for the incidence matrices of $t$-subsets vs.\ $k$-subsets, \emph{European J. Combin.} 11 (1990), 609--615. \end{thebibliography} \end{document}