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.Flow.Basic |
| 2 | |
| 3 | /-! |
| 4 | Adapted from Mapher `PoincareMT/Definitions/Ch15/SurgeryEndPolicy.lean` at |
| 5 | `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. Declaration bodies are retained; |
| 6 | see `references/ricci-flow/mapher/surgery-adapters-port.json`. |
| 7 | -/ |
| 8 | |
| 9 | /-! |
| 10 | # Terminal policy for constructed surgeries |
| 11 | |
| 12 | These are outputs of M33's Definition 15.8 construction (MT, pp. 361-362). |
| 13 | The raw flow class does not assert this policy for arbitrary earlier events. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | |
| 18 | open scoped Manifold ContDiff Bundle ENNReal Topology |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace PoincareMT |
| 23 | |
| 24 | variable {M : Type u} [TopologicalSpace M] |
| 25 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] |
| 26 | [IsManifold (𝓡 3) ∞ M] [MeasurableSpace M] [BorelSpace M] |
| 27 | [T2Space M] [T3Space M] |
| 28 | |
| 29 | /-- The terminal components meeting the actual scalar sublevel set Omega_rho. -/ |
| 30 | def SurgeryTerminalCoreComponents {g : RiemannianMetric 3 M} |
| 31 | (D : LeviCivitaData g) (rho : ℝ) : Set M := |
| 32 | {x | ∃ y, D.scalarCurvature y ≤ rho⁻¹ ^ 2 ∧ x ∈ connectedComponent y} |
| 33 | |
| 34 | /-- The proper ambient end beyond a selected neck sphere. Its identification |
| 35 | from the selected horn is part of M33's construction, not a raw event premise. -/ |
| 36 | structure SurgeryEndCut {g : RiemannianMetric 3 M} (N : EpsilonNeck g) where |
| 37 | point : M |
| 38 | point_positive : point ∈ N.region 0 N.epsilon⁻¹ |
| 39 | tail : Set M |
| 40 | component_eq : tail = connectedComponentIn N.central_sphereᶜ point |
| 41 | frontier_eq : frontier tail = N.central_sphere |
| 42 | escapes_compact : ∀ K : Set M, IsCompact K → ¬ tail ⊆ K |
| 43 | positive_subset : N.region 0 N.epsilon⁻¹ ⊆ tail |
| 44 | negative_disjoint : Disjoint (N.region (-N.epsilon⁻¹) 0) tail |
| 45 | |
| 46 | /-- The continuing terminal region is exactly Omega_big with the chosen |
| 47 | unbounded ends removed, using the actual event metric, necks and parameters. -/ |
| 48 | structure SurgeryEventTerminalPolicy |
| 49 | {g₀ : StandardInitialMetric} {K : MetricSurgeryConstants} |
| 50 | {P : SurgeryParameters} {slice : ℝ → GeneralizedSliceCarrier.{u}} |
| 51 | {metric : ∀ t, RiemannianMetric 3 (slice t).carrier} {T : ℝ} |
| 52 | (E : SurgeryEventData g₀ K P slice metric T) where |
| 53 | cuts : ∀ i : Fin E.cap_count, SurgeryEndCut (E.necks i).neck |
| 54 | retained_eq : E.limit_identify.map '' E.retained_pre = |
| 55 | SurgeryTerminalCoreComponents E.limit_connection (P.delta T * P.r T) \ |
| 56 | ⋃ i, (cuts i).tail |
| 57 | |
| 58 | /-- At every pre-flow point of a constructed vanishing event the scalar |
| 59 | curvature eventually exceeds a pointwise strict margin above rho^-2. -/ |
| 60 | def SurgeryVanishingEventTerminalPolicy |
| 61 | {P : SurgeryParameters} {slice : ℝ → GeneralizedSliceCarrier.{u}} |
| 62 | {metric : ∀ t, RiemannianMetric 3 (slice t).carrier} {T : ℝ} |
| 63 | (V : SurgeryVanishingEventData P slice metric T) : Prop := |
| 64 | ∀ x : (slice V.tMinus).carrier, |
| 65 | ∃ L : ℝ, (P.delta T * P.r T)⁻¹ ^ 2 < L ∧ |
| 66 | ∃ s ∈ Set.Ico V.tMinus T, |
| 67 | ∀ t ∈ Set.Ico s T, L < (V.pre_flow.connection t).scalarCurvature x |
| 68 | |
| 69 | /-! The raw `SurgeryFlowData` deliberately remains broad. The following |
| 70 | predicate is the source-faithful policy boundary used when an induction |
| 71 | argument is restricted to the Definition 15.8 construction. Its interval is |
| 72 | explicit so an observation need not claim policy for an unobserved future. |
| 73 | The nonempty branch carries the data-bearing policy through `Nonempty`; the |
| 74 | vanishing branch is already a proposition. -/ |
| 75 | |
| 76 | /-- Every surgery event in `J` carries the terminal policy produced by the |
| 77 | Definition 15.8 construction, including the strict vanishing policy for |
| 78 | empty terminal slices. This is a restriction on a given flow, not a theorem |
| 79 | that creates policy for arbitrary raw events. -/ |
| 80 | structure SurgeryFlowTerminalPolicyOn |
| 81 | (F : SurgeryFlowData.{u}) (J : Set ℝ) : Prop where |
| 82 | nonempty : ∀ T ∈ J, ∀ hT : T ∈ F.surgery_times, |
| 83 | ∀ [_hT_nonempty : Nonempty (F.slice T).carrier], |
| 84 | Nonempty (SurgeryEventTerminalPolicy (F.event T hT)) |
| 85 | vanishing : ∀ T ∈ J, ∀ hT : T ∈ F.surgery_times, |
| 86 | ∀ [_hT_empty : IsEmpty (F.slice T).carrier], |
| 87 | SurgeryVanishingEventTerminalPolicy (F.vanishing_event T hT) |
| 88 | |
| 89 | /-- Restrict a terminal-policy certificate to a smaller observed interval. -/ |
| 90 | theorem SurgeryFlowTerminalPolicyOn.restrict |
| 91 | {F : SurgeryFlowData.{u}} {J K : Set ℝ} |
| 92 | (hJK : J ⊆ K) (policy : SurgeryFlowTerminalPolicyOn F K) : |
| 93 | SurgeryFlowTerminalPolicyOn F J := |
| 94 | { nonempty := fun T hT hTsurgery => policy.nonempty T (hJK hT) hTsurgery |
| 95 | vanishing := fun T hT hTsurgery => policy.vanishing T (hJK hT) hTsurgery } |
| 96 | |
| 97 | end PoincareMT |