Navier–Stokes: the Lean blow-up proof, cleaned up together
OpenAI's 2026 Lean proofs of blowup for forced Navier–Stokes and Euler, rerun by others, not refereed, no ruling from Clay; cleaned up together: more readable, faster to build

| 1 | """The tree after the whole-file step (wave 0) and waves 1..k of plan.json: the changed files, written under <out>. |
| 2 | python3 -I mktree.py <plan.json> <site checkout> <k> <out dir> prints files changed, files removed, lines removed""" |
| 3 | import collections, json, os, sys |
| 4 | plan, site, k, out = json.load(open(sys.argv[1])), sys.argv[2], int(sys.argv[3]), sys.argv[4] |
| 5 | cut = collections.defaultdict(list) |
| 6 | for w in plan["waves"][:k]: |
| 7 | for units in w.values(): |
| 8 | for m, a, b, _ in units: cut[m.replace(".", "/") + ".lean"].append((a, b)) |
| 9 | removed = 0 |
| 10 | os.makedirs(out, exist_ok=True) |
| 11 | for f, rs in cut.items(): |
| 12 | t = open(f"{site}/{f}", encoding="utf-8").read().split("\n"); drop = set() |
| 13 | for a, b in rs: |
| 14 | drop.update(range(a, b + 1)) |
| 15 | if a >= 2 and b < len(t) and not t[a - 2].strip() and not t[b].strip(): drop.add(b + 1) # one blank line between what is left |
| 16 | removed += len(drop) |
| 17 | os.makedirs(os.path.dirname(f"{out}/{f}"), exist_ok=True) |
| 18 | open(f"{out}/{f}", "w", encoding="utf-8").write("\n".join(l for i, l in enumerate(t, 1) if i not in drop)) |
| 19 | open(f"{out}/REMOVED", "w").write("\n".join(plan["whole_files"]) + "\n") |
| 20 | print(f"wave {k}: {len(cut)} files changed, {len(plan['whole_files'])} files removed, {removed} lines removed from the changed files") |