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.Singular.RegularLimit.Coordinates.Convergence |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.Singular.RegularLimit.Metric.Construction |
| 3 | import PoincareLib.Geometry.Manifold.RegularLevel.OpenInclusion |
| 4 | |
| 5 | /-! |
| 6 | # The smooth terminal metric on the regular region |
| 7 | |
| 8 | The open regular region carries the positive pointwise terminal forms as an |
| 9 | actual smooth Riemannian metric. Its underlying manifold is the inherited open |
| 10 | submanifold, including when the regular region is empty. |
| 11 | Source: Morgan--Tian, Theorem 11.19, pp. 279--280. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | set_option synthInstance.maxHeartbeats 100000 |
| 17 | set_option maxSynthPendingDepth 8 |
| 18 | |
| 19 | open Set Filter Manifold |
| 20 | open scoped Manifold ContDiff Bundle Topology |
| 21 | |
| 22 | universe u |
| 23 | |
| 24 | noncomputable section |
| 25 | |
| 26 | namespace PoincareMT.SingularTimeAssumptions |
| 27 | |
| 28 | variable {M : Type u} [TopologicalSpace M] |
| 29 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] |
| 30 | [IsManifold (𝓡 3) ∞ M] [MeasurableSpace M] [BorelSpace M] |
| 31 | [T2Space M] [T3Space M] [SecondCountableTopology M] |
| 32 | {F : GeneralizedRicciFlowData.{u}} {T : ℝ} |
| 33 | |
| 34 | /-- The regular region with its inherited open-submanifold structure. -/ |
| 35 | def regularRegion (H : SingularTimeAssumptions F T M) |
| 36 | (P04 : RicciFlowCurvatureTheory.{u}) : TopologicalSpace.Opens M := |
| 37 | ⟨H.reference.regularLimitSet, H.regularLimitSet_isOpen P04⟩ |
| 38 | |
| 39 | /-- Terminal tangent forms on the open regular region. -/ |
| 40 | def regularRegionBilinear (H : SingularTimeAssumptions F T M) |
| 41 | (P04 : RicciFlowCurvatureTheory.{u}) (x : H.regularRegion P04) : |
| 42 | TangentSpace (𝓡 3) x →L[ℝ] TangentSpace (𝓡 3) x →L[ℝ] ℝ := |
| 43 | H.terminalMetricBilinear P04 x.property |
| 44 | |
| 45 | /-- Restricting to the open regular region restricts every chart target. -/ |
| 46 | theorem regularRegion_chart_target_subset |
| 47 | (H : SingularTimeAssumptions F T M) (P04 : RicciFlowCurvatureTheory.{u}) |
| 48 | (q : H.regularRegion P04) : |
| 49 | (extChartAt (𝓡 3) q).target ⊆ (extChartAt (𝓡 3) (q : M)).target := by |
| 50 | intro z hz |
| 51 | exact ⟨hz.1, (chartAt (EuclideanSpace ℝ (Fin 3)) (q : M)).subtypeRestr_target_subset |
| 52 | ⟨q⟩ hz.2⟩ |
| 53 | |
| 54 | /-- The inherited inverse chart has the original inverse as its ambient value. -/ |
| 55 | theorem regularRegion_chart_inverse |
| 56 | (H : SingularTimeAssumptions F T M) (P04 : RicciFlowCurvatureTheory.{u}) |
| 57 | (q : H.regularRegion P04) {z : EuclideanSpace ℝ (Fin 3)} |
| 58 | (hz : z ∈ (extChartAt (𝓡 3) q).target) : |
| 59 | (extChartAt (𝓡 3) (q : M)).symm z = |
| 60 | ((extChartAt (𝓡 3) q).symm z : M) := |
| 61 | (chartAt (EuclideanSpace ℝ (Fin 3)) (q : M)).subtypeRestr_symm_eqOn ⟨q⟩ hz.2 |
| 62 | |
| 63 | /-- Inverse-chart derivatives are unchanged by open-submanifold inclusion. -/ |
| 64 | theorem regularRegion_chart_mfderiv |
| 65 | (H : SingularTimeAssumptions F T M) (P04 : RicciFlowCurvatureTheory.{u}) |
| 66 | (q : H.regularRegion P04) {z : EuclideanSpace ℝ (Fin 3)} |
| 67 | (hz : z ∈ (extChartAt (𝓡 3) q).target) : |
| 68 | mfderiv (𝓡 3) (𝓡 3) (extChartAt (𝓡 3) (q : M)).symm z = |
| 69 | mfderiv (𝓡 3) (𝓡 3) (extChartAt (𝓡 3) q).symm z := by |
| 70 | have hnear : (fun y => (extChartAt (𝓡 3) (q : M)).symm y) =ᶠ[𝓝 z] |
| 71 | (fun y => ((extChartAt (𝓡 3) q).symm y : M)) := |
| 72 | Filter.eventuallyEq_of_mem ((isOpen_extChartAt_target q).mem_nhds hz) |
| 73 | (fun _ hy => H.regularRegion_chart_inverse P04 q hy) |
| 74 | have hdiff := mfderiv_comp z |
| 75 | (Poincare.Geometry.Manifold.RegularLevel.hasMFDerivAt_opens_subtypeVal |
| 76 | (I := 𝓡 3) (H.regularRegion P04) ((extChartAt (𝓡 3) q).symm z)).mdifferentiableAt |
| 77 | (((contMDiffOn_extChartAt_symm (n := ∞) q).contMDiffAt |
| 78 | ((isOpen_extChartAt_target q).mem_nhds hz)).mdifferentiableAt (by simp)) |
| 79 | rw [Poincare.Geometry.Manifold.RegularLevel.mfderiv_opens_subtypeVal] at hdiff |
| 80 | rw [hnear.mfderiv_eq] |
| 81 | ext v |
| 82 | exact congrArg (fun A => A v) hdiff |
| 83 | |
| 84 | /-- Terminal chart coefficients agree with the reference-chart limits. -/ |
| 85 | theorem regularRegion_chartCoefficients_eqOn |
| 86 | (H : SingularTimeAssumptions F T M) (P04 : RicciFlowCurvatureTheory.{u}) |
| 87 | (q : H.regularRegion P04) : |
| 88 | SingularRegularLimit.tangentBilinearChartCoefficients (H.regularRegionBilinear P04) q |
| 89 | =ᶠ[𝓟 (extChartAt (𝓡 3) q).target] H.terminalCoordinateCoefficients P04 q := by |
| 90 | let c := extChartAt (𝓡 3) (q : M) |
| 91 | let d := extChartAt (𝓡 3) q |
| 92 | intro z hzt |
| 93 | have hz := H.regularRegion_chart_inverse P04 q hzt |
| 94 | have hreg : c.symm z ∈ H.reference.regularLimitSet := by |
| 95 | rw [hz] |
| 96 | exact (d.symm z).property |
| 97 | have hD := H.regularRegion_chart_mfderiv P04 q hzt |
| 98 | ext v w |
| 99 | rw [H.terminalCoordinateCoefficients_apply P04 (q : M) hreg v w] |
| 100 | change H.terminalMetricBilinear P04 (d.symm z).property |
| 101 | (mfderiv (𝓡 3) (𝓡 3) d.symm z v) (mfderiv (𝓡 3) (𝓡 3) d.symm z w) = |
| 102 | H.terminalMetricBilinear P04 hreg |
| 103 | (mfderiv (𝓡 3) (𝓡 3) c.symm z v) (mfderiv (𝓡 3) (𝓡 3) c.symm z w) |
| 104 | rw [hD] |
| 105 | congr 2 |
| 106 | have htransport {x y : M} (hx : x ∈ H.reference.regularLimitSet) |
| 107 | (hy : y ∈ H.reference.regularLimitSet) (hxy : x = y) : |
| 108 | HEq (H.terminalMetricBilinear P04 hx) (H.terminalMetricBilinear P04 hy) := by |
| 109 | cases hxy |
| 110 | rfl |
| 111 | exact eq_of_heq (htransport _ _ hz.symm) |
| 112 | |
| 113 | /-- The terminal tangent forms are smooth in the inherited charts. -/ |
| 114 | theorem contDiffAt_regularRegionBilinear_chartCoefficients |
| 115 | (H : SingularTimeAssumptions F T M) (P04 : RicciFlowCurvatureTheory.{u}) |
| 116 | (q : H.regularRegion P04) : |
| 117 | ContDiffAt ℝ ∞ |
| 118 | (SingularRegularLimit.tangentBilinearChartCoefficients (H.regularRegionBilinear P04) q) |
| 119 | (extChartAt (𝓡 3) q q) := |
| 120 | (H.contDiffAt_terminalCoordinateCoefficients P04 q.property).congr_of_eventuallyEq |
| 121 | (Filter.eventuallyEq_of_mem (extChartAt_target_mem_nhds (I := 𝓡 3) q) |
| 122 | (H.regularRegion_chartCoefficients_eqOn P04 q)) |
| 123 | |
| 124 | /-- The actual smooth terminal metric, defined without a nonemptiness assumption. -/ |
| 125 | def terminalMetric (H : SingularTimeAssumptions F T M) |
| 126 | (P04 : RicciFlowCurvatureTheory.{u}) : RiemannianMetric 3 (H.regularRegion P04) := |
| 127 | SingularRegularLimit.metricOfChartCoefficients (H.regularRegionBilinear P04) |
| 128 | (fun x => H.terminalMetricBilinear_symm P04 x.property) |
| 129 | (fun x => H.terminalMetricBilinear_pos P04 x.property) |
| 130 | (H.contDiffAt_regularRegionBilinear_chartCoefficients P04) |
| 131 | |
| 132 | /-- The terminal metric is linked to the limit of the original tangent forms. -/ |
| 133 | theorem terminalMetric_inner (H : SingularTimeAssumptions F T M) |
| 134 | (P04 : RicciFlowCurvatureTheory.{u}) (x : H.regularRegion P04) |
| 135 | (v w : TangentSpace (𝓡 3) x) : |
| 136 | (H.terminalMetric P04).inner x v w = H.terminalMetricBilinear P04 x.property v w := rfl |
| 137 | |
| 138 | end PoincareMT.SingularTimeAssumptions |