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.ReducedGeometry.ReducedLength.Variation.Adapted.ExponentialAdaptedFrame |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Barrier.AdaptedComparisonFamily |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Barrier.ComparisonActionChart |
| 4 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Barrier.ComparisonFirstDerivatives |
| 5 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Barrier.ComparisonLaplacian |
| 6 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Tensor.HarnackIntegral |
| 7 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Geometry.MinimizingInitialVectors |
| 8 | |
| 9 | /-! |
| 10 | # Constructed upper barriers with zero first residual |
| 11 | |
| 12 | One common comparison family supplies its actual action, all scalar |
| 13 | variations, and the endpoint inverse. The Harnack identity cancels the |
| 14 | resulting time and Laplacian terms at the touching point. |
| 15 | -/ |
| 16 | |
| 17 | set_option autoImplicit false |
| 18 | set_option maxSynthPendingDepth 3 |
| 19 | |
| 20 | open scoped Manifold ContDiff Bundle Topology BigOperators |
| 21 | open Filter |
| 22 | |
| 23 | universe u |
| 24 | |
| 25 | namespace PoincareMT.ReducedLength |
| 26 | |
| 27 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 28 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 29 | [IsManifold (𝓡 n) ∞ M] [ConnectedSpace M] [T2Space M] |
| 30 | {J : Set ℝ} {F : RicciFlow n M J} {T τmax : ℝ} {p : M} |
| 31 | |
| 32 | set_option maxHeartbeats 1600000 in |
| 33 | -- All derivatives below belong to the same constructed comparison action. |
| 34 | set_option backward.isDefEq.respectTransparency false in |
| 35 | theorem lExponentialFamily_exists_zeroResidual_upperBarrier |
| 36 | (hM04 : RicciFlowCurvatureTheory.{u}) (hL : LGeodesicTheory F T τmax) |
| 37 | (hτmax : 0 < τmax) (hwindow : Set.Icc (T - τmax) T ⊆ J) |
| 38 | (A : LExponentialFamily F T τmax p) (Z : TangentSpace (𝓡 n) p) |
| 39 | (b : ℝ) (hb : 0 < b) (hmax : b < τmax) |
| 40 | (hmin : IsMinimizingBackwardLPath F T 0 b (A.path Z b hb hmax)) : |
| 41 | ∃ B : ReducedLengthUpperBarrier F T p (A.gamma Z b) b, |
| 42 | reducedLengthBarrierResidual F T p (A.gamma Z b) b B = 0 := by |
| 43 | let c := Real.sqrt b |
| 44 | have hc : 0 < c := Real.sqrt_pos.mpr hb |
| 45 | obtain ⟨U, P, hU, _, hKU, htime, hα, hP, hpair⟩ := |
| 46 | lExponentialFamily_exists_adapted_frame hτmax hwindow A Z b hb hmax |
| 47 | obtain ⟨f, Ω, N, hΩ, _, h0N, hNΩ, hf, hbase, hfixed0, hfields, hbij⟩ := |
| 48 | exists_scaled_frame_comparison_family F T c hc (A.squareFamily Z) P U hU hKU hα |
| 49 | (fun i ↦ (hP i).smooth) (hpair c (hKU ⟨hc.le, le_rfl⟩)) |
| 50 | have hsegment : ∀ s ∈ Set.Icc 0 c, ((0 : Fin n → ℝ), s) ∈ Ω := |
| 51 | fun _ hs ↦ hNΩ ⟨h0N, hs⟩ |
| 52 | have hfixed : ∀ x, f (x, 0) = p := fun x ↦ (hfixed0 x).trans (A.square_at_zero Z) |
| 53 | obtain ⟨B, e, hze, _, _, _, _, hpullSource⟩ := exists_upperBarrier_of_comparison_family |
| 54 | hM04 hL hτmax hwindow A Z b hb hmax hmin f Ω hΩ hf hsegment hbase hfixed hbij |
| 55 | have hpull : (fun z : (Fin n → ℝ) × ℝ ↦ B.representative (f (z.1, Real.sqrt z.2), z.2)) |
| 56 | =ᶠ[𝓝 (0, b)] (fun z ↦ backwardLLength F T 0 z.2 (fun t ↦ f (z.1, Real.sqrt t)) / |
| 57 | (2 * Real.sqrt z.2)) := by |
| 58 | filter_upwards [e.open_source.mem_nhds hze] with z hz |
| 59 | exact hpullSource z hz |
| 60 | obtain ⟨hdf, _, hd⟩ := comparison_family_first_derivatives hM04 hL hτmax hwindow |
| 61 | A Z b hb hmax f Ω hΩ hf hsegment hbase hfixed B.representative |
| 62 | B.representative_spacetime_smooth hpull hbij.2 |
| 63 | let O : Set M := {q | (q, b) ∈ B.neighborhood} |
| 64 | have hO : IsOpen O := B.neighborhood_open.preimage (continuous_id.prodMk continuous_const) |
| 65 | have hΔ := comparison_family_laplacian_eq hM04 hL hτmax hwindow A Z b hb hmax hmin |
| 66 | P U hU hKU htime hα hP hpair f Ω hΩ hf hsegment hbase hfixed hfields |
| 67 | B.representative O hO B.center_mem B.representative_space_smooth_on hdf hpull |
| 68 | have hvalue : B.representative (A.gamma Z b, b) = A.action Z b / (2 * Real.sqrt b) := |
| 69 | B.touches.trans ((lExponentialFamily_reducedLength_eq_action_iff hL A Z b hb hmax).mpr hmin) |
| 70 | have hK := lExponentialFamily_harnack_integral_eq hM04 hτmax hwindow A Z b hb hmax |
| 71 | refine ⟨B, ?_⟩ |
| 72 | unfold reducedLengthBarrierResidual |
| 73 | rw [hd, hΔ, hK, hvalue] |
| 74 | field_simp [hb.ne', hc.ne'] <;> ring |
| 75 | |
| 76 | theorem exists_zeroResidual_upperBarrier |
| 77 | (hM04 : RicciFlowCurvatureTheory.{u}) (hL : LGeodesicTheory F T τmax) |
| 78 | (hτmax : 0 < τmax) (hwindow : Set.Icc (T - τmax) T ⊆ J) |
| 79 | (A : LExponentialFamily F T τmax p) (q : M) |
| 80 | (b : ℝ) (hb : 0 < b) (hmax : b < τmax) : |
| 81 | ∃ B : ReducedLengthUpperBarrier F T p q b, reducedLengthBarrierResidual F T p q b B = 0 := by |
| 82 | obtain ⟨Z, hend, hmin⟩ := lExponentialFamily_exists_minimizing_initialVector |
| 83 | hM04 hL hτmax hwindow A b hb hmax q |
| 84 | rw [← hend] |
| 85 | exact lExponentialFamily_exists_zeroResidual_upperBarrier hM04 hL hτmax hwindow |
| 86 | A Z b hb hmax hmin |
| 87 | |
| 88 | theorem exists_upperBarrier_with_residual_le |
| 89 | (hM04 : RicciFlowCurvatureTheory.{u}) (hL : LGeodesicTheory F T τmax) |
| 90 | (hτmax : 0 < τmax) (hwindow : Set.Icc (T - τmax) T ⊆ J) |
| 91 | (A : LExponentialFamily F T τmax p) (q : M) |
| 92 | (b : ℝ) (hb : 0 < b) (hmax : b < τmax) (ε : ℝ) (hε : 0 < ε) : |
| 93 | ∃ B : ReducedLengthUpperBarrier F T p q b, reducedLengthBarrierResidual F T p q b B ≤ ε := by |
| 94 | obtain ⟨B, hB⟩ := exists_zeroResidual_upperBarrier hM04 hL hτmax hwindow A q b hb hmax |
| 95 | exact ⟨B, hB.le.trans hε.le⟩ |
| 96 | |
| 97 | end PoincareMT.ReducedLength |