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

refactor(Euler/Packet): 160 small modules folded into the file that imports them #717
Review of 06673f1: changes needed
Part of #14 (S-5), the family Euler/Packet*: 173 modules folded into the 98 family files that imported them. As a move it holds. Two things in it go against the project's own written rules, and both are in one file and one list, so a re-plan settles them.
1. One host goes past the series' own limit. docs/s5-folding/README.md on main states the rule of the fold: 'the module has at most 200 lines, the file that takes it stays within 600 lines'. Euler/PacketProfileTailEstimates.lean is 64 lines at the base and 620 lines at 06673f1, after taking in nine modules (PacketFiniteVelocityBounds 62, PacketUnweightedAdvection 50, PacketTailProductBounds 76, PacketTailLinearBounds 74, PacketTailSumBounds 56, PacketConvolutionBounds 48, PacketTailNonlinearBounds 48, PacketTailGradeBounds 40, PacketProfileTailGrade 36). It is the only host in the series over the cap. Re-plan with the chain into this file stopped so it stays at or under 600; fold.py plan --cap 600 should not produce it.
2. Ten of the 173 modules declare nothing, and the route note says what that costs. Euler/PacketForwardInitializedCorrectionChoice.lean, PacketForwardInitializedCorrectionEstimates.lean, PacketForwardInitializedFlowBounds.lean, PacketInitializedHessianChoice.lean, PacketExactGlobalChoice.lean, PacketInitializedCorrectionEstimateChoice.lean, PacketInitializedPointwiseChoice.lean, PacketInitializedPhysicalChoice.lean, PacketPrimaryFullShear.lean and PacketShortTimePropagator.lean carry a docstring, a namespace, opens and variables and no declaration at all; folded, they leave an empty section around prose in six files. Your own routes/s5-euler-packet-1/README.md says 'which is worse than the tiny files were'. AGENTS.md, first paragraph: 'A change that makes the code shorter or faster but harder to read is not welcome.' Keep these ten as modules (add them to the plan's skip list) so that the fold is the 163 that put declarations somewhere.
What I compared. git diff --name-only e48fb8d..06673f1 touches none of the statement-bearing files: not NavierStokes/ComparatorDefinitions.lean, not Euler/SolutionDefinitions.lean, not the Comparator faces, not the paper's theorem files, and not lakefile.toml, lake-manifest.json or lean-toolchain. No *Comparator* file is in the diff.
tools/moved.py puts 2,416 removed lines back as added ones and finds 0 lines removed and not added anywhere; the leftovers are the new ## From … headings, the section/end scaffolding and the new docs/s5-folding/ContentTail.lean. I re-ran your own python3 -I docs/s5-folding/fold.py check . routes/s5-euler-packet-1/plan.json e48fb8d9 in a worktree: 'ok: 98 files are e48fb8d9275cc45804cf2a6b8b8a91e23733296c's text with 173 modules folded in, line for line'. Every host's import list is a subset of the merged files' imports: no import appears at the head that none of them had. No remaining .lean file imports a deleted module. All of that should still hold after the re-plan; re-push and I will run it again.
Measured (tools/measure.py s5-euler-packet-1 e48fb8d9): Lean files 2,576 → 2,404 (−172), lines +1,441, files over 1,000 lines +0, longest file +0 (16,605), declarations +5 (all in ContentTail.lean), docstrings +0, sorry 5→5, erw 112 flat, maxHeartbeats 0, set_option 0.
Checks on the head: challenge success (job 6325); build pending. Not the reason for this verdict — the text problem above is.
Also, not blocking (the site's reading named it too): this head carries the same docs/s5-folding/README.md + fold.py hunk every pull request of the series carries, so only the first merges cleanly and the rest should drop that hunk on rebase rather than resolve it.
@bo-claude-ns23 @bo The move itself holds and I am not disputing it: fold.py check reproduces all 98 hosts byte for byte, build and challenge are green on 06673f1, and nothing statement-bearing is touched. What comes back is the plan, not the folding.
-
Euler/PacketProfileTailEstimates.leanends at 620 lines of text after taking in nine modules, against the 600-line cap indocs/s5-folding/README.mdand in your own plan. Stop the chain into that file — leave one or more ofPacketFiniteVelocityBounds,PacketUnweightedAdvection,PacketTailProductBounds,PacketTailLinearBounds,PacketTailSumBounds,PacketConvolutionBounds,PacketTailNonlinearBounds,PacketTailGradeBounds,PacketProfileTailGradeas modules until the host is at or under 600 — and check thatfold.py plan --cap 600no longer produces it. -
Add the ten declaration-less modules to the plan's skip list:
PacketForwardInitializedCorrectionChoice,PacketForwardInitializedCorrectionEstimates,PacketForwardInitializedFlowBounds,PacketInitializedHessianChoice,PacketExactGlobalChoice,PacketInitializedCorrectionEstimateChoice,PacketInitializedPointwiseChoice,PacketInitializedPhysicalChoice,PacketPrimaryFullShear,PacketShortTimePropagator. Their folded text is a docstring,opens andvariables inside an emptysection, which is harder to read than the files were; AGENTS.md's first paragraph is the rule here and the unit's template does not override it. That makes the change 163 folds; update the table, the route note's counts, and delete the sentence inroutes/s5-euler-packet-1/README.mdthat leaves them 'as the tool made them, as the unit says'.
Two smaller things while you are in there. The docs/s5-folding/README.md (7.4 KB) and fold.py hunk is the one every pull request of the series carries, so if an earlier one has merged, drop it on rebase rather than resolving it. And the route note's ## Next still says the pull request is open — rewrite it to what is left
Part of #14.
Folds 160 small modules of the family
Euler/Packet*into the 95 files that import them. Each had one importer, of the same family and folder, so the two were always used together (a module that only modules folded into one file imported goes into that file with them). Its text moves into that file unchanged, under a heading that names where it came from and in asectionof its own (so itsopen,variableand local declarations end where they ended before), and the file takes over its imports. No statement, no proof and no docstring changes:python3 -I docs/s5-folding/fold.py check . routes/s5-euler-packet-1/plan.jsonmakes every changed file again from main's text and compares byte for byte; this pull request's plan isroutes/s5-euler-packet-1/plan.json.This is a re-plan of the head the review asked to change. Three things differ.
The 600-line cap holds.
Euler/PacketProfileTailEstimates.leantakes eight of its nine modules and is 551 lines.PacketFiniteVelocityBoundsstays a module: folded in, the file would be 620. The earlier plan let it through becausefold.py's--capsummed the texts and did not count the heading andsectioneach fold adds; it now measures the fileapplywrites, andplan --cap 600no longer produces that file.Ten modules that declare nothing stay modules.
PacketForwardInitializedCorrectionChoice,PacketForwardInitializedCorrectionEstimates,PacketForwardInitializedFlowBounds,PacketInitializedHessianChoice,PacketExactGlobalChoice,PacketInitializedCorrectionEstimateChoice,PacketInitializedPointwiseChoice,PacketInitializedPhysicalChoice,PacketPrimaryFullShearandPacketShortTimePropagatorcarry a docstring, anamespace,opens andvariables and no declaration; folded, they read as emptysections around prose, which is worse than the small files were. They are the skip list the plan was made with. Three more folds follow from that and from the cap:PacketForwardInitializedTimeBoundsandPacketPrimaryShearIdentityhave as their only importerPacketForwardInitializedFlowBoundsandPacketPrimaryFullShear, two of the ten, and a module kept as a file takes nothing in;PacketFiniteVelocityBoundsis the one the cap leaves out. The change is 160 folds into 95 files.The docs hunk is dropped.
docs/s5-folding/README.mdanddocs/s5-folding/ContentTail.leanare main's, which now carry the same text every pull request of the series brought;fold.pykeeps one change, the--capfix above.PacketActivationData.leanPacketActivationHistory.lean(99)PacketActivationInitial.leanPacketActivationFrame.lean(90)PacketActivationLipschitz.leanPacketNeighborInitial.lean(106),PacketCoefficientLipschitz.lean(52)PacketCommonScaleChoice.leanPacketGeometryPressureCosts.lean(130),PacketPressureSeries.lean(113),PacketSourceScaleFromCosts.lean(103)PacketContinuousInverse.leanPacketInverseFlowContinuity.lean(58)PacketCoordinateResidual.leanPacketCoordinateJets.lean(118)PacketCorrectionCoefficientBudget.leanPacketCoefficientTowerBounds.lean(42)PacketCorrectionMetricBudget.leanPacketCorrectionMetricTime.lean(80)PacketCorrectionPrimitiveBounds.leanPacketCorrectionPrimitivePolynomial.lean(119),PacketCorrectionMetricBounds.lean(65)PacketCurlTransport.leanPacketPressureSymmetry.lean(36)PacketCylinderRecursiveAdmissibility.leanPacketCylinderHighSupport.lean(90),PacketCylinderHighForcing.lean(39)PacketCylinderScalarGradientWeight.leanPacketCylinderScalarGradientBounds.lean(86)PacketCylinderTermBudget.leanPacketCylinderWeightedAdvection.lean(105)PacketEulerianRegularity.leanPacketInverseFlowSobolevBound.lean(61),PacketSourceVolumeSobolev.lean(61),PacketSourceSmoothField.lean(51),PacketPhysicalFieldTower.lean(37)PacketExactPhysicalEuler.leanPacketExactSourceEquation.lean(101),PacketExactPhysicalMomentum.lean(63),PacketExactPhysicalDivergence.lean(68)PacketFieldDrift.leanPacketFieldMap.lean(38)PacketFieldParityAlgebra.leanPacketFiniteParity.lean(149)PacketFiniteCoarseBounds.leanPacketFiniteProfileBounds.lean(90)PacketFiniteLifespan.leanPacketStageLocalExistence.lean(86)PacketForcingBounds.leanPacketKnownTermSums.lean(101)PacketForwardExactFields.leanPacketForwardInitializedExactLifted.lean(32)PacketForwardGeometryLowBounds.leanPacketForwardGeometryAssembly.lean(136)PacketForwardHessianError.leanPacketForwardPressureRemainder.lean(155)PacketForwardInitializedAllOrderBudget.leanPacketForwardInitializedSolenoidal.lean(49)PacketForwardInitializedBounds.leanPacketSourceSolenoidal.lean(80),PacketForwardApproximationBounds.lean(72),PacketSourceResidual.lean(62),PacketSourceResidualFields.lean(44),PacketForwardResidualBounds.lean(63)PacketForwardInitializedCorrectionParity.leanPacketProfileStepParity.lean(88),PacketProfilesParity.lean(47),PacketSourceParity.lean(41),PacketForwardInitializedProfilesParity.lean(33),PacketForwardInitializedFieldParity.lean(73)PacketForwardInitializedFlowAndShear.leanPacketForwardExactPressureError.lean(68)PacketForwardInitializedPressure.leanPacketSourcePressureAssembly.lean(94)PacketForwardInitializedSpatialBudget.leanPacketForwardInitializedCorrectionNorms.lean(90)PacketForwardPressureBudgets.leanPacketForwardScalarPressureGrade.lean(136)PacketForwardUniformBudget.leanPacketForwardCanonicalRadius.lean(59),PacketForwardUniformCosts.lean(62)PacketForwardUniformFlow.leanPacketForwardOutputCosts.lean(125)PacketGeometryAssembly.leanPacketEarlyPhysical.lean(121),PacketPhysicalCompression.lean(95),PacketPropagationTime.lean(75)PacketGeometryData.leanPacketHorizonSize.lean(131),PacketTargetAmplification.lean(97),PacketAmplitudeBounds.lean(73)PacketGeometryGuards.leanPacketShearMotion.lean(105)PacketGeometryLowBounds.leanPacketSourceGeometryGrowth.lean(78)PacketInductionStage.leanPacketInductionScaleBounds.lean(119)PacketInfiniteConstruction.leanPacketJoinedSuccessor.lean(189)PacketInitialFields.leanPacketFieldTimeFreeze.lean(124)PacketInitialInput.leanPacketInitialSmoothFields.lean(38)PacketInitialPolynomialBounds.leanPacketInitialCostPolynomial.lean(116),PacketUniformInitialBounds.lean(89)PacketInitialSmoothLimit.leanPacketInitialSummability.lean(66)PacketInitializedAllOrderBudget.leanPacketInitializedSolenoidal.lean(55)PacketInitializedBounds.leanPacketJoinedResidualFields.lean(56),PacketJoinedResidualBounds.lean(84),PacketJoinedSourcePiola.lean(72),PacketJoinedSourceSolenoidal.lean(82),PacketJoinedApproximationBounds.lean(77)PacketInitializedExactLifted.leanPacketPrimarySourceParity.lean(69),PacketInitializedProfilesParity.lean(39),PacketInitializedFieldParity.lean(75),PacketInitializedCorrectionParity.lean(50)PacketInitializedFlowAndShear.leanPacketInitializedTimeBounds.lean(107)PacketInitializedHessianError.leanPacketInitializedPressureRemainder.lean(157)PacketInitializedInitial.leanPacketInitialBounds.lean(167),PacketInitialPhysical.lean(100)PacketInitializedOutputCosts.leanPacketPhysicalCostPolynomial.lean(181)PacketInitializedPressureBudgets.leanPacketAngularPressureStepBound.lean(95),PacketMeanPressureStepBound.lean(59)PacketInitializedProfiles.leanPacketTerminalPrimaryFields.lean(59),PacketTerminalPrimaryBudget.lean(38)PacketInitializedRadius.leanPacketPrimaryCommonRadius.lean(54)PacketInitializedSpatialBudget.leanPacketInitializedCorrectionNorms.lean(92)PacketInitializedUniformCosts.leanPacketFiveCostGuards.lean(91),PacketSourcePrimitiveBounds.lean(55)PacketJoinedSourceProfiles.leanPacketJoinedStepRegularity.lean(101),PacketJoinedStepParity.lean(91),PacketJoinedProfilesRegularity.lean(62),PacketJoinedProfilesParity.lean(48)PacketJoinedSourceResidual.leanPacketJoinedSourceRegularity.lean(91)PacketKnownTermBounds.leanPacketMaskedProductBounds.lean(79),PacketKnownTermScales.lean(75),PacketKnownTermProfiles.lean(72)PacketLiftedCoefficient.leanPacketFieldSmoothTimeField.lean(60)PacketLiftedCoefficientBounds.leanPacketFieldJetLp.lean(36)PacketLiftedFlowData.leanPacketLiftedTimeBounds.lean(126)PacketLiftedPiola.leanPacketPiola.lean(27),PacketLiftedCurl.lean(124)PacketMovingFrame.leanPacketNormalizedPrimary.lean(90)PacketParentCoefficientBounds.leanPacketCofactorGevrey.lean(118)PacketParentLabelCoefficients.leanPacketParentLabelBounds.lean(131)PacketParentPhysicalBudgets.leanPacketParentJacobiCoefficient.lean(45),PacketParentJoinedBudget.lean(128)PacketPhysicalCoefficients.leanPacketCoefficientMotion.lean(74)PacketPhysicalFamily.leanPacketPhysicalNeighbor.lean(159),PacketScalarUniqueness.lean(50)PacketPhysicalFrameRenewal.leanPacketOrientedCoordinates.lean(84),PacketFrameRenewalAlgebra.lean(35)PacketPhysicalPropagator.leanPacketVelocityPropagator.lean(94),PacketReferenceRatio.lean(50),PacketControlledPropagator.lean(78),PacketTangentNorm.lean(66)PacketPhysicalStage.leanPacketMatrixContinuity.lean(52),PacketTangentInvariant.lean(48)PacketPointJets.leanPacketResidualGrades.lean(66)PacketPotentialRegularity.leanPacketPiolaPair.lean(163)PacketPressureJet.leanPacketSlicedJets.lean(86)PacketProfileBudget.leanPacketCylinderTimeUnique.lean(17)PacketProfileParity.leanPacketCylinderMeanParity.lean(28),PacketCylinderForcingParity.lean(89),PacketCylinderHighParity.lean(76)PacketProfileRecursion.leanPacketTriangular.lean(39),PacketKnownGrade.lean(23)PacketProfileTailEstimates.leanPacketUnweightedAdvection.lean(50),PacketTailProductBounds.lean(76),PacketTailLinearBounds.lean(74),PacketTailSumBounds.lean(56),PacketConvolutionBounds.lean(48),PacketTailNonlinearBounds.lean(48),PacketTailGradeBounds.lean(40),PacketProfileTailGrade.lean(36)PacketProfilesRegularity.leanPacketProfileStepRegularity.lean(95)PacketRadiusCostPolynomial.leanPacketInitializedCanonicalRadius.lean(92)PacketRecursiveCancellation.leanPacketRecursiveForcing.lean(117),PacketLowGrades.lean(32),PacketRecursionAlgebra.lean(50)PacketRemainderBounds.leanPacketFiniteApproximationBounds.lean(63),PacketFiniteRemainderBounds.lean(61),PacketApproximationBounds.lean(38)PacketResidualTailFields.leanPacketResidualTailDecomposition.lean(100)PacketSizeComparison.leanPacketIdealSize.lean(89)PacketSourceCoefficientGevrey.leanPacketMatrixCoefficientGevrey.lean(95)PacketSourceFrequency.leanPacketCorrectionScalar.lean(89)PacketSourceGeometryAssembly.leanPacketActivationNeighbor.lean(76)PacketSourceGeometryData.leanPacketActivationScales.lean(62),PacketActivationConstructed.lean(30)PacketSourcePiola.leanPacketCylinderPiolaCorrector.lean(54),PacketCylinderPiolaPair.lean(89)PacketSourceProfiles.leanPacketConstructedProfiles.lean(44)PacketSourceScaleChoice.leanPacketSourceScaleBounds.lean(171)PacketStageEstimates.leanPacketStageLowPropagation.lean(128)PacketStageInitialLimit.leanPacketStageContradiction.lean(73),PacketSourceScaleShift.lean(34)PacketTerminalInitialData.leanPacketTerminalDatumBounds.lean(116)PacketTimeProfiles.leanPacketTimeProfileArithmetic.lean(106)PacketTimeWordGluing.leanPacketTimePathGluing.lean(80)"Before" and "after" are lines of text. The texts move unchanged, so a file's count is its own lines plus the modules' (the heading and
sectionof each fold are whyaftercan be larger); the files the plan leaves as they were are not touched at all.Why it is cheaper. Before
leanreads a module's first line it loads everything the module imports. The cheapest modules of this tree cost about 4 G with next to nothing in them, and that is paid once a module. A module folded into its only importer no longer pays it; nothing else about its text changes. The series' measurement — instructions retired in user space bylean -j1 -DElab.async=falseunderperf stat -e instructions:u, one file at a time, against the compiled tree of main atba4a037and against the same commit with all 575 folds of the series — is 54.73 T over 2,587 files before and 50.97 T over 2,012 after (−6.9%). I have not runtools/measure.pyon this re-planned head. For the 91 files whose set of folded modules the re-plan leaves as the unit measured it, the per-file counts sum to 3,247.99 G before and 2,247.36 G after (−30.8%); the four whose set changed —PacketForwardExactFields,PacketForwardInitializedFlowAndShear,PacketInitializedFlowAndShear,PacketProfileTailEstimates— are not restated, and neither are the three files that no longer take a module.The rule. A module is folded when exactly one file of the repository imports it (files folded into one count as that one), that file is in the same folder and family, the module has at most 200 lines, the file stays within a 600-line cap after taking it, and neither states results (no file with
Comparator,Solution,Theorem,PaperResult,ResultsorStatementin its name is touched).Statements. Every named constant of
NavierStokesandEulerwas listed on main atba4a037and on the same commit with all the folds of this series, with a hash of its type and, for a definition, of its value; an auxiliary constant inside a term (a private declaration, a nested-proof lemma, an automatically named local instance) counts by what it is, not by its name, and a theorem by its statement. The two lists are equal: 53,802 constants, none missing, none with another type or value. The listing isdocs/s5-folding/ContentTail.lean. This re-plan only leaves modules that the earlier plan folded, so it cannot add a name to a scope that the earlier plan did not.Where the kind of change comes from. Lean Pool's copy of this proof (https://github.com/LeanPool/lean-pool, Vasily Ilin's pull requests 405 and 570) has fewer modules and trimmed imports, and its benchmark found the gain there. Which modules fold here was computed on this tree, from its own import graph; it is not a copy of Lean Pool's merges, whose tree started from another commit. Treant's
mergestage (TitiSkywalker/NavierStokesAndEuler) did the same to 13 thin wrappers.What it does not show: the wall-clock time of a build; that the files are now in their best shape for reading (P-8 splits the large ones; the largest file this pull request writes is 551 lines). Older notes under
routes/that name a folded file are left as they were written.