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.NormalizedBackwardPath |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Exponential.ForwardSmoothFamily |
| 4 | |
| 5 | /-! |
| 6 | # The constructed coherent L-exponential family |
| 7 | |
| 8 | All paths use the same global backward curve. Joint square-time smoothness |
| 9 | holds on the actual open smooth domain, and its initial phase is (p,2Z). |
| 10 | The minimizing regular chart and Jacobi differential are separate results. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | set_option maxSynthPendingDepth 3 |
| 15 | set_option maxHeartbeats 800000 |
| 16 | |
| 17 | open scoped Manifold ContDiff Bundle Topology |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.ReducedLength |
| 22 | |
| 23 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 24 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 25 | [IsManifold (𝓡 n) ∞ M] [ConnectedSpace M] [T3Space M] [SecondCountableTopology M] |
| 26 | |
| 27 | local notation "V" => EuclideanSpace ℝ (Fin n) |
| 28 | |
| 29 | set_option backward.isDefEq.respectTransparency false in |
| 30 | theorem nonempty_lExponentialFamily {J : Set ℝ} |
| 31 | (F : RicciFlow n M J) (hM04 : RicciFlowCurvatureTheory.{u}) |
| 32 | (T τmax : ℝ) (hτmax : 0 < τmax) (hwindow : Set.Icc (T - τmax) T ⊆ J) |
| 33 | (hcurvature : CompleteBoundedCurvatureOn F (Set.Icc (T - τmax) T)) (p : M) : |
| 34 | Nonempty (LExponentialFamily F T τmax p) := by |
| 35 | classical |
| 36 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 37 | ⟨(F.metric T).toRiemannianMetric⟩ |
| 38 | let E := TangentSpace (𝓡 n) p |
| 39 | let f : E × ℝ → M := fun z ↦ normalizedSquareFamily F T τmax p z.1 z.2 |
| 40 | have hex := fun (Z : E) (b : ℝ) (hb : 0 < b) (hbmax : b < τmax) ↦ |
| 41 | exists_normalizedBackwardPath F hM04 T τmax hτmax hwindow hcurvature p Z b hb hbmax |
| 42 | choose paths hpaths hregularizations using hex |
| 43 | have hcontains : Set.univ ×ˢ Set.Ico 0 (Real.sqrt τmax) ⊆ |
| 44 | smoothFamilyDomain (n := n) f := |
| 45 | univ_Ico_subset_normalizedSquareFamily_smoothFamilyDomain F hM04 T τmax hτmax |
| 46 | hwindow hcurvature p |
| 47 | let U : Set (E × ℝ) := Set.univ ×ˢ Set.Ioo 0 τmax |
| 48 | have hsqrt : ContDiffOn ℝ ∞ (fun z : E × ℝ ↦ Real.sqrt z.2) U := |
| 49 | contDiff_snd.contDiffOn.sqrt (fun z hz ↦ hz.2.1.ne') |
| 50 | have hmap : ContMDiffOn (𝓘(ℝ, E × ℝ)) (𝓘(ℝ, E × ℝ)) ∞ |
| 51 | (fun z : E × ℝ ↦ (z.1, Real.sqrt z.2)) U := |
| 52 | (contDiff_fst.contDiffOn.prodMk hsqrt).contMDiffOn |
| 53 | have hγ : ContMDiffOn (𝓘(ℝ, E × ℝ)) (𝓡 n) ∞ |
| 54 | (fun z ↦ normalizedBackwardFamily F T τmax p z.1 z.2) U := by |
| 55 | apply (contMDiffOn_smoothFamilyDomain (n := n) f).comp hmap |
| 56 | intro z hz |
| 57 | exact hcontains ⟨Set.mem_univ _, Real.sqrt_nonneg z.2, |
| 58 | Real.sqrt_lt_sqrt hz.2.1.le hz.2.2⟩ |
| 59 | refine ⟨{ |
| 60 | gamma := normalizedBackwardFamily F T τmax p |
| 61 | gamma_at_zero := ?_ |
| 62 | path := paths |
| 63 | path_eq := hpaths |
| 64 | regularization := fun Z b hb hbmax ↦ Classical.choice (hregularizations Z b hb hbmax) |
| 65 | squareFamily := normalizedSquareFamily F T τmax p |
| 66 | squareDomain := smoothFamilyDomain (n := n) f |
| 67 | square_open := isOpen_smoothFamilyDomain (n := n) f |
| 68 | square_contains := hcontains |
| 69 | square_smooth := ?_ |
| 70 | square_agrees := ?_ |
| 71 | square_at_zero := normalizedSquareFamily_zero F hM04 T τmax hτmax hwindow p |
| 72 | initial_derivative := ?_ |
| 73 | gamma_smooth := ?_ |
| 74 | }⟩ |
| 75 | · intro Z |
| 76 | simpa only [normalizedBackwardFamily, Real.sqrt_zero] using |
| 77 | normalizedSquareFamily_zero F hM04 T τmax hτmax hwindow p Z |
| 78 | · convert! (contMDiffOn_smoothFamilyDomain (n := n) f) using 1 <;> |
| 79 | simp only [E, modelWithCornersSelf_prod, chartedSpaceSelf_prod] |
| 80 | · intro Z s hs |
| 81 | simp only [normalizedBackwardFamily, Real.sqrt_sq hs.1] |
| 82 | · intro Z |
| 83 | have hcast (x y : M) (h : x = y) (v : TangentSpace (𝓡 n) x) : |
| 84 | (h ▸ v : TangentSpace (𝓡 n) y) = (show TangentSpace (𝓡 n) y from v) := by |
| 85 | cases h |
| 86 | rfl |
| 87 | rw [hcast] |
| 88 | exact congrArg (fun q : TangentBundle (𝓡 n) M ↦ (q.2 : V)) |
| 89 | (normalizedSquareFamily_initial_phase F hM04 T τmax hτmax hwindow p Z) |
| 90 | · convert! hγ using 1 <;> |
| 91 | simp only [E, modelWithCornersSelf_prod, chartedSpaceSelf_prod] |
| 92 | |
| 93 | end PoincareMT.ReducedLength |