Spaces:
Running
Running
deploy(hf): sync szl-holdings/a11oy@main derived COPY set
Browse filesReusable Dockerfile-COPY-derived deploy from szl-holdings/a11oy main.
Files: 761 Pruned: 0
Derived from Dockerfile COPY sources (NO hand-maintained allowlist).
Signed-off-by: SZL Holdings <noreply@szlholdings.ai>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- serve.py +19 -35
- web/proof.html +453 -0
serve.py
CHANGED
|
@@ -8825,6 +8825,25 @@ async def status_page() -> Response:
|
|
| 8825 |
return FileResponse(INDEX_HTML, media_type="text/html")
|
| 8826 |
|
| 8827 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8828 |
@app.get("/chaski")
|
| 8829 |
async def chaski_page() -> Response:
|
| 8830 |
f = PAGES_DIR / "chaski.html"
|
|
@@ -10333,41 +10352,6 @@ except Exception as _gov_e:
|
|
| 10333 |
# END: a11oy GOVERNANCE / EVAL / CALIBRATION layer
|
| 10334 |
# ============================================================================
|
| 10335 |
|
| 10336 |
-
# ============================================================================
|
| 10337 |
-
# BEGIN: a11oy FORMULA SURFACES layer (Dev B — formula-corpus wiring 2026-06-30)
|
| 10338 |
-
# ADDITIVE. Namespace /api/a11oy/v1/formula-surfaces/* — no overlap with any
|
| 10339 |
-
# existing namespace. register() inserts routes at HEAD so they win over the
|
| 10340 |
-
# /api/a11oy/{path:path} Node proxy + SPA catch-all.
|
| 10341 |
-
#
|
| 10342 |
-
# Wires 6 previously-dormant corpus formulas into live honest surfaces:
|
| 10343 |
-
# GET /formula-surfaces/bekenstein-plausibility — F19/Bekenstein ratio (APPLIED)
|
| 10344 |
-
# GET /formula-surfaces/landauer — Landauer ratio (MEASURED or SAMPLE)
|
| 10345 |
-
# GET/POST /formula-surfaces/yarqa-plug-flow — Yarqa CFD (ENGINEERING-METHOD-CFD)
|
| 10346 |
-
# GET /formula-surfaces/science/kalman — Kalman step (LIVE, PROVEN)
|
| 10347 |
-
# GET /formula-surfaces/science/hoeffding — Hoeffding tail (LIVE, PROVEN)
|
| 10348 |
-
# GET /formula-surfaces/science/byzantine-quorum — BFT quorum (LIVE / Conjecture 2)
|
| 10349 |
-
# GET /formula-surfaces/science — formula index
|
| 10350 |
-
# GET /formula-surfaces/healthz — module health
|
| 10351 |
-
#
|
| 10352 |
-
# DOCTRINE v11: locked-8={F1,F4,F7,F11,F12,F18,F19,F22}@c7c0ba17; Λ=Conjecture 1;
|
| 10353 |
-
# half-state forbidden; F19 APPLIED not re-claimed; labels LIVE/MEASURED/SAMPLE/
|
| 10354 |
-
# MODELED/UNAVAILABLE enforced. Signed-off-by: Stephen Lutar <stephenlutar2@gmail.com>
|
| 10355 |
-
# ============================================================================
|
| 10356 |
-
try:
|
| 10357 |
-
import szl_formula_surfaces as _szl_formula_surfaces
|
| 10358 |
-
import sys as _fs_sys
|
| 10359 |
-
_fs_status = _szl_formula_surfaces.register(app, ns="a11oy")
|
| 10360 |
-
print(f"[a11oy] Formula surfaces registered: {_fs_status}", file=_fs_sys.stderr)
|
| 10361 |
-
_A11OY_FORMULA_SURFACES_DIAG = {"status": "ok", "registered": _fs_status}
|
| 10362 |
-
except Exception as _fs_e:
|
| 10363 |
-
import sys as _fs_sys, traceback as _fs_tb
|
| 10364 |
-
print(f"[a11oy] Formula surfaces FAILED (non-fatal): {_fs_e!r}", file=_fs_sys.stderr)
|
| 10365 |
-
_fs_tb.print_exc(file=_fs_sys.stderr)
|
| 10366 |
-
_A11OY_FORMULA_SURFACES_DIAG = {"status": "FAILED", "error": repr(_fs_e)}
|
| 10367 |
-
# ============================================================================
|
| 10368 |
-
# END: a11oy FORMULA SURFACES layer
|
| 10369 |
-
# ============================================================================
|
| 10370 |
-
|
| 10371 |
|
| 10372 |
# ============================================================================
|
| 10373 |
# BEGIN: a11oy GOVERNED AUTO-REVIEW layer (Integration I2) — the keystone
|
|
|
|
| 8825 |
return FileResponse(INDEX_HTML, media_type="text/html")
|
| 8826 |
|
| 8827 |
|
| 8828 |
+
# /proof — In-browser Lean 4 proof replay ("See the math"). web/proof.html is a
|
| 8829 |
+
# self-contained KANCHAY page: a Tao-Blueprint-style dependency graph (Cytoscape +
|
| 8830 |
+
# Dagre, vendored at /vendor/*) over SZL's REAL formal core. Each green node carries
|
| 8831 |
+
# verbatim Lean 4 source from the lutar-lean repo; the locked-8 formula snippets are
|
| 8832 |
+
# Mathlib-free / self-contained and type-check LIVE in the official Lean 4 web kernel
|
| 8833 |
+
# (live.lean-lang.org, opened with the source preloaded via #code=). Honest by design:
|
| 8834 |
+
# Theorem U = PROVEN but CONDITIONAL + axiom-free (green); Λ-uniqueness = Conjecture 1
|
| 8835 |
+
# = OPEN, machine-checked FALSE under A1–A5 (gray, preloads the real `sorry`); Khipu
|
| 8836 |
+
# BFT = Conjecture 2 (gray). 0 runtime CDN (KaTeX/Cytoscape/Dagre vendored). Registered
|
| 8837 |
+
# BEFORE the SPA /{full_path:path} catch-all so it wins the ordered match.
|
| 8838 |
+
# Signed-off-by: Stephen P. Lutar Jr. <stephenlutar2@gmail.com>
|
| 8839 |
+
@app.get("/proof")
|
| 8840 |
+
async def proof_replay_page() -> Response:
|
| 8841 |
+
f = Path("/app/web/proof.html")
|
| 8842 |
+
if f.is_file():
|
| 8843 |
+
return FileResponse(f, media_type="text/html")
|
| 8844 |
+
return FileResponse(INDEX_HTML, media_type="text/html")
|
| 8845 |
+
|
| 8846 |
+
|
| 8847 |
@app.get("/chaski")
|
| 8848 |
async def chaski_page() -> Response:
|
| 8849 |
f = PAGES_DIR / "chaski.html"
|
|
|
|
| 10352 |
# END: a11oy GOVERNANCE / EVAL / CALIBRATION layer
|
| 10353 |
# ============================================================================
|
| 10354 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10355 |
|
| 10356 |
# ============================================================================
|
| 10357 |
# BEGIN: a11oy GOVERNED AUTO-REVIEW layer (Integration I2) — the keystone
|
web/proof.html
ADDED
|
@@ -0,0 +1,453 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<!-- SPDX-License-Identifier: Apache-2.0
|
| 3 |
+
(c) 2026 Lutar, Stephen P. - SZL Holdings - ORCID 0009-0001-0110-4173 -->
|
| 4 |
+
<html lang="en">
|
| 5 |
+
<head>
|
| 6 |
+
<meta charset="utf-8" />
|
| 7 |
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
| 8 |
+
<title>SZL · Proof Replay — See the Math (Lean 4)</title>
|
| 9 |
+
<meta name="description" content="Interactive, public, honest in-browser Lean 4 proof replay for SZL's formal core: Theorem U (proven, conditional, axiom-free), the 8 locked-proven formulas, and the open conjectures (Λ-uniqueness = Conjecture 1). Type-check the real source live, zero install." />
|
| 10 |
+
<!-- 0 runtime CDN: KaTeX + Cytoscape + Dagre are vendored in-image and served from /vendor/* -->
|
| 11 |
+
<link rel="stylesheet" href="/vendor/katex.min.css" />
|
| 12 |
+
<style>
|
| 13 |
+
:root{
|
| 14 |
+
--void:#080c14; --void2:#0c1320; --panel:#0e1626; --line:#1d2940;
|
| 15 |
+
--proof:#3af4c8; --lattice:#5b8dee; --gold:#d7b96b;
|
| 16 |
+
--open:#8b95a7; --ink:#e8edf6; --muted:#9aa7bd; --warn:#f4b23a;
|
| 17 |
+
--mono:"JetBrains Mono",ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
|
| 18 |
+
--sans:"Inter",system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
|
| 19 |
+
--grot:"Space Grotesk","Inter",system-ui,sans-serif;
|
| 20 |
+
}
|
| 21 |
+
*{box-sizing:border-box}
|
| 22 |
+
html,body{margin:0;height:100%}
|
| 23 |
+
body{background:radial-gradient(1200px 700px at 70% -10%,#0f1a2e 0,var(--void) 55%);
|
| 24 |
+
color:var(--ink);font-family:var(--sans);line-height:1.5;-webkit-font-smoothing:antialiased}
|
| 25 |
+
a{color:var(--lattice);text-decoration:none} a:hover{text-decoration:underline}
|
| 26 |
+
header{padding:26px 30px 18px;border-bottom:1px solid var(--line)}
|
| 27 |
+
.eyebrow{font:600 12px/1 var(--mono);letter-spacing:.18em;text-transform:uppercase;color:var(--proof);margin-bottom:10px}
|
| 28 |
+
h1{font:600 30px/1.15 var(--grot);margin:0 0 8px;letter-spacing:-.01em}
|
| 29 |
+
.sub{color:var(--muted);max-width:80ch;font-size:14.5px}
|
| 30 |
+
.legend{display:flex;gap:18px;flex-wrap:wrap;margin-top:16px;font:500 12.5px/1 var(--sans)}
|
| 31 |
+
.legend span{display:inline-flex;align-items:center;gap:7px;color:var(--muted)}
|
| 32 |
+
.dot{width:11px;height:11px;border-radius:50%;display:inline-block;box-shadow:0 0 0 1px rgba(255,255,255,.08)}
|
| 33 |
+
.dot.green{background:var(--proof)} .dot.gray{background:var(--open)}
|
| 34 |
+
.dot.blue{background:var(--lattice)}
|
| 35 |
+
main{display:grid;grid-template-columns:1.35fr 1fr;gap:0;height:calc(100vh - 168px);min-height:520px}
|
| 36 |
+
@media(max-width:980px){main{grid-template-columns:1fr;height:auto}}
|
| 37 |
+
#graph{position:relative;border-right:1px solid var(--line);background:
|
| 38 |
+
linear-gradient(0deg,rgba(91,141,238,.03),transparent),var(--void2)}
|
| 39 |
+
#cy{position:absolute;inset:0}
|
| 40 |
+
.graphhint{position:absolute;left:14px;bottom:12px;font:500 11.5px/1.4 var(--mono);color:var(--muted);
|
| 41 |
+
background:rgba(8,12,20,.7);padding:7px 10px;border:1px solid var(--line);border-radius:8px;max-width:46ch}
|
| 42 |
+
aside{padding:22px 26px;overflow:auto;background:var(--panel)}
|
| 43 |
+
.nodetitle{font:600 19px/1.25 var(--grot);margin:0 0 4px;display:flex;align-items:center;gap:10px;flex-wrap:wrap}
|
| 44 |
+
.badge{font:700 10.5px/1 var(--mono);letter-spacing:.08em;text-transform:uppercase;
|
| 45 |
+
padding:5px 9px;border-radius:999px;border:1px solid transparent;white-space:nowrap}
|
| 46 |
+
.badge.green{color:var(--void);background:var(--proof);border-color:var(--proof)}
|
| 47 |
+
.badge.gray{color:var(--ink);background:transparent;border-color:var(--open)}
|
| 48 |
+
.badge.blue{color:var(--void);background:var(--lattice);border-color:var(--lattice)}
|
| 49 |
+
.meta{font:500 12.5px/1.6 var(--sans);color:var(--muted);margin:6px 0 14px}
|
| 50 |
+
.meta b{color:var(--ink);font-weight:600}
|
| 51 |
+
.kicker{font:600 11px/1 var(--mono);letter-spacing:.14em;text-transform:uppercase;color:var(--gold);margin:18px 0 8px}
|
| 52 |
+
.statement{background:var(--void);border:1px solid var(--line);border-radius:10px;padding:14px 16px;font-size:14px;color:var(--ink);overflow-x:auto}
|
| 53 |
+
pre.lean{background:#070b12;border:1px solid var(--line);border-left:3px solid var(--proof);border-radius:10px;
|
| 54 |
+
padding:14px 15px;overflow:auto;font:500 12.5px/1.55 var(--mono);color:#cfe8df;margin:0;max-height:340px}
|
| 55 |
+
pre.lean.open{border-left-color:var(--open);color:#cdd5e2}
|
| 56 |
+
.caveat{margin-top:12px;border:1px solid var(--warn);border-left-width:3px;border-radius:10px;
|
| 57 |
+
background:rgba(244,178,58,.07);padding:11px 14px;font-size:12.7px;color:#f3dcae}
|
| 58 |
+
.axioms{margin-top:12px;font:500 12px/1.55 var(--mono);color:var(--muted)}
|
| 59 |
+
.axioms code{color:var(--proof)}
|
| 60 |
+
.actions{display:flex;gap:10px;flex-wrap:wrap;margin:18px 0 4px}
|
| 61 |
+
button,.btn{font:600 13px/1 var(--sans);cursor:pointer;border-radius:9px;padding:11px 16px;border:1px solid var(--line);
|
| 62 |
+
background:var(--void2);color:var(--ink);transition:.15s}
|
| 63 |
+
.btn-primary{background:var(--proof);color:var(--void);border-color:var(--proof)}
|
| 64 |
+
.btn-primary:hover{filter:brightness(1.08)}
|
| 65 |
+
.btn-ghost:hover{border-color:var(--lattice);color:#fff}
|
| 66 |
+
.btn[disabled]{opacity:.4;cursor:not-allowed}
|
| 67 |
+
.live-note{font:500 11.5px/1.5 var(--mono);color:var(--muted);margin-top:10px}
|
| 68 |
+
.live-note code{color:var(--lattice)}
|
| 69 |
+
footer{padding:14px 30px;border-top:1px solid var(--line);font:500 12px/1.6 var(--mono);color:var(--muted);
|
| 70 |
+
display:flex;gap:20px;flex-wrap:wrap;justify-content:space-between}
|
| 71 |
+
.src{font-size:12.5px;margin-top:10px}
|
| 72 |
+
.src a{font-family:var(--mono);font-size:12px}
|
| 73 |
+
</style>
|
| 74 |
+
</head>
|
| 75 |
+
<body>
|
| 76 |
+
<header>
|
| 77 |
+
<div class="eyebrow">SZL Holdings · Formal Core · Lean 4 + Mathlib</div>
|
| 78 |
+
<h1>Proof Replay — See the Math</h1>
|
| 79 |
+
<div class="sub">Every green node below is a <b>real, machine-checked</b> SZL theorem pulled verbatim from the
|
| 80 |
+
<a href="https://github.com/szl-holdings/lutar-lean" target="_blank" rel="noopener">lutar-lean</a> repository.
|
| 81 |
+
Click a node to read its actual Lean 4 source; press <b>See the math</b> to type-check it
|
| 82 |
+
<b>live in your browser</b> — zero install — on the official Lean 4 web kernel.
|
| 83 |
+
We label honestly: <b>Theorem U</b> is proven but <b>conditional</b> (axiom-free); <b>Λ-uniqueness is
|
| 84 |
+
Conjecture 1 — OPEN</b>, and machine-checked <b>false as stated</b> under A1–A5. We never paint a conjecture green.</div>
|
| 85 |
+
<div class="legend">
|
| 86 |
+
<span><i class="dot green"></i> Proven · machine-checked · axiom-free</span>
|
| 87 |
+
<span><i class="dot blue"></i> Proven conditional / in-progress</span>
|
| 88 |
+
<span><i class="dot gray"></i> Open conjecture · honestly NOT proven</span>
|
| 89 |
+
</div>
|
| 90 |
+
</header>
|
| 91 |
+
|
| 92 |
+
<main>
|
| 93 |
+
<section id="graph">
|
| 94 |
+
<div id="cy"></div>
|
| 95 |
+
<div class="graphhint">Tao-Blueprint-style dependency graph. Arrows point from a result to what it depends on.
|
| 96 |
+
The locked-8 formula pack (bottom) is the kernel-checked foundation; Theorem U sits above it;
|
| 97 |
+
Conjecture 1 is the open apex.</div>
|
| 98 |
+
</section>
|
| 99 |
+
<aside id="panel"><!-- filled by JS --></aside>
|
| 100 |
+
</main>
|
| 101 |
+
|
| 102 |
+
<footer>
|
| 103 |
+
<span>Source of truth: <a href="https://github.com/szl-holdings/lutar-lean/blob/main/PROVEN_FORMULAS.md" target="_blank" rel="noopener">lutar-lean/PROVEN_FORMULAS.md</a> · locked-proven = <b>8</b> · Λ = Conjecture 1</span>
|
| 104 |
+
<span>0 runtime CDN · KaTeX/Cytoscape/Dagre vendored · live check uses live.lean-lang.org (Mathlib)</span>
|
| 105 |
+
</footer>
|
| 106 |
+
|
| 107 |
+
<script src="/vendor/katex.min.js" defer></script>
|
| 108 |
+
<script src="/vendor/cytoscape.min.js"></script>
|
| 109 |
+
<script src="/vendor/dagre.min.js"></script>
|
| 110 |
+
<script src="/vendor/cytoscape-dagre.js"></script>
|
| 111 |
+
<script>
|
| 112 |
+
"use strict";
|
| 113 |
+
/* ============================================================================
|
| 114 |
+
SZL Proof Replay — node data.
|
| 115 |
+
Every `lean` field is verbatim source from the lutar-lean repo @ ce53602.
|
| 116 |
+
`selfContained:true` snippets are Mathlib-free / Lean-core and genuinely
|
| 117 |
+
type-check standalone; the live button preloads them into the Lean 4 web
|
| 118 |
+
kernel. Theorem U / the conjectures depend on the full Lutar library, so for
|
| 119 |
+
those we link the REAL source file and (for Conjecture 1) preload the open
|
| 120 |
+
statement WITH its real `sorry` so the kernel's orange warning visibly proves
|
| 121 |
+
it is unproven. Honest by design.
|
| 122 |
+
========================================================================== */
|
| 123 |
+
const REPO = "https://github.com/szl-holdings/lutar-lean/blob/main/";
|
| 124 |
+
const PROVED = "Lutar/Puriq/Formulas/ProvedFormulas.lean";
|
| 125 |
+
const THMU = "Lutar/Uniqueness/TheoremU.lean";
|
| 126 |
+
const RND13 = "Lutar/Round13/Lambda_Uniqueness.lean";
|
| 127 |
+
const CORE_AX = "[propext, Classical.choice, Quot.sound]";
|
| 128 |
+
|
| 129 |
+
const N = {
|
| 130 |
+
thmU: {
|
| 131 |
+
label:"Theorem U", status:"green", layer:0,
|
| 132 |
+
title:"Theorem U — Λ-uniqueness (conditional)",
|
| 133 |
+
kind:"PROVEN · CONDITIONAL · AXIOM-FREE",
|
| 134 |
+
latex:"\\forall\\,\\Phi,\\Psi.\\ \\mathrm{IA}(\\Phi)\\wedge \\mathrm{IA}(\\Psi)\\ \\Rightarrow\\ \\Phi \\approx_\\Lambda \\Psi",
|
| 135 |
+
meta:"Any two aggregators satisfying the Identifiability Assumptions are Λ-equivalent (strict <b>=</b> under anchoring). Proven by reduction — each equals Λ k. <b>Sorry-free</b>; <code>#print axioms</code> = Lean core only.",
|
| 136 |
+
file:THMU, selfContained:false,
|
| 137 |
+
axioms:CORE_AX,
|
| 138 |
+
lean:
|
| 139 |
+
`theorem TheoremU_LambdaUnique {k : ℕ} (Φ Ψ : Aggregator k)
|
| 140 |
+
(iaΦ : IdentifiabilityAssumptions Φ) (iaΨ : IdentifiabilityAssumptions Ψ) :
|
| 141 |
+
LambdaEquiv Φ Ψ := by
|
| 142 |
+
have hΦ := identifiability_forces_lambda Φ iaΦ
|
| 143 |
+
have hΨ := identifiability_forces_lambda Ψ iaΨ
|
| 144 |
+
unfold LambdaEquiv InvariantΛ
|
| 145 |
+
rw [hΦ, hΨ]
|
| 146 |
+
|
| 147 |
+
/-- Theorem U (strict form): under IA the two solutions are literally equal. -/
|
| 148 |
+
theorem TheoremU_LambdaUnique_eq {k : ℕ} (Φ Ψ : Aggregator k)
|
| 149 |
+
(iaΦ : IdentifiabilityAssumptions Φ) (iaΨ : IdentifiabilityAssumptions Ψ) :
|
| 150 |
+
Φ = Ψ :=
|
| 151 |
+
(identifiability_forces_lambda Φ iaΦ).trans
|
| 152 |
+
(identifiability_forces_lambda Ψ iaΨ).symm`,
|
| 153 |
+
note:"This proof references the full Lutar library (Aggregator, IdentifiabilityAssumptions, Λ). It type-checks under <code>lake build</code> in CI — not standalone in the web kernel — so the live button opens the real source file. The statement shown is verbatim."
|
| 154 |
+
},
|
| 155 |
+
factors: {
|
| 156 |
+
label:"Λ-unique\n(under factorization)", status:"blue", layer:1,
|
| 157 |
+
title:"lambda_unique_of_factors — conditional Λ-uniqueness",
|
| 158 |
+
kind:"PROVEN · CONDITIONAL (requires factorization)",
|
| 159 |
+
latex:"\\big(\\forall i.\\ \\Phi = \\textstyle\\prod_i \\alpha_i\\big)\\ \\Rightarrow\\ \\Phi = \\Lambda\\,k",
|
| 160 |
+
meta:"The proven, <b>conditional</b> route to Λ: <i>if</i> the aggregator factorizes (the open A6 bisymmetry hypothesis), <i>then</i> it equals Λ. This is the bridge Theorem U uses. The unconditional drop of this hypothesis is exactly Conjecture 1.",
|
| 161 |
+
file:RND13, selfContained:false, axioms:CORE_AX,
|
| 162 |
+
lean:
|
| 163 |
+
`theorem lambda_unique_of_factors {k : ℕ} (hk : 0 < k)
|
| 164 |
+
(Φ : Aggregator k) (hL : LutarAxioms Φ)
|
| 165 |
+
(αs : ...) (hfac : Factorizes Φ αs) :
|
| 166 |
+
Φ = Λ k := by
|
| 167 |
+
-- proven: factorization + A1–A5 pins the canonical Λ representative
|
| 168 |
+
...`,
|
| 169 |
+
note:"Verbatim signature from the source file; the proof body is long — open the file to read it in full. Proven (no sorry), but conditional on factorization."
|
| 170 |
+
},
|
| 171 |
+
conj1: {
|
| 172 |
+
label:"Conjecture 1\nΛ-uniqueness", status:"gray", layer:1,
|
| 173 |
+
title:"Conjecture 1 — unconditional Λ-uniqueness",
|
| 174 |
+
kind:"OPEN · machine-checked FALSE as stated under A1–A5",
|
| 175 |
+
latex:"\\forall\\,\\Phi.\\ \\mathrm{LutarAxioms}(\\Phi)\\ \\Rightarrow\\ \\Phi = \\Lambda\\,k\\qquad(\\textbf{open})",
|
| 176 |
+
meta:"The unconditional claim that the Lutar axioms <b>alone</b> force Λ. This is <b>NOT a theorem</b>. As formalized under A1–A5 it is machine-checked <b>false</b> (counterexample <code>maxAgg_ne_Lambda</code>); closing it soundly needs a new axiom A6 (bisymmetry, Kolmogorov–Nagumo–Aczél). It ships <b>statement-only with a real <code>sorry</code></b> — never a closed proof of a false statement.",
|
| 177 |
+
file:RND13, selfContained:true, axioms:"sorryAx (UNPROVEN) — open obligation",
|
| 178 |
+
lean:
|
| 179 |
+
`-- Conjecture 1 (UNCONDITIONAL Λ-uniqueness). OPEN. This snippet preloads the
|
| 180 |
+
-- real open statement with its real \`sorry\` — the Lean kernel will accept the
|
| 181 |
+
-- statement and emit an ORANGE warning ("declaration uses 'sorry'"), which is
|
| 182 |
+
-- the honest, visible proof that it is NOT proven. Under A1–A5 it is in fact
|
| 183 |
+
-- FALSE (see maxAgg_ne_Lambda); a sound proof would require a new axiom A6.
|
| 184 |
+
|
| 185 |
+
theorem conjecture1_lambda_unique
|
| 186 |
+
(Aggregator : Type) (LutarAxioms : Aggregator → Prop) (Lambda : Aggregator)
|
| 187 |
+
(Φ : Aggregator) (hL : LutarAxioms Φ) :
|
| 188 |
+
Φ = Lambda := by
|
| 189 |
+
-- FACTORIZATION_AXIOM_GAP — needs A6 bisymmetry; FALSE under A1–A5.
|
| 190 |
+
sorry`,
|
| 191 |
+
note:"Live type-check loads this open statement. You will SEE the kernel flag the <code>sorry</code> — that orange warning is the honesty: Λ-uniqueness is unproven. The real, library-backed statement lives in the source file."
|
| 192 |
+
},
|
| 193 |
+
maxagg: {
|
| 194 |
+
label:"maxAgg ≠ Λ\n(counterexample)", status:"green", layer:1,
|
| 195 |
+
title:"maxAgg_ne_Lambda — refutes Conjecture 1 as stated",
|
| 196 |
+
kind:"PROVEN · the counterexample",
|
| 197 |
+
latex:"\\mathrm{maxAgg} \\neq \\Lambda\\,2",
|
| 198 |
+
meta:"A <b>proven</b> witness that the max-aggregator satisfies A1–A5 yet differs from Λ — so Conjecture 1 is <b>false as currently axiomatized</b>. This is why C1 stays gray: the math itself rules out the unconditional claim without a new axiom.",
|
| 199 |
+
file:RND13, selfContained:false, axioms:CORE_AX,
|
| 200 |
+
lean:
|
| 201 |
+
`theorem maxAgg_ne_Lambda : maxAgg ≠ Λ 2 := by
|
| 202 |
+
-- maxAgg satisfies A2/A3/A5 (proved: maxAgg_A2, maxAgg_A3, maxAgg_A5)
|
| 203 |
+
-- yet differs from Λ at k = 2 — an explicit counterexample.
|
| 204 |
+
...`,
|
| 205 |
+
note:"Verbatim statement; proof body in the source file. Proven — it is the formal reason Conjecture 1 cannot be green."
|
| 206 |
+
},
|
| 207 |
+
|
| 208 |
+
// ---- locked-8 formula foundation (all Mathlib-free, sorry-free, self-contained) ----
|
| 209 |
+
f1: {
|
| 210 |
+
label:"F1\nReplay determinism", status:"green", layer:2, kind:"PROVEN · self-contained",
|
| 211 |
+
title:"F1 — Replay-Hash Determinism",
|
| 212 |
+
latex:"f(x) = f(x)",
|
| 213 |
+
meta:"Pure deterministic replay is stable: re-running the same pure function on the same input yields the same output. Foundation of receipt replay.",
|
| 214 |
+
file:PROVED, selfContained:true, axioms:CORE_AX,
|
| 215 |
+
lean:
|
| 216 |
+
`/-- F1 — Replay-Hash Determinism. Pure deterministic replay is stable. -/
|
| 217 |
+
theorem f1_replay_hash_determinism {α β : Type} (f : α → β) (x : α) :
|
| 218 |
+
f x = f x := rfl
|
| 219 |
+
|
| 220 |
+
/-- F1' — Replay over a recorded trace is pointwise stable. -/
|
| 221 |
+
theorem f1_replay_trace_stable {α β : Type} (f : α → β) (xs : List α) :
|
| 222 |
+
xs.map f = xs.map f := rfl`
|
| 223 |
+
},
|
| 224 |
+
f4: {
|
| 225 |
+
label:"F4\nKhipu DAG acyclic", status:"green", layer:2, kind:"PROVEN · self-contained",
|
| 226 |
+
title:"F4 — Khipu DAG acyclicity preservation",
|
| 227 |
+
latex:"\\mathrm{Reach}(a,b) \\Rightarrow b < a\\ \\ \\therefore\\ \\neg\\,\\mathrm{Reach}(a,a)",
|
| 228 |
+
meta:"The Khipu DAG enforces the backward-edge invariant (dst < src). Proven: every path strictly decreases the node index, so <b>no node reaches itself</b> (acyclic), and appending a fresh max node preserves it. (Upgraded 2026-06-10 from the earlier vacuous statement.)",
|
| 229 |
+
file:PROVED, selfContained:true, axioms:CORE_AX,
|
| 230 |
+
lean:
|
| 231 |
+
`abbrev KhipuEdges := List (Nat × Nat)
|
| 232 |
+
|
| 233 |
+
def KhipuBackwardInvariant (es : KhipuEdges) : Prop := ∀ e ∈ es, e.2 < e.1
|
| 234 |
+
def KhipuStep (es : KhipuEdges) (a b : Nat) : Prop := (a, b) ∈ es
|
| 235 |
+
|
| 236 |
+
inductive KhipuReach (es : KhipuEdges) : Nat → Nat → Prop
|
| 237 |
+
| base {a b : Nat} : KhipuStep es a b → KhipuReach es a b
|
| 238 |
+
| trans {a b c : Nat} : KhipuStep es a b → KhipuReach es b c → KhipuReach es a c
|
| 239 |
+
|
| 240 |
+
theorem f4_khipu_reach_decreases
|
| 241 |
+
(es : KhipuEdges) (inv : KhipuBackwardInvariant es)
|
| 242 |
+
{a b : Nat} (r : KhipuReach es a b) : b < a := by
|
| 243 |
+
induction r with
|
| 244 |
+
| base h => exact inv _ h
|
| 245 |
+
| trans h _ ih => exact Nat.lt_trans ih (inv _ h)
|
| 246 |
+
|
| 247 |
+
theorem f4_khipu_no_cycle
|
| 248 |
+
(es : KhipuEdges) (inv : KhipuBackwardInvariant es) (a : Nat) :
|
| 249 |
+
¬ KhipuReach es a a := by
|
| 250 |
+
intro r
|
| 251 |
+
exact Nat.lt_irrefl a (f4_khipu_reach_decreases es inv r)`
|
| 252 |
+
},
|
| 253 |
+
f7: {
|
| 254 |
+
label:"F7\nChaski FIFO", status:"green", layer:2, kind:"PROVEN · self-contained",
|
| 255 |
+
title:"F7 — Chaski FIFO reception ordering",
|
| 256 |
+
latex:"\\mathrm{drain}(\\mathrm{enqueueAll}\\ []\\ \\mathit{msgs}) = \\mathit{msgs}",
|
| 257 |
+
meta:"The Chaski channel is a FIFO queue (enqueue = append to back, drain = serve from front). Proven: the <b>received order equals the sent order</b>, with a positional witness. (Upgraded 2026-06-10 from the earlier tautology.)",
|
| 258 |
+
file:PROVED, selfContained:true, axioms:CORE_AX,
|
| 259 |
+
lean:
|
| 260 |
+
`abbrev ChaskiQueue := List Nat
|
| 261 |
+
def chaskiEnqueueAll (q : ChaskiQueue) (xs : List Nat) : ChaskiQueue := q ++ xs
|
| 262 |
+
def chaskiDrain : ChaskiQueue → List Nat
|
| 263 |
+
| [] => []
|
| 264 |
+
| m :: ms => m :: chaskiDrain ms
|
| 265 |
+
|
| 266 |
+
theorem f7_chaski_enqueueAll_nil (xs : List Nat) :
|
| 267 |
+
chaskiEnqueueAll [] xs = xs := by simp [chaskiEnqueueAll]
|
| 268 |
+
|
| 269 |
+
theorem f7_chaski_drain_eq (q : ChaskiQueue) : chaskiDrain q = q := by
|
| 270 |
+
induction q with
|
| 271 |
+
| nil => rfl
|
| 272 |
+
| cons m ms ih => simp [chaskiDrain, ih]
|
| 273 |
+
|
| 274 |
+
/-- F7 — reception order = send order. -/
|
| 275 |
+
theorem f7_chaski_fifo_order (msgs : List Nat) :
|
| 276 |
+
chaskiDrain (chaskiEnqueueAll [] msgs) = msgs := by
|
| 277 |
+
rw [f7_chaski_enqueueAll_nil, f7_chaski_drain_eq]`
|
| 278 |
+
},
|
| 279 |
+
f11: {
|
| 280 |
+
label:"F11\nAyni reciprocity", status:"green", layer:2, kind:"PROVEN · self-contained",
|
| 281 |
+
title:"F11 — Ayni Reciprocity Conservation",
|
| 282 |
+
latex:"(b + c) - c = b",
|
| 283 |
+
meta:"Credit then equal debit returns to the start: fold-replay of an append-only event log conserves balance.",
|
| 284 |
+
file:PROVED, selfContained:true, axioms:CORE_AX,
|
| 285 |
+
lean:
|
| 286 |
+
`/-- F11 — Ayni Reciprocity Conservation. -/
|
| 287 |
+
theorem f11_ayni_reciprocity_conservation (b c : Int) :
|
| 288 |
+
(b + c) - c = b := by
|
| 289 |
+
simp [Int.add_sub_cancel]`
|
| 290 |
+
},
|
| 291 |
+
f12: {
|
| 292 |
+
label:"F12\nKuramoto (additive)", status:"green", layer:2, kind:"PROVEN · self-contained · ADDITIVE FRAGMENT",
|
| 293 |
+
title:"F12 — Kuramoto additive coupling",
|
| 294 |
+
latex:"k\\,(p_1 + p_2) = k\\,p_1 + k\\,p_2",
|
| 295 |
+
meta:"Combined increment = sum of increments (left distributivity).",
|
| 296 |
+
caveat:"HONEST SCOPE: this proves the <b>additive coupling fragment only</b> — NOT the full nonlinear Kuramoto synchronization model. Labeled per PROVEN_FORMULAS.md.",
|
| 297 |
+
file:PROVED, selfContained:true, axioms:CORE_AX,
|
| 298 |
+
lean:
|
| 299 |
+
`/-- F12 — Kuramoto Additive Coupling. Combined increment = sum of increments. -/
|
| 300 |
+
theorem f12_kuramoto_additive (p1 p2 k : Nat) :
|
| 301 |
+
k * (p1 + p2) = k * p1 + k * p2 :=
|
| 302 |
+
Nat.left_distrib k p1 p2`
|
| 303 |
+
},
|
| 304 |
+
f18: {
|
| 305 |
+
label:"F18\nReed–Solomon", status:"green", layer:2, kind:"PROVEN · self-contained",
|
| 306 |
+
title:"F18 — Reed–Solomon RS(10,6) erasure tolerance",
|
| 307 |
+
latex:"10 - 6 = 4 \\quad\\wedge\\quad e \\le 4 \\Rightarrow 6 \\le 10 - e",
|
| 308 |
+
meta:"RS(10,6): 4 parity shards; erasing up to 4 shards still leaves ≥ 6 to reconstruct. Durability of the receipt store.",
|
| 309 |
+
file:PROVED, selfContained:true, axioms:CORE_AX,
|
| 310 |
+
lean:
|
| 311 |
+
`/-- F18 — Reed–Solomon RS(10,6) parity count. -/
|
| 312 |
+
theorem f18_reed_solomon_parity_count : (10 - 6 : Nat) = 4 := by decide
|
| 313 |
+
|
| 314 |
+
/-- F18' — Erasure tolerance: erasing e ≤ 4 shards leaves 10 − e ≥ 6. -/
|
| 315 |
+
theorem f18_erasure_tolerance (e : Nat) (h : e ≤ 4) : 6 ≤ 10 - e := by omega`
|
| 316 |
+
},
|
| 317 |
+
f19: {
|
| 318 |
+
label:"F19\nBekenstein (additive)", status:"green", layer:2, kind:"PROVEN · self-contained · ADDITIVE FRAGMENT",
|
| 319 |
+
title:"F19 — Bekenstein additive scaffolding",
|
| 320 |
+
latex:"s_1 \\le s_1 + s_2",
|
| 321 |
+
meta:"Disjoint-region information budgets add (monotonicity under union).",
|
| 322 |
+
caveat:"HONEST SCOPE: this proves the <b>additive budget scaffolding only</b> — NOT the full physical Bekenstein bound. Labeled per PROVEN_FORMULAS.md.",
|
| 323 |
+
file:PROVED, selfContained:true, axioms:CORE_AX,
|
| 324 |
+
lean:
|
| 325 |
+
`/-- F19 — Bekenstein additive scaffolding. Disjoint-region budgets add. -/
|
| 326 |
+
theorem f19_bekenstein_additive (s1 s2 : Nat) : s1 ≤ s1 + s2 :=
|
| 327 |
+
Nat.le_add_right s1 s2
|
| 328 |
+
|
| 329 |
+
/-- F19' — Budget monotonicity under region union. -/
|
| 330 |
+
theorem f19_budget_monotone (s d : Nat) : s ≤ s + d := Nat.le_add_right s d`
|
| 331 |
+
},
|
| 332 |
+
f22: {
|
| 333 |
+
label:"F22\nKhipu emit monotone", status:"green", layer:2, kind:"PROVEN · self-contained",
|
| 334 |
+
title:"F22 — Khipu emit append-only monotonicity",
|
| 335 |
+
latex:"i < j < n \\Rightarrow (\\mathrm{seqLog}\\,n)_i < (\\mathrm{seqLog}\\,n)_j",
|
| 336 |
+
meta:"Emit appends a sequence number equal to the current length; sequence numbers <b>strictly increase</b> with position. Append-only audit ordering.",
|
| 337 |
+
file:PROVED, selfContained:true, axioms:CORE_AX,
|
| 338 |
+
lean:
|
| 339 |
+
`def f22_seqLog (n : Nat) : List Nat := List.range n
|
| 340 |
+
|
| 341 |
+
theorem f22_emit_appends_length (n : Nat) :
|
| 342 |
+
f22_seqLog (n + 1) = f22_seqLog n ++ [n] := by
|
| 343 |
+
simp [f22_seqLog, List.range_succ]
|
| 344 |
+
|
| 345 |
+
theorem f22_emit_strictly_greater (n s : Nat) (h : s ∈ f22_seqLog n) : s < n := by
|
| 346 |
+
simpa [f22_seqLog, List.mem_range] using h
|
| 347 |
+
|
| 348 |
+
/-- F22 — sequence numbers strictly increase with position. -/
|
| 349 |
+
theorem f22_khipu_emit_monotone (n i j : Nat) (hij : i < j) (hj : j < n) :
|
| 350 |
+
(f22_seqLog n)[i]'(by simp [f22_seqLog]; omega)
|
| 351 |
+
< (f22_seqLog n)[j]'(by simp [f22_seqLog]; exact hj) := by
|
| 352 |
+
simp only [f22_seqLog]
|
| 353 |
+
rw [List.getElem_range, List.getElem_range]
|
| 354 |
+
exact hij`
|
| 355 |
+
},
|
| 356 |
+
|
| 357 |
+
conj2: {
|
| 358 |
+
label:"Conjecture 2\nKhipu BFT safety", status:"gray", layer:0, kind:"OPEN conjecture",
|
| 359 |
+
title:"Conjecture 2 — Khipu BFT safety",
|
| 360 |
+
latex:"\\text{3-of-4 witness safety under} \\le 1 \\text{ Byzantine fault} \\quad(\\textbf{open})",
|
| 361 |
+
meta:"The Byzantine-fault-tolerant safety of the 3-of-4 Khipu witness consensus. Tracked as an <b>open conjecture</b> — not yet machine-checked. Shown for completeness; deliberately gray.",
|
| 362 |
+
file:null, selfContained:false, axioms:"— (not yet formalized)",
|
| 363 |
+
lean:`-- Conjecture 2 (Khipu BFT safety) is an OPEN conjecture: not yet a Lean theorem.
|
| 364 |
+
-- It is tracked honestly as gray. No proof is claimed.`,
|
| 365 |
+
note:"No Lean proof exists yet — this node is informational and intentionally has no live type-check."
|
| 366 |
+
}
|
| 367 |
+
};
|
| 368 |
+
|
| 369 |
+
const EDGES = [
|
| 370 |
+
["thmU","factors"], ["thmU","maxagg"],
|
| 371 |
+
["factors","f11"], ["factors","f12"],
|
| 372 |
+
["maxagg","f18"],
|
| 373 |
+
["conj1","factors"], ["conj1","maxagg"],
|
| 374 |
+
["thmU","f1"], ["thmU","f4"], ["thmU","f7"], ["thmU","f19"], ["thmU","f22"]
|
| 375 |
+
];
|
| 376 |
+
|
| 377 |
+
/* ---------- build cytoscape graph ---------- */
|
| 378 |
+
const COL = { green:"#3af4c8", blue:"#5b8dee", gray:"#8b95a7" };
|
| 379 |
+
const els = [];
|
| 380 |
+
for (const id in N){
|
| 381 |
+
const n = N[id];
|
| 382 |
+
els.push({ data:{ id, label:n.label, status:n.status } });
|
| 383 |
+
}
|
| 384 |
+
for (const [s,t] of EDGES) els.push({ data:{ id:s+"_"+t, source:s, target:t } });
|
| 385 |
+
|
| 386 |
+
const cy = cytoscape({
|
| 387 |
+
container: document.getElementById("cy"),
|
| 388 |
+
elements: els,
|
| 389 |
+
style:[
|
| 390 |
+
{ selector:"node", style:{
|
| 391 |
+
"background-color":"#0e1626", "border-width":2,
|
| 392 |
+
"border-color":(e)=>COL[e.data("status")],
|
| 393 |
+
"label":"data(label)", "color":"#e8edf6",
|
| 394 |
+
"font-family":"JetBrains Mono, monospace", "font-size":"10px",
|
| 395 |
+
"font-weight":600, "text-wrap":"wrap", "text-max-width":"96px",
|
| 396 |
+
"text-valign":"center", "text-halign":"center",
|
| 397 |
+
"width":"118px", "height":"54px", "shape":"round-rectangle",
|
| 398 |
+
"text-justification":"center" } },
|
| 399 |
+
{ selector:'node[status="green"]', style:{ "border-color":COL.green,
|
| 400 |
+
"shadow-blur":18, "shadow-color":COL.green, "shadow-opacity":0.45 } },
|
| 401 |
+
{ selector:'node[status="blue"]', style:{ "border-color":COL.blue } },
|
| 402 |
+
{ selector:'node[status="gray"]', style:{ "border-color":COL.gray, "border-style":"dashed", "color":"#aab4c6" } },
|
| 403 |
+
{ selector:"node.sel", style:{ "background-color":"#15203a", "border-width":3 } },
|
| 404 |
+
{ selector:"edge", style:{
|
| 405 |
+
"width":1.6, "line-color":"#2a3a5c", "target-arrow-color":"#2a3a5c",
|
| 406 |
+
"target-arrow-shape":"triangle", "curve-style":"bezier", "arrow-scale":0.9 } }
|
| 407 |
+
],
|
| 408 |
+
layout:{ name:"dagre", rankDir:"TB", nodeSep:26, rankSep:64, edgeSep:12 },
|
| 409 |
+
wheelSensitivity:0.25, minZoom:0.4, maxZoom:2.2
|
| 410 |
+
});
|
| 411 |
+
|
| 412 |
+
/* ---------- panel rendering ---------- */
|
| 413 |
+
const panel = document.getElementById("panel");
|
| 414 |
+
function liveUrl(code){
|
| 415 |
+
return "https://live.lean-lang.org/#code=" + encodeURIComponent(code) + "&theme=dark";
|
| 416 |
+
}
|
| 417 |
+
function render(id){
|
| 418 |
+
const n = N[id];
|
| 419 |
+
cy.nodes().removeClass("sel"); cy.getElementById(id).addClass("sel");
|
| 420 |
+
const caveat = n.caveat ? `<div class="caveat">⚠ ${n.caveat}</div>` : "";
|
| 421 |
+
const note = n.note ? `<div class="live-note">${n.note}</div>` : "";
|
| 422 |
+
const fileLink = n.file ? `<div class="src">Real source: <a href="${REPO}${n.file}" target="_blank" rel="noopener">${n.file}</a></div>` : "";
|
| 423 |
+
let primary;
|
| 424 |
+
if (n.selfContained){
|
| 425 |
+
primary = `<a class="btn btn-primary" href="${liveUrl(n.lean)}" target="_blank" rel="noopener">▶ See the math — type-check live</a>`;
|
| 426 |
+
} else if (n.file){
|
| 427 |
+
primary = `<a class="btn btn-primary" href="${REPO}${n.file}" target="_blank" rel="noopener">▶ See the math — view real source</a>`;
|
| 428 |
+
} else {
|
| 429 |
+
primary = `<button class="btn" disabled>No Lean proof yet (open)</button>`;
|
| 430 |
+
}
|
| 431 |
+
panel.innerHTML = `
|
| 432 |
+
<div class="nodetitle">${n.title} <span class="badge ${n.status}">${n.status==="green"?"PROVEN":n.status==="blue"?"CONDITIONAL":"OPEN"}</span></div>
|
| 433 |
+
<div class="meta"><b>${n.kind}</b><br>${n.meta}</div>
|
| 434 |
+
<div class="kicker">Statement</div>
|
| 435 |
+
<div class="statement" id="stmt"></div>
|
| 436 |
+
<div class="kicker">Lean 4 source <span style="color:var(--muted);font-weight:400">(verbatim · lutar-lean@ce53602)</span></div>
|
| 437 |
+
<pre class="lean ${n.status==="gray"?"open":""}">${escapeHtml(n.lean)}</pre>
|
| 438 |
+
<div class="axioms"><code>#print axioms</code> → ${escapeHtml(n.axioms)}</div>
|
| 439 |
+
${caveat}
|
| 440 |
+
<div class="actions">${primary}</div>
|
| 441 |
+
${note}
|
| 442 |
+
${fileLink}`;
|
| 443 |
+
const stmt = document.getElementById("stmt");
|
| 444 |
+
try { if (window.katex) katex.render(n.latex, stmt, {throwOnError:false, displayMode:true}); else stmt.textContent = n.latex; }
|
| 445 |
+
catch(e){ stmt.textContent = n.latex; }
|
| 446 |
+
}
|
| 447 |
+
function escapeHtml(s){ return s.replace(/[&<>]/g, c=>({ "&":"&","<":"<",">":">" }[c])); }
|
| 448 |
+
|
| 449 |
+
cy.on("tap","node",(e)=>render(e.target.id()));
|
| 450 |
+
cy.ready(()=>{ cy.fit(undefined,40); render("thmU"); });
|
| 451 |
+
</script>
|
| 452 |
+
</body>
|
| 453 |
+
</html>
|