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 | import PoincareLib.Geometry.RicciFlow.Surgery.Comparison.Map |
| 2 | |
| 3 | /-! |
| 4 | # M40 repaired comparison-map homotopy data |
| 5 | |
| 6 | This layer adds homotopy, degree, and pi3 transport to the M39 comparison map. |
| 7 | The endpoint theorem is not part of this local certificate. |
| 8 | -/ |
| 9 | |
| 10 | set_option autoImplicit false |
| 11 | |
| 12 | open scoped Manifold ContDiff Bundle ENNReal Topology |
| 13 | |
| 14 | universe u |
| 15 | |
| 16 | namespace PoincareMT |
| 17 | |
| 18 | structure RepairedComparisonHomotopyInput |
| 19 | {g₀ : StandardInitialMetric} |
| 20 | (D : RepairedSurgeryFlowData.{u} g₀) |
| 21 | (T : ℝ) (hT : T ∈ D.flow.surgery_times) |
| 22 | [Nonempty (D.flow.slice T).carrier] |
| 23 | extends RepairedComparisonMapInput D T hT where |
| 24 | parent_simply_connected : SimplyConnectedSpace parent.carrier.carrier |
| 25 | child_simply_connected : SimplyConnectedSpace child.carrier.carrier |
| 26 | parent_orientation : |
| 27 | surgeryThirdHomology parent.carrier.carrier ≃ₗ[ℤ] ULift.{u} ℤ |
| 28 | |
| 29 | structure RepairedComparisonHomotopyConclusion |
| 30 | {g₀ : StandardInitialMetric} {D : RepairedSurgeryFlowData.{u} g₀} |
| 31 | {T : ℝ} {hT : T ∈ D.flow.surgery_times} |
| 32 | [Nonempty (D.flow.slice T).carrier] |
| 33 | (I : RepairedComparisonHomotopyInput D T hT) where |
| 34 | comparison : RepairedComparisonMapConclusion I.toRepairedComparisonMapInput |
| 35 | child_orientation : |
| 36 | surgeryThirdHomology I.child.carrier.carrier ≃ₗ[ℤ] ULift.{u} ℤ |
| 37 | degree_one : ∀ z : surgeryThirdHomology I.parent.carrier.carrier, |
| 38 | child_orientation (surgeryThirdHomologyMap comparison.map z) = |
| 39 | I.parent_orientation z |
| 40 | homotopy_equivalence : ∃ e : ContinuousMap.HomotopyEquiv |
| 41 | I.parent.carrier.carrier I.child.carrier.carrier, |
| 42 | e.toFun = comparison.map |
| 43 | pi_three_bijective : Function.Bijective |
| 44 | (surgeryHomotopyMap (n := 3) comparison.map comparison.based) |
| 45 | smooth_approximants : ∀ eta : ℝ, 0 < eta → ∃ d : ℝ, 0 < d ∧ |
| 46 | ∀ t : ℝ, T - d < t → t < T → |
| 47 | ∃ f : ContinuousMap I.parent.carrier.carrier I.child.carrier.carrier, |
| 48 | ContMDiff (𝓡 3) (𝓡 3) ∞ f ∧ |
| 49 | (∃ hbase : f I.parent.basepoint = comparison.target_basepoint, |
| 50 | ∀ alpha, surgeryHomotopyMap (n := 3) f hbase alpha = |
| 51 | surgeryHomotopyMap comparison.map comparison.based alpha) ∧ |
| 52 | ContinuousMap.Homotopic f comparison.map ∧ |
| 53 | (∀ x y, I.child_metric.edist (f x) (f y) ≤ |
| 54 | ENNReal.ofReal (1 + eta) * (I.parent_metric t).edist x y) ∧ |
| 55 | (∀ z : surgeryThirdHomology I.parent.carrier.carrier, |
| 56 | child_orientation (surgeryThirdHomologyMap f z) = |
| 57 | I.parent_orientation z) |
| 58 | |
| 59 | structure RepairedComparisonHomotopyData |
| 60 | {g₀ : StandardInitialMetric} |
| 61 | (D : RepairedSurgeryFlowData.{u} g₀) |
| 62 | (K : RepairedComparisonMapData D) where |
| 63 | transport : ∀ (T : ℝ) (hT : T ∈ D.flow.surgery_times) |
| 64 | [Nonempty (D.flow.slice T).carrier], |
| 65 | ∀ I : RepairedComparisonHomotopyInput D T hT, |
| 66 | ∀ hdelta : D.flow.parameters.delta T < repairedComparisonDeltaBound |
| 67 | D.flow.local_constants, |
| 68 | ∀ hh : D.flow.parameters.h T < repairedComparisonHeightBound |
| 69 | D.flow.local_constants, |
| 70 | Nonempty {O : RepairedComparisonHomotopyConclusion I // |
| 71 | O.comparison = Classical.choice |
| 72 | (K.comparison T hT I.toRepairedComparisonMapInput hdelta hh)} |
| 73 | |
| 74 | end PoincareMT |