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.ReducedLength.Tensor.FixedChartTensor |
| 2 | |
| 3 | /-! |
| 4 | # The scalar Hessian throughout a fixed chart |
| 5 | |
| 6 | The derivative of the frozen extension's coordinate vector cancels |
| 7 | from the actual scalar Hessian, leaving the coordinate second derivative. |
| 8 | -/ |
| 9 | |
| 10 | set_option autoImplicit false |
| 11 | set_option maxSynthPendingDepth 3 |
| 12 | |
| 13 | open scoped Manifold ContDiff Bundle Topology |
| 14 | open Filter |
| 15 | |
| 16 | universe u |
| 17 | |
| 18 | namespace PoincareMT.ReducedLength |
| 19 | |
| 20 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 21 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 22 | [IsManifold (𝓡 n) ∞ M] |
| 23 | |
| 24 | local notation "E" => EuclideanSpace ℝ (Fin n) |
| 25 | |
| 26 | theorem mvfderiv_chartVectorField_normed |
| 27 | {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] |
| 28 | (p : M) (f : M → V) (y u : E) (hy : y ∈ (chartAt E p).target) |
| 29 | (hf : MDifferentiableAt (𝓡 n) (𝓘(ℝ, V)) f ((chartAt E p).symm y)) : |
| 30 | mvfderiv (𝓡 n) f ((chartAt E p).symm y) |
| 31 | (chartVectorField p u ((chartAt E p).symm y)) = |
| 32 | fderiv ℝ (fun z ↦ f ((chartAt E p).symm z)) y u := by |
| 33 | rw [chartVectorField_at_inverse p u y hy] |
| 34 | have h := mfderiv_comp y hf |
| 35 | ((mdifferentiable_chart (I := 𝓡 n) p).mdifferentiableAt_symm hy) |
| 36 | rw [mfderiv_eq_fderiv] at h |
| 37 | exact (congrArg (fun L ↦ L u) h).symm |
| 38 | |
| 39 | set_option maxHeartbeats 1000000 in |
| 40 | -- The actual frozen extension and both differentiated scalar germs share one chart. |
| 41 | set_option backward.isDefEq.respectTransparency false in |
| 42 | theorem hessian_fixedChart {g : RiemannianMetric n M} (D : LeviCivitaData g) |
| 43 | (f : M → ℝ) (p q : M) (hq : q ∈ (chartAt E p).source) |
| 44 | (hf : ContMDiffOn (𝓡 n) (𝓘(ℝ, ℝ)) ∞ f (chartAt E p).source) |
| 45 | (u v : E) (A : E →L[ℝ] E) |
| 46 | (hA : ∀ w : E, D.connection (chartVectorField p w) q (chartVectorField p u q) = |
| 47 | chartVectorField p (A w) q) : |
| 48 | let φ : E → ℝ := fun y ↦ f ((chartAt E p).symm y) |
| 49 | D.hessian f q (chartVectorField p u q) (chartVectorField p v q) = |
| 50 | fderiv ℝ (fderiv ℝ φ) ((chartAt E p) q) u v - |
| 51 | fderiv ℝ φ ((chartAt E p) q) (A v) := by |
| 52 | dsimp only |
| 53 | let e := chartAt E p |
| 54 | let φ : E → ℝ := fun y ↦ f (e.symm y) |
| 55 | let P : M → E →L[ℝ] ℝ := fun x ↦ fderiv ℝ φ (e x) |
| 56 | let X := chartVectorField p u q |
| 57 | let V := chartVectorField p v q |
| 58 | let c := frozenChartCoordinates p q V |
| 59 | have hφ : ContDiffOn ℝ ∞ φ e.target := |
| 60 | (hf.comp contMDiffOn_chart_symm (fun y hy ↦ e.map_target hy)).contDiffOn |
| 61 | have hDφ := hφ.fderiv_of_isOpen e.open_target (m := ∞) (by simp) |
| 62 | have hP : ContMDiffOn (𝓡 n) (𝓘(ℝ, E →L[ℝ] ℝ)) ∞ P e.source := |
| 63 | hDφ.contMDiffOn.comp contMDiffOn_chart (fun x hx ↦ e.map_source hx) |
| 64 | have hPd := (hP.contMDiffAt (e.open_source.mem_nhds hq)).mdifferentiableAt (by simp) |
| 65 | have hcd := (frozenChartCoordinates_contMDiffAt p q hq V).mdifferentiableAt (by simp) |
| 66 | have hcv : c q = v := frozenChartCoordinates_at_base p q hq v |
| 67 | have hfirst (x : M) (hx : x ∈ e.source) (w : E) : |
| 68 | mvfderiv (𝓡 n) f x (chartVectorField p w x) = P x w := by |
| 69 | have hfx : MDifferentiableAt (𝓡 n) (𝓘(ℝ, ℝ)) f (e.symm (e x)) := by |
| 70 | rw [e.left_inv hx] |
| 71 | exact (hf.contMDiffAt (e.open_source.mem_nhds hx)).mdifferentiableAt (by simp) |
| 72 | have h := mvfderiv_chartVectorField_normed p f (e x) w (e.map_source hx) hfx |
| 73 | rwa [e.left_inv hx] at h |
| 74 | have heq : (fun x ↦ mvfderiv (𝓡 n) f x (FiberBundle.extend E V x)) =ᶠ[𝓝 q] |
| 75 | (fun x ↦ P x (c x)) := by |
| 76 | filter_upwards [e.open_source.mem_nhds hq] with x hx |
| 77 | rw [← frozenChartCoordinates_reconstruct p q x V hx] |
| 78 | exact hfirst x hx (c x) |
| 79 | have hder : mvfderiv (𝓡 n) |
| 80 | (fun x ↦ mvfderiv (𝓡 n) f x (FiberBundle.extend E V x)) q X = |
| 81 | P q (mvfderiv (𝓡 n) c q X) + mvfderiv (𝓡 n) P q X v := by |
| 82 | rw [mvfderiv, heq.mfderiv_eq] |
| 83 | change mvfderiv (𝓡 n) (fun x ↦ P x (c x)) q X = _ |
| 84 | rw [mvfderiv_clm_application P c q hPd hcd X, hcv] |
| 85 | have hPder : mvfderiv (𝓡 n) P q X = fderiv ℝ (fderiv ℝ φ) (e q) u := by |
| 86 | have hPd' : MDifferentiableAt (𝓡 n) (𝓘(ℝ, E →L[ℝ] ℝ)) P (e.symm (e q)) := by |
| 87 | rwa [e.left_inv hq] |
| 88 | have h := mvfderiv_chartVectorField_normed p P (e q) u (e.map_source hq) hPd' |
| 89 | rw [e.left_inv hq] at h |
| 90 | have hgerm : (fun y ↦ P (e.symm y)) =ᶠ[𝓝 (e q)] fderiv ℝ φ := by |
| 91 | filter_upwards [e.open_target.mem_nhds (e.map_source hq)] with y hy |
| 92 | exact congrArg (fderiv ℝ φ) (e.right_inv hy) |
| 93 | exact h.trans (congrArg (fun L : E →L[ℝ] E →L[ℝ] ℝ ↦ L u) |
| 94 | (hgerm.fderiv_eq (𝕜 := ℝ))) |
| 95 | change mvfderiv (𝓡 n) |
| 96 | (fun x ↦ mvfderiv (𝓡 n) f x (FiberBundle.extend E V x)) q |
| 97 | (FiberBundle.extend E X q) - |
| 98 | mvfderiv (𝓡 n) f q (D.connection (FiberBundle.extend E V) |
| 99 | q (FiberBundle.extend E X q)) = _ |
| 100 | rw [FiberBundle.extend_apply_self, hder, |
| 101 | connection_frozenChartCoordinates D p q hq X A hA v, hfirst q hq, map_add, hPder] |
| 102 | ring |
| 103 | |
| 104 | end PoincareMT.ReducedLength |