\section{The Lean certificate}\label{sec:verification} The deduction of the main theorems from the three results of Section~\ref{sec:literature} has been checked in Lean~4. This appendix says where the formal proof is, which statements are assumed, and which statements of the paper the proof covers. We have tried to be exact about the boundary between what the proof assistant has verified and what rests on the literature. \subsection{The repositories} The formal development extends the Lean proof of the Generalized Riemann Hypothesis for Dirichlet $L$-functions \cite{AlpogeGRH} from $\Q$ to a totally real field, and imports the Lean proof of the half-plane $\Rea s>31/32$ \cite{CuretonThorner}. The statements below refer to the public repository \cite{ERHLiteratureInputs} at commit \texttt{c578e9b}. It is a self-contained Lean~4.36 project whose only dependencies are Mathlib, at a fixed version, and the public formalization of \cite{CuretonThorner}; it builds with the standard build tool. It contains $2{,}613$ Lean files, about $1.33$ million lines in all: the proof over a totally real field, the formal statements of the three literature inputs, the adapters that connect them to the proof, and the final theorems. \subsection{The assumed statements} The three results of Section~\ref{sec:literature} enter the formal proof as axioms. They are declared in a single file, \texttt{external.lean}, which is the only place in the development where axioms other than the three standard axioms of Lean are permitted (no other file declares an axiom), and each is accompanied by its exact source and theorem number. Each axiom transcribes a printed statement, specialized to the fields in which the proof applies it. Let $k$ range over totally real number fields. A \emph{parameter} is a triple $P=(\varsigma_0,q_0,\delta)$ as in Section~\ref{sec:inputs}; it determines the CM field $F=k(\sqrt{-\delta})$ and the stages $E_j$. The axiom \texttt{averagedColmez} is Theorem~\ref{thm:lit-colmez} of Yuan and Zhang \cite[Theorem~1.1]{YuanZhang}, applied to the extension $F/k$. It states that for every parameter $P$ and every family consisting of, for each CM type $\Phi$ of $F$, an abelian scheme over a ring of integers with an action of $\OO_F$ of type $\Phi$, the mean of the Faltings heights of the members of the family is \[ -\frac12\,\Rea\frac{\mathcal L_k'(0,\eta)}{\mathcal L_k(0,\eta)}-\frac14\log\frac{|\operatorname{disc}F|}{|\operatorname{disc}k|}, \] which is the formula of Theorem~\ref{thm:lit-colmez}, since $|\operatorname{disc}F|/|\operatorname{disc}k|=d_{F/k}\,d_k$. The Faltings height is defined in the formal development with the metric of Section~\ref{subsec:lit-colmez}, and it is a property of the abelian scheme, not a number supplied with it. The Galois invariance of the heights is proved, not assumed. The axiom \texttt{dasguptaKakde} is Theorem~\ref{thm:lit-dk} of Dasgupta and Kakde \cite[Theorem~1.3, equation~(6)]{DasguptaKakde}, for each odd prime $\ell$ and each layer $H=E(\mu_{\ell^b})$ of a stage $E=E_j$ over $E^+$, with $S$ the infinite places and the places above $\ell$, and $T=\{\frakq\}$ for an admissible smoothing prime $\frakq$. It is stated as in the source: over the full ring $\Z[\tfrac12][G]/(1+c)$, for the full Pontryagin dual of the ray class group with the action of Section~\ref{subsec:lit-dk}, and for the image of the smoothed Stickelberger element under the involution $x\mapsto x^{\#}$. The passage from this statement to the $\ell$-primary part at finite depth and to the cyclic presentation used in the proof of Proposition~\ref{prop:odd-length} is proved in the formal development and is not part of the assumption. The axiom \texttt{dkswDyadicUnits} is Theorem~\ref{thm:lit-dksw-unit} of Dasgupta, Kakde, Silliman and Wang \cite[Theorem~1.1, equation~(3)]{DKSW}, for the layers $H=E(\mu_{2^b})$ over $E^+$, with $S$ the infinite and dyadic places and $T=\{\frakq\}$. It asserts the existence of the unit of that theorem for every prime of $E^+$ that splits completely in $H$, with all three of its properties. As explained at the end of Section~\ref{subsec:lit-dksw}, the formal proof treats the prime $2$ through this unit rather than through Theorem~\ref{thm:lit-dksw-fitting}; the divisor of the unit gives the relations among the primes above a completely split prime that the proof of Proposition~\ref{prop:odd-length} needs. The conditions on the field and on $\frakq$ under which the theorem applies are verified separately for each application. \noindent The passage from these statements to the forms used in the proof of Proposition~\ref{prop:odd-length} is itself proved in Lean: the identification of the Stickelberger element with the explicit combination of partial zeta values, the passage from the full dual to its $\ell$-primary part at finite depth, the transport of Fitting ideals to the cyclic quotient attached to a layer, and, at the prime $2$, the deduction of the annihilation of the minus class group from the units of Theorem~\ref{thm:lit-dksw-unit}. Theorem~\ref{thm:lit-dksw-fitting} is therefore not needed by the formal proof. The text of Proposition~\ref{prop:odd-length} uses it because the argument is shorter to write. \subsection{The theorems checked} The file \texttt{main.lean} of \cite{ERHLiteratureInputs} contains seven theorems, stated with no hypotheses beyond those in the table. Write $\mathcal L_K(s,\xi)$ for the entire $L$-function of \eqref{eq:intro-entire-hecke}; in Lean it is \texttt{entireRayHeckeL}. \begin{center} \begin{tabular}{@{}lll@{}} \toprule Lean theorem & Conclusion, for $\Rea s>1/2$ & In this paper \\ \midrule \texttt{totallyReal\_normTwist} & $\mathcal L_k(s,\chi\circ\N_{k/\Q})\ne0$, $k$ totally real & Theorem~\ref{thm:intro-main} \\ \texttt{totallyReal\_poleRemovedZeta} & $(s-1)\zeta_k(s)\ne0$, $k$ totally real & Corollary~\ref{cor:intro-dedekind} \\ \texttt{totallyReal\_uniformSign} & $\mathcal L_k(s,\xi)\ne0$, $\xi$ of uniform sign & Theorem~\ref{thm:intro-uniform} \\ \texttt{cm\_normTwist} & $\mathcal L_K(s,\chi\circ\N_{K/\Q})\ne0$, $K$ a CM field & Theorem~\ref{thm:intro-cm} \\ \texttt{cm\_poleRemovedZeta} & $(s-1)\zeta_K(s)\ne0$, $K$ a CM field & Theorem~\ref{thm:intro-cm} \\ \texttt{centralConj\_normTwist} & the same, $K$ with central conjugation & Theorem~\ref{thm:intro-cm} \\ \texttt{centralConj\_poleRemovedZeta} & the same, for $(s-1)\zeta_K(s)$ & Theorem~\ref{thm:intro-cm} \\ \bottomrule \end{tabular} \end{center} \noindent The seven theorems compile, together with the $2{,}612$ modules on which they depend. Each depends on exactly six axioms: the three standard axioms of Lean (\texttt{propext}, \texttt{Classical.choice}, \texttt{Quot.sound}) and the three axioms \texttt{averagedColmez}, \texttt{dasguptaKakde} and \texttt{dkswDyadicUnits} described above. There is no \texttt{sorry}, and no other axiom is used. Between the axioms and the main theorems lie the adapters that connect the printed statements to the objects of the proof. They identify the Faltings height of the source with the height defined from the abelian schemes of the construction; they identify the action of the Galois group on the dual of the ray class group, compare Fitting ideals under extension of scalars, and pass to the $\ell$-primary part at finite depth; they match the Stickelberger element with the explicit combination of partial zeta values and its involution with the one used here; they translate the divisor of the dyadic unit into valuations at split primes; and they specialize all of this to the fields $E_j$ and their layers. All of these steps are proved. \subsection{What the certificate does not cover} The proofs of Theorems~\ref{thm:lit-colmez}, \ref{thm:lit-dk} and~\ref{thm:lit-dksw-unit} are not formalized. They are deep theorems, and we take them from the literature. The three declarations assert them for the fields named above; that these declarations say what the printed theorems say is a matter of reading, and the repository records the comparison line by line, including the normalization of the Faltings height and of the $L$-function at $s=0$. First, the proofs of Theorems~\ref{thm:lit-colmez}, \ref{thm:lit-dk} and~\ref{thm:lit-dksw-unit} themselves. They are deep theorems, and we take them from the literature. Second, the fidelity of the three axioms to the printed theorems. Each axiom has been compared with its source, but the proof assistant cannot check that a formal statement says what a paper says. Third, the elementary consequences drawn in the introduction from nonvanishing in the half-plane: the reflection of zeros by the functional equation, which places the zeros in the critical strip on the line $\Rea s=1/2$, and the error term in the prime ideal theorem. Proposition~\ref{prop:abelian-norm} is likewise not among the seven theorems; it follows from the theorem of \cite{AlpogeGRH} by the factorization given in its proof. Everything else in Sections~\ref{sec:inputs}--\ref{sec:scope} is covered: the seven theorems are deduced in Lean from the three axioms, and the text of those sections is an account of that deduction in the usual language.