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.Metric.Terminal |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.Singular.RegularLimit.Metric.Family |
| 3 | import PoincareLib.Geometry.RicciFlow.Surgery.Singular.RegularLimit.Coordinates.SpacetimeLimit |
| 4 | import PoincareLib.Geometry.RicciFlow.Restriction |
| 5 | |
| 6 | /-! |
| 7 | # The smooth metric family on the regular region through the terminal time |
| 8 | |
| 9 | Insert the constructed terminal metric into the restricted original family. |
| 10 | Its old-time values are exact, and the joint coordinate extension proves |
| 11 | smoothness within the half-closed time domain. |
| 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 old restricted metrics with the actual terminal metric inserted. -/ |
| 35 | def terminalMetricFamily (H : SingularTimeAssumptions F T M) |
| 36 | (P04 : RicciFlowCurvatureTheory.{u}) (t : ℝ) : |
| 37 | RiemannianMetric 3 (H.regularRegion P04) := |
| 38 | if t = T then H.terminalMetric P04 |
| 39 | else (H.reference.flow.restrictToOpen (H.regularRegion P04)).metric t |
| 40 | |
| 41 | @[simp] theorem terminalMetricFamily_at_terminal (H : SingularTimeAssumptions F T M) |
| 42 | (P04 : RicciFlowCurvatureTheory.{u}) : |
| 43 | H.terminalMetricFamily P04 T = H.terminalMetric P04 := by |
| 44 | simp [terminalMetricFamily] |
| 45 | |
| 46 | theorem terminalMetricFamily_of_ne (H : SingularTimeAssumptions F T M) |
| 47 | (P04 : RicciFlowCurvatureTheory.{u}) {t : ℝ} (ht : t ≠ T) : |
| 48 | H.terminalMetricFamily P04 t = |
| 49 | (H.reference.flow.restrictToOpen (H.regularRegion P04)).metric t := by |
| 50 | simp only [terminalMetricFamily, if_neg ht] |
| 51 | |
| 52 | /-- In inherited charts the family has the exact extended reference coefficients. -/ |
| 53 | theorem terminalMetricFamily_chartCoefficients_eqOn |
| 54 | (H : SingularTimeAssumptions F T M) (P04 : RicciFlowCurvatureTheory.{u}) |
| 55 | (q : H.regularRegion P04) (p : ℝ × EuclideanSpace ℝ (Fin 3)) |
| 56 | (hp : p.2 ∈ (extChartAt (𝓡 3) q).target) : |
| 57 | (H.terminalMetricFamily P04 p.1).pullbackCoefficients |
| 58 | (extChartAt (𝓡 3) q).symm p.2 = |
| 59 | H.extendedCoordinateCoefficients P04 (q : M) p := by |
| 60 | by_cases ht : p.1 = T |
| 61 | · simp only [terminalMetricFamily, extendedCoordinateCoefficients, ht] |
| 62 | exact H.regularRegion_chartCoefficients_eqOn P04 q hp |
| 63 | · rw [H.terminalMetricFamily_of_ne P04 ht] |
| 64 | simp only [extendedCoordinateCoefficients, if_neg ht] |
| 65 | ext v w |
| 66 | change ((H.reference.flow.restrictToOpen (H.regularRegion P04)).metric p.1).inner |
| 67 | ((extChartAt (𝓡 3) q).symm p.2) |
| 68 | (mfderiv (𝓡 3) (𝓡 3) (extChartAt (𝓡 3) q).symm p.2 v) |
| 69 | (mfderiv (𝓡 3) (𝓡 3) (extChartAt (𝓡 3) q).symm p.2 w) = _ |
| 70 | rw [RicciFlow.restrictToOpen_inner, |
| 71 | Poincare.Geometry.Manifold.RegularLevel.mfderiv_opens_subtypeVal] |
| 72 | change (H.reference.flow.metric p.1).inner ((extChartAt (𝓡 3) q).symm p.2 : M) |
| 73 | (mfderiv (𝓡 3) (𝓡 3) (extChartAt (𝓡 3) q).symm p.2 v) |
| 74 | (mfderiv (𝓡 3) (𝓡 3) (extChartAt (𝓡 3) q).symm p.2 w) = |
| 75 | (H.reference.flow.metric p.1).inner ((extChartAt (𝓡 3) (q : M)).symm p.2) |
| 76 | (mfderiv (𝓡 3) (𝓡 3) (extChartAt (𝓡 3) (q : M)).symm p.2 v) |
| 77 | (mfderiv (𝓡 3) (𝓡 3) (extChartAt (𝓡 3) (q : M)).symm p.2 w) |
| 78 | rw [H.regularRegion_chart_inverse P04 q hp, H.regularRegion_chart_mfderiv P04 q hp] |
| 79 | rfl |
| 80 | |
| 81 | /-- The actual old-time and terminal metrics are jointly smooth up to the |
| 82 | terminal boundary on the fixed regular carrier. -/ |
| 83 | theorem terminalMetricFamily_isSmoothFamilyOn |
| 84 | (H : SingularTimeAssumptions F T M) (P04 : RicciFlowCurvatureTheory.{u}) : |
| 85 | RiemannianMetric.IsSmoothFamilyOn (H.terminalMetricFamily P04) |
| 86 | (Ioc H.reference.tMinus T) := by |
| 87 | apply SingularRegularLimit.isSmoothFamilyOn_of_chartCoefficients |
| 88 | intro t ht q |
| 89 | let p := extChartAt (𝓡 3) q q |
| 90 | by_cases htT : t = T |
| 91 | · subst t |
| 92 | obtain ⟨s, r, _, hsT, hr, _, _, hcoeff⟩ := |
| 93 | H.exists_smooth_terminal_spacetime_coordinates P04 q.property |
| 94 | have hpoint : (T, p) ∈ Ioc s T ×ˢ Metric.ball (extChartAt (𝓡 3) (q : M) q) r := |
| 95 | ⟨⟨hsT, le_rfl⟩, Metric.mem_ball_self hr⟩ |
| 96 | have hlocal : Ioc s T ×ˢ Metric.ball (extChartAt (𝓡 3) (q : M) q) r ∈ |
| 97 | 𝓝[Ioc H.reference.tMinus T ×ˢ univ] (T, p) := by |
| 98 | filter_upwards [self_mem_nhdsWithin, |
| 99 | mem_nhdsWithin_of_mem_nhds |
| 100 | (continuousAt_fst.preimage_mem_nhds (Ioi_mem_nhds hsT)), |
| 101 | mem_nhdsWithin_of_mem_nhds |
| 102 | (continuousAt_snd.preimage_mem_nhds (Metric.ball_mem_nhds p hr))] |
| 103 | with z hz hzs hzr |
| 104 | exact ⟨⟨hzs, hz.1.2⟩, hzr⟩ |
| 105 | apply ((hcoeff (T, p) hpoint).mono_of_mem_nhdsWithin hlocal).congr_of_eventuallyEq |
| 106 | · filter_upwards [mem_nhdsWithin_of_mem_nhds |
| 107 | (continuousAt_snd.preimage_mem_nhds (extChartAt_target_mem_nhds (I := 𝓡 3) q))] |
| 108 | with z hz |
| 109 | exact H.terminalMetricFamily_chartCoefficients_eqOn P04 q z hz |
| 110 | · exact H.terminalMetricFamily_chartCoefficients_eqOn P04 q (T, p) |
| 111 | (mem_extChartAt_target q) |
| 112 | · have htlt : t < T := lt_of_le_of_ne ht.2 htT |
| 113 | let G := Poincare.Geometry.RicciFlow.Harnack.restrictFlow |
| 114 | (H.reference.flow.restrictToOpen (H.regularRegion P04)) |
| 115 | (Ioo_subset_Ico_self : Ioo H.reference.tMinus T ⊆ Ico H.reference.tMinus T) |
| 116 | ordConnected_Ioo ⟨t, ⟨ht.1, htlt⟩, (t + T) / 2, |
| 117 | ⟨by linarith [ht.1], by linarith⟩, by linarith⟩ |
| 118 | have hsmooth := G.contDiffOn_pullbackCoefficients isOpen_Ioo |
| 119 | (isOpen_extChartAt_target q) (contMDiffOn_extChartAt_symm q) |
| 120 | have hpoint : (t, p) ∈ Ioo H.reference.tMinus T ×ˢ (extChartAt (𝓡 3) q).target := |
| 121 | ⟨⟨ht.1, htlt⟩, mem_extChartAt_target q⟩ |
| 122 | apply ContDiffAt.contDiffWithinAt |
| 123 | apply (hsmooth.contDiffAt |
| 124 | ((isOpen_Ioo.prod (isOpen_extChartAt_target q)).mem_nhds hpoint)).congr_of_eventuallyEq |
| 125 | filter_upwards [continuousAt_fst.preimage_mem_nhds (Iio_mem_nhds htlt)] with z hz |
| 126 | rw [H.terminalMetricFamily_of_ne P04 (ne_of_lt hz)] |
| 127 | rfl |
| 128 | |
| 129 | end PoincareMT.SingularTimeAssumptions |