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.Surgery.CanonicalInduction.Terminal.Germs.TerminalGermsOpenCharts |
| 2 | |
| 3 | /-! |
| 4 | # Genuine coordinate contractions for early source indices |
| 5 | |
| 6 | One fixed positive contraction lands strictly inside the actual base |
| 7 | chart. Its open embedding, local diffeomorphism and distances are exact. |
| 8 | MT Proposition 5.14, pp. 90-91; terminal-source-countable-maps.md, A. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | set_option backward.isDefEq.respectTransparency false |
| 13 | |
| 14 | open Set TopologicalSpace |
| 15 | open scoped Manifold ContDiff Topology |
| 16 | |
| 17 | namespace PoincareMT.M47 |
| 18 | |
| 19 | local notation "E" => EuclideanSpace ℝ (Fin 3) |
| 20 | |
| 21 | /-- The unchanged inner coordinate domain of one actual stage chart. -/ |
| 22 | def terminalSourceCountableDomain (rho : ℝ) : Opens E := |
| 23 | ⟨Metric.ball 0 (rho / 2), Metric.isOpen_ball⟩ |
| 24 | |
| 25 | /-- The actual coordinate origin, using the positive stage radius. -/ |
| 26 | def terminalSourceCountableZero {rho : ℝ} (hrho : 0 < rho) : |
| 27 | terminalSourceCountableDomain rho := |
| 28 | ⟨0, Metric.mem_ball_self (half_pos hrho)⟩ |
| 29 | |
| 30 | /-- A positive contraction fixed before the physical sequence index. -/ |
| 31 | noncomputable def terminalSourceCountableScaleFactor (rho0 rho : ℝ) : ℝ := |
| 32 | min 1 (rho0 / (2 * rho)) |
| 33 | |
| 34 | /-- The contraction retains a full quarter-radius buffer in the base chart. -/ |
| 35 | theorem terminalSourceCountableScaleFactor_bounds {rho0 rho : ℝ} |
| 36 | (h0 : 0 < rho0) (hrho : 0 < rho) : |
| 37 | 0 < terminalSourceCountableScaleFactor rho0 rho ∧ |
| 38 | terminalSourceCountableScaleFactor rho0 rho ≤ 1 ∧ |
| 39 | terminalSourceCountableScaleFactor rho0 rho * (rho / 2) ≤ rho0 / 4 := by |
| 40 | have hpos : 0 < terminalSourceCountableScaleFactor rho0 rho := |
| 41 | lt_min (by norm_num) (div_pos h0 (mul_pos (by norm_num) hrho)) |
| 42 | have hmul := (le_div_iff₀ (mul_pos (by norm_num : (0 : ℝ) < 2) hrho)).mp |
| 43 | (min_le_right (1 : ℝ) (rho0 / (2 * rho))) |
| 44 | exact ⟨hpos, min_le_left _ _, by |
| 45 | change min 1 (rho0 / (2 * rho)) * (rho / 2) ≤ rho0 / 4 |
| 46 | nlinarith only [hmul]⟩ |
| 47 | |
| 48 | private theorem scaled_norm_lt {rho0 rho : ℝ} (h0 : 0 < rho0) (hrho : 0 < rho) |
| 49 | (x : terminalSourceCountableDomain rho) : |
| 50 | ‖terminalSourceCountableScaleFactor rho0 rho • (x : E)‖ < rho0 / 4 := by |
| 51 | obtain ⟨hlambda, _, hbound⟩ := terminalSourceCountableScaleFactor_bounds h0 hrho |
| 52 | have hxBall : (x : E) ∈ Metric.ball 0 (rho / 2) := x.property |
| 53 | have hx : ‖(x : E)‖ < rho / 2 := by |
| 54 | simpa only [Metric.mem_ball, dist_zero_right] using hxBall |
| 55 | rw [norm_smul, Real.norm_of_nonneg hlambda.le] |
| 56 | exact (mul_lt_mul_of_pos_left hx hlambda).trans_le hbound |
| 57 | |
| 58 | /-- The actual contracted map into the stage-zero coordinate domain. -/ |
| 59 | noncomputable def terminalSourceCountableScaleMap {rho0 rho : ℝ} |
| 60 | (h0 : 0 < rho0) (hrho : 0 < rho) : |
| 61 | terminalSourceCountableDomain rho → terminalSourceCountableDomain rho0 := |
| 62 | fun x => ⟨terminalSourceCountableScaleFactor rho0 rho • (x : E), by |
| 63 | change ‖terminalSourceCountableScaleFactor rho0 rho • (x : E) - 0‖ < rho0 / 2 |
| 64 | rw [sub_zero] |
| 65 | exact (scaled_norm_lt h0 hrho x).trans (by linarith only [h0])⟩ |
| 66 | |
| 67 | /-- The genuine early map keeps the same physical base chart center. -/ |
| 68 | theorem terminalSourceCountableScaleMap_zero {rho0 rho : ℝ} |
| 69 | (h0 : 0 < rho0) (hrho : 0 < rho) : |
| 70 | terminalSourceCountableScaleMap h0 hrho (terminalSourceCountableZero hrho) = |
| 71 | terminalSourceCountableZero h0 := by |
| 72 | apply Subtype.ext |
| 73 | exact smul_zero _ |
| 74 | |
| 75 | /-- The image has strict coordinate slack inside the base chart. -/ |
| 76 | theorem terminalSourceCountableScaleMap_norm_lt {rho0 rho : ℝ} |
| 77 | (h0 : 0 < rho0) (hrho : 0 < rho) (x : terminalSourceCountableDomain rho) : |
| 78 | ‖(terminalSourceCountableScaleMap h0 hrho x : E)‖ < rho0 / 4 := |
| 79 | scaled_norm_lt h0 hrho x |
| 80 | |
| 81 | /-- Both coordinate points are contracted by exactly the fixed factor. -/ |
| 82 | theorem terminalSourceCountableScaleMap_dist {rho0 rho : ℝ} |
| 83 | (h0 : 0 < rho0) (hrho : 0 < rho) (x y : terminalSourceCountableDomain rho) : |
| 84 | dist (terminalSourceCountableScaleMap h0 hrho x) |
| 85 | (terminalSourceCountableScaleMap h0 hrho y) = |
| 86 | terminalSourceCountableScaleFactor rho0 rho * dist x y := by |
| 87 | change dist (terminalSourceCountableScaleFactor rho0 rho • (x : E)) |
| 88 | (terminalSourceCountableScaleFactor rho0 rho • (y : E)) = _ |
| 89 | rw [dist_smul₀, Real.norm_of_nonneg (terminalSourceCountableScaleFactor_bounds h0 hrho).1.le] |
| 90 | rfl |
| 91 | |
| 92 | /-- The early coordinate replacement is an actual open local diffeomorphism. -/ |
| 93 | theorem terminalSourceCountableScaleMap_geometry {rho0 rho : ℝ} |
| 94 | (h0 : 0 < rho0) (hrho : 0 < rho) : |
| 95 | Topology.IsOpenEmbedding (terminalSourceCountableScaleMap h0 hrho) ∧ |
| 96 | IsLocalDiffeomorph (𝓡 3) (𝓡 3) ∞ (terminalSourceCountableScaleMap h0 hrho) := by |
| 97 | let L := (LinearEquiv.smulOfNeZero ℝ E |
| 98 | (terminalSourceCountableScaleFactor rho0 rho) |
| 99 | (terminalSourceCountableScaleFactor_bounds h0 hrho).1.ne').toContinuousLinearEquiv |
| 100 | have hsmooth : IsLocalDiffeomorph (𝓡 3) (𝓡 3) ∞ |
| 101 | (Subtype.val ∘ terminalSourceCountableScaleMap h0 hrho) := by |
| 102 | intro x |
| 103 | exact (Poincare.isLocalDiffeomorph_opensSubtypeVal (𝓡 3) |
| 104 | (terminalSourceCountableDomain rho) x).comp (𝓡 3) E |
| 105 | (L.toDiffeomorph.isLocalDiffeomorph (x : E)) |
| 106 | refine ⟨?_, terminalGerms_open_codomain_localDiffeomorph |
| 107 | (terminalSourceCountableDomain rho0) hsmooth⟩ |
| 108 | apply Topology.IsOpenEmbedding.of_comp _ |
| 109 | (terminalSourceCountableDomain rho0).isOpen.isOpenEmbedding_subtypeVal |
| 110 | exact L.toHomeomorph.isOpenEmbedding.comp |
| 111 | (terminalSourceCountableDomain rho).isOpen.isOpenEmbedding_subtypeVal |
| 112 | |
| 113 | end PoincareMT.M47 |