Poincaré conjecture: the Lean proof, cleaned up together
The 2026 Lean proof of the Poincaré conjecture after Morgan and Tian, 3 million lines, cleaned up together: smaller, faster to build, more readable, the theorems unchanged

P-1 notes: file by file account; status done
Browse files+48 −42 routes/p1-surfaces-cuts/README.md View file
| @@ -1,65 +1,71 @@ | ||
| 1 | 1 | --- |
| 2 | 2 | issue: 2 |
| 3 | -status: working | |
| 3 | +status: done | |
| 4 | 4 | --- |
| 5 | 5 | # p1-surfaces-cuts |
| 6 | 6 | |
| 7 | 7 | P-1 for the folder `PoincareLib/Topology/Manifold/Smoothing/Rigidity/Surfaces/Cuts` (78 files): fix the linter |
| 8 | 8 | warnings Lean prints for it, without changing any statement. |
| 9 | 9 | |
| 10 | -## What I did | |
| 10 | +## How it was done | |
| 11 | 11 | |
| 12 | -No Lean on my machine, so the fixes come from the `build` log of `main` (job 660). That log only keeps its last 25 | |
| 13 | -lines, and they show three warnings, all in this folder: | |
| 12 | +No Lean on my machine, so every fix comes from the `build` check's log. That log keeps only its last 25 lines and Lake | |
| 13 | +replays every module's warnings, so each push showed the last two or three warnings of the folder that remained; | |
| 14 | +fixing those showed the next ones. The rounds are the build jobs 660 (on `main`), then 830 to 1705 on this branch. | |
| 15 | +From job 896 on, a small script read each log and added the `omit … in` line the linter itself printed, above the | |
| 16 | +declaration it named; the other kinds were fixed by hand. Nothing was fixed that a log did not name, except the two | |
| 17 | +`zeroSheet` lemmas below. | |
| 14 | 18 | |
| 15 | -- `OriginalBridgeReversal.lean:152`: `hbound` unused in `source_bridge_endpoint_reversal_of_scalar` → `_hbound`. | |
| 16 | -- `OriginalBridgeScalarCharts.lean:33`: `hαβ` unused in `scalar_bridge_chart` → `_hαβ` (its one caller passes it | |
| 17 | - positionally, so nothing else moves). | |
| 18 | -- `OriginalPeriodicSquareMap.lean:55`: `letI` in a proof → `let`, as the `haveILetI` linter suggests. | |
| 19 | +## What changed, file by file (folder `…/Surfaces/Cuts/`) | |
| 19 | 20 | |
| 20 | -The `build` log of this branch's first head (job 830) then showed three more for the folder, fixed in a second | |
| 21 | -commit: | |
| 21 | +Unused hypotheses, renamed with `_` (callers pass them positionally, so nothing else moves): | |
| 22 | 22 | |
| 23 | -- `OriginalBridgeReversal.lean:33`: `hab` unused in `endpoint_pair_reversal_of_scalar` → `_hab`. | |
| 24 | -- `OriginalHalfBandCofaces.lean:134, 159`: the section variable `[FiniteDimensional ℝ E]` was included but unused in | |
| 25 | - `OriginalResidualHalfBands.coface_hulls_inter` and `residualCofaceContact_subset_original_coface` → `omit … in`, | |
| 26 | - as the `unusedSectionVars` linter suggests (an instance argument nothing used; the stated claim is unchanged). | |
| 23 | +- `OriginalBridgeReversal.lean`: `hab` → `_hab` (`endpoint_pair_reversal_of_scalar`), `hbound` → `_hbound` | |
| 24 | + (`source_bridge_endpoint_reversal_of_scalar`). | |
| 25 | +- `OriginalBridgeScalarCharts.lean`: `hαβ` → `_hαβ` (`scalar_bridge_chart`). | |
| 26 | +- `ComplementaryAttachments.lean`: `het` → `_het`. | |
| 27 | 27 | |
| 28 | -Job 838 (second head) showed two more unused section variables, fixed in a third commit with `omit … in`: | |
| 29 | -`OriginalHalfBandCofaces.lean:70` (`residualBand_subset_original_cofaces`) and `OriginalRefinementOrientation.lean:154` | |
| 30 | -(`original_refined_pair_cancellation`). Job 842 (third head) showed unused simp arguments in `OriginalRefinementOrientation.lean`: `or_left_comm` at 133 | |
| 31 | -and 135, dropped; and `sub_zero` in a `simp only` whose line was cut off, which I take to be line 127 of the same | |
| 32 | -file (the only such `simp only` in it, just before the others); `build` judges that guess. (It passed: job 845.) | |
| 28 | +`letI` in a proof of a proposition → `let` (`haveILetI` linter): `OriginalPeriodicSquareMap.lean`, | |
| 29 | +`ComplementaryAttachments.lean`. | |
| 33 | 30 | |
| 34 | -Job 845 (fourth head) showed `or_assoc` unused at `OriginalOwnerIntersection.lean:82` and `:85`, dropped, and | |
| 35 | -`[FiniteDimensional ℝ E] [DecidableEq E]` unused in `charted_refined_triangle_independent` | |
| 36 | -(`OriginalRefinementOrientation.lean:14`), omitted. | |
| 31 | +Unused simp arguments, dropped (`unusedSimpArgs`): `or_assoc` twice in `OriginalOwnerIntersection.lean`; | |
| 32 | +`or_left_comm` twice and `sub_zero` once in `OriginalRefinementOrientation.lean`; `sub_zero` once in | |
| 33 | +`OriginalCutCoherentSigns.lean` (line 306). | |
| 37 | 34 | |
| 38 | -Job 850 (fifth head) showed the same two section variables unused in `charted_refined_cross_ne_zero` (omitted), and | |
| 39 | -`sub_zero` unused at `OriginalCutCoherentSigns.lean:306` (dropped). | |
| 35 | +Unused section variables, left out with `omit … in` above the declaration (`unusedSectionVars`), 96 lines: | |
| 36 | +`PrimalSectorAttachmentFibers` 19, `SeparatedDiskAttachment` 14, `FiniteSeparatedAttachments` 8, | |
| 37 | +`BoundaryGraphAttachment` 7, `OriginalHalfBands` 5, `ExteriorProjectionFibers` 4, `OriginalRefinementOrientation` 4, | |
| 38 | +`PrimalRimLiftCoverage` 4, `ConnectedRimProjection` 3, `OriginalCutCoherentSigns` 3, `OriginalHalfBandCofaces` 3, | |
| 39 | +`ResidualBand` 3, `RetainedEdgeFibers` 3, `BoundaryInventory` 2, `ResidualBandCut` 2, `ResidualBridges` 2, and one each | |
| 40 | +in `OriginalExteriorGaps`, `OriginalPrimalCutDisk`, `OriginalRefinementCoherentSigns`, `OriginalRimEndpoints`, | |
| 41 | +`PrimalCutRim`, `TreeSourceGeometry`. Almost all are instance binders (`[FiniteDimensional ℝ E]`, `[Fintype ι]`, | |
| 42 | +`[DecidableEq E]` …), which only make a statement more general. One is not: `omit hbound in` on the private lemma | |
| 43 | +`copiedBridge_over_primalRim_is_endpoint` (`PrimalRimLiftCoverage.lean`), whose one caller no longer passes `hbound`. | |
| 40 | 44 | |
| 41 | -A failure worth keeping: I first took that `sub_zero` for a pattern (eleven `simp only [show (2 : ZMod 2) = 0 from | |
| 42 | -rfl, mul_zero, …]` lines close what `linear_combination (norm := ring_nf)` leaves) and dropped the zero lemmas from all | |
| 43 | -of them. Jobs 856, 859 and 864 failed: in `OrientedDiskBoundary.lean:212`, `PlanarBoundaryOrientation.lean` and | |
| 44 | -`OriginalCutCoherentSigns.lean:168` the goal left is `0 - 0 … = 0` or `-0 = 0`, so those lemmas are needed there. | |
| 45 | -Every one of those lines is back as it was; only the two the log named (127 and 306) are changed. | |
| 45 | +Two `omit` lines no log named: `zeroSheet_apply` and `zeroSheet_injective` (`SeparatedDiskAttachment.lean`). The log | |
| 46 | +named `separatedSheet_eq_zeroSheet_iff`, but omitting its unused instances alone failed (job 967): its `simp` needs | |
| 47 | +`zeroSheet_apply`, which carried `[FiniteDimensional ℝ E] [Fintype ι] [DecidableEq ι]` it does not use. Omitting them | |
| 48 | +from the two `zeroSheet` lemmas as well passed (job 1005). | |
| 46 | 49 | |
| 47 | -Job 868 (green again) showed two more unused section variables, omitted: `[NormedAddCommGroup E] [NormedSpace ℝ E]` | |
| 48 | -in `mapped_numbered_boundary_cross_parity` (`OriginalCutCoherentSigns.lean:99`) and `[FiniteDimensional ℝ E]` in | |
| 49 | -`charted_refined_cofaces_cancel` (`OriginalRefinementOrientation.lean:74`). | |
| 50 | +No statement's claim changes: binder names, a tactic keyword, simp lemma lists, and instance or hypothesis binders | |
| 51 | +nothing used. | |
| 50 | 52 | |
| 51 | -Only binder names, one tactic keyword, `omit` lines and unused simp arguments change; no statement changes. `python3 checks/challenge.py .` says ok. | |
| 53 | +## Failures worth keeping | |
| 52 | 54 | |
| 53 | -## How to go on | |
| 55 | +- Jobs 856, 859, 864: I took the `sub_zero` at line 306 for a pattern and dropped the zero lemmas from all eleven | |
| 56 | + `simp only [show (2 : ZMod 2) = 0 from rfl, mul_zero, …]` lines; in `OrientedDiskBoundary.lean`, | |
| 57 | + `PlanarBoundaryOrientation.lean` and `OriginalCutCoherentSigns.lean:168` they are needed. All reverted. | |
| 58 | +- Job 888: `omit hbound` broke the caller until its `hbound` argument was removed (job 891). | |
| 59 | +- Job 967: the `separatedSheet_eq_zeroSheet_iff` case above. | |
| 54 | 60 | |
| 55 | -The `build` check prints only the last 25 lines of its log, and Lake replays every module's warnings, so each push | |
| 56 | -shows the last two or three warnings of the folder that remain; fixing them shows the next ones. Each round takes | |
| 57 | -about five minutes on the site. Fix only what the log names, line by line: guessing by pattern failed (see above). | |
| 61 | +## Where it stands | |
| 62 | + | |
| 63 | +`build` on the last head (job 1705) passes, and its log's tail names no file of this folder: the last warnings it shows | |
| 64 | +are in `Surfaces/OriginalTrianglePartialQuotient.lean`, one folder up. The log is cut to 25 lines, so this is the | |
| 65 | +tail's word, not a full listing; a full `lake build` log would settle it. | |
| 58 | 66 | |
| 59 | 67 | ## Next |
| 60 | 68 | |
| 61 | -Job 875 (head ea59feb) names two more: `omit [NormedAddCommGroup E] [NormedSpace ℝ E] in` before the private | |
| 62 | -`mapped_numbered_boundary_cross_parity_reverse` (`OriginalCutCoherentSigns.lean:137`) and `omit [FiniteDimensional ℝ | |
| 63 | -E] in` before `original_refined_sorted_cross_cancellation` (`OriginalRefinementCoherentSigns.lean:25`); above them, cut | |
| 64 | -off, an `omit hbound in` for a theorem whose file the log no longer shows. Fix those, push, read the next log, and | |
| 65 | -repeat until the tail of `build` shows no warning for this folder; then set `status: done`. | |
| 69 | +If a maintainer's full log still shows a warning for this folder, fix it on this branch the same way. The parent | |
| 70 | +folder `Surfaces/` (`OriginalTrianglePartialQuotient.lean:77` `letI`, `:82` unused `[FiniteDimensional ℝ E]`) is a | |
| 71 | +natural next unit for P-1. | |