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.Generalized.ReducedGeometry.Regularity.Formulas.GradientNorm |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Regularity.Formulas.HarnackIntegral |
| 3 | |
| 4 | /-! |
| 5 | # The actual regular gradient identity |
| 6 | |
| 7 | The frozen horizontal gradient norm and the actual integrated Harnack |
| 8 | formula refer to the same selected exponential path. Their algebra gives |
| 9 | Morgan-Tian Lemma 6.49 and Theorem 6.50, p. 131. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Set |
| 15 | open scoped Manifold ContDiff Bundle |
| 16 | |
| 17 | universe u |
| 18 | |
| 19 | namespace PoincareMT.M14 |
| 20 | |
| 21 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 22 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 23 | {T : ℝ} {x : G.Point} |
| 24 | |
| 25 | /-- The K integral of the actual selected branch has its prescribed |
| 26 | action and terminal square-energy boundary, Lemma 6.48, p. 130. -/ |
| 27 | theorem exponential_harnackIntegral_eq |
| 28 | (hM12 : GeneralizedRicciGaugeTheory.{u} n) (E : M14ExponentialFamily G T x) |
| 29 | {Z : G.Horizontal x} {s : ℝ} (hs : (Z, s) ∈ E.domain) (hpos : 0 < s) : |
| 30 | M14GeneralizedKIntegral G (E.path Z s hs hpos) |
| 31 | (fun t => M14BackwardTimeDerivative G (horizontalScalarCurvature G.leafwise) |
| 32 | ((E.path Z s hs hpos).curve t)) = |
| 33 | E.action Z s / 2 - |
| 34 | (s ^ 3 * horizontalScalarCurvature G.leafwise ((E.square_path Z s hs hpos).curve s) + |
| 35 | s * G.spacetime.horizontalMetric.inner ((E.square_path Z s hs hpos).curve s) |
| 36 | ((E.square_path Z s hs hpos).horizontal_velocity s) |
| 37 | ((E.square_path Z s hs hpos).horizontal_velocity s) / 4) := by |
| 38 | have h := squareRoot_harnackIntegral_zero_start hM12 (E.square_path Z s hs hpos) |
| 39 | (E.square_extension Z s hs hpos) (by |
| 40 | intro r hr |
| 41 | apply E.square_euler Z s hs hpos r |
| 42 | simpa only [M14SqrtParameterInterval, Real.sqrt_zero] using Ioo_subset_Icc_self hr) |
| 43 | rw [Real.sqrt_sq hpos.le, ← E.action_eq Z s hs hpos] at h |
| 44 | exact h |
| 45 | |
| 46 | /-- The exact regular gradient identity for the actual branch and |
| 47 | any prescribed orthonormal horizontal basis, Theorem 6.50, p. 131. -/ |
| 48 | theorem reducedLengthGradientNormSq_joint_identity |
| 49 | (hCoordinates : M12MetricPredecessors.{0} n) |
| 50 | (hM04 : RicciFlowCurvatureTheory.{0}) (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 51 | (E : M14ExponentialFamily G T x) {Z : G.Horizontal x} {s : ℝ} |
| 52 | (hs : (Z, s) ∈ E.domain) (hpos : 0 < s) (hz : (Z, s) ∈ M14JointDomain G E) |
| 53 | (hpoint : (E.square_path Z s hs hpos).curve s = E.gamma Z s) |
| 54 | (b : Module.Basis (Fin n) ℝ (G.Horizontal (E.gamma Z s))) |
| 55 | (hb : ∀ i j, G.spacetime.horizontalMetric.inner (E.gamma Z s) (b i) (b j) = |
| 56 | if i = j then 1 else 0) : |
| 57 | M14ReducedLengthGradientNormSq (T := T) (τ₁ := 0) G x (E.gamma Z s) b = |
| 58 | M14ReducedLengthValue G T 0 (s ^ 2) x (E.gamma Z s) / s ^ 2 - |
| 59 | M14GeneralizedKIntegral G (E.path Z s hs hpos) |
| 60 | (fun t => M14BackwardTimeDerivative G (horizontalScalarCurvature G.leafwise) |
| 61 | ((E.path Z s hs hpos).curve t)) / (s ^ 2 * Real.sqrt (s ^ 2)) - |
| 62 | horizontalScalarCurvature G.leafwise (E.gamma Z s) := by |
| 63 | have hK := exponential_harnackIntegral_eq hM12 E hs hpos |
| 64 | have hS := congrArg (horizontalScalarCurvature G.leafwise) hpoint |
| 65 | rw [hS] at hK |
| 66 | obtain ⟨_, _, _, _, _, hl⟩ := jointDomain_action_branch E hz |
| 67 | rw [E.reduced_length_eq Z s hs hpos] at hl |
| 68 | rw [reducedLengthGradientNormSq_eq_squareEnergy hCoordinates hM04 hM12 E hs hpos hz hpoint b hb, |
| 69 | ← hl, Real.sqrt_sq hpos.le, hK] |
| 70 | field_simp [hpos.ne'] |
| 71 | ring |
| 72 | |
| 73 | end PoincareMT.M14 |