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.CurveShortening.Ramp.Polygon |
| 2 | import PoincareLib.Geometry.CurveShortening.Ramp.LocalFlow.Uniqueness.AmbientAcceleration |
| 3 | import PoincareLib.Geometry.CurveShortening.Ramp.Analysis.Smooth.RetractionDifferentials |
| 4 | import Mathlib.Geometry.Manifold.ContMDiffMFDeriv |
| 5 | |
| 6 | /-! |
| 7 | # Actual embedded initial jets of a continuous C2 family |
| 8 | |
| 9 | The actual tangent map and the spatial Hessian identity transfer the |
| 10 | frozen angular-jet hypotheses to ordinary Euclidean derivatives. |
| 11 | MT2007 Claim 19.1, p. 437, and Lemma 19.17, pp. 449-450; |
| 12 | `2026-09-22-continuous-dependence-embedded-initial-jets.md`. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | set_option backward.isDefEq.respectTransparency false |
| 17 | |
| 18 | open Set |
| 19 | open scoped Manifold ContDiff Bundle |
| 20 | |
| 21 | universe u v w |
| 22 | |
| 23 | namespace PoincareMT.M63 |
| 24 | |
| 25 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 26 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 27 | {ι : Type v} [Fintype ι] {Z : Type w} [TopologicalSpace Z] {a b : ℝ} |
| 28 | |
| 29 | local notation "W" => EuclideanSpace ℝ ι |
| 30 | |
| 31 | /-- Joint continuity of the actual angular jets gives continuity of |
| 32 | all three ordinary embedded C2 jets, including at stopped points. |
| 33 | MT2007 Claim 19.1, p. 437; embedded initial-family jets derivation. -/ |
| 34 | theorem continuous_embedded_initial_jets |
| 35 | (F : RicciFlow n M (Icc a b)) {tau : ℝ} (htau : tau ∈ Icc a b) |
| 36 | (gamma : Z → ℝ → M) |
| 37 | (hgamma : Continuous (fun z : Z × ℝ => gamma z.1 z.2)) |
| 38 | (hfirst : Continuous (fun z : Z × ℝ => |
| 39 | m63AngularFirstJet (n := n) (gamma z.1) z.2)) |
| 40 | (hsecond : Continuous (fun z : Z × ℝ => |
| 41 | m63AngularSecondJet (F.connection tau) (gamma z.1) z.2)) |
| 42 | (hC2 : ∀ z, ContMDiff 𝓘(ℝ, ℝ) (𝓡 n) 2 (gamma z)) |
| 43 | {e : M → W} (he : ContMDiff (𝓡 n) 𝓘(ℝ, W) ∞ e) |
| 44 | {U : Set W} (hU : IsOpen U) (heU : range e ⊆ U) {ρ : W → M} |
| 45 | (hρ : ContMDiffOn 𝓘(ℝ, W) (𝓡 n) ∞ ρ U) (hρe : ∀ p, ρ (e p) = p) : |
| 46 | (∀ z, ContDiff ℝ 2 (fun x => e (gamma z x))) ∧ |
| 47 | Continuous (fun z : Z × ℝ => e (gamma z.1 z.2)) ∧ |
| 48 | Continuous (fun z : Z × ℝ => deriv (fun y => e (gamma z.1 y)) z.2) ∧ |
| 49 | Continuous (fun z : Z × ℝ => deriv (deriv (fun y => e (gamma z.1 y))) z.2) := by |
| 50 | have hspace (z : Z) : ContDiff ℝ 2 (fun x => e (gamma z x)) := |
| 51 | ((he.of_le (ENat.natCast_le_of_coe_top_le_withTop le_rfl 2)).comp (hC2 z)).contDiff |
| 52 | have hderiv (z : Z) (x : ℝ) : HasDerivAt (fun y => e (gamma z y)) |
| 53 | (mfderiv (𝓡 n) 𝓘(ℝ, W) e (gamma z x) |
| 54 | (curveVelocity (n := n) (gamma z) x) : W) x := by |
| 55 | have hchain : fderiv ℝ (fun y => e (gamma z y)) x = |
| 56 | (mfderiv (𝓡 n) 𝓘(ℝ, W) e (gamma z x)).comp |
| 57 | (mfderiv 𝓘(ℝ, ℝ) (𝓡 n) (gamma z) x) := by |
| 58 | rw [← mfderiv_eq_fderiv] |
| 59 | exact mfderiv_comp x (he.mdifferentiable (by simp)).mdifferentiableAt |
| 60 | ((hC2 z x).mdifferentiableAt (by norm_num)) |
| 61 | exact ((hspace z).differentiable (by norm_num) x).hasDerivAt.congr_deriv |
| 62 | (congrArg (fun L : ℝ →L[ℝ] W => L 1) hchain) |
| 63 | have hpush : Continuous (fun p : TangentBundle (𝓡 n) M => |
| 64 | (mfderiv (𝓡 n) 𝓘(ℝ, W) e p.1 p.2 : W)) := |
| 65 | (contMDiff_snd_tangentBundle_modelSpace (n := ∞) W 𝓘(ℝ, W)).continuous.comp |
| 66 | (he.continuous_tangentMap (by simp)) |
| 67 | have hzero : Continuous (fun z : Z × ℝ => e (gamma z.1 z.2)) := |
| 68 | he.continuous.comp hgamma |
| 69 | have hfirstW : Continuous |
| 70 | (fun z : Z × ℝ => deriv (fun y => e (gamma z.1 y)) z.2) := |
| 71 | (hpush.comp hfirst).congr (fun z => (hderiv z.1 z.2).deriv.symm) |
| 72 | have hacc : Continuous (fun z : Z × ℝ => |
| 73 | (mfderiv (𝓡 n) 𝓘(ℝ, W) e (gamma z.1 z.2) |
| 74 | (rampHorizontalCovariantDerivative (F.connection tau) (gamma z.1) |
| 75 | (fun y => curveVelocity (n := n) (gamma z.1) y) z.2) : W)) := |
| 76 | hpush.comp hsecond |
| 77 | have hB : ContinuousOn |
| 78 | (fun z : (ℝ × W) × W => |
| 79 | (coordinateHessian (F.connection z.1.1) e (ρ z.1.2) |
| 80 | (mfderiv 𝓘(ℝ, W) (𝓡 n) ρ z.1.2 z.2) |
| 81 | (mfderiv 𝓘(ℝ, W) (𝓡 n) ρ z.1.2 z.2) : W)) |
| 82 | ((Icc a b ×ˢ U) ×ˢ univ) := |
| 83 | (flow_coordinateHessian_pullback_contDiffOn F he hU hρ).continuousOn |
| 84 | let coefficientInput : Z × ℝ → (ℝ × W) × W := fun z => |
| 85 | ((tau, e (gamma z.1 z.2)), deriv (fun y => e (gamma z.1 y)) z.2) |
| 86 | have hinput : Continuous coefficientInput := |
| 87 | (continuous_const.prodMk hzero).prodMk hfirstW |
| 88 | have hmem (z : Z × ℝ) : coefficientInput z ∈ ((Icc a b ×ˢ U) ×ˢ univ) := |
| 89 | ⟨⟨htau, heU (mem_range_self _)⟩, mem_univ _⟩ |
| 90 | have hcomposed := hB.comp_continuous (f := coefficientInput) hinput hmem |
| 91 | have hleft := (smooth_retraction_differentials he hU heU hρ hρe).2.2 |
| 92 | have hHessian : Continuous (fun z : Z × ℝ => |
| 93 | (coordinateHessian (F.connection tau) e (gamma z.1 z.2) |
| 94 | (curveVelocity (n := n) (gamma z.1) z.2) |
| 95 | (curveVelocity (n := n) (gamma z.1) z.2) : W)) := by |
| 96 | apply hcomposed.congr |
| 97 | intro z |
| 98 | change coordinateHessian (F.connection tau) e (ρ (e (gamma z.1 z.2))) |
| 99 | (mfderiv 𝓘(ℝ, W) (𝓡 n) ρ (e (gamma z.1 z.2)) |
| 100 | (deriv (fun y => e (gamma z.1 y)) z.2)) |
| 101 | (mfderiv 𝓘(ℝ, W) (𝓡 n) ρ (e (gamma z.1 z.2)) |
| 102 | (deriv (fun y => e (gamma z.1 y)) z.2)) = _ |
| 103 | rw [(hderiv z.1 z.2).deriv] |
| 104 | erw [hleft (gamma z.1 z.2) (curveVelocity (n := n) (gamma z.1) z.2), |
| 105 | hρe (gamma z.1 z.2)] |
| 106 | refine ⟨hspace, hzero, hfirstW, ?_⟩ |
| 107 | exact (hHessian.add hacc).congr (fun z => |
| 108 | (secondDeriv_embedding_eq_hessian_add_acceleration |
| 109 | (F.connection tau) he (hC2 z.1) z.2).symm) |
| 110 | |
| 111 | end PoincareMT.M63 |