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.Calculus.WithinEquationCongruence |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Variation.Initial.InitialVectorIdentification |
| 3 | |
| 4 | /-! |
| 5 | # The family equation at every square-time point |
| 6 | |
| 7 | The actual joint family supplies a smooth open slice. Agreement with the |
| 8 | chosen regularization transfers the equation through both endpoints. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | set_option maxSynthPendingDepth 3 |
| 13 | |
| 14 | open scoped Manifold ContDiff Bundle |
| 15 | |
| 16 | universe u |
| 17 | |
| 18 | namespace PoincareMT.ReducedLength |
| 19 | |
| 20 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 21 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 22 | [IsManifold (𝓡 n) ∞ M] |
| 23 | {J : Set ℝ} {F : RicciFlow n M J} {T τmax : ℝ} {p : M} |
| 24 | |
| 25 | set_option backward.isDefEq.respectTransparency false in |
| 26 | theorem lExponentialFamily_squareSlice_contMDiffOn (A : LExponentialFamily F T τmax p) |
| 27 | (Z : TangentSpace (𝓡 n) p) : |
| 28 | ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ (A.squareFamily Z) |
| 29 | ((fun s : ℝ ↦ (Z, s)) ⁻¹' A.squareDomain) := by |
| 30 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 31 | ⟨(F.metric T).toRiemannianMetric⟩ |
| 32 | let E := TangentSpace (𝓡 n) p |
| 33 | have hf : ContMDiffOn (𝓘(ℝ, E × ℝ)) (𝓡 n) ∞ |
| 34 | (fun z ↦ A.squareFamily z.1 z.2) A.squareDomain := by |
| 35 | convert! A.square_smooth using 1 <;> |
| 36 | simp only [E, modelWithCornersSelf_prod, chartedSpaceSelf_prod] |
| 37 | have hi : ContMDiff (𝓘(ℝ, ℝ)) (𝓘(ℝ, E × ℝ)) ∞ (fun s : ℝ ↦ (Z, s)) := |
| 38 | (contDiff_const.prodMk contDiff_id).contMDiff |
| 39 | exact hf.comp hi.contMDiffOn (fun s hs ↦ hs) |
| 40 | |
| 41 | theorem lExponentialFamily_localRegularizedEquation_closed |
| 42 | (hM04 : RicciFlowCurvatureTheory.{u}) (hτmax : 0 < τmax) |
| 43 | (hwindow : Set.Icc (T - τmax) T ⊆ J) (A : LExponentialFamily F T τmax p) |
| 44 | (Z : TangentSpace (𝓡 n) p) (b : ℝ) (hb : 0 < b) (hmax : b < τmax) |
| 45 | (s : ℝ) (hs : s ∈ sqrtParameterInterval 0 b) : |
| 46 | LocalRegularizedEquation F T (A.squareFamily Z) s := by |
| 47 | let R := A.regularization Z b hb hmax |
| 48 | let K := sqrtParameterInterval 0 b |
| 49 | let U := (fun r : ℝ ↦ (Z, r)) ⁻¹' A.squareDomain |
| 50 | have hK : K = Set.Icc 0 (Real.sqrt b) := by simp [K, sqrtParameterInterval] |
| 51 | have hKd : UniqueDiffOn ℝ K := hK ▸ uniqueDiffOn_Icc (Real.sqrt_pos.mpr hb) |
| 52 | have hU : IsOpen U := A.square_open.preimage (continuous_const.prodMk continuous_id) |
| 53 | have hKU : K ⊆ U := by |
| 54 | intro r hr |
| 55 | have hr0 : 0 ≤ r := by simpa only [sqrtParameterInterval, Real.sqrt_zero] using hr.1 |
| 56 | exact A.square_contains ⟨Set.mem_univ _, hr0, |
| 57 | hr.2.trans_lt (Real.sqrt_lt_sqrt hb.le hmax)⟩ |
| 58 | have htime : s ∈ Set.Ioo (-Real.sqrt τmax) (Real.sqrt τmax) := by |
| 59 | have hs0 : 0 ≤ s := by simpa only [sqrtParameterInterval, Real.sqrt_zero] using hs.1 |
| 60 | exact ⟨(neg_lt_zero.mpr (Real.sqrt_pos.mpr hτmax)).trans_le hs0, |
| 61 | hs.2.trans_lt (Real.sqrt_lt_sqrt hb.le hmax)⟩ |
| 62 | have heq := (regularizedEquation_iff_local F hM04 T τmax hτmax hwindow |
| 63 | R.path.curve R.path.domain K R.path.open_domain R.path.interval_subset hKd |
| 64 | R.path.smooth R.velocity_extension s hs htime).mp (R.equation s hs) |
| 65 | exact heq.congr_of_eqOn K R.path.domain U R.path.open_domain hU |
| 66 | R.path.interval_subset hKU R.path.smooth (lExponentialFamily_squareSlice_contMDiffOn A Z) |
| 67 | hKd (lExponentialFamily_regularization_eqOn A Z b hb hmax) hs |
| 68 | |
| 69 | end PoincareMT.ReducedLength |