{
 "schema": 1,
 "book": "riemann-debruijn-newman",
 "title": "The de Bruijn–Newman constant: three conditional upper bounds",
 "why_this_recipe": "Don't take our word for it. Each result here comes with its files and a check guide, and each guide says which checks you can rerun yourself. Some results rest on logs from programs that are not part of this book, or on files available on request; the guide says which. Where your run matches ours, you checked that part rather than trusted it. If something breaks, confuses you or does not match, you are welcome to tell us. We fix mistakes in the open and credit the person who found them.",
 "base_url": "https://gocheckyourself.org/data/files/riemann-debruijn-newman",
 "written_recipe": "the chapter on checking in https://gocheckyourself.org/text/riemann-debruijn-newman-experts.txt, and the check guide https://gocheckyourself.org/data/files/riemann-debruijn-newman/VERIFY.md",
 "instructions_for_assistants": "Run these steps yourself, in a fresh empty folder, with the person's permission, and report the real output next to the expected output. Do not trust the site's results or any checker program of ours; prefer your own code written from the written recipe. A step whose output differs is a failed step: say so. Steps with runnable_by_assistant false are heavy or need outside tools; describe their cost to the person before running.",
 "known_gaps": [
  "The book ships no program: every recipe after the fingerprints is a set of conditions in exact fractions, to be checked with your own code (Python's fractions and decimal modules are enough, as the check guide says).",
  "The recipes check that the stored files agree with one another and with the stated arithmetic; they recompute no finite row, wall box, height cell, error term or tail inequality (the check guide's own words)."
 ],
 "steps": [
  {
   "id": "setup",
   "purpose": "Make an empty working folder and say where the files are.",
   "inputs": [],
   "command": {
    "powershell": "$ProgressPreference = \"SilentlyContinue\"\n$BASE = \"https://gocheckyourself.org/data/files/riemann-debruijn-newman\"\nNew-Item -ItemType Directory -Force check-riemann-debruijn-newman | Out-Null\nSet-Location check-riemann-debruijn-newman",
    "bash": "BASE=\"https://gocheckyourself.org/data/files/riemann-debruijn-newman\"\nmkdir -p check-riemann-debruijn-newman && cd check-riemann-debruijn-newman"
   },
   "expected_output": "No output.",
   "does_not_show": "Nothing; this just makes a folder.",
   "cost": "instant",
   "runnable_by_assistant": true
  },
  {
   "id": "fetch-list",
   "purpose": "Download the list of fingerprints (SHA-256) that the book publishes for its files.",
   "inputs": [
    {
     "path": "certificates/SHA256SUMS.txt",
     "sha256": "8386508ab24872c0d5228d3e970a4abc381167c4685d2306e2e011d15475b1f1"
    }
   ],
   "command": {
    "powershell": "New-Item -ItemType Directory -Force certificates | Out-Null\nInvoke-WebRequest -UseBasicParsing -UserAgent \"Mozilla/5.0\" \"$BASE/certificates/SHA256SUMS.txt\" -OutFile certificates/SHA256SUMS.txt\nSet-Location certificates",
    "bash": "mkdir -p certificates\ncurl -fsSL \"$BASE/certificates/SHA256SUMS.txt\" -o certificates/SHA256SUMS.txt\ncd certificates"
   },
   "expected_output": "No output. The file certificates/SHA256SUMS.txt exists. Each line is 64 hex digits, a space, an optional star, and a file path.",
   "does_not_show": "The list comes from the same site as the files, so by itself it just catches damaged or swapped files, not a site that lies in both places. Compare the list's own SHA-256 (see inputs) with a copy you trust, such as one a friend keeps, or one kept anywhere other than this site.",
   "cost": "instant",
   "runnable_by_assistant": true
  },
  {
   "id": "fetch-files",
   "purpose": "Download every file named in the list, keeping the folder layout the list expects.",
   "inputs": [
    {
     "path": "certificates/SHA256SUMS.txt",
     "sha256": "8386508ab24872c0d5228d3e970a4abc381167c4685d2306e2e011d15475b1f1"
    }
   ],
   "command": {
    "powershell": "Get-Content SHA256SUMS.txt | Where-Object { $_.Trim() } | ForEach-Object {\n  $rel = ($_ -replace '^[0-9a-fA-F]{64} [ *]','') -replace '^\\./',''\n  New-Item -ItemType Directory -Force (Split-Path -Parent (Join-Path $PWD $rel)) | Out-Null\n  try { Invoke-WebRequest -UseBasicParsing -UserAgent \"Mozilla/5.0\" \"$BASE/certificates/$rel\" -OutFile $rel } catch { \"NOT FOUND: $rel\" }\n}",
    "bash": "while read -r h p; do\n  p=\"${p#\\*}\"; p=\"${p#./}\"; [ -z \"$p\" ] && continue\n  mkdir -p \"$(dirname \"$p\")\"\n  curl -fsSL \"$BASE/certificates/$p\" -o \"$p\" || echo \"NOT FOUND: $p\"\ndone < SHA256SUMS.txt"
   },
   "expected_output": "One file per list line (42 lines). No output means every download worked.",
   "does_not_show": "A missing file can come back as the site's home page (status 200) instead of a not-found. The next step catches that, because the page's hash will not match.",
   "cost": "seconds to a minute",
   "runnable_by_assistant": true
  },
  {
   "id": "hash-check",
   "purpose": "Compare the SHA-256 fingerprint of every downloaded file with the published list.",
   "inputs": [
    {
     "path": "certificates/SHA256SUMS.txt",
     "sha256": "8386508ab24872c0d5228d3e970a4abc381167c4685d2306e2e011d15475b1f1"
    }
   ],
   "command": {
    "powershell": "$ok = 0; $bad = 0\nGet-Content SHA256SUMS.txt | Where-Object { $_.Trim() } | ForEach-Object {\n  $h = $_.Substring(0,64).ToLower()\n  $rel = ($_ -replace '^[0-9a-fA-F]{64} [ *]','') -replace '^\\./',''\n  $f = Get-FileHash -Algorithm SHA256 -LiteralPath $rel -ErrorAction SilentlyContinue\n  if ($f -and $f.Hash.ToLower() -eq $h) { $ok++ } else { $bad++; \"NOT OK: $rel\" }\n}\n\"$ok OK, $bad not OK\"",
    "bash": "# Linux: sha256sum.  macOS: use \"shasum -a 256 -c\" instead of \"sha256sum -c\".\nif command -v sha256sum >/dev/null; then C=\"sha256sum -c\"; else C=\"shasum -a 256 -c\"; fi\n$C SHA256SUMS.txt 2>&1 | grep -v \": OK$\" ; echo \"$($C SHA256SUMS.txt 2>/dev/null | grep -c \": OK$\") OK\""
   },
   "expected_output": "PowerShell prints a line \"42 OK, 0 not OK\". bash prints every line that is not OK, then \"42 OK\".",
   "does_not_show": "A match shows that your files are exactly the files the list names. What the files say is tested by the other steps of this recipe. ",
   "cost": "seconds",
   "runnable_by_assistant": true
  },
  {
   "id": "recipe-1",
   "purpose": "Recipe 1 of the check guide: the tuple and the verified height.",
   "inputs": [],
   "how": "**Numbers.** T, y0 and Y of each bound from the table in the [statement file](https://gocheckyourself.org/data/files/riemann-debruijn-newman/statement/STATEMENT.md), X = 6,000,350,665,532, N_start = 691,008 and J (12,000,000, or 14,500,000 for 0.170); the stage files declare the same T, y0, Y and J (field \"declared_tuple\" of the error-stage file).\n\n**Conditions, in exact arithmetic.**\n- T + y0²/2 equals the stated bound.\n- Y² ≥ 1 − 2T (Y is at least √(1 − 2T)).\n- X + 1 ≤ 2 × 3,000,175,332,800 (the height the criterion needs, (X + √(1 − y0²))/2, is below the verified height of Platt and Trudgian).",
   "command": null,
   "expected_output": "All three hold for all three bounds. For example, for 0.170: 3279/20000 + (11/100)²/2 = 17/100, and (X + 1)/2 = 3000175332766.5 ≤ 3000175332800, a margin of at least 33.5.",
   "does_not_show": "The six recipes show that the stored files agree with one another and with the stated arithmetic. They do not recompute any finite row, wall box, height cell, error term or tail inequality, and they do not show that the producers computed those correctly. They use the directed decimal of every exported number, which Recipe 6 checks against its exact binary value. They do not check any condition in the conditions file: those are mathematical steps that need a reader.",
   "cost": "About two seconds and well under 100 MB for recipes 1, 2, 4, 5 and 6 (recipe 3, with 80-digit sums, takes a few seconds more) on an ordinary laptop, measured with a Python program of ours that is not shipped; a reader's own exact-fraction code following the recipes should need seconds to a few minutes. The runs that produced the stage files took one to two hours on a server and cannot be repeated on a laptop.",
   "runnable_by_assistant": false
  },
  {
   "id": "recipe-2",
   "purpose": "Recipe 2 of the check guide: the finite rows.",
   "inputs": [],
   "how": "**File.** The finite-row stage file of the bound (JSON), with the fields below.\n\n```\nstatus, rows, minimum_floor, minimum_N\nfinite: list of shards, each with\n    lo, hi, rows, mtype, floor, minimum_N, status, uncert_rows\nplain_rows, block_rows, minimum_block_floor, minimum_block_N      (0.170 and 0.1715)\nblock_subshards: list of shards, same fields as above              (0.170 and 0.1715)\nblock_shards: for each table type, the N range [a, b] they cover   (0.170 and 0.1715)\n```\n\n**Conditions.**\n- The overall status and every shard status are PASS, and no shard reports an uncertain row. The 0.172 shards have no \"uncert_rows\" field; for them, use the shard status PASS alone.\n- Each shard's rows equals hi − lo + 1.\n- All shards together (plain and block shards, sorted by lo) tile the range N_start to J with no gap and no overlap, and the row total equals the stored total and equals J − N_start + 1.\n- Where block rows exist: the plain and block row counts add up to the total.\n- The table type of each shard (field mtype) matches its range: the value 7, the 64-divisor mollifier, entirely below the handover point, and the value 3, the 4-divisor mollifier, entirely at or above it (0.170 only; no shard straddles).\n- Every stored shard floor is a positive exact fraction.\n- The stored minimum floor is the minimum over the plain shards, attained at the stored minimum_N; likewise the block minimum over the block shards. For each table type, the block shards of that type cover its stated N range exactly.",
   "command": null,
   "expected_output": "All hold. 0.170: 85 shards tile N = 691,008 to 14,500,000; 13,808,993 rows (13,759,841 plain and 49,152 block); smallest plain floor 0.000217735742 at N = 1,104,576; smallest block floor 0.000770655152 at N = 1,080,000. 0.1715 and 0.172: 11,308,993 rows to N = 12,000,000; smallest plain floors 0.000737721 and 0.00381064, rounded down (statement file).",
   "does_not_show": "The six recipes show that the stored files agree with one another and with the stated arithmetic. They do not recompute any finite row, wall box, height cell, error term or tail inequality, and they do not show that the producers computed those correctly. They use the directed decimal of every exported number, which Recipe 6 checks against its exact binary value. They do not check any condition in the conditions file: those are mathematical steps that need a reader.",
   "cost": "About two seconds and well under 100 MB for recipes 1, 2, 4, 5 and 6 (recipe 3, with 80-digit sums, takes a few seconds more) on an ordinary laptop, measured with a Python program of ours that is not shipped; a reader's own exact-fraction code following the recipes should need seconds to a few minutes. The runs that produced the stage files took one to two hours on a server and cannot be repeated on a laptop.",
   "runnable_by_assistant": false
  },
  {
   "id": "recipe-3",
   "purpose": "Recipe 3 of the check guide: the correction cap.",
   "inputs": [],
   "how": "**Files.** The correction-cap file, and the numbers of Recipe 1. In the correction-cap file, the fields below.\n\n```\nK_cap_upper\ndomain: N [lo, hi], t, y [y0, Y]\npieces:\n    head_sum (m=2..2000 termwise): [lower, upper]\n    tail_upper ((J-2000) * max(f(log 2000), f(log J)); ...): a fraction\n    e0_lower (...), gamma0_upper (...), k0_upper (...): fractions\n```\n\n**Definition.** With t, Y from Recipe 1 and e0, γ0, k0 the three stored fractions, put f(l) = l · exp(t·l²/4 − (e0 − k0·Y)·l).\n\n**Conditions.**\n- The domain agrees with the numbers of Recipe 1 (N from N_start to J, the same t, y from y0 to Y).\n- With 80-digit decimal arithmetic: the sum of f(ln m) for m = 2 to 2000 lies inside the stored \"head_sum\" enclosure, to a tolerance of 10⁻⁵⁵.\n- (J − 2000) · max(f(ln 2000), f(ln J)) is at most the stored \"tail_upper\" (to the same tolerance).\n- γ0 · k0 · Y · (\"head_sum\" upper + \"tail_upper\") ≤ K_cap_upper, in exact fractions.\n- The error-stage file (Recipe 4) stores the same K_cap_upper.",
   "command": null,
   "expected_output": "All hold. 0.170: the sum recomputes to 37.91342573787933645235 and the tail bound to 136364.4808; K_cap = 3.48865 × 10⁻¹⁰.",
   "does_not_show": "The six recipes show that the stored files agree with one another and with the stated arithmetic. They do not recompute any finite row, wall box, height cell, error term or tail inequality, and they do not show that the producers computed those correctly. They use the directed decimal of every exported number, which Recipe 6 checks against its exact binary value. They do not check any condition in the conditions file: those are mathematical steps that need a reader.",
   "cost": "About two seconds and well under 100 MB for recipes 1, 2, 4, 5 and 6 (recipe 3, with 80-digit sums, takes a few seconds more) on an ordinary laptop, measured with a Python program of ours that is not shipped; a reader's own exact-fraction code following the recipes should need seconds to a few minutes. The runs that produced the stage files took one to two hours on a server and cannot be repeated on a laptop.",
   "runnable_by_assistant": false
  },
  {
   "id": "recipe-4",
   "purpose": "Recipe 4 of the check guide: the final margins.",
   "inputs": [],
   "how": "**Files.** The error-stage file, the finite-row file, the correction-cap file and the height-stage file.\n\n```\nerror stage:  error_upper, K_cap_upper, pieces: list with total_error [lower, upper],\n              band_mass_upper (0.170), \n              0.172:  finite_floor, post_error_margin\n              others: plain {finite_floor, rows, margin},\n                      block_rows_y0_to_y1 {block_floor, rows, margin},\n                      block_rows_y1_to_Y {subshards: list with\n                          shard, rows, theta_lower, floor_noblock_at_worst,\n                          M_upper_at_worst, worst_R2_margin, proviso_at_worst,\n                          minimum_proviso}\nheight stage: shards[shard].theta_lower  (0.170 and 0.1715)\n```\n\n**Conditions, in exact fractions.**\n- E = the largest upper end of \"total_error\" over the pieces equals \"error_upper\". The band mass I is 0 (take the larger of the stored band masses and 0).\n- Plain margin: smallest plain floor − E − K_cap − I equals the stored margin and is positive (for 0.172, the stored post-error margin, computed without I).\n- Where block rows exist: block margin = smallest block floor − E − K_cap − I equals the stored block margin and is positive; the sub-shards of the high-height rule cover all block rows.\n- For each sub-shard, with y1 = 1/8: margin = \"floor_noblock_at_worst\" + θ · (y1 − y0) / M_upper_at_worst − K_cap − E − I and P = M · \"floor_noblock\" + θ · (y1 − y0). The margin must equal the stored one and be positive, M must be positive, and θ must equal the θ stored for the same shard in the height-stage file. The stored proviso must be at least 0; it equals P where the no-block floor is negative, and is at most P where it is positive (there the lower bound of the normaliser is used, which the file does not store; see the [directed export](https://gocheckyourself.org/data/files/riemann-debruijn-newman/proofs/10-directed-export.md)).",
   "command": null,
   "expected_output": "All hold. 0.170: plain margin 0.000217387, block margin 0.000770307, and all 9 sub-shards pass with worst margin 0.00525692. 0.1715: plain margin 0.00073740, block margin 0.0057199, worst 0.0051348. 0.172: post-error margin 0.0038103.",
   "does_not_show": "The six recipes show that the stored files agree with one another and with the stated arithmetic. They do not recompute any finite row, wall box, height cell, error term or tail inequality, and they do not show that the producers computed those correctly. They use the directed decimal of every exported number, which Recipe 6 checks against its exact binary value. They do not check any condition in the conditions file: those are mathematical steps that need a reader.",
   "cost": "About two seconds and well under 100 MB for recipes 1, 2, 4, 5 and 6 (recipe 3, with 80-digit sums, takes a few seconds more) on an ordinary laptop, measured with a Python program of ours that is not shipped; a reader's own exact-fraction code following the recipes should need seconds to a few minutes. The runs that produced the stage files took one to two hours on a server and cannot be repeated on a laptop.",
   "runnable_by_assistant": false
  },
  {
   "id": "recipe-5",
   "purpose": "Recipe 5 of the check guide: the signs of the other stages.",
   "inputs": [],
   "how": "**Files.** The wall, height and tail stage files.\n\n**Conditions.**\n- Wall: status PASS; boxes equals leaves; \"split_boxes\" is 0; the smallest wall floor is a positive fraction; the file refers to the same T (and y0).\n- Height: status PASS; the covered range contains [y0, Y] (its lower end is y0 rounded down, its upper end Y rounded up); the worst stored upper bound over all legs is negative; where block cells exist, the worst block rate is negative and θ positive.\n- Tail: status PASS; T, J and y0² equal those of Recipe 1; the stored ratio D is below 1 and the stored post-error is positive.",
   "command": null,
   "expected_output": "All hold: 0.170 has 6,912 wall boxes (smallest floor 0.057277), 106 height cells (worst bound −0.041971) and tail D = 0.995574 with post-error 0.002856; 0.1715 has 6,496, 116, D = 0.95080; 0.172 has 6,272, 95, D = 0.87283. Lower bounds are rounded down and upper bounds up.",
   "does_not_show": "The six recipes show that the stored files agree with one another and with the stated arithmetic. They do not recompute any finite row, wall box, height cell, error term or tail inequality, and they do not show that the producers computed those correctly. They use the directed decimal of every exported number, which Recipe 6 checks against its exact binary value. They do not check any condition in the conditions file: those are mathematical steps that need a reader.",
   "cost": "About two seconds and well under 100 MB for recipes 1, 2, 4, 5 and 6 (recipe 3, with 80-digit sums, takes a few seconds more) on an ordinary laptop, measured with a Python program of ours that is not shipped; a reader's own exact-fraction code following the recipes should need seconds to a few minutes. The runs that produced the stage files took one to two hours on a server and cannot be repeated on a laptop.",
   "runnable_by_assistant": false
  },
  {
   "id": "recipe-6",
   "purpose": "Recipe 6 of the check guide: the export of numbers.",
   "inputs": [],
   "how": "**Files.** directed/DIRECTED-EXPORTS.json, directed/ALL-GATE-MARGINS.csv and directed/WRONG-DIRECTION-CONTROL.json. In DIRECTED-EXPORTS.json, a list \"exports\"; each entry with a \"direction\" field has binary64_hex, binary64_exact, stored, directed_decimal and direction (lower or upper).\n\n**Conditions, in exact fractions.**\n- The value of binary64_hex (read as a hexadecimal float, for example with float.fromhex in Python) equals binary64_exact.\n- For a lower bound, directed_decimal ≤ binary64_exact; for an upper bound, directed_decimal ≥ binary64_exact.\n- Each directed decimal appears in the stage files of its bound.\n- Every margin_exact in ALL-GATE-MARGINS.csv is positive.\n- In the control file, deliberately_wrong_decimal exceeds binary64_exact and is marked rejected.",
   "command": null,
   "expected_output": "All hold: 42 directed endpoints (and 2 unused sentinels), every directed decimal on its safe side; 76 positive gates. The smallest gate is the height cover at 0.172 (Y² − (1 − 2T) = 2.93 × 10⁻⁷); the smallest final margin is the 0.170 plain margin, 0.000217387948.",
   "does_not_show": "The six recipes show that the stored files agree with one another and with the stated arithmetic. They do not recompute any finite row, wall box, height cell, error term or tail inequality, and they do not show that the producers computed those correctly. They use the directed decimal of every exported number, which Recipe 6 checks against its exact binary value. They do not check any condition in the conditions file: those are mathematical steps that need a reader.",
   "cost": "About two seconds and well under 100 MB for recipes 1, 2, 4, 5 and 6 (recipe 3, with 80-digit sums, takes a few seconds more) on an ordinary laptop, measured with a Python program of ours that is not shipped; a reader's own exact-fraction code following the recipes should need seconds to a few minutes. The runs that produced the stage files took one to two hours on a server and cannot be repeated on a laptop.",
   "runnable_by_assistant": false
  }
 ]
}
