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.CurveShortening.Comparison.IntrinsicComparison.Normal.Scalar |
| 2 | import PoincareLib.Geometry.CurveShortening.Comparison.IntrinsicComparison.Focusing.Transport |
| 3 | |
| 4 | /-! |
| 5 | # The initial derivative of the normal Jacobi coefficient |
| 6 | |
| 7 | The coordinate, intrinsic, and frozen pullback connections coincide on the |
| 8 | intrinsic plane. Torsion-freeness of the actual two-parameter pullback then |
| 9 | identifies the time derivative of the variation field with the boundary |
| 10 | derivative of the normal. Source: Claim 19.37, pp. 468-469. |
| 11 | |
| 12 | Context: Morgan--Tian Claim 19.37, printed pp. 468-469, in the proof of Proposition |
| 13 | 19.35. |
| 14 | -/ |
| 15 | |
| 16 | noncomputable section |
| 17 | set_option autoImplicit false |
| 18 | set_option backward.isDefEq.respectTransparency false |
| 19 | |
| 20 | open Set Filter |
| 21 | open scoped Topology Manifold ContDiff Bundle |
| 22 | |
| 23 | namespace PoincareMT |
| 24 | |
| 25 | open ConnectionVariation CoordinateExponential |
| 26 | |
| 27 | attribute [local instance] normedAddCommGroupTangentSpaceVectorSpace |
| 28 | normedSpaceTangentSpaceVectorSpace |
| 29 | |
| 30 | /-- The chart-based intrinsic derivative has the global Euclidean Christoffel formula on the |
| 31 | intrinsic surface. Source/construction: Morgan--Tian Claim 19.37, printed pp. 468-469. -/ |
| 32 | theorem m64Intrinsic_manifoldCovDeriv_model |
| 33 | (N : IntrinsicAnnulus) (q V : ℝ → AnnulusCoordinates) (t : ℝ) : |
| 34 | manifoldCovDerivAlong N.metric q V 1 t = |
| 35 | deriv V t + coordinateChristoffel N.metric.euclideanCoefficients (q t) |
| 36 | (deriv q t) (V t) := by |
| 37 | have hcoeff : N.metric.pullbackCoefficients id = N.metric.euclideanCoefficients := by |
| 38 | ext p v w |
| 39 | change N.metric.inner p (mfderiv (𝓡 2) (𝓡 2) id p v) |
| 40 | (mfderiv (𝓡 2) (𝓡 2) id p w) = N.metric.inner p v w |
| 41 | rw [mfderiv_id] |
| 42 | rfl |
| 43 | simp [manifoldCovDerivAlong, hcoeff, covDerivAlong, fderiv_eq_smul_deriv] |
| 44 | |
| 45 | /-- The M07 chart-defined and M62 frozen derivatives agree for smooth fields along the |
| 46 | actual intrinsic curve. Source/construction: Morgan--Tian Claim 19.37, printed pp. 468-469. -/ |
| 47 | theorem m64Intrinsic_manifoldCovDeriv_eq_frozen |
| 48 | (N : IntrinsicAnnulus) {q V : ℝ → AnnulusCoordinates} {I : Set ℝ} |
| 49 | (hI : IsOpen I) {t : ℝ} (ht : t ∈ I) (hq : DifferentiableAt ℝ q t) |
| 50 | (hV : ContDiffOn ℝ ∞ V I) : |
| 51 | manifoldCovDerivAlong N.metric q V 1 t = |
| 52 | rampHorizontalCovariantDerivative N.connection q V t := by |
| 53 | exact (m64Intrinsic_manifoldCovDeriv_model N q V t).trans |
| 54 | (m64Intrinsic_pullback_modelOn N hI ht hq hV).symm |
| 55 | |
| 56 | /-- Torsion-freeness computes the initial covariant derivative of the normal variation field |
| 57 | from the actual boundary normal derivative. Source/construction: Morgan--Tian Claim 19.37, |
| 58 | printed pp. 468-469. -/ |
| 59 | theorem m64Intrinsic_normal_variation_initial_covDeriv |
| 60 | (N : IntrinsicAnnulus) {radius : ℝ} |
| 61 | {u : ℝ × ℝ → AnnulusCoordinates} {S I : Set ℝ} |
| 62 | (hS : IsOpen S) (hI : IsOpen I) (hzero : (0 : ℝ) ∈ I) |
| 63 | (hu : ContMDiffOn 𝓘(ℝ, ℝ × ℝ) (𝓡 2) ∞ u (S ×ˢ I)) |
| 64 | (hboundary : ∀ s ∈ S, u (s, 0) = intrinsicAnnulusBoundary radius s) |
| 65 | {normal : ℝ → AnnulusCoordinates} (hnormal : ContDiff ℝ ∞ normal) |
| 66 | (hvelocity : ∀ s ∈ S, curveVelocity (n := 2) (fun t => u (s, t)) 0 = normal s) |
| 67 | {a : ℝ} (ha : a ∈ S) : |
| 68 | let q : ℝ → AnnulusCoordinates := fun t => u (a, t) |
| 69 | let X : ℝ → AnnulusCoordinates := fun t => curveVelocity (n := 2) (fun s => u (s, t)) a |
| 70 | manifoldCovDerivAlong N.metric q X 1 0 = |
| 71 | rampHorizontalCovariantDerivative N.connection |
| 72 | (intrinsicAnnulusBoundary radius) normal a := by |
| 73 | let q : ℝ → AnnulusCoordinates := fun t => u (a, t) |
| 74 | let X : ℝ → AnnulusCoordinates := |
| 75 | fun t => curveVelocity (n := 2) (fun s => u (s, t)) a |
| 76 | let base : ℝ → AnnulusCoordinates := fun s => u (s, 0) |
| 77 | let V : ℝ → AnnulusCoordinates := fun s => curveVelocity (n := 2) (fun t => u (s, t)) 0 |
| 78 | have huat := hu.contMDiffAt ((hS.prod hI).mem_nhds |
| 79 | (show (a, 0) ∈ S ×ˢ I from ⟨ha, hzero⟩)) |
| 80 | have hq : DifferentiableAt ℝ q 0 := |
| 81 | ((contMDiffAt_iff_contDiffAt.mp huat).comp 0 (by fun_prop)).differentiableAt (by simp) |
| 82 | have hbase : DifferentiableAt ℝ base a := |
| 83 | ((contMDiffAt_iff_contDiffAt.mp huat).comp a (by fun_prop)).differentiableAt (by simp) |
| 84 | have hX : ContDiffOn ℝ ∞ X I := fun t ht => |
| 85 | (m64Intrinsic_contDiff_variation_field hS hI hu.contDiffOn ha ht).contDiffWithinAt |
| 86 | have hge : base =ᶠ[𝓝 a] intrinsicAnnulusBoundary radius := by |
| 87 | filter_upwards [hS.mem_nhds ha] with s hs |
| 88 | exact hboundary s hs |
| 89 | have hveq : V =ᶠ[𝓝 a] normal := by |
| 90 | filter_upwards [hS.mem_nhds ha] with s hs |
| 91 | exact hvelocity s hs |
| 92 | have hcomm := M62.pullback_velocity_commute N.connection (fun s t => u (s, t)) |
| 93 | (hS.prod hI) hu (show (a, 0) ∈ S ×ˢ I from ⟨ha, hzero⟩) |
| 94 | change rampHorizontalCovariantDerivative N.connection q X 0 = |
| 95 | rampHorizontalCovariantDerivative N.connection base V a at hcomm |
| 96 | have hright : rampHorizontalCovariantDerivative N.connection base V a = |
| 97 | rampHorizontalCovariantDerivative N.connection |
| 98 | (intrinsicAnnulusBoundary radius) normal a := by |
| 99 | exact (M62.pullback_congr N.connection hveq).trans |
| 100 | (m64Intrinsic_pullback_congr_base N hS ha hbase |
| 101 | ((m64Intrinsic_contDiff_boundary radius).contDiffAt.differentiableAt (by simp)) |
| 102 | hnormal.contDiffOn hge) |
| 103 | exact (m64Intrinsic_manifoldCovDeriv_eq_frozen N hI hzero hq hX).trans |
| 104 | (hcomm.trans hright) |
| 105 | |
| 106 | end PoincareMT |