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.Metric.Coordinates.ChartMetricSmooth |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedVolume.Exponential.Jacobian.DeterminantCalculus |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedVolume.Metric.Coordinates.MetricCoordinates |
| 4 | |
| 5 | /-! |
| 6 | # Smooth genuine Gram density and a frozen orthonormal normalization |
| 7 | |
| 8 | Positivity of the actual inverse-chart differential gives a positive |
| 9 | Gram determinant. Smooth determinant and square-root calculus then |
| 10 | apply to the genuine volume density. A source normalization is chosen |
| 11 | once at the evaluation point and kept fixed for differentiation. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Set |
| 17 | open scoped Manifold ContDiff Bundle |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.ReducedVolume |
| 22 | |
| 23 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 24 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 25 | |
| 26 | /-- Smoothness of the actual pullback form gives smoothness of its positive Gram density. -/ |
| 27 | theorem pullbackJacobian_contDiffAt_of_form (g : RiemannianMetric n M) |
| 28 | {f : EuclideanSpace ℝ (Fin n) → M} {y : EuclideanSpace ℝ (Fin n)} {k : ℕ∞ω} |
| 29 | (hB : ContDiffAt ℝ k (pullbackMetricForm g f) y) |
| 30 | (hD : Function.Injective (mfderiv (𝓡 n) (𝓡 n) f y)) : |
| 31 | ContDiffAt ℝ k (pullbackJacobian g f) y := by |
| 32 | let A := fun z ↦ (fun i j : Fin n ↦ pullbackMetricForm g f z |
| 33 | (EuclideanSpace.basisFun (Fin n) ℝ i) (EuclideanSpace.basisFun (Fin n) ℝ j)) |
| 34 | have hA : ContDiffAt ℝ k A y := |
| 35 | contDiffAt_pi.mpr (fun _ ↦ contDiffAt_pi.mpr (fun _ ↦ |
| 36 | (hB.clm_apply contDiffAt_const).clm_apply contDiffAt_const)) |
| 37 | have hdet : ContDiffAt ℝ k (fun z ↦ Matrix.det (A z)) y := by |
| 38 | have h := (continuousRowDeterminant (ι := Fin n)).contDiff.contDiffAt.comp y hA |
| 39 | apply h.congr_of_eventuallyEq |
| 40 | exact Filter.Eventually.of_forall (fun z ↦ (continuousRowDeterminant_apply (A z)).symm) |
| 41 | have hpos : 0 < Matrix.det (A y) := Real.sqrt_pos.mp (pullbackJacobian_pos g hD) |
| 42 | exact hdet.sqrt hpos.ne' |
| 43 | |
| 44 | set_option backward.isDefEq.respectTransparency false in |
| 45 | /-- The actual inverse-chart Gram density is smooth throughout the chart target. -/ |
| 46 | theorem chartJacobian_contDiffOn (g : RiemannianMetric n M) (q₀ : M) : |
| 47 | ContDiffOn ℝ ∞ (pullbackJacobian g (extChartAt (𝓡 n) q₀).symm) |
| 48 | (extChartAt (𝓡 n) q₀).target := by |
| 49 | intro y hy |
| 50 | apply ContDiffAt.contDiffWithinAt |
| 51 | apply pullbackJacobian_contDiffAt_of_form g |
| 52 | ((chartMetricForm_contDiffOn g q₀).contDiffAt |
| 53 | ((isOpen_extChartAt_target (I := 𝓡 n) q₀).mem_nhds hy)) |
| 54 | obtain ⟨L, hL⟩ := inverseChart_mfderiv_isInvertible q₀ hy |
| 55 | rw [← hL] |
| 56 | exact L.injective |
| 57 | |
| 58 | set_option backward.isDefEq.respectTransparency false in |
| 59 | /-- One fixed source equivalence makes the actual differential orthonormal at the chosen point. -/ |
| 60 | theorem exists_pullback_source_normalization (g : RiemannianMetric n M) |
| 61 | {f : EuclideanSpace ℝ (Fin n) → M} {y : EuclideanSpace ℝ (Fin n)} |
| 62 | (hD : (mfderiv (𝓡 n) (𝓡 n) f y).IsInvertible) : |
| 63 | ∃ C : EuclideanSpace ℝ (Fin n) ≃L[ℝ] EuclideanSpace ℝ (Fin n), |
| 64 | ∀ v, mfderiv (𝓡 n) (𝓡 n) f y (C v) = metricCoordinates g (f y) v := by |
| 65 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 66 | ⟨g.toRiemannianMetric⟩ |
| 67 | obtain ⟨L, hL⟩ := hD |
| 68 | refine ⟨(metricCoordinates g (f y)).toContinuousLinearEquiv.trans L.symm, ?_⟩ |
| 69 | intro v |
| 70 | rw [← hL] |
| 71 | exact L.apply_symm_apply _ |
| 72 | |
| 73 | end PoincareMT.ReducedVolume |