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.Basic |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Action.ActionCongruence |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Action.FamilyActionDensity |
| 4 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Calculus.LocalSmoothPrimitive |
| 5 | |
| 6 | /-! |
| 7 | # Smoothness of the actual L-exponential action |
| 8 | |
| 9 | The frozen square family gives the exact regularized action integral. |
| 10 | Its density is smooth near every compact vertical segment; local |
| 11 | parameter integration and positive-time square roots finish the proof. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | set_option maxSynthPendingDepth 3 |
| 16 | set_option maxHeartbeats 800000 |
| 17 | |
| 18 | open scoped Manifold ContDiff Bundle Topology intervalIntegral |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace PoincareMT.ReducedLength |
| 23 | |
| 24 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 25 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 26 | [IsManifold (𝓡 n) ∞ M] |
| 27 | |
| 28 | set_option backward.isDefEq.respectTransparency false in |
| 29 | theorem lExponentialFamily_action_square_eq {J : Set ℝ} {F : RicciFlow n M J} |
| 30 | {T τmax : ℝ} {p : M} (A : LExponentialFamily F T τmax p) |
| 31 | (Z : TangentSpace (𝓡 n) p) (τ : ℝ) (hτ : 0 < τ) (hmax : τ < τmax) : |
| 32 | A.action Z τ = ∫ s in 0..Real.sqrt τ, |
| 33 | squareFamilyActionDensity F T (fun z ↦ A.squareFamily z.1 z.2) (Z, s) := by |
| 34 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 35 | ⟨(F.metric T).toRiemannianMetric⟩ |
| 36 | let E := TangentSpace (𝓡 n) p |
| 37 | have hf : ContMDiffOn (𝓘(ℝ, E × ℝ)) (𝓡 n) ∞ |
| 38 | (fun z ↦ A.squareFamily z.1 z.2) A.squareDomain := by |
| 39 | convert! A.square_smooth using 1 <;> |
| 40 | simp only [E, modelWithCornersSelf_prod, chartedSpaceSelf_prod] |
| 41 | have hα : ∀ s ∈ Set.Ioo 0 (Real.sqrt τ), |
| 42 | MDifferentiableAt (𝓘(ℝ, ℝ)) (𝓡 n) (A.squareFamily Z) s := by |
| 43 | intro s hs |
| 44 | have hmem : (Z, s) ∈ A.squareDomain := A.square_contains |
| 45 | ⟨Set.mem_univ _, hs.1.le, hs.2.trans (Real.sqrt_lt_sqrt hτ.le hmax)⟩ |
| 46 | have hpair : ContMDiff (𝓘(ℝ, ℝ)) (𝓘(ℝ, E × ℝ)) ∞ (fun r : ℝ ↦ (Z, r)) := |
| 47 | (contDiff_const.prodMk contDiff_id).contMDiff |
| 48 | exact ((hf.contMDiffAt (A.square_open.mem_nhds hmem)).comp s |
| 49 | hpair.contMDiffAt).mdifferentiableAt (by simp) |
| 50 | have heq : Set.EqOn (A.gamma Z) (fun r ↦ A.squareFamily Z (Real.sqrt r)) |
| 51 | (Set.Ioo 0 τ) := by |
| 52 | intro r hr |
| 53 | have h := A.square_agrees Z (Real.sqrt r) |
| 54 | ⟨Real.sqrt_nonneg r, Real.sqrt_lt_sqrt hr.1.le (hr.2.trans hmax)⟩ |
| 55 | simpa only [Real.sq_sqrt hr.1.le] using h.symm |
| 56 | exact (backwardLLength_congr_Ioo F T 0 τ hτ.le _ _ heq).trans |
| 57 | (backwardLLength_comp_sqrt_eq F T τ hτ (A.squareFamily Z) hα) |
| 58 | |
| 59 | set_option backward.isDefEq.respectTransparency false in |
| 60 | theorem lExponentialFamily_action_contDiffOn {J : Set ℝ} {F : RicciFlow n M J} |
| 61 | (hM04 : RicciFlowCurvatureTheory.{u}) {T τmax : ℝ} |
| 62 | (hτmax : 0 < τmax) (hwindow : Set.Icc (T - τmax) T ⊆ J) |
| 63 | {p : M} (A : LExponentialFamily F T τmax p) : |
| 64 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 65 | ⟨(F.metric T).toRiemannianMetric⟩ |
| 66 | ContDiffOn ℝ ∞ (fun z : TangentSpace (𝓡 n) p × ℝ ↦ A.action z.1 z.2) |
| 67 | (Set.univ ×ˢ Set.Ioo 0 τmax) := by |
| 68 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 69 | ⟨(F.metric T).toRiemannianMetric⟩ |
| 70 | let E := TangentSpace (𝓡 n) p |
| 71 | letI : FiniteDimensional ℝ E := |
| 72 | VectorBundle.finiteDimensional ℝ (EuclideanSpace ℝ (Fin n)) |
| 73 | (TangentSpace (𝓡 n) : M → Type _) p |
| 74 | let f : E × ℝ → M := fun z ↦ A.squareFamily z.1 z.2 |
| 75 | let U := A.squareDomain ∩ (Set.univ ×ˢ Set.Ioo (-Real.sqrt τmax) (Real.sqrt τmax)) |
| 76 | let H := squareFamilyActionDensity F T f |
| 77 | have hU : IsOpen U := A.square_open.inter (isOpen_univ.prod isOpen_Ioo) |
| 78 | have hf : ContMDiffOn (𝓘(ℝ, E × ℝ)) (𝓡 n) ∞ f A.squareDomain := by |
| 79 | convert! A.square_smooth using 1 <;> |
| 80 | simp only [E, modelWithCornersSelf_prod, chartedSpaceSelf_prod] |
| 81 | have hH : ContDiffOn ℝ ∞ H U := |
| 82 | squareFamilyActionDensity_contDiffOn F hM04 T τmax hτmax hwindow f U hU |
| 83 | (hf.mono Set.inter_subset_left) (fun z hz ↦ hz.2.2) |
| 84 | intro z hz |
| 85 | have hsegment : ∀ r ∈ Set.Icc (0 : ℝ) 1, (z.1, Real.sqrt z.2 * r) ∈ U := by |
| 86 | intro r hr |
| 87 | have h0 : 0 ≤ Real.sqrt z.2 * r := mul_nonneg (Real.sqrt_nonneg z.2) hr.1 |
| 88 | have hlt : Real.sqrt z.2 * r < Real.sqrt τmax := |
| 89 | (mul_le_of_le_one_right (Real.sqrt_nonneg z.2) hr.2).trans_lt |
| 90 | (Real.sqrt_lt_sqrt hz.2.1.le hz.2.2) |
| 91 | exact ⟨A.square_contains ⟨Set.mem_univ _, h0, hlt⟩, |
| 92 | Set.mem_univ _, (neg_lt_zero.mpr (Real.sqrt_pos.mpr hτmax)).trans_le h0, hlt⟩ |
| 93 | have hprimitive := contDiffAt_parameter_primitive H U hU hH (z.1, Real.sqrt z.2) hsegment |
| 94 | have hsqrt : ContDiffAt ℝ ∞ (fun w : E × ℝ ↦ (w.1, Real.sqrt w.2)) z := |
| 95 | contDiffAt_fst.prodMk (contDiffAt_snd.sqrt hz.2.1.ne') |
| 96 | have hsmooth := hprimitive.comp z hsqrt |
| 97 | have heq : (fun w : E × ℝ ↦ A.action w.1 w.2) =ᶠ[nhds z] |
| 98 | (fun w : E × ℝ ↦ ∫ s in 0..Real.sqrt w.2, H (w.1, s)) := by |
| 99 | filter_upwards [(isOpen_univ.prod isOpen_Ioo).mem_nhds hz] with w hw |
| 100 | exact lExponentialFamily_action_square_eq A w.1 w.2 hw.2.1 hw.2.2 |
| 101 | exact (hsmooth.congr_of_eventuallyEq heq).contDiffWithinAt |
| 102 | |
| 103 | end PoincareMT.ReducedLength |