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 | import PoincareLib.Geometry.RicciFlow.Surgery.Continuation.Branch |
| 3 | import PoincareLib.Geometry.RicciFlow.Surgery.Metric.OperationData |
| 4 | |
| 5 | /-! |
| 6 | Adapted from Mapher `PoincareMT/Definitions/M37SurgeryFlow.lean` at |
| 7 | `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. Declaration bodies are retained; |
| 8 | see `references/ricci-flow/mapher/surgery-adapters-port.json`. |
| 9 | -/ |
| 10 | |
| 11 | /-! |
| 12 | # M37 repaired changing-carrier surgery-flow data |
| 13 | |
| 14 | The core view retains the actual event maps, retained regions, inserted |
| 15 | caps, discarded components, and empty terminal slices. Optional M36 operation |
| 16 | provenance lives in a separate compatibility extension. |
| 17 | -/ |
| 18 | |
| 19 | set_option autoImplicit false |
| 20 | |
| 21 | open scoped Manifold ContDiff Bundle ENNReal Topology |
| 22 | |
| 23 | universe u |
| 24 | |
| 25 | namespace PoincareMT |
| 26 | |
| 27 | /-! The core changing-carrier view is intentionally independent of the M36 |
| 28 | operation witness. Every later topology and width consumer uses only this |
| 29 | primitive flow/index pair. -/ |
| 30 | structure RepairedSurgeryFlowData (g₀ : StandardInitialMetric) where |
| 31 | flow : SurgeryFlowData.{u} |
| 32 | standard_initial_eq : flow.standard_initial = g₀ |
| 33 | |
| 34 | /-! M37 keeps the optional operation provenance in a separate extension. The |
| 35 | raw global flow does not acquire this data merely by being reindexed. -/ |
| 36 | structure RepairedSurgeryFlowCompatibilityData (g₀ : StandardInitialMetric) |
| 37 | extends RepairedSurgeryFlowData.{u} g₀ where |
| 38 | metric_surgery : RepairedMetricSurgeryData.{u} g₀ |
| 39 | constants_eq : metric_surgery.constants = flow.local_constants |
| 40 | /-- Each selected event result is the result supplied by M36 after |
| 41 | transporting the event constants across `constants_eq`. -/ |
| 42 | event_operation_input : |
| 43 | ∀ (T : ℝ) (hT : T ∈ flow.surgery_times) |
| 44 | [Nonempty (flow.slice T).carrier] |
| 45 | (_i : Fin ((flow.event T hT).cap_count)), |
| 46 | MetricSurgeryInput metric_surgery.constants |
| 47 | (flow.event T hT).limit_metric |
| 48 | event_operation_input_eq : |
| 49 | ∀ (T : ℝ) (hT : T ∈ flow.surgery_times) |
| 50 | [Nonempty (flow.slice T).carrier] |
| 51 | (i : Fin ((flow.event T hT).cap_count)), |
| 52 | HEq ((flow.event T hT).necks i) (event_operation_input T hT i) |
| 53 | event_operation_alignment : |
| 54 | ∀ (T : ℝ) (hT : T ∈ flow.surgery_times) |
| 55 | [Nonempty (flow.slice T).carrier] |
| 56 | (i : Fin ((flow.event T hT).cap_count)), |
| 57 | HEq ((flow.event T hT).local_result i) |
| 58 | (Classical.choice (metric_surgery.operation (event_operation_input T hT i))) |
| 59 | end PoincareMT |