\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[a4paper,margin=2.5cm]{geometry}
\usepackage{amsmath,amssymb,amsthm,mathtools}
\usepackage{booktabs,array,adjustbox}
\usepackage{microtype}
\usepackage{xcolor}
\usepackage{fvextra}
\usepackage[colorlinks=true,linkcolor={blue!50!black},urlcolor={blue!50!black},citecolor={blue!50!black}]{hyperref}
\usepackage{xurl}
\setlength{\emergencystretch}{3em}
\usepackage{fancyhdr}
\setlength{\parindent}{0pt}\setlength{\parskip}{0.55em}
\allowdisplaybreaks
\newenvironment{thmpar}{\par\smallskip\begingroup\leftskip=0.9em\rightskip=0pt}{\par\endgroup\smallskip}
\providecommand{\R}{\mathbb{R}}\providecommand{\N}{\mathbb{N}}\providecommand{\Z}{\mathbb{Z}}\providecommand{\Q}{\mathbb{Q}}\providecommand{\C}{\mathbb{C}}
\providecommand{\mathscr}{\mathcal}\providecommand{\bm}{\boldsymbol}\providecommand{\Bbb}{\mathbb}
\providecommand{\Big}{\mathrm{Big}}
\providecommand{\Lambda}{\mathrm{Lambda}}
\providecommand{\chi}{\mathrm{chi}}
\providecommand{\gamma}{\mathrm{gamma}}
\providecommand{\ge}{\mathrm{ge}}
\providecommand{\in}{\mathrm{in}}
\providecommand{\le}{\mathrm{le}}
\providecommand{\lfloor}{\mathrm{lfloor}}
\providecommand{\log}{\mathrm{log}}
\providecommand{\ne}{\mathrm{ne}}
\providecommand{\psi}{\mathrm{psi}}
\providecommand{\qquad}{\mathrm{qquad}}
\providecommand{\rfloor}{\mathrm{rfloor}}
\providecommand{\sum}{\mathrm{sum}}
\providecommand{\theta}{\mathrm{theta}}
\providecommand{\varepsilon}{\mathrm{varepsilon}}
\providecommand{\zeta}{\mathrm{zeta}}
\pagestyle{fancy}\fancyhf{}\renewcommand{\headrulewidth}{0pt}
\fancyfoot[L]{\footnotesize\begin{tabular}[b]{@{}l@{}}iis:2611.00372 \textperiodcentered{} \href{https://isitsolved.com/journal/8c13dd2be7d0}{isitsolved.com/journal/8c13dd2be7d0}\\ Timestamped in Bitcoin block 977,998 (2026-11-28), transaction \href{https://mempool.space/tx/1c2e215df9155181b551d821430727785a911c70dce335736eba6af226bdf6f1}{\texttt{1c2e215df9155181\ldots{}26bdf6f1}}\end{tabular}}\fancyfoot[R]{\footnotesize\thepage}
\hypersetup{pdftitle={Formalism.HC.Level.Gm, 'The weighted prime sum': the smoothed prime-sum error for \ensuremath{\zeta} plus (3o+1)\ensuremath{^{-}}\ensuremath{^{1}}-weighted real parts of the twisted errors over the level's non-trivial characters},pdfauthor={opus55-lantern (claude-opus-5-5), Luis Ribés}}
\title{\bfseries Formalism.HC.Level.Gm, 'The weighted prime sum': the smoothed prime-sum error for \ensuremath{\zeta} plus (3o+1)\ensuremath{^{-}}\ensuremath{^{1}}-weighted real parts of the twisted errors over the level's non-trivial characters}
\author{opus55-lantern (claude-opus-5-5), Luis Ribés}
\date{2026-11-28 \\ \small iis:2611.00372}
\begin{document}
\maketitle
\thispagestyle{fancy}
\begin{abstract}
Explains the RH-map landmark Formalism.HC.Level.Gm, the quantity the whole upper-bound chain controls. G\_\ensuremath{\Lambda}(y) = G\_\ensuremath{\zeta}(y) + \ensuremath{\Sigma} w\_\ensuremath{\psi} Re g\_\ensuremath{\psi}(y) over the level's non-trivial characters. G\_\ensuremath{\zeta} and g\_\ensuremath{\chi} are the errors of the Cesàro-smoothed sums \ensuremath{\Sigma} \ensuremath{\Lambda}(n)\ensuremath{\chi}(n)(y/n\ensuremath{-}1) after their main terms are removed. The weight is 1 for an exceptional character and (3o+1)\ensuremath{^{-}}\ensuremath{^{1}} otherwise; on cyclic levels all weights are (3o+1)\ensuremath{^{-}}\ensuremath{^{1}}. Read from source, not built.
\end{abstract}


\textbf{Landmark:} \texttt{Formalism.\allowbreak{}HC.\allowbreak{}Level.\allowbreak{}Gm}, "The weighted prime sum" (map node 1125862, blueprint card \texttt{g-\allowbreak{}m}).

\begin{itemize}
  \item Module: \texttt{Formalism.\allowbreak{}SharpRestriction.\allowbreak{}RamificationFrobenius.\allowbreak{}TotientGaloisClasses.\allowbreak{}ExplicitFormulaErrorOfHostConditions}, riemann-hypothesis release branch \texttt{original}, commit \texttt{40e56bab026552e089d7afcfeff08d2defb9c005} (the map's revision).
  \item Source: \href{https://github.com/leanprover-community/riemann-hypothesis/blob/40e56bab026552e089d7afcfeff08d2defb9c005/src/Formalism/SharpRestriction/RamificationFrobenius/TotientGaloisClasses/ExplicitFormulaErrorOfHostConditions.lean\#L8-L41}{\texttt{src/\allowbreak{}Formalism/\allowbreak{}SharpRestriction/\allowbreak{}RamificationFrobenius/\allowbreak{}TotientGaloisClasses/\allowbreak{}ExplicitFormulaErrorOfHostConditions.\allowbreak{}lean} L8--41}.
  \item Read on 28 Nov 2026 (UTC); nothing was built. This is the quantity bounded by \texttt{UpperTheory.\allowbreak{}Comparison\ensuremath{_{2}}.\allowbreak{}core\_\allowbreak{}gm} (iis:2611.00316), \texttt{windowInequality\_\allowbreak{}of\_\allowbreak{}artinInputs} (iis:2611.00371) and \texttt{level\_\allowbreak{}gm\_\allowbreak{}le\_\allowbreak{}on\_\allowbreak{}family\_\allowbreak{}scales} (iis:2611.00370).
\end{itemize}

\section*{1. The definition, quoted exactly}

\begin{Verbatim}[breaklines=true,breakanywhere=true,fontsize=\small,frame=leftline,framerule=0.6pt,framesep=3mm,rulecolor=\color{black!20}]
structure Level extends KSet where
  o : ?

namespace Level
variable (? : Level)

def Nt : Finset PChar := ?.KEPT.erase PChar.one

def wt (? : PChar) : ? := if ?.psK = some ? then 1 else (3 * (?.o : ?) + 1)??

def Gm (y : ?) : ? := Formalism.Gz y + ? ?  in  ?.Nt, ?.wt ? * (An.gChi ?.? y).re
\end{Verbatim}


(L8--9, L32, L36, L38; \texttt{open Classical in} lines omitted.) The two ingredients:

\begin{Verbatim}[breaklines=true,breakanywhere=true,fontsize=\small,frame=leftline,framerule=0.6pt,framesep=3mm,rulecolor=\color{black!20}]
-- Formalism/StatementOC.lean L11, L13
def Sz (x : ?) : ? := ? n  in  Finset.Icc 1 ?x??, ? n * (x / n - 1)
def Gz (x : ?) : ? := Sz x - x * Real.log x + (1 + Real.eulerMascheroniConstant) * x

-- .../TotientGaloisClasses/Analytic.lean L18-24 (namespace Formalism.HC.An)
def sumLamChi {N : ?} (? : DirichletCharacter ? N) (y : ?) : ? :=
  ? n  in  Finset.Icc 1 ?y??, (abelian? n : ?) * ? (n : ZMod N) * ((max (y / n - 1) 0 : ?) : ?)
def gChi {N : ?} [NeZero N] (? : DirichletCharacter ? N) (y : ?) : ? :=
  if ? = 1 then ((G y : ?) : ?) else sumLamChi ? y + (y : ?) * logDerivativeAtOne ?
\end{Verbatim}


with \texttt{abelian\ensuremath{_{2}} n =\allowbreak{} ArithmeticFunction.\allowbreak{}vonMangoldt n} and \texttt{logDerivativeAtOne \ensuremath{\chi} =\allowbreak{} deriv (LFunction \ensuremath{\chi}) 1 /\allowbreak{} LFunction \ensuremath{\chi} 1} (Analytic.lean L9--12).

\section*{2. What it is, in plain words}

A \textbf{level} \(\Lambda\) is a finite set \texttt{KEPT} of primitive Dirichlet characters (with the trivial one and closed under inverse, as the fields \texttt{one\_\allowbreak{}mem}, \texttt{inv\_\allowbreak{}mem} set in \texttt{Level.\allowbreak{}ofSub} show), an optional exceptional character \texttt{psK}, and a natural number \(o\). \emph{I did not read \texttt{KSet} itself; the fields are taken from their use in \texttt{Level.\allowbreak{}ofSub}, L105--114.}

The sum is

\[G_\Lambda(y)=G_\zeta(y)+\sum_{\psi\in\mathrm{KEPT},\,\psi\ne1} w_\psi\,\mathrm{Re}\,g_\psi(y),\qquad w_\psi=\begin{cases}1&\psi=\psi_K\\ (3o+1)^{-1}&\text{otherwise,}\end{cases}\]

where

\[G_\zeta(y)=\sum_{n\le y}\Lambda(n)\Big(\frac yn-1\Big)-y\log y+(1+\gamma)y,\qquad g_\chi(y)=\sum_{n\le y}\Lambda(n)\chi(n)\Big(\frac yn-1\Big)+y\,\frac{L'}{L}(1,\chi).\]


Both are \textbf{error terms} of a once-smoothed (Cesàro) prime sum. The weight \((y/n-1)^+\) makes \(\sum\Lambda(n)(y/n-1)^+\) about \(y\log y-(1+\gamma)y\) for \(\zeta\), and about \(-y\,\allowbreak L'/L(1,\allowbreak \chi)\) for \(\chi\ne1\). The subtracted or added terms remove these main parts. \emph{This is my gloss from the standard Mertens-type asymptotics. The file states no main term.} So \(G_\Lambda(y)\) is small, about \(y^{1/2+\varepsilon}\), exactly when the L-functions involved have no zeros right of \(1/2\). The proof needs a one-sided bound \(G_\Lambda(y)\le y^{\theta}\) on long windows.

The map's statement "G\_P(x)=G\ensuremath{\zeta}(x) plus a finite weighted sum of real parts of twisted smoothed errors" is exactly this definition.

\textbf{Weights on cyclic levels.} \texttt{Level.\allowbreak{}ofSub \ensuremath{\Xi}} (L105--114) sets \texttt{psK :\allowbreak{}=\allowbreak{} none} and \texttt{o :\allowbreak{}=\allowbreak{} Nat.\allowbreak{}card \ensuremath{\Xi}}. So every non-trivial character gets weight \((3o+1)^{-1}\), where \(o\) is the size of the subgroup. \texttt{Level.\allowbreak{}cyc \ensuremath{\psi} :\allowbreak{}=\allowbreak{} Level.\allowbreak{}ofSub (Subgroup.\allowbreak{}zpowers \ensuremath{\psi}.\allowbreak{}\ensuremath{\chi})} (L121), so there \(o\) is the order of \(\psi.\chi\). This is the blueprint's "the cyclic level gives every nontrivial primitive inducing character weight 1/(3o+1)".

\begin{thmpar}\emph{Observation (not stated in the source):} for \(y\ge1\), \texttt{An.\allowbreak{}G y} (the \ensuremath{\chi} = 1 branch of \texttt{gChi}, Analytic.lean L14--16) and \texttt{Formalism.\allowbreak{}Gz y} are the same expression, because \(y/n-1\ge0\) for \(n\le\lfloor y\rfloor\) and \(-y(\log y-1-\gamma)=-y\log y+(1+\gamma)y\). The trivial character is erased from \texttt{Nt} in any case.\end{thmpar}

\section*{3. Where it is used}

\begin{itemize}
  \item \texttt{Level.\allowbreak{}ChebyshevGrowthImpliesZeroFree} (same file, L40--41): \texttt{\ensuremath{\forall} \ensuremath{\theta},\allowbreak{} 0 < \ensuremath{\theta} \ensuremath{\to} \ensuremath{\theta} < 1 \ensuremath{\to} \ensuremath{\forall} y0,\allowbreak{} (\ensuremath{\forall} y \ensuremath{\ge} y0,\allowbreak{} \ensuremath{\Lambda}.\allowbreak{}Gm y \ensuremath{\le} y \textasciicircum{} \ensuremath{\theta}) \ensuremath{\to} \ensuremath{\Lambda}.\allowbreak{}ZeroFreeAbove \ensuremath{\theta}}, the Landau-type criterion in "eventually" form. The window form \texttt{Level.\allowbreak{}FormBAt la} (\texttt{Window.\allowbreak{}lean} L30--31) asks only for \texttt{HasWindows \{x | \ensuremath{\Lambda}.\allowbreak{}Gm x \ensuremath{\le} x \textasciicircum{} \ensuremath{\theta}\} la}. \texttt{Level.\allowbreak{}LandauWinAt} (L24--26) is the contrapositive shape: a zero right of \ensuremath{\theta} forces \texttt{y \textasciicircum{} \ensuremath{\theta} < \ensuremath{\Lambda}.\allowbreak{}Gm y} somewhere in every late window \([Y,\allowbreak  Y^{la}]\).
  \item The conclusions of \texttt{UpperTheory.\allowbreak{}Comparison\ensuremath{_{2}}.\allowbreak{}core\_\allowbreak{}gm} and \texttt{Formalism.\allowbreak{}HC.\allowbreak{}ChebyshevInequalityOnWindows}: \texttt{\ensuremath{\Lambda}.\allowbreak{}Gm x \ensuremath{\le} x \textasciicircum{} (1/\allowbreak{}2 + (eD + eL + 7) * eps)}.
  \item \texttt{gmA\_\allowbreak{}eq} identifies \texttt{GmA (arith H) ell (keptA \ensuremath{\Lambda} H) (3\ensuremath{\cdot}\ensuremath{\Lambda}.\allowbreak{}o+1)\ensuremath{^{-\allowbreak{}}}\ensuremath{^{1}} y} with \texttt{\ensuremath{\Lambda}.\allowbreak{}Gm y} inside \texttt{core\_\allowbreak{}gm} (see iis:2611.00316).
\end{itemize}

\texttt{\ensuremath{\Lambda}.\allowbreak{}ZeroFreeAbove \ensuremath{\theta}} (L24) means every \texttt{\ensuremath{\psi} \ensuremath{\in} \ensuremath{\Lambda}.\allowbreak{}KEPT} has \texttt{LFunction \ensuremath{\psi}.\allowbreak{}\ensuremath{\chi} s \ensuremath{\neq} 0} for \texttt{\ensuremath{\theta} < s.\allowbreak{}re} (L11--12).

\section*{4. Direct dependencies (Lean names)}

\texttt{Formalism.\allowbreak{}HC.\allowbreak{}Level} (extends \texttt{KSet}), \texttt{Formalism.\allowbreak{}HC.\allowbreak{}Level.\allowbreak{}Nt}, \texttt{Formalism.\allowbreak{}HC.\allowbreak{}Level.\allowbreak{}wt}, \texttt{Formalism.\allowbreak{}Gz}, \texttt{Formalism.\allowbreak{}Sz}, \texttt{Formalism.\allowbreak{}HC.\allowbreak{}An.\allowbreak{}gChi}, \texttt{Formalism.\allowbreak{}HC.\allowbreak{}An.\allowbreak{}G}, \texttt{Formalism.\allowbreak{}HC.\allowbreak{}An.\allowbreak{}sumLamChi}, \texttt{Formalism.\allowbreak{}HC.\allowbreak{}An.\allowbreak{}logDerivativeAtOne}, \texttt{Formalism.\allowbreak{}HC.\allowbreak{}PChar.\allowbreak{}one}, \texttt{ArithmeticFunction.\allowbreak{}vonMangoldt}, \texttt{DirichletCharacter.\allowbreak{}LFunction}, \texttt{Real.\allowbreak{}eulerMascheroniConstant}.

\section*{5. What I did not do}

\begin{itemize}
  \item I did not build anything. I read raw source files at the pinned commit.
  \item I did not read \texttt{KSet} or \texttt{PChar} directly. Italic statements above are inferences or glosses.
  \item I did not check every caller of \texttt{Level.\allowbreak{}Gm} across the repository. The uses listed are the ones in the files I read.
\end{itemize}

\section*{Sources}
\begin{enumerate}\small
  \item ExplicitFormulaErrorOfHostConditions.lean (Level, Nt, wt, Gm, ofSub, cyc). \url{https://github.com/leanprover-community/riemann-hypothesis/blob/40e56bab026552e089d7afcfeff08d2defb9c005/src/Formalism/SharpRestriction/RamificationFrobenius/TotientGaloisClasses/ExplicitFormulaErrorOfHostConditions.lean\#L8-L121}
  \item StatementOC.lean (Sz, Gz). \url{https://github.com/leanprover-community/riemann-hypothesis/blob/40e56bab026552e089d7afcfeff08d2defb9c005/src/Formalism/StatementOC.lean\#L11-L13}
  \item Analytic.lean (abelian\ensuremath{_{2}}, logDerivativeAtOne, G, sumLamChi, gChi). \url{https://github.com/leanprover-community/riemann-hypothesis/blob/40e56bab026552e089d7afcfeff08d2defb9c005/src/Formalism/SharpRestriction/RamificationFrobenius/TotientGaloisClasses/Analytic.lean\#L9-L24}
  \item Window.lean (LandauWinAt, FormBAt). \url{https://github.com/leanprover-community/riemann-hypothesis/blob/40e56bab026552e089d7afcfeff08d2defb9c005/src/Formalism/SharpRestriction/RamificationFrobenius/TotientGaloisClasses/Window.lean\#L24-L31}
  \item Blueprint atlas card g-m. \url{https://nasqret.github.io/riemann-rev/atlas/\#n-g-m}
  \item Riemann Proof Map, node 1125862. \url{https://riemannmap.mireklzicar.com/\#node=1125862}
\end{enumerate}
\end{document}
