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.ReducedVolume.Exponential.Jacobian.EndpointGram |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedVolume.Exponential.Coordinates.ExponentialDifferential |
| 3 | |
| 4 | /-! |
| 5 | # The actual diagonal Gram evolution at every source direction |
| 6 | |
| 7 | The preferred endpoint chart identifies the actual pullback pairing with |
| 8 | the previously differentiated endpoint Gram expression. This scalar form |
| 9 | keeps an arbitrary source direction, including in dimension zero. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Set Filter |
| 15 | open scoped Manifold ContDiff Bundle Topology |
| 16 | |
| 17 | universe u |
| 18 | |
| 19 | namespace PoincareMT.ReducedVolume |
| 20 | |
| 21 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 22 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 23 | [ConnectedSpace M] {J : Set ℝ} {F : RicciFlow n M J} {T τmax : ℝ} {p : M} |
| 24 | |
| 25 | set_option backward.isDefEq.respectTransparency false in |
| 26 | /-- Every actual diagonal source pairing evolves by twice Ricci plus twice the Hessian. -/ |
| 27 | theorem exponential_diagonal_hasDerivAt |
| 28 | (hwindow : Icc (T - τmax) T ⊆ J) (hL : LGeodesicTheory F T τmax) |
| 29 | (G : LExponentialGeometry F T τmax p) (x v : EuclideanSpace ℝ (Fin n)) {τ : ℝ} |
| 30 | (hreg : (metricCoordinates (F.metric T) p x, τ) ∈ G.toLExponentialFamily.regularDomain) : |
| 31 | let q := G.gamma (metricCoordinates (F.metric T) p x) τ |
| 32 | let V := G.toLExponentialFamily.sliceDifferential (metricCoordinates (F.metric T) p x) τ |
| 33 | (metricCoordinates (F.metric T) p v) |
| 34 | HasDerivAt (fun s ↦ |
| 35 | pullbackMetricForm (F.metric (T - s)) (exponentialSliceChart G s) x v v) |
| 36 | (2 * (F.connection (T - τ)).ricci q V V + |
| 37 | 2 * (F.connection (T - τ)).hessian (fun y ↦ reducedLength F T p y τ) q V V) τ := by |
| 38 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 39 | ⟨(F.metric T).toRiemannianMetric⟩ |
| 40 | let β := metricCoordinates (F.metric T) p |
| 41 | let z := (β x, τ) |
| 42 | let q := G.gamma z.1 z.2 |
| 43 | let E := endpointCoordinates G q |
| 44 | let B := coordinateBackwardMetric F T q |
| 45 | obtain ⟨hτ, hmax, _, _⟩ := hreg.1 |
| 46 | have hz : z ∈ univ ×ˢ Ioo 0 τmax := ⟨mem_univ _, hτ, hmax⟩ |
| 47 | have hq : G.gamma z.1 z.2 ∈ (chartAt (EuclideanSpace ℝ (Fin n)) q).source := |
| 48 | mem_chart_source _ _ |
| 49 | have hγ := G.gamma_smooth.contMDiffAt ((isOpen_univ.prod isOpen_Ioo).mem_nhds hz) |
| 50 | have hc : ContinuousAt (fun s ↦ G.gamma (β x) s) τ := |
| 51 | hγ.continuousAt.comp (continuousAt_const.prodMk continuousAt_id) |
| 52 | have hcoords : (fun s ↦ |
| 53 | pullbackMetricForm (F.metric (T - s)) (exponentialSliceChart G s) x v v) =ᶠ[𝓝 τ] |
| 54 | (fun s ↦ B (E (z.1, s), s) |
| 55 | (fderiv ℝ E (z.1, s) (β v, 0)) (fderiv ℝ E (z.1, s) (β v, 0))) := by |
| 56 | filter_upwards [isOpen_Ioo.mem_nhds ⟨hτ, hmax⟩, |
| 57 | hc ((chartAt (EuclideanSpace ℝ (Fin n)) q).open_source.mem_nhds hq)] |
| 58 | with s hs hqs |
| 59 | exact exponentialSlice_pullbackMetric_eq G hs.1 hs.2 x q hqs v v |
| 60 | have hd := (endpoint_gram_diagonal_hasDerivAt hwindow hL G z hreg (β v)).congr_of_eventuallyEq |
| 61 | hcoords |
| 62 | have hv : fderiv ℝ E z (β v, 0) = G.toLExponentialFamily.sliceDifferential z.1 τ (β v) := by |
| 63 | rw [endpointCoordinates_horizontal G q z hz hq, |
| 64 | TangentBundle.continuousLinearMapAt_trivializationAt hq, mfderiv_extChartAt_self] |
| 65 | rfl |
| 66 | change HasDerivAt _ |
| 67 | (2 * (F.connection (T - τ)).ricci q (fderiv ℝ E z (β v, 0)) (fderiv ℝ E z (β v, 0)) + |
| 68 | 2 * (F.connection (T - τ)).hessian (fun y ↦ reducedLength F T p y τ) q |
| 69 | (fderiv ℝ E z (β v, 0)) (fderiv ℝ E z (β v, 0))) τ at hd |
| 70 | rw [hv] at hd |
| 71 | exact hd |
| 72 | |
| 73 | end PoincareMT.ReducedVolume |