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.Comparison.AnnularEvolution.Boundary.Half.DiskCollarRectangle |
| 2 | |
| 3 | /-! Continuity of the actual connection integrands on their genuine |
| 4 | interior and boundary domains. The boundary derivative is the within |
| 5 | derivative of the original C1 map. |
| 6 | Source: MT Lemma 19.15, pp. 447-449; M64 periodic finite collar derivation. -/ |
| 7 | |
| 8 | noncomputable section |
| 9 | set_option autoImplicit false |
| 10 | set_option warningAsError true |
| 11 | set_option backward.isDefEq.respectTransparency false |
| 12 | |
| 13 | open Set Filter Metric Complex |
| 14 | open scoped Topology ContDiff |
| 15 | |
| 16 | namespace PoincareMT.M64 |
| 17 | |
| 18 | open M65Gauss M65StrictTrace |
| 19 | |
| 20 | /-- The genuine interior connection pairing is continuous on each open coordinate domain of |
| 21 | the C1 map and C1 tangent field. Source: Morgan--Tian (2007), Lemma 19.15, pp. 447-449; |
| 22 | project derivations `proof-work/tasks/M64/derivations/2026-09-26-finite-boundary-collar.md` |
| 23 | and `proof-work/tasks/M64/derivations/2026-09-26-periodic-finite-collar.md`. -/ |
| 24 | theorem frame_connection_continuousOn {n : ℕ} |
| 25 | {g : RiemannianMetric n (EuclideanSpace ℝ (Fin n))} (D : LeviCivitaData g) |
| 26 | {H T N : ℂ → EuclideanSpace ℝ (Fin n)} {U : Set ℂ} (hU : IsOpen U) |
| 27 | (hH : ContDiffOn ℝ 1 H U) (hT : ContDiffOn ℝ 1 T U) (hN : ContinuousOn N U) : |
| 28 | ContinuousOn (fun z => g.inner (H z) |
| 29 | (covariantDerivativeAlongMap D H T z 1) (N z)) U := by |
| 30 | have hG : ContinuousOn (fun z => g.euclideanCoefficients (H z)) U := |
| 31 | (contDiff_iff_contDiffAt.mpr g.contDiffAt_euclideanCoefficients).continuous.comp_continuousOn |
| 32 | hH.continuousOn |
| 33 | have hDH : ContinuousOn (fun z => fderiv ℝ H z 1) U := |
| 34 | ((hH.fderiv_of_isOpen hU (m := 0) (by norm_num)).continuousOn).clm_apply continuousOn_const |
| 35 | have hDT : ContinuousOn (fun z => fderiv ℝ T z 1) U := |
| 36 | ((hT.fderiv_of_isOpen hU (m := 0) (by norm_num)).continuousOn).clm_apply continuousOn_const |
| 37 | have hGamma : ContinuousOn (fun z => connectionCoefficient D (H z)) U := |
| 38 | (contDiff_connectionCoefficient D).continuous.comp_continuousOn hH.continuousOn |
| 39 | exact (hG.clm_apply (hDT.add ((hGamma.clm_apply hDH).clm_apply hT.continuousOn))).clm_apply hN |
| 40 | |
| 41 | /-- The actual boundary connection is continuous on a closed diameter interval on which its |
| 42 | unit tangent is genuinely C1. Source: Morgan--Tian (2007), Lemma 19.15, pp. 447-449; project |
| 43 | derivations `proof-work/tasks/M64/derivations/2026-09-26-finite-boundary-collar.md` and |
| 44 | `proof-work/tasks/M64/derivations/2026-09-26-periodic-finite-collar.md`. -/ |
| 45 | theorem halfDisk_boundary_connection_continuousOn {n : ℕ} |
| 46 | {g : RiemannianMetric n (EuclideanSpace ℝ (Fin n))} (D : LeviCivitaData g) |
| 47 | {H : ℂ → EuclideanSpace ℝ (Fin n)} |
| 48 | {V : ℂ → EuclideanSpace ℝ (Fin n) × EuclideanSpace ℝ (Fin n)} |
| 49 | {R e : ℝ} (hR : 0 < R) (heR : e ≤ R) |
| 50 | (hH : ContDiffOn ℝ 1 H (closedBall (0 : ℂ) R ∩ {z | 0 ≤ z.im})) |
| 51 | (hV : ContinuousOn V (closedBall (0 : ℂ) R ∩ {z | 0 ≤ z.im})) |
| 52 | (hT : ∀ t ∈ Icc (-e) e, ContDiffAt ℝ 1 (fun s : ℝ => (V (s : ℂ)).1) t) : |
| 53 | ContinuousOn (fun t : ℝ => g.inner (H (t : ℂ)) |
| 54 | (deriv (fun s : ℝ => (V (s : ℂ)).1) t + |
| 55 | connectionCoefficient D (H (t : ℂ)) |
| 56 | (fderivWithin ℝ H (closedBall (0 : ℂ) R ∩ {z | 0 ≤ z.im}) (t : ℂ) 1) |
| 57 | (V (t : ℂ)).1) (V (t : ℂ)).2) (Icc (-e) e) := by |
| 58 | let K := closedBall (0 : ℂ) R ∩ {z | 0 ≤ z.im} |
| 59 | let J := Icc (-e) e |
| 60 | have hmap : MapsTo (fun t : ℝ => (t : ℂ)) J K := by |
| 61 | intro t ht |
| 62 | refine ⟨mem_closedBall_zero_iff.mpr ?_, by simp⟩ |
| 63 | rw [Complex.norm_real, Real.norm_eq_abs] |
| 64 | exact (abs_le.mpr ht).trans heR |
| 65 | have hH0 : ContinuousOn (fun t : ℝ => H (t : ℂ)) J := |
| 66 | hH.continuousOn.comp continuous_ofReal.continuousOn hmap |
| 67 | have hV0 : ContinuousOn (fun t : ℝ => V (t : ℂ)) J := |
| 68 | hV.comp continuous_ofReal.continuousOn hmap |
| 69 | have hD := hH.continuousOn_fderivWithin (halfDisk_differential_domain hR).2.2.1 le_rfl |
| 70 | have hDH0 : ContinuousOn (fun t : ℝ => fderivWithin ℝ H K (t : ℂ) 1) J := |
| 71 | (hD.clm_apply continuousOn_const).comp continuous_ofReal.continuousOn hmap |
| 72 | have hDT : ContinuousOn (deriv (fun s : ℝ => (V (s : ℂ)).1)) J := by |
| 73 | intro t ht |
| 74 | apply ContinuousAt.continuousWithinAt |
| 75 | simpa only [fderiv_apply_one_eq_deriv] using |
| 76 | (((hT t ht).fderiv_right (m := 0) (by norm_num)).continuousAt.clm_apply |
| 77 | (continuousAt_const (x := t) (y := (1 : ℝ)))) |
| 78 | have hG : ContinuousOn (fun t : ℝ => g.euclideanCoefficients (H (t : ℂ))) J := |
| 79 | (contDiff_iff_contDiffAt.mpr g.contDiffAt_euclideanCoefficients).continuous.comp_continuousOn |
| 80 | hH0 |
| 81 | have hGamma : ContinuousOn (fun t : ℝ => connectionCoefficient D (H (t : ℂ))) J := |
| 82 | (contDiff_connectionCoefficient D).continuous.comp_continuousOn hH0 |
| 83 | exact (hG.clm_apply (hDT.add ((hGamma.clm_apply hDH0).clm_apply hV0.fst))).clm_apply hV0.snd |
| 84 | |
| 85 | end PoincareMT.M64 |