<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Proof reading: the five Lean declarations</title>
<!--
  Proof-reading component for the classroom scene.
  Self-contained: no network requests, no external scripts, fonts or styles.
  Embed with <iframe src="proof_reading.html#t=0"></iframe> or as a board texture source.
  Messaging (optional):
    parent -> component : {type:"proof-reading:select", index:0..4, tab?:"domain"|"definition"|"provider"|"evidence"}
    component -> parent : {type:"proof-reading:selected", index, name, tab}
  All facts shown are taken from the local snapshots in sources/ and results/ and from
  verification/audit_formal.py (run 2026-11-23). No Lean kernel was run to produce this page.
-->
<style>
  :root{
    --paper:#f6f1e6; --card:#fbf8f0; --ink:#2a2925; --muted:#6b675d; --line:#d8d0be; --soft:#ece5d5;
    --ext:#2c6c70; --ext-bg:#dcebea; --log:#8f641b; --log-bg:#f1e6cd; --num:#754873; --num-bg:#ecdfeb;
    --accent:#7b2d26;
  }
  *{box-sizing:border-box}
  html,body{margin:0;background:var(--paper);color:var(--ink)}
  body{font:16px/1.5 Georgia,"Iowan Old Style","Times New Roman",serif;padding:18px 18px 28px}
  h1{font-size:1.35rem;font-weight:normal;margin:0 0 2px;letter-spacing:.01em}
  .sub{color:var(--muted);margin:0 0 12px;font-size:.93rem;max-width:60rem}
  code,pre,.mono{font:13px/1.5 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}
  .sans{font-family:ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif}
  .legend{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 14px;align-items:center}
  .legend span.lbl{font-size:.8rem;color:var(--muted)}
  .chip{border:1px solid var(--line);border-radius:999px;padding:3px 11px;font-size:.78rem;cursor:pointer;background:var(--card);color:var(--ink);display:inline-flex;gap:6px;align-items:center}
  .chip i{width:9px;height:9px;border-radius:50%;display:inline-block}
  .chip[aria-pressed="false"]{opacity:.42}
  .chip:focus-visible,button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
  .t-ext i,.dot-ext{background:var(--ext)} .t-log i,.dot-log{background:var(--log)} .t-num i,.dot-num{background:var(--num)}
  .grid{display:grid;grid-template-columns:minmax(210px,250px) minmax(0,1fr);gap:16px;max-width:1180px}
  nav{display:flex;flex-direction:column;gap:7px}
  nav button{all:unset;cursor:pointer;display:block;border:1px solid var(--line);background:var(--card);border-radius:7px;padding:8px 10px}
  nav button .n{font-size:.72rem;color:var(--muted)}
  nav button .k{display:block;font:12.5px/1.35 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;word-break:break-all}
  nav button .d{display:block;font-size:.82rem;color:var(--muted);margin-top:2px}
  nav button[aria-current="true"]{border-color:var(--accent);box-shadow:inset 3px 0 0 var(--accent);background:#fffdf7}
  .card{background:var(--card);border:1px solid var(--line);border-radius:8px;padding:14px 16px}
  .top{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(250px,.9fr);gap:14px;margin-bottom:14px}
  pre{background:var(--soft);border-radius:6px;padding:10px 12px;margin:8px 0 6px;overflow-x:auto;white-space:pre-wrap;word-break:break-word}
  .plain{margin:6px 0 0}
  .meta{font-size:.82rem;color:var(--muted);margin-top:6px}
  svg{width:100%;height:auto;display:block}
  .cap{font-size:.8rem;color:var(--muted);min-height:2.6em;margin-top:4px}
  .tabs{display:flex;gap:4px;border-bottom:1px solid var(--line);margin:0 0 10px;flex-wrap:wrap}
  .tabs button{all:unset;cursor:pointer;padding:6px 12px;font-size:.88rem;color:var(--muted);border:1px solid transparent;border-bottom:none;border-radius:6px 6px 0 0}
  .tabs button[aria-selected="true"]{color:var(--ink);background:var(--card);border-color:var(--line);position:relative;top:1px}
  table{border-collapse:collapse;width:100%;font-size:.9rem}
  th,td{text-align:left;vertical-align:top;padding:7px 9px;border-bottom:1px solid var(--line)}
  th{font-weight:normal;color:var(--muted);font-size:.78rem;width:11.5rem}
  .ev{border-left:4px solid var(--line);padding:7px 10px;margin:8px 0;background:#fffdf8;border-radius:0 6px 6px 0}
  .ev.ext{border-left-color:var(--ext)} .ev.log{border-left-color:var(--log)} .ev.num{border-left-color:var(--num)}
  .ev h4{margin:0 0 2px;font-size:.92rem;font-weight:normal}
  .ev p{margin:2px 0;font-size:.86rem}
  .ev .src{color:var(--muted);font-size:.76rem}
  .tag{font-size:.7rem;border-radius:4px;padding:1px 6px;margin-right:6px;white-space:nowrap}
  .tag.ext{background:var(--ext-bg);color:var(--ext)} .tag.log{background:var(--log-bg);color:var(--log)} .tag.num{background:var(--num-bg);color:var(--num)}
  .tag.open{background:#f3ddd9;color:var(--accent)}
  .foot{max-width:1180px;margin-top:14px;font-size:.8rem;color:var(--muted);border-top:1px solid var(--line);padding-top:9px}
  @media (max-width:820px){.grid,.top{grid-template-columns:1fr} nav{flex-direction:row;flex-wrap:wrap} nav button{flex:1 1 150px}}
</style>
</head>
<body>
<h1>Reading the five Lean declarations</h1>
<p class="sub">Choose a theorem from <code>Main.lean</code>, then read it four ways: over what domain it speaks, which definitions give it meaning, who verified what, and which records are held locally. Every item is labelled by the kind of evidence it is.</p>

<div class="legend sans" id="legend">
  <span class="lbl">Evidence kinds (click to show or hide):</span>
  <button class="chip t-ext" data-tier="ext" aria-pressed="true"><i></i>External kernel verification, read from a log</button>
  <button class="chip t-log" data-tier="log" aria-pressed="true"><i></i>Local log check, re-run in this audit</button>
  <button class="chip t-num" data-tier="num" aria-pressed="true"><i></i>Finite numerical work</button>
</div>

<div class="grid">
  <nav id="nav" aria-label="Theorem declarations"></nav>
  <div>
    <div class="top">
      <section class="card" aria-live="polite">
        <div class="meta sans" id="kicker"></div>
        <pre id="lean"></pre>
        <p class="plain" id="plain"></p>
        <div class="meta" id="meta"></div>
      </section>
      <section class="card">
        <svg id="plane" viewBox="0 0 420 300" role="img" aria-label="The complex s-plane with the domain of the selected statement"></svg>
        <div class="cap sans" id="cap"></div>
      </section>
    </div>
    <section class="card">
      <div class="tabs sans" role="tablist" id="tabs"></div>
      <div id="panel" role="tabpanel"></div>
    </section>
  </div>
</div>

<p class="foot sans">Sources: local snapshots in <code>sources/</code> (Main.lean, Statements.lean, pinned Mathlib <code>RiemannZeta.lean</code>, MIT logs and SHA256SUMS, MIT / Waterloo / Lean-community pages, announcement) and <code>results/summary.json</code>. The audit script <code>verification/audit_formal.py</code> re-hashed ten snapshots and cross-matched the declarations with the logs on 2026-11-23. <b>No Lean kernel was run here</b>: a blue-green item reports what a log records, an ochre item was recomputed locally from text, and a plum item is a finite computation that cannot bear on the truth of a universal statement. See <code>verification/formal_reading.md</code>.</p>

<script>
(function(){
"use strict";
var AX="[propext, Classical.choice, Quot.sound]";
var T=[
 {name:"riemannHypothesis", label:"RH, Mathlib's own statement", type:"RiemannHypothesis", term:"rhOfAll", cid:"#51215", region:"plane",
  lean:"theorem riemannHypothesis : RiemannHypothesis := rhOfAll\n\n-- Mathlib (pinned), NumberTheory/LSeries/RiemannZeta.lean\ndef RiemannHypothesis : Prop :=\n  ∀ (s : ℂ) (_ : riemannZeta s = 0) (_ : ¬∃ n : ℕ, s = -2 * (n + 1)) (_ : s ≠ 1),\n    s.re = 1 / 2",
  plain:"Every zero of ζ other than the trivial zeros −2, −4, −6, … has real part 1/2.",
  src:"Statement defined in Mathlib, not in the submission.",
  domain:[
   ["Variable","s ranges over all of ℂ; there is no restriction to the critical strip."],
   ["Hypotheses","ζ(s) = 0; s is not −2(n+1) for any natural number n; s ≠ 1."],
   ["Conclusion","Re s = 1/2."],
   ["Excluded points","The trivial zeros −2, −4, −6, … (Lean's ℕ starts at 0, so −2(n+1) lists exactly these), and s = 1. Mathlib's ζ is a total function ℂ → ℂ and carries a conventional value at its pole; the MIT page gives this as the reason for the hypothesis s ≠ 1."],
   ["What the whole-plane form adds","Because s is unrestricted, the statement also contains the absence of zeros with Re s ≥ 1 and with Re s ≤ 0 away from the trivial zeros."]],
  definition:[
   ["riemannZeta","Module Mathlib.NumberTheory.LSeries.RiemannZeta: <code>def riemannZeta := hurwitzZetaEven 0</code>. The same file proves it equals Σ 1/nˢ for Re s &gt; 1, that ζ(0) = −1/2, that it vanishes at −2(n+1), and that it is differentiable away from s = 1."],
   ["RiemannHypothesis","Same Mathlib file, where it carries a Wikidata tag (Q205966) and the docstring “a formal statement of the Riemann hypothesis”. The logged printout in audit.log shows the elaborated form with the cast ↑n."],
   ["Proof term","<code>rhOfAll</code>, defined upstream of <code>Supplements.Kernels.MainTheoremsAll</code>; its definition is not among the local snapshots."]],
  own:[["log","Mathlib source, the logged printout and theorem 2's written-out statement agree token for token","Check D1: after erasing binder syntax, the displayed cast and parentheses, the three texts coincide. A textual comparison only; definitional equality is the kernel's business.","sources/zeta_definition.lean, audit.log, Statements.lean"]]},
 {name:"riemannZeta_eq_zero_re", label:"RH, written out", type:"RiemannZetaZerosOnLine", term:"rhOfAll", cid:"#51218", region:"plane",
  lean:"theorem riemannZeta_eq_zero_re : RiemannZetaZerosOnLine := rhOfAll\n\n-- Statements.lean (imports only Mathlib)\ndef RiemannZetaZerosOnLine : Prop :=\n  ∀ s : ℂ, riemannZeta s = 0 → (¬∃ n : ℕ, s = -2 * ((n : ℂ) + 1)) → s ≠ 1 →\n    s.re = 1 / 2",
  plain:"The same statement as theorem 1 with nothing hidden behind a name: the cast from ℕ to ℂ is written explicitly.",
  src:"Statement defined in Statements.lean.",
  domain:[
   ["Variable","s ranges over all of ℂ."],
   ["Hypotheses","ζ(s) = 0; s ≠ −2((n : ℂ)+1) for every n : ℕ; s ≠ 1."],
   ["Conclusion","Re s = 1/2."],
   ["Relation to theorem 1","Identical domain and exclusions. The only visible difference is the explicit cast (n : ℂ), which Lean inserts silently in Mathlib's definition."],
   ["Why state it twice","A reader can check this version against the textbook statement without trusting that the name RiemannHypothesis unfolds to what it should."]],
  definition:[
   ["riemannZeta","Mathlib's function, exactly as in theorem 1."],
   ["RiemannZetaZerosOnLine","Module Statements (per audit.log). The file's only import is Mathlib, so the statement cannot depend on anything in the submission."],
   ["Proof term","<code>rhOfAll</code>, the same term as theorem 1. Lean accepting one term at both types is source-level evidence that the two Props are equal by definition (MIT page: “Lean accepts the two as equal by definition”)."]],
  own:[["log","Same proof term as theorem 1","Check D2: Main.lean gives <code>rhOfAll</code> to both declarations.","sources/Main.lean"]]},
 {name:"LFunction_ne_zero_of_half_lt_re", label:"No zeros right of the line, all Dirichlet L", type:"DirichletLNonvanishingRightOfHalf", term:"allChi", cid:"#51581", region:"half",
  lean:"theorem LFunction_ne_zero_of_half_lt_re : DirichletLNonvanishingRightOfHalf := allChi\n\ndef DirichletLNonvanishingRightOfHalf : Prop :=\n  ∀ (N : ℕ) [NeZero N] (χ : DirichletCharacter ℂ N) (s : ℂ),\n    1 / 2 < s.re → (χ ≠ 1 ∨ s ≠ 1) → DirichletCharacter.LFunction χ s ≠ 0",
  plain:"For every modulus N ≥ 1 and every Dirichlet character χ mod N, primitive or not, L(χ, s) ≠ 0 whenever Re s > 1/2, except for the trivial character at its pole s = 1.",
  src:"Statement defined in Statements.lean.",
  domain:[
   ["Variables","N a natural number with N ≠ 0; χ any Dirichlet character mod N with complex values; s a complex number."],
   ["Hypotheses","Re s > 1/2, and (χ ≠ 1 or s ≠ 1)."],
   ["Conclusion","L(χ, s) ≠ 0."],
   ["Excluded point","Only the pair (χ trivial, s = 1), where the L-function has its pole and the Lean function a conventional value."],
   ["Shape","A one-sided, open half-plane statement. It includes the classical region Re s ≥ 1. By itself it says nothing about 0 &lt; Re s &lt; 1/2; theorem 4 is the two-sided statement."],
   ["Case N = 1","The only character is trivial and L is ζ, so this contains ζ(s) ≠ 0 for Re s &gt; 1/2, s ≠ 1."]],
  definition:[
   ["DirichletCharacter","Module Mathlib.NumberTheory.DirichletCharacter.Basic (per audit.log)."],
   ["DirichletCharacter.LFunction","Module Mathlib.NumberTheory.LSeries.DirichletContinuation (per audit.log); by its module name, the continued L-function as a function on all of ℂ. Its source file is not among the local snapshots; only the module name is recorded."],
   ["DirichletLNonvanishingRightOfHalf","Module Statements; imports only Mathlib."],
   ["Proof term","<code>allChi</code>, defined upstream; not among the local snapshots."]],
  own:[]},
 {name:"LFunction_eq_zero_re", label:"Strip zeros on the line, all Dirichlet L", type:"DirichletLZerosOnLine", term:"claimAll.2.1", cid:"#51583", region:"strip",
  lean:"theorem LFunction_eq_zero_re : DirichletLZerosOnLine := claimAll.2.1\n\ndef DirichletLZerosOnLine : Prop :=\n  ∀ (N : ℕ) [NeZero N] (χ : DirichletCharacter ℂ N) (s : ℂ),\n    0 < s.re → s.re < 1 → DirichletCharacter.LFunction χ s = 0 → s.re = 1 / 2",
  plain:"For every modulus and every Dirichlet character, each zero of L(χ, s) in the open critical strip lies on the line Re s = 1/2.",
  src:"Statement defined in Statements.lean.",
  domain:[
   ["Variables","N ≥ 1; χ any Dirichlet character mod N, primitive or not; s complex."],
   ["Hypotheses","0 &lt; Re s &lt; 1 and L(χ, s) = 0."],
   ["Conclusion","Re s = 1/2."],
   ["Why the open strip","It leaves out the trivial zeros (Re s ≤ 0) and, for imprimitive characters, the extra zeros on the line Re s = 0 that come from the removed Euler factors. No clause about s = 1 is needed because Re s &lt; 1. (The remark on imprimitive characters is classical background, not taken from the sources.)"],
   ["Scope","Dirichlet L-functions only. The MIT page states that Dedekind, Hecke and general automorphic L-functions are not among the checked statements."]],
  definition:[
   ["DirichletCharacter.LFunction","Mathlib.NumberTheory.LSeries.DirichletContinuation (per audit.log)."],
   ["DirichletLZerosOnLine","Module Statements; imports only Mathlib."],
   ["Proof term","<code>claimAll.2.1</code>: one component of a conjunction named <code>claimAll</code> proved upstream. Which other statements that conjunction bundles is not visible in the local snapshots."]],
  own:[]},
 {name:"LFunction_eq_zero_re_of_isPrimitive", label:"GRH for primitive characters", type:"PrimitiveDirichletLZerosOnLine", term:"critAll", cid:"#51687", region:"strip",
  lean:"theorem LFunction_eq_zero_re_of_isPrimitive : PrimitiveDirichletLZerosOnLine := critAll\n\ndef PrimitiveDirichletLZerosOnLine : Prop :=\n  ∀ (N : ℕ) [NeZero N] (χ : DirichletCharacter ℂ N), χ.IsPrimitive →\n    ∀ s : ℂ, 0 < s.re → s.re < 1 → DirichletCharacter.LFunction χ s = 0 → s.re = 1 / 2",
  plain:"For every primitive Dirichlet character, each zero of L(χ, s) in the open critical strip lies on Re s = 1/2: the form in which GRH for Dirichlet L-functions is usually stated.",
  src:"Statement defined in Statements.lean.",
  domain:[
   ["Variables","N ≥ 1; χ a Dirichlet character mod N with χ.IsPrimitive; s complex."],
   ["Hypotheses","χ primitive; 0 &lt; Re s &lt; 1; L(χ, s) = 0."],
   ["Conclusion","Re s = 1/2."],
   ["Relation to theorem 4","As a statement it is the restriction of theorem 4 to primitive characters. In Main.lean it is nevertheless given its own proof term, <code>critAll</code>."],
   ["Scope","“GRH” here means Dirichlet L-functions, all moduli and characters, and nothing wider (MIT page)."]],
  definition:[
   ["DirichletCharacter.IsPrimitive","Module Mathlib.NumberTheory.DirichletCharacter.Basic (per audit.log)."],
   ["DirichletCharacter.LFunction","Mathlib.NumberTheory.LSeries.DirichletContinuation (per audit.log)."],
   ["PrimitiveDirichletLZerosOnLine","Module Statements; imports only Mathlib."],
   ["Proof term","<code>critAll</code>; the name echoes the imported module <code>Supplements.Kernels.MainTheoremsCritical</code>. Its definition is not among the local snapshots."]],
  own:[]}
];

var PROVIDERS=[
 ["Levent Alpöge, working with Claude","Author of the Lean library and of the five proof terms (announcement of 20 November 2026). Authorship is not verification.",""],
 ["Mathlib (pinned tag v4.33.1, rev 0df444a3)","Supplies every mathematical notion in the statements: ζ, Dirichlet characters, their L-functions, primitivity, and the Prop RiemannHypothesis.",""],
 ["Lean and Mathlib communities","Joint statement of 21 November 2026 listing four criteria (statement correct, library compiles, code proves that statement, proof valid). The statement file imports only Mathlib. Snapshot of Main.lean and Statements.lean taken from leanprover-community/riemann-hypothesis at commit 40e56bab.","ext"],
 ["Andrew Sutherland, MIT (checks run with Claude Code)","Axiom audit, con-leche <code>--compare</code>, nanoda, sandboxed rebuild and export: logs held locally with matching checksums. Also reported on the page without a local log: leanchecker replay of 175,187 modules, lean4lean, con-ron, con-leche master.","ext"],
 ["Michael Rubinstein, Waterloo","Reports an independent compile, axiom list, kernel replay and a nanoda run on 1,484,729 declarations (21 November 2026). Page only; no logs held locally.","ext"],
 ["This audit (2026-11-23)","Re-hashed the snapshots, parsed the declarations and logs, compared statement texts. Reads logs; runs no kernel.","log"],
 ["Companion experiments (results/summary.json)","100 zeros of ζ, primes below 10⁶, a 131 × 49 mesh. Finite, and only about ζ.","num"]
];

function shared(t){
 var isZeta=(t.region==="plane");
 return [
 ["ext","Axioms: only Lean's three standard ones","<code>'"+t.name+"' depends on axioms: "+AX+"</code>. The same log lists all 15 axioms in the environment, all declared in Lean core; <code>sorryAx</code> and the compiler-trust axioms exist there but appear in no dependency list.","sources/audit.log · sha256 0a1473fc…d87a62 · checks E1–E4"],
 ["ext","Statement comparison: proved theorem equals the challenge statement","<code>con-leche: theorem "+t.name+" justified by the solution</code>. The challenge holds this statement as placeholder "+t.cid+" among 51,692 declarations that import only Mathlib; the solution's 1,468,418 declarations were accepted in <code>--verified</code> mode, exit status 0.","sources/con-leche-compare.log · sha256 5a068bf5…af1f6e · checks D4, D5"],
 ["ext","A second, independently written kernel accepts the export","nanoda (Rust) run on the full export: exit status 0 after 27 min 42 s. The log holds timing and exit status only, so it supports all five theorems jointly, not this one by name.","sources/nanoda.log · sha256 d4c5360b…b6ac49 · check F1"],
 ["ext","Sandboxed rebuild reproduces the export byte for byte","<code>lake build Main</code> without network, read-only source, Lean 4.33.1: exit 0; export of 61,570,595,788 bytes with sha256 5ea74b91…f6be244e, “EXPORT SHA256 MATCHES the published export”. 175,186 of 175,187 compiled files identical; the one exception is a documented non-deterministic bound-variable name.","sources/sandbox-timeline.txt · sha256 610dafdb…c63792c · checks F2–F4"],
 ["ext","Reported on the MIT page, log not held locally","leanchecker replay of all 175,187 modules; lean4lean on all modules (five needed a raised step limit); con-ron <code>--compare</code>; con-leche master. Their log hashes are listed in SHA256SUMS, but the files are not in <code>sources/</code>, so this audit could not read them.","sources/mit.html, sources/SHA256SUMS"],
 ["open","Still running when the MIT page was captured","Lean's own kernel on the export, and <code>lake comparator</code> end to end (its statement comparison and axiom check had passed in one run). Page last updated 2026-11-22 16:20 UTC. Lean's kernel had already accepted every module from the compiled files.","sources/mit.html · check F6"],
 ["log","The logs read here are the published ones","Recomputed sha256 of audit.log, nanoda.log, con-leche-compare.log and sandbox-timeline.txt equals both the snapshot index and the MIT SHA256SUMS entries; SHA256SUMS itself matches the index.","checks A1, B"],
 ["log","The statement printed on the MIT page equals the local statement","After HTML unescaping and whitespace normalisation the page's text for this theorem is identical to "+(t.type==="RiemannHypothesis"?"the name RiemannHypothesis with Mathlib's definition":"the body of "+t.type+" in Statements.lean")+".","check D3"],
 ["log","Toolchain agreement","lean-toolchain (v4.33.1), the Mathlib revision in lake-manifest.json and the rebuild log name the same Lean and Mathlib.","check F4"],
 ["num", isZeta?"Finite numerical companion (ζ only)":"Finite numerical companion: touches only the case N = 1",
   (isZeta?"":"The local experiments concern ζ, that is the trivial character mod 1. Nothing numerical is recorded for any other character. ")+
   "100 zeros located; largest |ζ(ρ)| residual 4.6 × 10⁻⁴⁴; largest difference from the LMFDB printed decimals 2.2 × 10⁻³¹; 11 bracketed sign changes; primes below 10⁶ (78,498, re-derived by sieve in this audit). The summary itself notes that the zero index comes from mpmath with no independent completeness certificate. Consistent with the theorem; no finite computation can establish it.","results/summary.json · checks G1, G2"]
 ];
}

var TABS=[["domain","Precise domain"],["definition","Definitions"],["provider","Who verified what"],["evidence","Recorded evidence"]];
var state={i:0,tab:"domain",tiers:{ext:true,log:true,num:true}};
var $=function(id){return document.getElementById(id)};
function esc(s){return s.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
var TAGS={ext:"external kernel · from log",log:"local log check",num:"finite numerical",open:"open item"};

function rows(list){return "<table>"+list.map(function(r){return "<tr><th>"+r[0]+"</th><td>"+r[1]+"</td></tr>"}).join("")+"</table>"}
function evHtml(e){
  var cls=e[0]==="open"?"ext":e[0];
  return '<div class="ev '+cls+'" data-tier="'+cls+'"><h4><span class="tag sans '+e[0]+'">'+TAGS[e[0]]+"</span>"+e[1]+"</h4><p>"+e[2]+'</p><p class="src sans">'+e[3]+"</p></div>";
}

/* ---------- s-plane ---------- */
var NS="http://www.w3.org/2000/svg";
function X(re){return 40+(re+7)/10*350}
function Y(im){return 150-im/34*125}
function el(tag,attrs,note){var e=document.createElementNS(NS,tag);for(var k in attrs)e.setAttribute(k,attrs[k]);
  if(note){e.style.cursor="help";e.addEventListener("mouseenter",function(){$("cap").textContent=note});e.addEventListener("click",function(){$("cap").textContent=note});}
  return e}
var ZEROS=[14.1347,21.0220,25.0109,30.4249];
function drawPlane(t){
  var s=$("plane");while(s.firstChild)s.removeChild(s.firstChild);
  var top=Y(34),bot=Y(-34),h=bot-top;
  var shade={fill:"#2c6c70","fill-opacity":".10"};
  if(t.region==="plane") s.appendChild(el("rect",{x:X(-7),y:top,width:X(3)-X(-7),height:h,fill:"#2c6c70","fill-opacity":".06"},"Theorems 1 and 2 quantify over every complex s; the exclusions are single points."));
  if(t.region==="half") s.appendChild(el("rect",Object.assign({x:X(.5),y:top,width:X(3)-X(.5),height:h},shade),"Theorem 3: the open half-plane Re s > 1/2 is asserted to be zero-free (apart from the pole of the trivial character)."));
  if(t.region==="strip") s.appendChild(el("rect",Object.assign({x:X(0),y:top,width:X(1)-X(0),height:h},shade),"Theorems 4 and 5 speak only about the open strip 0 < Re s < 1."));
  s.appendChild(el("line",{x1:X(-7),y1:Y(0),x2:X(3),y2:Y(0),stroke:"#6b675d","stroke-width":".8"}));
  s.appendChild(el("line",{x1:X(0),y1:top,x2:X(0),y2:bot,stroke:"#6b675d","stroke-width":".8"}));
  s.appendChild(el("line",{x1:X(1),y1:top,x2:X(1),y2:bot,stroke:"#b9b09c","stroke-width":".8","stroke-dasharray":"2 3"}));
  var concl=t.region!=="half";
  s.appendChild(el("line",{x1:X(.5),y1:top,x2:X(.5),y2:bot,stroke:"#7b2d26","stroke-width":concl?2:1,"stroke-dasharray":concl?"":"5 4"},
    concl?"Conclusion: every zero in the stated domain has Re s = 1/2.":"Boundary of the zero-free region: Re s = 1/2 itself is not part of theorem 3's domain."));
  [-6,-4,-2].forEach(function(r){
    var g=el("g",{},"Trivial zero s = "+r+(t.region==="plane"?": excluded by the hypothesis s ≠ −2(n+1).":": outside this statement's domain."));
    g.appendChild(el("circle",{cx:X(r),cy:Y(0),r:7,fill:"transparent"}));
    g.appendChild(el("path",{d:"M"+(X(r)-4)+" "+(Y(0)-4)+"l8 8m0 -8l-8 8",stroke:"#6b675d","stroke-width":"1.4",fill:"none"}));
    s.appendChild(g)});
  s.appendChild(el("circle",{cx:X(1),cy:Y(0),r:4.5,fill:"#fbf8f0",stroke:"#7b2d26","stroke-width":"1.5"},
    t.region==="strip"?"s = 1 lies outside the open strip, so no clause is needed.":(t.region==="half"?"s = 1: excluded only for the trivial character, where L has its pole.":"s = 1: the pole of ζ. Mathlib's total function has a conventional value here, hence the hypothesis s ≠ 1.")));
  if(state.tiers.num) ZEROS.forEach(function(g){[1,-1].forEach(function(sg){
    s.appendChild(el("circle",{cx:X(.5),cy:Y(sg*g),r:3.2,fill:"#754873"},"Zero of ζ at 1/2 ± "+g.toFixed(4)+"i (first four ordinates from the LMFDB snapshot). Finite numerical data for N = 1 only; illustrative, not evidence for the universal statement."))})});
  [[-6,"−6"],[-4,"−4"],[-2,"−2"],[0,"0"],[1,"1"]].forEach(function(p){var tx=el("text",{x:X(p[0]),y:Y(0)+16,"text-anchor":"middle","font-size":"10",fill:"#6b675d","font-family":"ui-sans-serif,system-ui,sans-serif"});tx.textContent=p[1];s.appendChild(tx)});
  var l1=el("text",{x:X(.5)+5,y:top+11,"font-size":"10",fill:"#7b2d26","font-family":"ui-sans-serif,system-ui,sans-serif"});l1.textContent="Re s = 1/2";s.appendChild(l1);
  var l2=el("text",{x:X(-7)+2,y:top+11,"font-size":"10",fill:"#6b675d","font-family":"ui-sans-serif,system-ui,sans-serif"});l2.textContent="s-plane (schematic)";s.appendChild(l2);
  $("cap").textContent={plane:"Shaded: all of ℂ. Crosses and the ring mark the excluded points. Point at any mark for a note.",half:"Shaded: the open half-plane Re s > 1/2, asserted zero-free. Point at any mark for a note.",strip:"Shaded: the open strip 0 < Re s < 1. Zeros there must sit on the red line. Point at any mark for a note."}[t.region];
}

function renderPanel(){
  var t=T[state.i],h="";
  if(state.tab==="domain") h=rows(t.domain);
  else if(state.tab==="definition") h=rows(t.definition)+'<p class="meta">Module names are those printed by the axiom audit (<code>audit.log</code>). Only Mathlib\'s <code>RiemannZeta.lean</code> is held locally as source.</p>';
  else if(state.tab==="provider") h="<table>"+PROVIDERS.map(function(p){return "<tr><th>"+p[0]+"</th><td>"+(p[2]?'<span class="tag sans '+p[2]+'">'+TAGS[p[2]]+"</span>":"")+p[1]+"</td></tr>"}).join("")+'</table><p class="meta">For this declaration the named records are the axiom line and the comparison line under “Recorded evidence”. The kernel runs cover all five theorems together.</p>';
  else{
    var list=shared(t).concat(t.own).filter(function(e){return state.tiers[e[0]==="open"?"ext":e[0]]});
    h=list.length?list.map(evHtml).join(""):'<p class="meta">All evidence kinds are hidden. Use the chips above to show them.</p>';
  }
  $("panel").innerHTML=h;
}
function render(){
  var t=T[state.i];
  $("kicker").textContent="Declaration "+(state.i+1)+" of 5 · "+t.label;
  $("lean").innerHTML=esc(t.lean);
  $("plain").textContent=t.plain;
  $("meta").innerHTML=t.src+" Type <code>"+t.type+"</code>, proof term <code>"+esc(t.term)+"</code>.";
  [].forEach.call($("nav").children,function(b,k){b.setAttribute("aria-current",k===state.i?"true":"false")});
  [].forEach.call($("tabs").children,function(b){b.setAttribute("aria-selected",b.dataset.tab===state.tab?"true":"false")});
  drawPlane(t);renderPanel();
  try{history.replaceState(null,"","#t="+state.i+"&tab="+state.tab)}catch(e){}
  try{if(window.parent!==window)window.parent.postMessage({type:"proof-reading:selected",index:state.i,name:t.name,tab:state.tab},"*")}catch(e){}
}
function select(i,tab){
  if(typeof i==="number"&&i>=0&&i<T.length)state.i=i;
  if(tab&&TABS.some(function(x){return x[0]===tab}))state.tab=tab;
  render();
}
T.forEach(function(t,k){var b=document.createElement("button");
  b.innerHTML='<span class="n sans">'+(k+1)+'</span> <span class="k">'+t.name+'</span><span class="d">'+t.label+"</span>";
  b.addEventListener("click",function(){select(k)});$("nav").appendChild(b)});
TABS.forEach(function(x){var b=document.createElement("button");b.textContent=x[1];b.dataset.tab=x[0];b.setAttribute("role","tab");
  b.addEventListener("click",function(){select(state.i,x[0])});$("tabs").appendChild(b)});
[].forEach.call(document.querySelectorAll("#legend .chip"),function(c){c.addEventListener("click",function(){
  var k=c.dataset.tier;state.tiers[k]=!state.tiers[k];c.setAttribute("aria-pressed",String(state.tiers[k]));
  if(state.tab!=="evidence")state.tab="evidence";render()})});
document.addEventListener("keydown",function(e){
  if(e.target&&/INPUT|TEXTAREA/.test(e.target.tagName))return;
  if(e.key==="ArrowDown"||e.key==="j"){select((state.i+1)%T.length);e.preventDefault()}
  else if(e.key==="ArrowUp"||e.key==="k"){select((state.i+T.length-1)%T.length);e.preventDefault()}
  else if(/^[1-5]$/.test(e.key))select(+e.key-1)});
window.addEventListener("message",function(e){var d=e.data;if(d&&d.type==="proof-reading:select")select(d.index,d.tab)});
var m=/t=(\d)/.exec(location.hash),m2=/tab=(\w+)/.exec(location.hash);
select(m?+m[1]:0,m2?m2[1]:null);
})();
</script>
</body>
</html>
