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.Rigidity.Exponential.PullbackMetric |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedVolume.Measure.Calibration.Calibration |
| 3 | import Mathlib.Analysis.InnerProductSpace.NormDet |
| 4 | |
| 5 | /-! |
| 6 | # The genuine pullback Jacobian |
| 7 | |
| 8 | The Gram determinant of the actual pulled-back metric gives the norm |
| 9 | determinant of the actual differential. It is continuous for a C1 map, |
| 10 | positive at noncritical points, and agrees with linear volume scaling. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set Filter MeasureTheory |
| 16 | open scoped Manifold ContDiff Bundle Topology ENNReal |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT.ReducedVolume |
| 21 | |
| 22 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 23 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 24 | |
| 25 | /-- The square-root Gram determinant of the genuine selected pullback metric. -/ |
| 26 | noncomputable def pullbackJacobian (g : RiemannianMetric n M) |
| 27 | (f : EuclideanSpace ℝ (Fin n) → M) (x : EuclideanSpace ℝ (Fin n)) : ℝ := |
| 28 | Real.sqrt (Matrix.det (fun i j : Fin n ↦ pullbackMetricForm g f x |
| 29 | (EuclideanSpace.basisFun (Fin n) ℝ i) (EuclideanSpace.basisFun (Fin n) ℝ j))) |
| 30 | |
| 31 | set_option backward.isDefEq.respectTransparency false in |
| 32 | /-- The Gram formula agrees with the norm determinant for the actual selected metric. -/ |
| 33 | theorem pullbackJacobian_eq_normDet (g : RiemannianMetric n M) |
| 34 | (f : EuclideanSpace ℝ (Fin n) → M) (x : EuclideanSpace ℝ (Fin n)) : |
| 35 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 36 | ⟨g.toRiemannianMetric⟩ |
| 37 | pullbackJacobian g f x = LinearMap.normDet |
| 38 | (U := EuclideanSpace ℝ (Fin n)) (V := TangentSpace (𝓡 n) (f x)) |
| 39 | (mfderiv (𝓡 n) (𝓡 n) f x).toLinearMap := by |
| 40 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 41 | ⟨g.toRiemannianMetric⟩ |
| 42 | let D : EuclideanSpace ℝ (Fin n) →ₗ[ℝ] TangentSpace (𝓡 n) (f x) := |
| 43 | (mfderiv (𝓡 n) (𝓡 n) f x).toLinearMap |
| 44 | have hsq := D.normDet_sq_eq_det_gram (EuclideanSpace.basisFun (Fin n) ℝ) |
| 45 | rw [RCLike.ofReal_real_eq_id, id_eq] at hsq |
| 46 | change Real.sqrt (Matrix.gram ℝ (fun i ↦ D (EuclideanSpace.basisFun (Fin n) ℝ i))).det = |
| 47 | D.normDet |
| 48 | rw [← hsq, Real.sqrt_sq D.normDet_nonneg] |
| 49 | |
| 50 | /-- The actual Jacobian is always nonnegative, including at critical points. -/ |
| 51 | theorem pullbackJacobian_nonneg (g : RiemannianMetric n M) |
| 52 | (f : EuclideanSpace ℝ (Fin n) → M) (x : EuclideanSpace ℝ (Fin n)) : |
| 53 | 0 ≤ pullbackJacobian g f x := Real.sqrt_nonneg _ |
| 54 | |
| 55 | set_option backward.isDefEq.respectTransparency false in |
| 56 | /-- An injective actual differential gives a strictly positive Jacobian. -/ |
| 57 | theorem pullbackJacobian_pos (g : RiemannianMetric n M) |
| 58 | {f : EuclideanSpace ℝ (Fin n) → M} {x : EuclideanSpace ℝ (Fin n)} |
| 59 | (hD : Function.Injective (mfderiv (𝓡 n) (𝓡 n) f x)) : |
| 60 | 0 < pullbackJacobian g f x := by |
| 61 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 62 | ⟨g.toRiemannianMetric⟩ |
| 63 | rw [pullbackJacobian_eq_normDet] |
| 64 | let D : EuclideanSpace ℝ (Fin n) →ₗ[ℝ] TangentSpace (𝓡 n) (f x) := |
| 65 | (mfderiv (𝓡 n) (𝓡 n) f x).toLinearMap |
| 66 | change 0 < D.normDet |
| 67 | refine lt_of_le_of_ne D.normDet_nonneg ?_ |
| 68 | exact Ne.symm (fun h ↦ LinearMap.normDet_eq_zero_iff_ker_ne_bot.mp h |
| 69 | (LinearMap.ker_eq_bot.mpr hD)) |
| 70 | |
| 71 | /-- The actual Gram Jacobian is continuous at every C1 germ. -/ |
| 72 | theorem pullbackJacobian_continuousAt (g : RiemannianMetric n M) |
| 73 | {f : EuclideanSpace ℝ (Fin n) → M} {x : EuclideanSpace ℝ (Fin n)} |
| 74 | (hf : ContMDiffAt (𝓡 n) (𝓡 n) 1 f x) : |
| 75 | ContinuousAt (pullbackJacobian g f) x := by |
| 76 | have hB := pullbackMetricForm_continuousAt g hf |
| 77 | have hmatrix : ContinuousAt (fun y ↦ (fun i j : Fin n ↦ pullbackMetricForm g f y |
| 78 | (EuclideanSpace.basisFun (Fin n) ℝ i) (EuclideanSpace.basisFun (Fin n) ℝ j))) x := |
| 79 | continuousAt_pi.mpr fun _ ↦ continuousAt_pi.mpr fun _ ↦ |
| 80 | (hB.clm_apply continuousAt_const).clm_apply continuousAt_const |
| 81 | exact Real.continuous_sqrt.continuousAt.comp |
| 82 | (continuous_id.matrix_det.continuousAt.comp hmatrix) |
| 83 | |
| 84 | /-- A positive actual Jacobian varies by an arbitrarily small multiplicative factor locally. -/ |
| 85 | theorem eventually_pullbackJacobian_comparison (g : RiemannianMetric n M) |
| 86 | {f : EuclideanSpace ℝ (Fin n) → M} {x : EuclideanSpace ℝ (Fin n)} |
| 87 | (hf : ContMDiffAt (𝓡 n) (𝓡 n) 1 f x) |
| 88 | (hD : Function.Injective (mfderiv (𝓡 n) (𝓡 n) f x)) |
| 89 | {r : ℝ} (hr : 1 < r) : |
| 90 | ∀ᶠ y in 𝓝 x, pullbackJacobian g f x / r ≤ pullbackJacobian g f y ∧ |
| 91 | pullbackJacobian g f y ≤ r * pullbackJacobian g f x := by |
| 92 | have hJ := pullbackJacobian_pos g hD |
| 93 | have hlo : pullbackJacobian g f x / r < pullbackJacobian g f x := |
| 94 | (div_lt_self hJ hr).trans_le le_rfl |
| 95 | have hhi : pullbackJacobian g f x < r * pullbackJacobian g f x := by nlinarith |
| 96 | have hcont := pullbackJacobian_continuousAt g hf |
| 97 | filter_upwards [hcont (eventually_gt_nhds hlo), hcont (eventually_lt_nhds hhi)] |
| 98 | with y hylo hyhi |
| 99 | exact ⟨hylo.le, hyhi.le⟩ |
| 100 | |
| 101 | /-- Linear Euclidean volume scaling uses the same norm determinant and calibration. -/ |
| 102 | theorem volume_linear_image_eq_normDet_mul |
| 103 | (L : EuclideanSpace ℝ (Fin n) →ₗ[ℝ] EuclideanSpace ℝ (Fin n)) |
| 104 | (A : Set (EuclideanSpace ℝ (Fin n))) : |
| 105 | volume (L '' A) = ENNReal.ofReal L.normDet * volume A := by |
| 106 | have hH := L.hausdorffMeasure_image A |
| 107 | simp only [finrank_euclideanSpace, Fintype.card_fin] at hH |
| 108 | rw [← euclideanVolumeCalibration_smul_hausdorff n, |
| 109 | Measure.smul_apply, Measure.smul_apply, smul_eq_mul, smul_eq_mul, hH] |
| 110 | exact mul_left_comm _ _ _ |
| 111 | |
| 112 | end PoincareMT.ReducedVolume |