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.RegularSmooth |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Exponential.Action.ActionDifferential |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Exponential.Stability.StablePrefix |
| 4 | |
| 5 | /-! |
| 6 | # The actual horizontal derivative of regular reduced length |
| 7 | |
| 8 | First variation identifies the branch action differential with endpoint |
| 9 | momentum. The stable neighborhood and the actual bijective exponential |
| 10 | differential identify every horizontal reduced-length derivative. |
| 11 | Morgan-Tian Lemma 6.22, Corollary 6.29 and Lemma 6.49, pp. 115-118, 131. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Set Filter |
| 17 | open scoped Manifold ContDiff Bundle Topology |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.M14 |
| 22 | |
| 23 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 24 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 25 | {T : ℝ} {x : G.Point} |
| 26 | |
| 27 | private theorem horizontal_t2Space : T2Space (G.Horizontal x) := |
| 28 | FiberBundle.t2Space (EuclideanSpace ℝ (Fin n)) G.Horizontal x |
| 29 | |
| 30 | attribute [local instance] horizontal_t2Space |
| 31 | |
| 32 | /-- Every actual minimizing exponential path gives its raw spacetime |
| 33 | reduced length by normalized action, Definition 6.45, p. 129. -/ |
| 34 | theorem reducedLengthAt_eq_normalized_action (E : M14ExponentialFamily G T x) |
| 35 | {Z : G.Horizontal x} {s : ℝ} (hs : (Z, s) ∈ E.domain) (hpos : 0 < s) |
| 36 | (hmin : M14IsMinimizing (E.path Z s hs hpos)) : |
| 37 | M14ReducedLengthAt G T 0 x (E.gamma Z s) = E.action Z s / (2 * s) := by |
| 38 | unfold M14ReducedLengthAt |
| 39 | rw [E.clock Z s hs, sub_sub_cancel, ← E.reduced_length_global_eq Z s hs hpos hmin, |
| 40 | E.reduced_length_eq Z s hs hpos] |
| 41 | |
| 42 | set_option backward.isDefEq.respectTransparency false in |
| 43 | -- The source self-model tangent is the actual metric-normed horizontal fiber. |
| 44 | /-- The actual horizontal differential of regular reduced length is |
| 45 | the terminal square-velocity pairing divided by 2s, Corollary 6.29 and |
| 46 | Lemma 6.49, pp. 118, 131. -/ |
| 47 | theorem reducedLengthAt_horizontal_differential |
| 48 | (hCoordinates : M12MetricPredecessors.{0} n) |
| 49 | (hM04 : RicciFlowCurvatureTheory.{0}) (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 50 | (E : M14ExponentialFamily G T x) {Z : G.Horizontal x} {s : ℝ} |
| 51 | (hs : (Z, s) ∈ E.domain) (hpos : 0 < s) (hz : (Z, s) ∈ M14JointDomain G E) |
| 52 | (hpoint : (E.square_path Z s hs hpos).curve s = E.gamma Z s) |
| 53 | (V : G.Horizontal (E.gamma Z s)) : |
| 54 | mvfderiv (spacetimeModel n) (M14ReducedLengthAt G T 0 x) (E.gamma Z s) V.val = |
| 55 | G.spacetime.horizontalMetric.inner (E.gamma Z s) |
| 56 | (hpoint ▸ (E.square_path Z s hs hpos).horizontal_velocity s) V / (2 * s) := by |
| 57 | let metric := G.spacetime.horizontalMetric.toRiemannianMetric |
| 58 | let : NormedAddCommGroup (G.Horizontal x) := |
| 59 | (metric.toCore x).toNormedAddCommGroupOfTopology |
| 60 | (metric.continuousAt x) (metric.isVonNBounded x) |
| 61 | let : InnerProductSpace ℝ (G.Horizontal x) := |
| 62 | .ofCoreOfTopology (metric.toCore x) (metric.continuousAt x) (metric.isVonNBounded x) |
| 63 | let : Bundle.RiemannianBundle (G.Horizontal : G.Point → Type _) := ⟨metric⟩ |
| 64 | obtain ⟨H, hZH⟩ := jointDomain_stableSet E hz |
| 65 | have hbij : Function.Bijective (E.differential Z s hs) := by |
| 66 | have hstable := (H.carrier_exact Z).mp hZH |
| 67 | unfold M14StableInitialVector at hstable |
| 68 | rw [Real.sqrt_sq hpos.le] at hstable |
| 69 | exact hstable.choose_spec.1 |
| 70 | obtain ⟨W, hWV⟩ := hbij.2 V |
| 71 | have hline : HasDerivAt (fun r : ℝ => Z + r • W) W 0 := by |
| 72 | simpa only [id_eq, one_smul] using ((hasDerivAt_id (0 : ℝ)).smul_const W).const_add Z |
| 73 | have hzero : Z + (0 : ℝ) • W = Z := by simp only [zero_smul, add_zero] |
| 74 | have hnear : (fun r : ℝ => M14ReducedLengthAt G T 0 x (E.gamma (Z + r • W) s)) |
| 75 | =ᶠ[𝓝 0] (fun r => E.action (Z + r • W) s / (2 * s)) := by |
| 76 | have hU : H.carrier ∈ 𝓝 (Z + (0 : ℝ) • W) := hzero.symm ▸ H.carrier_open.mem_nhds hZH |
| 77 | filter_upwards [hline.continuousAt.preimage_mem_nhds hU] with r hr |
| 78 | have hsurv : (Z + r • W, s) ∈ E.domain := by |
| 79 | simpa only [Real.sqrt_sq hpos.le] using H.survivor _ hr |
| 80 | have hbranch := stableInitialVector_unique_branch E ((H.carrier_exact _).mp hr) |
| 81 | exact reducedLengthAt_eq_normalized_action E hsurv hpos |
| 82 | (exponentialPath_minimizing_of_uniqueBranch E hpos hsurv hbranch) |
| 83 | have hq : E.gamma Z s ∈ range (fun z : M14JointDomain G E => E.gamma z.1.1 z.1.2) := |
| 84 | ⟨⟨(Z, s), hz⟩, rfl⟩ |
| 85 | have hl := ((reducedLengthAt_contMDiffOn_jointImage hM04 hM12 E) _ hq).contMDiffAt |
| 86 | ((jointMap_range_isOpen E).mem_nhds hq) |
| 87 | have hgamma := (exponentialFamily_gamma_slice_contMDiffAt E hs).mdifferentiableAt (by simp) |
| 88 | have hcomp := ((hl.mdifferentiableAt (by simp)).hasMFDerivAt.comp Z hgamma.hasMFDerivAt) |
| 89 | have hactual := hcomp.hasFDerivAt.comp_hasDerivAt_of_eq 0 hline hzero.symm |
| 90 | change HasDerivAt (fun r : ℝ => M14ReducedLengthAt G T 0 x (E.gamma (Z + r • W) s)) |
| 91 | (mvfderiv (spacetimeModel n) (M14ReducedLengthAt G T 0 x) (E.gamma Z s) |
| 92 | (M14InitialVectorDerivative G E.gamma s Z W)) 0 at hactual |
| 93 | rw [← E.differential_pointwise_mfderiv Z s hs W, hWV] at hactual |
| 94 | have ha := exponentialFamily_action_differential hCoordinates hM04 hM12 E Z s hs hpos |
| 95 | have haction := ha.1.hasMFDerivAt.hasFDerivAt.comp_hasDerivAt_of_eq 0 hline hzero.symm |
| 96 | have heq := hactual.unique ((haction.div_const (2 * s)).congr_of_eventuallyEq hnear) |
| 97 | obtain ⟨_, hpair⟩ := ha.2 W |
| 98 | have hp := hpair.trans (congrArg (G.spacetime.horizontalMetric.inner (E.gamma Z s) |
| 99 | (hpoint ▸ (E.square_path Z s hs hpos).horizontal_velocity s)) hWV) |
| 100 | exact heq.trans (congrArg (fun r : ℝ => r / (2 * s)) hp) |
| 101 | |
| 102 | end PoincareMT.M14 |