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

| 1 | # Where the three million lines go |
| 2 | |
| 3 | Issue [S-4, #14](https://shoal.club/shoal/poincare-conjecture/issues/14). |
| 4 | Measured on 2026-12-03 at main commit |
| 5 | [`c888d66f31f7aeb12905bf64f7d0abf564db4791`](https://shoal.club/shoal/poincare-conjecture/tree/c888d66f31f7aeb12905bf64f7d0abf564db4791). |
| 6 | This route changes no Lean source, so these counts also describe its source tree. |
| 7 | |
| 8 | ## Scope and reading key |
| 9 | |
| 10 | The census includes every tracked `.lean` file below `PoincareLib/`: **23,554 |
| 11 | files, 3,061,704 physical lines**. A line means one newline byte, exactly as in |
| 12 | `wc -l`; blank lines, comments, docstrings, imports and notices count. It excludes |
| 13 | `PoincareLib.lean`, the entry-point wrappers, Comparator, Mathlib and all other |
| 14 | dependencies. This is a source-size census, not a count of proof terms, necessary |
| 15 | lines, distinct mathematics, build work or dependency reachability. |
| 16 | |
| 17 | The main table goes two directory levels below `PoincareLib/`; the two drilldowns |
| 18 | go one level further to expose the issue's surgery and smoothing examples. Each |
| 19 | table is a partition of its named parent: counts are recursive, and direct files |
| 20 | are separate. Do not add a drilldown to its parent total. |
| 21 | |
| 22 | The reading regions below are navigation pointers, **not an exclusive allocation |
| 23 | of files to book pages**, and B is not the authors' background classifier. The |
| 24 | book is John Morgan and Gang Tian, *Ricci Flow and the Poincaré Conjecture*, |
| 25 | Clay Mathematics Monographs 3, **2007**: [publisher's PDF](https://www.claymath.org/library/monographs/cmim03.pdf). |
| 26 | Its contents (printed pp. v–viii) supply the inclusive spans below; these may |
| 27 | include blank pages. Repeated regions overlap and must not be summed. The |
| 28 | examples below were opened in the Lean; no statement-equivalence audit is claimed. |
| 29 | There were no P-4 guides under `docs/guide/` at the measured commit. |
| 30 | |
| 31 | | Key | Part served / reading pointer | Printed pages; nominal span | |
| 32 | |---|---|---| |
| 33 | | B | Shared/supporting material; no dedicated book block assigned here | —; no per-folder page count established | |
| 34 | | R | Riemannian background: chapters 1–2, 5 | 3–34 (32), 83–102 (20) | |
| 35 | | F | Early Ricci flow: chapters 3–5 | 35–102 (68) | |
| 36 | | L | Reduced geometry / noncollapse: chapters 6–8 | 105–178 (74) | |
| 37 | | K | Ancient solutions: chapter 9 | 179–244 (66) | |
| 38 | | G | Geometric limits: chapters 10–11 | 245–292 (48); also §3.8, 59–62 | |
| 39 | | S | Standard solution and surgery: chapters 12–17 | 293–328 (36), 331–412 (82) | |
| 40 | | E | Extinction: chapter 18 | 415–436 (22) | |
| 41 | | C | Curve shrinking: chapter 19 | 437–496 (60); §19.2 uses the **2015 correction** | |
| 42 | | N | Neck/cap topology: Appendix, with chapter 9 | 497–514 (18); also 230–244 | |
| 43 | | T | Topological-to-smooth extension | Introduction p. ix, footnote 1; less than one page | |
| 44 | | P | Final smooth endpoint: Corollary 0.2(a) | Introduction p. x; proof route E/C | |
| 45 | |
| 46 | For C, [Morgan–Tian's 2015 correction, arXiv:1512.00699v1](https://arxiv.org/pdf/1512.00699v1) |
| 47 | replaces the estimates in the 2007 §19.2, pp. 441–445. The page comparison uses |
| 48 | the 2007 pagination and acknowledges this replacement; it does not certify the |
| 49 | correction's implementation. T refers to the book's |
| 50 | [footnote on printed p. ix](https://www.claymath.org/library/monographs/cmim03.pdf#page=9), |
| 51 | which treats smoothing as an available result rather than developing its proof. |
| 52 | |
| 53 | ## Totals by subject |
| 54 | |
| 55 | | Folder under `PoincareLib/` | Lean files | Physical lines | Reading region | |
| 56 | |---|---:|---:|---| |
| 57 | | `AlgebraicTopology` | 272 | 35,427 | B | |
| 58 | | `Analysis` | 540 | 119,266 | B (examples support F/C) | |
| 59 | | `Geometry` | 13,854 | 1,785,931 | R/F/L/K/G/S/E/C + B | |
| 60 | | `LinearAlgebra` | 4 | 452 | B | |
| 61 | | `MeasureTheory` | 6 | 571 | B | |
| 62 | | `Topology` | 8,878 | 1,120,057 | N/T/P/S/E + B | |
| 63 | | **Total** | **23,554** | **3,061,704** | | |
| 64 | |
| 65 | ## Two levels down |
| 66 | |
| 67 | A broad region marks where to start reading; a parent folder can serve several |
| 68 | parts. In particular, the remaining analytic and topological helpers marked B |
| 69 | have not been assigned disjoint page ranges. |
| 70 | |
| 71 | | Folder under `PoincareLib/` | Lean files | Physical lines | Reading region | |
| 72 | |---|---:|---:|---| |
| 73 | | `AlgebraicTopology/FundamentalGroup` | 16 | 2,197 | B | |
| 74 | | `AlgebraicTopology/HomologicalAlgebra` | 7 | 684 | B | |
| 75 | | `AlgebraicTopology/HomotopyGroup` | 114 | 11,429 | B | |
| 76 | | `AlgebraicTopology/SingularHomology` | 135 | 21,117 | B | |
| 77 | | `Analysis/Approximation` | 9 | 1,215 | B | |
| 78 | | `Analysis/Asymptotics` | 4 | 299 | F | |
| 79 | | `Analysis/Calculus` | 63 | 7,289 | B | |
| 80 | | `Analysis/Complex` | 1 | 75 | B | |
| 81 | | `Analysis/Convex` | 6 | 631 | B | |
| 82 | | `Analysis/Convolution` | 5 | 443 | B | |
| 83 | | `Analysis/Distribution` | 1 | 87 | B | |
| 84 | | `Analysis/Elliptic` | 112 | 38,688 | B | |
| 85 | | `Analysis/Heat` | 5 | 985 | B | |
| 86 | | `Analysis/InnerProductSpace` | 3 | 364 | B | |
| 87 | | `Analysis/Integral` | 3 | 153 | C | |
| 88 | | `Analysis/Matrix` | 1 | 147 | B | |
| 89 | | `Analysis/Measure` | 2 | 143 | B | |
| 90 | | `Analysis/Normed` | 1 | 38 | C | |
| 91 | | `Analysis/NormedSpace` | 1 | 33 | B | |
| 92 | | `Analysis/ODE` | 65 | 17,152 | B | |
| 93 | | `Analysis/Parabolic` | 218 | 43,616 | F/C + B | |
| 94 | | `Analysis/Sobolev` | 35 | 7,138 | B | |
| 95 | | `Analysis/Spectral` | 5 | 770 | B | |
| 96 | | `Geometry/Alexandrov` | 39 | 3,941 | B | |
| 97 | | `Geometry/Curvature` | 222 | 36,166 | B | |
| 98 | | `Geometry/CurveShortening` | 2,534 | 332,768 | C/E | |
| 99 | | `Geometry/Euclidean` | 5 | 353 | B | |
| 100 | | `Geometry/Manifold` | 114 | 12,176 | B | |
| 101 | | `Geometry/RicciFlow` | 9,088 | 1,135,178 | F/L/K/G/S/E/C + B | |
| 102 | | `Geometry/Riemannian` | 1,704 | 250,434 | R + B | |
| 103 | | `Geometry/Spacetime` | 148 | 14,915 | B | |
| 104 | | `LinearAlgebra/BilinearForm` | 2 | 175 | B | |
| 105 | | `LinearAlgebra/CrossProduct` | 2 | 277 | B | |
| 106 | | `MeasureTheory/Integral` | 5 | 492 | B | |
| 107 | | `MeasureTheory/Measure` | 1 | 79 | R | |
| 108 | | `Topology (direct files)` | 1 | 98 | B | |
| 109 | | `Topology/CWComplex` | 10 | 1,282 | B | |
| 110 | | `Topology/Connected` | 20 | 1,932 | B | |
| 111 | | `Topology/Covering` | 13 | 3,479 | B | |
| 112 | | `Topology/Flow` | 1 | 86 | B | |
| 113 | | `Topology/Gluing` | 4 | 501 | B | |
| 114 | | `Topology/Homotopy` | 70 | 10,344 | B | |
| 115 | | `Topology/Manifold` | 8,511 | 1,047,097 | N/T/P/S/E + B | |
| 116 | | `Topology/Maps` | 5 | 573 | B | |
| 117 | | `Topology/Metric` | 4 | 485 | B | |
| 118 | | `Topology/MetricSpace` | 40 | 9,419 | B | |
| 119 | | `Topology/Order` | 1 | 100 | B | |
| 120 | | `Topology/Paths` | 1 | 116 | B | |
| 121 | | `Topology/Plane` | 42 | 15,718 | B | |
| 122 | | `Topology/Quotient` | 1 | 91 | B | |
| 123 | | `Topology/SecondCountable` | 1 | 49 | B | |
| 124 | | `Topology/Sequences` | 2 | 125 | B | |
| 125 | | `Topology/Sheaves` | 1 | 104 | B | |
| 126 | | `Topology/Surface` | 147 | 28,165 | B | |
| 127 | | `Topology/UniformConvergence` | 1 | 96 | B | |
| 128 | | `Topology/VectorBundle` | 2 | 197 | B | |
| 129 | | **Total** | **23,554** | **3,061,704** | | |
| 130 | |
| 131 | ## Ricci flow drilldown |
| 132 | |
| 133 | | Folder under `PoincareLib/` | Lean files | Physical lines | Reading region | |
| 134 | |---|---:|---:|---| |
| 135 | | `Geometry/RicciFlow (direct files)` | 11 | 1,020 | F + B | |
| 136 | | `Geometry/RicciFlow/AncientKappa` | 397 | 47,941 | K | |
| 137 | | `Geometry/RicciFlow/Area` | 37 | 3,096 | E | |
| 138 | | `Geometry/RicciFlow/Blowup` | 234 | 31,387 | G | |
| 139 | | `Geometry/RicciFlow/CanonicalNeighborhood` | 477 | 62,293 | K/S | |
| 140 | | `Geometry/RicciFlow/Compactness` | 169 | 20,935 | F/R | |
| 141 | | `Geometry/RicciFlow/ConjugateHeat` | 21 | 2,314 | K/L | |
| 142 | | `Geometry/RicciFlow/Connection` | 4 | 753 | B | |
| 143 | | `Geometry/RicciFlow/Coordinates` | 1 | 49 | F | |
| 144 | | `Geometry/RicciFlow/Curvature` | 117 | 27,815 | F/R | |
| 145 | | `Geometry/RicciFlow/CurveShortening` | 42 | 5,249 | C/E | |
| 146 | | `Geometry/RicciFlow/Evolution` | 1 | 163 | B | |
| 147 | | `Geometry/RicciFlow/Extinction` | 114 | 11,095 | E | |
| 148 | | `Geometry/RicciFlow/Frame` | 16 | 2,804 | F | |
| 149 | | `Geometry/RicciFlow/Generalized` | 1,439 | 171,424 | G/F | |
| 150 | | `Geometry/RicciFlow/Harnack` | 369 | 64,041 | F/K | |
| 151 | | `Geometry/RicciFlow/Limit` | 10 | 984 | F/G | |
| 152 | | `Geometry/RicciFlow/Local` | 167 | 69,370 | F | |
| 153 | | `Geometry/RicciFlow/Measure` | 1 | 50 | F | |
| 154 | | `Geometry/RicciFlow/Metric` | 3 | 469 | B | |
| 155 | | `Geometry/RicciFlow/MetricComparison` | 3 | 467 | F | |
| 156 | | `Geometry/RicciFlow/MetricFamily` | 6 | 493 | B | |
| 157 | | `Geometry/RicciFlow/Pinching` | 39 | 5,577 | F | |
| 158 | | `Geometry/RicciFlow/Positivity` | 20 | 4,313 | F | |
| 159 | | `Geometry/RicciFlow/Product` | 15 | 1,520 | C | |
| 160 | | `Geometry/RicciFlow/ReducedGeometry` | 780 | 82,992 | L | |
| 161 | | `Geometry/RicciFlow/Rescaling` | 12 | 1,290 | B | |
| 162 | | `Geometry/RicciFlow/Soliton` | 297 | 37,135 | K | |
| 163 | | `Geometry/RicciFlow/Spacetime` | 13 | 1,849 | C | |
| 164 | | `Geometry/RicciFlow/Splitting` | 35 | 5,663 | B | |
| 165 | | `Geometry/RicciFlow/Surgery` | 4,118 | 459,270 | S | |
| 166 | | `Geometry/RicciFlow/Tensor` | 17 | 2,283 | K + B | |
| 167 | | `Geometry/RicciFlow/Volume` | 103 | 9,074 | S + B | |
| 168 | | **Total** | **9,088** | **1,135,178** | | |
| 169 | |
| 170 | ## Manifold drilldown |
| 171 | |
| 172 | | Folder under `PoincareLib/` | Lean files | Physical lines | Reading region | |
| 173 | |---|---:|---:|---| |
| 174 | | `Topology/Manifold (direct files)` | 3 | 478 | N/P + B | |
| 175 | | `Topology/Manifold/ConnectedSum` | 9 | 888 | S | |
| 176 | | `Topology/Manifold/Diffeomorph` | 76 | 10,193 | B | |
| 177 | | `Topology/Manifold/EmbeddedSphere` | 36 | 3,024 | B | |
| 178 | | `Topology/Manifold/NeckCap` | 584 | 103,398 | N | |
| 179 | | `Topology/Manifold/Orientation` | 25 | 3,115 | B | |
| 180 | | `Topology/Manifold/Poincare` | 31 | 1,252 | P/T | |
| 181 | | `Topology/Manifold/Schoenflies` | 864 | 124,259 | B (topological bridge support) | |
| 182 | | `Topology/Manifold/Separation` | 9 | 776 | B | |
| 183 | | `Topology/Manifold/Smoothing` | 6,394 | 736,177 | T | |
| 184 | | `Topology/Manifold/Surgery` | 422 | 52,791 | S/E | |
| 185 | | `Topology/Manifold/ThreeDimensional` | 58 | 10,746 | B | |
| 186 | | **Total** | **8,511** | **1,047,097** | | |
| 187 | |
| 188 | ## Opened Lean anchors for the reading regions |
| 189 | |
| 190 | These witnesses explain the orientation of the large folders. A witness neither |
| 191 | classifies every file in its folder nor establishes that its hypotheses are |
| 192 | discharged; several explicitly package predecessor assumptions. |
| 193 | |
| 194 | | Folder / region | Opened declaration and what is visible there | |
| 195 | |---|---| |
| 196 | | `Geometry/Riemannian / R` | [`PoincareMT.RiemannianMetric.toponogov_comparison`](https://shoal.club/shoal/poincare-conjecture/blob/c888d66f31f7aeb12905bf64f7d0abf564db4791/PoincareLib/Geometry/Riemannian/Comparison/Toponogov.lean): Triangle comparison; docstring points to Theorem 2.4 and Theorem 5.35. | |
| 197 | | `Geometry/RicciFlow/ReducedGeometry / L` | [`PoincareMT.reducedVolumeMonotonicity`](https://shoal.club/shoal/poincare-conjecture/blob/c888d66f31f7aeb12905bf64f7d0abf564db4791/PoincareLib/Geometry/RicciFlow/ReducedGeometry/ReducedVolume/Monotonicity.lean): Reduced-volume assembly with explicit predecessor inputs. | |
| 198 | | `Geometry/RicciFlow/AncientKappa / K` | [`PoincareMT.ancientKappaStructuralConsequences`](https://shoal.club/shoal/poincare-conjecture/blob/c888d66f31f7aeb12905bf64f7d0abf564db4791/PoincareLib/Geometry/RicciFlow/AncientKappa/Structure.lean): Ancient-solution structural consequences with predecessor theories. | |
| 199 | | `Geometry/RicciFlow/CanonicalNeighborhood / K/S` | [`PoincareMT.M27KappaNine93Conclusion`](https://shoal.club/shoal/poincare-conjecture/blob/c888d66f31f7aeb12905bf64f7d0abf564db4791/PoincareLib/Geometry/RicciFlow/CanonicalNeighborhood/Ancient/Alternatives.lean): Ancient κ-solution alternatives. | |
| 200 | | `Geometry/RicciFlow/Generalized / G/F` | [`PoincareMT.GeneralizedRicciFlowData`](https://shoal.club/shoal/poincare-conjecture/blob/c888d66f31f7aeb12905bf64f7d0abf564db4791/PoincareLib/Geometry/RicciFlow/Generalized/Basic.lean): Changing time-slice carriers and local Ricci-flow boxes. | |
| 201 | | `Geometry/RicciFlow/Surgery / S` | [`PoincareMT.repairedGlobalFlow`](https://shoal.club/shoal/poincare-conjecture/blob/c888d66f31f7aeb12905bf64f7d0abf564db4791/PoincareLib/Geometry/RicciFlow/Surgery/Global/Existence.lean): Global surgery construction; docstring names Theorem 15.9 and Corollary 15.10. | |
| 202 | | `Geometry/RicciFlow/Extinction / E` | [`PoincareMT.M71GlobalFiniteExtinctionStatement`](https://shoal.club/shoal/poincare-conjecture/blob/c888d66f31f7aeb12905bf64f7d0abf564db4791/PoincareLib/Geometry/RicciFlow/Extinction/Global/Statement.lean): Finite-extinction statement, with references to chapter 18. | |
| 203 | | `Geometry/CurveShortening / C` | [`PoincareMT.M64Annulus`](https://shoal.club/shoal/poincare-conjecture/blob/c888d66f31f7aeb12905bf64f7d0abf564db4791/PoincareLib/Geometry/CurveShortening/Comparison/Annulus.lean): Actual Lipschitz annuli; references Lemma 19.15 and later annulus estimates. | |
| 204 | | `Topology/Manifold/NeckCap / N` | [`PoincareMT.m25NeckCapTopology`](https://shoal.club/shoal/poincare-conjecture/blob/c888d66f31f7aeb12905bf64f7d0abf564db4791/PoincareLib/Topology/Manifold/NeckCap.lean): Neck/cap topology linked to chapter 9 and Appendix A. This anchor is a direct file of Manifold, outside the NeckCap child count. | |
| 205 | | `Topology/Manifold/Surgery / S/E` | [`PoincareMT.RepairedGroupEffectsTheory`](https://shoal.club/shoal/poincare-conjecture/blob/c888d66f31f7aeb12905bf64f7d0abf564db4791/PoincareLib/Topology/Manifold/Surgery/GroupEffects/Statement.lean): Surgery group effects and persistence of trivial component groups. | |
| 206 | | `Topology/Manifold/ConnectedSum / S` | [`PoincareMT.SurgeryRegionEquivalence.transportTarget`](https://shoal.club/shoal/poincare-conjecture/blob/c888d66f31f7aeb12905bf64f7d0abf564db4791/PoincareLib/Topology/Manifold/ConnectedSum/Transport.lean): Reconstruction transport across a diffeomorphism. | |
| 207 | | `Topology/Manifold/Schoenflies / B` | [`Poincare.Manifold.Schoenflies.exists_nonsingular_sphere_extension`](https://shoal.club/shoal/poincare-conjecture/blob/c888d66f31f7aeb12905bf64f7d0abf564db4791/PoincareLib/Topology/Manifold/Schoenflies/Collar.lean): Local sphere-collar input; by itself this is not an extension over the ball. Its cited source is outside Morgan–Tian. | |
| 208 | | `Topology/Manifold/Smoothing / T` | [`PoincareMT.m76CompatibleSmoothing`](https://shoal.club/shoal/poincare-conjecture/blob/c888d66f31f7aeb12905bf64f7d0abf564db4791/PoincareLib/Topology/Manifold/Smoothing/Compatible.lean): Compatible smooth model via the Hamilton–Cairns route. | |
| 209 | | `Topology/Manifold/Smoothing / T` | [`PoincareMT.M76.smoothingConclusion_iff_exists_atlas`](https://shoal.club/shoal/poincare-conjecture/blob/c888d66f31f7aeb12905bf64f7d0abf564db4791/PoincareLib/Topology/Manifold/Smoothing/Assembly.lean): Connects the replacement-atlas formulation to the smoothing bridge. | |
| 210 | | `Topology/Manifold/Poincare / P/T` | [`PoincareMT.m80EndpointAssembly`](https://shoal.club/shoal/poincare-conjecture/blob/c888d66f31f7aeb12905bf64f7d0abf564db4791/PoincareLib/Topology/Manifold/Poincare/Assembly.lean): Packages smooth and topological endpoints. The direct file Poincare.lean exports both skeleton theorems. | |
| 211 | |
| 212 | Additional opened witnesses for the Ricci-flow reading keys (paths below are |
| 213 | relative to `PoincareLib/Geometry/RicciFlow/`): |
| 214 | |
| 215 | | Folder / region | Declaration in the opened file | |
| 216 | |---|---| |
| 217 | | `Area` / E | [`PoincareMT.m60AreaGram_det_ne_zero_iff`](https://shoal.club/shoal/poincare-conjecture/blob/c888d66f31f7aeb12905bf64f7d0abf564db4791/PoincareLib/Geometry/RicciFlow/Area/FixedMap/GramRank.lean): Area Gram determinant used for extinction. | |
| 218 | | `Blowup` / G | [`PoincareMT.m29GeneralizedBoundedDistance`](https://shoal.club/shoal/poincare-conjecture/blob/c888d66f31f7aeb12905bf64f7d0abf564db4791/PoincareLib/Geometry/RicciFlow/Blowup/BoundedDistance.lean): Bounded-distance theory, with the uniform estimate a premise. | |
| 219 | | `Compactness` / F/R | [`PoincareMT.PointedRicciFlowCompactnessHypotheses.eventually_exists_uniform_finset_cover`](https://shoal.club/shoal/poincare-conjecture/blob/c888d66f31f7aeb12905bf64f7d0abf564db4791/PoincareLib/Geometry/RicciFlow/Compactness/Covering.lean): Uniform finite covers for compactness. | |
| 220 | | `ConjugateHeat` / K/L | [`PoincareMT.RicciFlow.conjugateHeatDensity_residual`](https://shoal.club/shoal/poincare-conjecture/blob/c888d66f31f7aeb12905bf64f7d0abf564db4791/PoincareLib/Geometry/RicciFlow/ConjugateHeat/Density.lean): Conjugate-heat density residual. | |
| 221 | | `Coordinates` / F | [`PoincareMT.RicciFlow.contDiffOn_pullbackCoefficients`](https://shoal.club/shoal/poincare-conjecture/blob/c888d66f31f7aeb12905bf64f7d0abf564db4791/PoincareLib/Geometry/RicciFlow/Coordinates/Coefficients.lean): Regularity of pullback coefficients. | |
| 222 | | `Curvature` / F/R | [`PoincareMT.ricciFlowCurvatureTheory`](https://shoal.club/shoal/poincare-conjecture/blob/c888d66f31f7aeb12905bf64f7d0abf564db4791/PoincareLib/Geometry/RicciFlow/Curvature/Construction.lean): Curvature evolution and regularity theory. | |
| 223 | | `Frame` / F | [`PoincareMT.RicciFlow.Frame.exists_ricciTransport_on`](https://shoal.club/shoal/poincare-conjecture/blob/c888d66f31f7aeb12905bf64f7d0abf564db4791/PoincareLib/Geometry/RicciFlow/Frame/TransportInterval.lean): Ricci transport along an interval. | |
| 224 | | `Harnack` / F/K | [`PoincareMT.differentialHarnackAncientTheory`](https://shoal.club/shoal/poincare-conjecture/blob/c888d66f31f7aeb12905bf64f7d0abf564db4791/PoincareLib/Geometry/RicciFlow/Harnack/Theorem.lean): Harnack theory for ancient solutions. | |
| 225 | | `Limit` / F/G | [`PoincareMT.RicciFlow.exists_of_coordinate_jets_on_open`](https://shoal.club/shoal/poincare-conjecture/blob/c888d66f31f7aeb12905bf64f7d0abf564db4791/PoincareLib/Geometry/RicciFlow/Limit/Flow.lean): Limit flow from coordinate jets. | |
| 226 | | `Local` / F | [`PoincareMT.ricciFlowLocalTheory`](https://shoal.club/shoal/poincare-conjecture/blob/c888d66f31f7aeb12905bf64f7d0abf564db4791/PoincareLib/Geometry/RicciFlow/Local/ExistenceUniquenessContinuation.lean): Local existence, uniqueness and continuation. | |
| 227 | | `Measure` / F | [`PoincareMT.RicciFlow.volumeMeasure_antitone_of_nonnegative_ricci`](https://shoal.club/shoal/poincare-conjecture/blob/c888d66f31f7aeb12905bf64f7d0abf564db4791/PoincareLib/Geometry/RicciFlow/Measure/Monotonicity.lean): Volume-measure monotonicity. | |
| 228 | | `MetricComparison` / F | [`PoincareMT.RicciFlow.metric_comparison_of_curvature_bound`](https://shoal.club/shoal/poincare-conjecture/blob/c888d66f31f7aeb12905bf64f7d0abf564db4791/PoincareLib/Geometry/RicciFlow/MetricComparison/Curvature.lean): Metric comparison from curvature bounds. | |
| 229 | | `Pinching` / F | [`PoincareMT.LeviCivitaData.curvatureOperator_mem_region_iff`](https://shoal.club/shoal/poincare-conjecture/blob/c888d66f31f7aeb12905bf64f7d0abf564db4791/PoincareLib/Geometry/RicciFlow/Pinching/CurvatureCarrier.lean): Curvature-operator pinching carrier. | |
| 230 | | `Positivity` / F | [`PoincareMT.RicciFlow.nonnegativeSectionalCurvature_preserved`](https://shoal.club/shoal/poincare-conjecture/blob/c888d66f31f7aeb12905bf64f7d0abf564db4791/PoincareLib/Geometry/RicciFlow/Positivity/Preservation.lean): Preservation of nonnegative sectional curvature. | |
| 231 | | `Soliton` / K | [`PoincareMT.twoDimensionalAncientAndShrinkingSolitonClassification`](https://shoal.club/shoal/poincare-conjecture/blob/c888d66f31f7aeb12905bf64f7d0abf564db4791/PoincareLib/Geometry/RicciFlow/Soliton/TwoDimensional.lean): Two-dimensional ancient/soliton classification. | |
| 232 | | `Product` / C | [`PoincareMT.M62.nonempty_circleProductData`](https://shoal.club/shoal/poincare-conjecture/blob/c888d66f31f7aeb12905bf64f7d0abf564db4791/PoincareLib/Geometry/RicciFlow/Product/Circle/Flow.lean): Circle-product Ricci flow. | |
| 233 | | `Spacetime` / C | [`PoincareMT.M62.nonempty_spacetimeCharts`](https://shoal.club/shoal/poincare-conjecture/blob/c888d66f31f7aeb12905bf64f7d0abf564db4791/PoincareLib/Geometry/RicciFlow/Spacetime/Product/Charts.lean): Spacetime charts, with the corrected curve-evolution source. | |
| 234 | | `Tensor` / K + B | [`PoincareMT.RicciFlow.hasDerivAt_gradient_normSq`](https://shoal.club/shoal/poincare-conjecture/blob/c888d66f31f7aeb12905bf64f7d0abf564db4791/PoincareLib/Geometry/RicciFlow/Tensor/GradientEnergyTime.lean): Gradient-energy time derivative. | |
| 235 | | `Volume` / S + B | [`PoincareMT.repairedFinitePrefix`](https://shoal.club/shoal/poincare-conjecture/blob/c888d66f31f7aeb12905bf64f7d0abf564db4791/PoincareLib/Geometry/RicciFlow/Volume/Surgery/FinitePrefix.lean): Finite surgery-prefix construction. | |
| 236 | |
| 237 | B is deliberately conservative. For example, `Analysis/Asymptotics/Harnack.lean` |
| 238 | contains the real-analysis limit step used in chapter 4; |
| 239 | `Analysis/Integral/DifferentialApproximation.lean` and |
| 240 | `Analysis/Normed/Multilinear/UnitBound.lean` cite the 2015 correction. Their |
| 241 | folder position alone does not separate background theory from theorem-specific |
| 242 | work. The remaining B entries have no dedicated page allocation established by this |
| 243 | reading of the source layout and representative module headers; neither the |
| 244 | repository overview nor the absent P-4 guides supply one. The algebraic-topology, |
| 245 | analytic, linear-algebra and measure-theory rows |
| 246 | are counted in full even where no exclusive book allocation was established. |
| 247 | |
| 248 | ## Checking the authors' two figures |
| 249 | |
| 250 | The authors' [paper, arXiv:2610.08329v1, §5 and footnote 6](https://arxiv.org/html/2610.08329v1#S5) |
| 251 | reports roughly **48%** background/support. Footnote 6 attributes that split to |
| 252 | GPT-6-Astra's assessment at |
| 253 | [`3d7318c32025ccb30465dd29850e95a9e2aa1526`](https://github.com/frenzymath/PoincareConjecture/commit/3d7318c32025ccb30465dd29850e95a9e2aa1526). |
| 254 | This is a model-assessed classification at another revision, not a statistic |
| 255 | reproduced by these directory counts; that footnote supplies no per-file |
| 256 | classification or counting command. We confirm what the source reports, not an |
| 257 | independent 48% measurement of this tree. |
| 258 | |
| 259 | The same paragraph reports about **650,000 lines** for compatible smooth |
| 260 | structures **including supporting theory**. Our narrower directory census is |
| 261 | **6,394 files / 736,177 physical lines** in `Topology/Manifold/Smoothing`: |
| 262 | **24.04%** of this library's physical lines. The paper's introduction, footnote 3, |
| 263 | uses comment-stripped source for its headline totals. Neither its revision, |
| 264 | classification nor that metric equals our directory/newline metric, so 650,000 |
| 265 | is not reproduced as a current `wc -l` result. Conversely, counting only this |
| 266 | folder does not include all its imported support. The book-side comparison is |
| 267 | T: one footnote, not a smoothing chapter. |
| 268 | |
| 269 | The other three large examples are `Geometry/RicciFlow/Surgery` (459,270 lines, |
| 270 | 15.00%), `Geometry/CurveShortening` (332,768, 10.87%) and |
| 271 | `Geometry/Riemannian` (250,434, 8.18%). Together with Smoothing they account for |
| 272 | 1,778,649 physical lines (58.09%). These are places to investigate readability |
| 273 | and reuse, not lines proved redundant or removable. The map does not show |
| 274 | which lines either endpoint actually needs, nor verify the proof. |
| 275 | |
| 276 | ## Reproduce after a merge |
| 277 | |
| 278 | Use a clean checkout; record its commit before comparing counts. To reproduce |
| 279 | this snapshot, use the commit at the top of this page. After a merge, run the |
| 280 | same commands on the new commit and update the snapshot and tables together. |
| 281 | The script reads tracked paths and current file contents, so untracked scratch |
| 282 | Lean files are excluded and local modifications must be absent. |
| 283 | |
| 284 | ```sh |
| 285 | git status --short |
| 286 | git rev-parse HEAD |
| 287 | python3 - <<'PYCODE' |
| 288 | from collections import defaultdict |
| 289 | from pathlib import Path |
| 290 | import subprocess |
| 291 | |
| 292 | paths = subprocess.check_output( |
| 293 | ['git', 'ls-files', '-z', '--', 'PoincareLib'] |
| 294 | ).decode().split('\0') |
| 295 | tables = {name: defaultdict(lambda: [0, 0]) for name in |
| 296 | ('Totals', 'Two levels', 'Ricci flow detail', 'Manifold detail')} |
| 297 | for name in sorted(p for p in paths if p.endswith('.lean')): |
| 298 | path = Path(name) |
| 299 | parts = path.relative_to('PoincareLib').parts |
| 300 | lines = path.read_bytes().count(b'\n') # same physical-line metric as wc -l |
| 301 | keys = [('Totals', parts[0] if len(parts) > 1 else '(direct files)'), |
| 302 | ('Two levels', '/'.join(parts[:2]) if len(parts) > 2 |
| 303 | else str(Path(*parts).parent) + ' (direct files)')] |
| 304 | for prefix, table in [(('Geometry', 'RicciFlow'), 'Ricci flow detail'), |
| 305 | (('Topology', 'Manifold'), 'Manifold detail')]: |
| 306 | if parts[:2] == prefix: |
| 307 | key = '/'.join(parts[:3]) if len(parts) > 3 else '/'.join(prefix) + ' (direct files)' |
| 308 | keys.append((table, key)) |
| 309 | for table, key in keys: |
| 310 | tables[table][key][0] += 1 |
| 311 | tables[table][key][1] += lines |
| 312 | for table, rows in tables.items(): |
| 313 | print('\n' + table) |
| 314 | print('Folder\tFiles\tLines') |
| 315 | for folder, (files, lines) in sorted(rows.items()): |
| 316 | print(f'{folder}\t{files}\t{lines}') |
| 317 | print('TOTAL\t{}\t{}'.format(*(sum(v[i] for v in rows.values()) for i in (0, 1)))) |
| 318 | PYCODE |
| 319 | ``` |
| 320 | |
| 321 | The emitted tables reproduce the folder, file and line columns above (without |
| 322 | thousands separators or reading labels). The first two totals are both |
| 323 | `23554 / 3061704`; the drilldown totals are `9088 / 1135178` and |
| 324 | `8511 / 1047097`. For an independent `find`/`wc` cross-check of a parent, use: |
| 325 | |
| 326 | ```sh |
| 327 | find PoincareLib -type f -name '*.lean' -exec wc -l {} + | |
| 328 | awk '$NF != "total" { files++; lines += $1 } |
| 329 | END { printf "%d files, %d lines\n", files, lines }' |
| 330 | find PoincareLib/Topology/Manifold/Smoothing -type f -name '*.lean' -exec wc -l {} + | |
| 331 | awk '$NF != "total" { files++; lines += $1 } |
| 332 | END { printf "%d files, %d lines\n", files, lines }' |
| 333 | ``` |
| 334 | |
| 335 | Expected: `23554 files, 3061704 lines` and `6394 files, 736177 lines`. |
| 336 | These shell commands assume this tree's whitespace-free paths and, unlike the |
| 337 | tracked-path script, include untracked files, so use a clean checkout. Discarding |
| 338 | batch `total` rows avoids double-counting when `find -exec ... +` invokes `wc` |
| 339 | more than once. A second person's rerun and review are still required by #14; |
| 340 | these local cross-checks do not satisfy that independent-review condition. |