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.Variation.IndexForm.IndexPair |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.IndexForm.IndexContinuity |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Coordinates.MovingMetric |
| 4 | |
| 5 | /-! |
| 6 | # Green's identity for the actual horizontal index form |
| 7 | |
| 8 | Morgan-Tian Proposition 6.13 and Lemma 6.14, pp. 110-112. The |
| 9 | moving metric product rule integrates to the actual paired index |
| 10 | identity with its endpoint term. Smoothness within the closed interval |
| 11 | establishes integrability before applying the fundamental theorem. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Set Filter Topology MeasureTheory |
| 17 | open scoped Manifold ContDiff Bundle intervalIntegral |
| 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 y : G.Point} {p : M14BackwardPath G T τ₁ τ₂ x y} |
| 26 | (R : M14SquareRootPath G p) |
| 27 | (Q : M14JacobiFieldData G R.curve (M14SqrtParameterInterval τ₁ τ₂)) |
| 28 | {Z : ∀ s, G.Horizontal (R.curve s)} |
| 29 | (EZ : M14PullbackExtension G R.curve (M14SqrtParameterInterval τ₁ τ₂) Z) |
| 30 | |
| 31 | include EZ |
| 32 | |
| 33 | /-- The actual index boundary pair is smooth on the full closed |
| 34 | interval, Proposition 6.13 and Lemma 6.14, pp. 110-112. -/ |
| 35 | theorem pullbackIndexBoundaryPair_contDiffOn : |
| 36 | ContDiffOn ℝ ∞ (pullbackIndexBoundaryPair R Q.extension Z) |
| 37 | (M14SqrtParameterInterval τ₁ τ₂) := by |
| 38 | intro s hs |
| 39 | have hR := R.smooth.mono R.interval_subset |
| 40 | have hpair := pullbackExtensions_metric_pair_contMDiffAt Q.derivative_extension EZ hs |
| 41 | have h := hpair.comp_contMDiffWithinAt s (contMDiffWithinAt_id.prodMk (hR s hs)) |
| 42 | apply h.contDiffWithinAt.congr_of_mem _ hs |
| 43 | intro r hr |
| 44 | dsimp only [Function.comp_def, id_eq] |
| 45 | rw [Q.derivative_extension.agrees r hr, EZ.agrees r hr] |
| 46 | rfl |
| 47 | |
| 48 | /-- The corrected Jacobi residual against any actual smooth test |
| 49 | field is smooth at both closed endpoints, Proposition 6.13 and |
| 50 | Lemma 6.14, pp. 110-112. -/ |
| 51 | theorem jacobiResidual_contDiffOn |
| 52 | (hM04 : RicciFlowCurvatureTheory.{0}) (hM12 : GeneralizedRicciGaugeTheory.{u} n) : |
| 53 | ContDiffOn ℝ ∞ (fun s => M14JacobiResidual G R Q s (Z s)) |
| 54 | (M14SqrtParameterInterval τ₁ τ₂) := by |
| 55 | have hR := R.smooth.mono R.interval_subset |
| 56 | have hCoordinates := hM12.coordinate_gauges X time I G.spacetime G.slices |
| 57 | G.timeIntervals G.gaugeCover G.leafwise |
| 58 | exact horizontalJacobiPairResidual_contDiffOn R hM04 hM12 |
| 59 | (pullbackExtension_field_contMDiffOn Q.extension hR) |
| 60 | (pullbackExtension_field_contMDiffOn Q.derivative_extension hR) |
| 61 | (horizontalCovariantDerivative_contMDiffOn R hCoordinates Q.derivative_extension) |
| 62 | (pullbackExtension_field_contMDiffOn EZ hR) |
| 63 | |
| 64 | /-- The derivative of the actual boundary pair is the paired index |
| 65 | density plus the corrected Jacobi residual at every closed point, |
| 66 | Lemma 6.14, pp. 110-112. -/ |
| 67 | theorem pullbackIndexBoundaryPair_hasDerivWithinAt {s : ℝ} |
| 68 | (hs : s ∈ M14SqrtParameterInterval τ₁ τ₂) : |
| 69 | HasDerivWithinAt (pullbackIndexBoundaryPair R Q.extension Z) |
| 70 | (pullbackIndexPairDensity R Q.extension EZ s + M14JacobiResidual G R Q s (Z s)) |
| 71 | (M14SqrtParameterInterval τ₁ τ₂) s := by |
| 72 | have hid : pullbackIndexPairDensity R Q.extension EZ s + |
| 73 | M14JacobiResidual G R Q s (Z s) = |
| 74 | G.spacetime.horizontalMetric.inner (R.curve s) (M14JacobiSecondDerivative Q s) (Z s) + |
| 75 | G.spacetime.horizontalMetric.inner (R.curve s) (M14JacobiFirstDerivative Q s) |
| 76 | (M14HorizontalCovariantDerivative G R.curve |
| 77 | (M14SqrtParameterInterval τ₁ τ₂) Z EZ s) + |
| 78 | 4 * s * horizontalRicci G.leafwise (R.curve s) (M14JacobiFirstDerivative Q s) (Z s) := |
| 79 | horizontalIndexPairDensity_green_value R s (Q.field s) (Z s) |
| 80 | (M14JacobiFirstDerivative Q s) _ (M14JacobiSecondDerivative Q s) |
| 81 | rw [hid] |
| 82 | exact squareRoot_covariantDerivative_metric_product R Q.derivative_extension EZ hs |
| 83 | |
| 84 | /-- The paired index density is smooth within the closed interval, |
| 85 | as the boundary derivative minus the actual Jacobi residual, |
| 86 | Proposition 6.13 and Lemma 6.14, pp. 110-112. -/ |
| 87 | theorem pullbackIndexPairDensity_contDiffOn |
| 88 | (hM04 : RicciFlowCurvatureTheory.{0}) (hM12 : GeneralizedRicciGaugeTheory.{u} n) : |
| 89 | ContDiffOn ℝ ∞ (pullbackIndexPairDensity R Q.extension EZ) |
| 90 | (M14SqrtParameterInterval τ₁ τ₂) := by |
| 91 | have hC := uniqueDiffOn_Icc (Real.sqrt_lt_sqrt p.tau_nonneg p.tau_lt) |
| 92 | have hB := pullbackIndexBoundaryPair_contDiffOn R Q EZ |
| 93 | have hJ := jacobiResidual_contDiffOn R Q EZ hM04 hM12 |
| 94 | apply ((hB.derivWithin hC (m := ∞) (by simp)).sub hJ).congr |
| 95 | intro s hs |
| 96 | have h := (pullbackIndexBoundaryPair_hasDerivWithinAt R Q EZ hs).derivWithin (hC s hs) |
| 97 | linarith |
| 98 | |
| 99 | /-- Green's identity for the actual paired index form, including |
| 100 | both endpoint terms and the corrected Jacobi residual, |
| 101 | Proposition 6.13 and Lemma 6.14, pp. 110-112. -/ |
| 102 | theorem integral_pullbackIndexPairDensity |
| 103 | (hM04 : RicciFlowCurvatureTheory.{0}) (hM12 : GeneralizedRicciGaugeTheory.{u} n) : |
| 104 | (∫ s in Real.sqrt τ₁..Real.sqrt τ₂, pullbackIndexPairDensity R Q.extension EZ s) = |
| 105 | pullbackIndexBoundaryPair R Q.extension Z (Real.sqrt τ₂) - |
| 106 | pullbackIndexBoundaryPair R Q.extension Z (Real.sqrt τ₁) - |
| 107 | ∫ s in Real.sqrt τ₁..Real.sqrt τ₂, M14JacobiResidual G R Q s (Z s) := by |
| 108 | have hab := Real.sqrt_lt_sqrt p.tau_nonneg p.tau_lt |
| 109 | have hB := pullbackIndexBoundaryPair_contDiffOn R Q EZ |
| 110 | have hI := (pullbackIndexPairDensity_contDiffOn R Q EZ |
| 111 | hM04 hM12).continuousOn.intervalIntegrable_of_Icc (μ := volume) hab.le |
| 112 | have hJ := (jacobiResidual_contDiffOn R Q EZ |
| 113 | hM04 hM12).continuousOn.intervalIntegrable_of_Icc (μ := volume) hab.le |
| 114 | have hFTC := intervalIntegral.integral_eq_sub_of_hasDerivAt_of_le hab.le hB.continuousOn |
| 115 | (fun s hs => (pullbackIndexBoundaryPair_hasDerivWithinAt R Q EZ |
| 116 | (Ioo_subset_Icc_self hs)).hasDerivAt (Icc_mem_nhds hs.1 hs.2)) (hI.add hJ) |
| 117 | rw [intervalIntegral.integral_add hI hJ] at hFTC |
| 118 | linarith |
| 119 | |
| 120 | end PoincareMT.M14 |