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.Generalized.ReducedGeometry.Rescaling.Paths.RescalingSquare |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Rescaling.Paths.RescalingPathInverse |
| 3 | |
| 4 | /-! |
| 5 | # Inverse transport of closed square-root paths |
| 6 | |
| 7 | Morgan-Tian Lemma 6.72 and Remark 6.73, p. 141. Multiplication by |
| 8 | the positive square root scale gives the inverse closed square curve |
| 9 | and its genuine endpoint derivative. No open extension is used. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | -- The two selected spacetime charts have the same tangent model. |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | |
| 16 | open Set |
| 17 | open scoped Manifold ContDiff Bundle Topology |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.M14 |
| 22 | |
| 23 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] |
| 24 | {time : X → ℝ} {I : SpacetimeInterval} |
| 25 | (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 26 | (hM13 : GeneralizedParabolicRescalingTheory.{u} n) |
| 27 | (G : GeneralizedLGeometryTransport n X time I) (Q : ℝ) (hQ : 0 < Q) (a : ℝ) |
| 28 | |
| 29 | include hQ in |
| 30 | /-- Multiplication by the square root scale maps the full source |
| 31 | square interval to the target interval. Remark 6.73, p. 141. -/ |
| 32 | theorem rescalingSquareInverseParameter_mapsTo (τ₁ τ₂ : ℝ) : |
| 33 | MapsTo (fun s : ℝ => Real.sqrt Q * s) |
| 34 | (M14SqrtParameterInterval τ₁ τ₂) (M14SqrtParameterInterval (Q * τ₁) (Q * τ₂)) := by |
| 35 | intro s hs |
| 36 | rw [M14SqrtParameterInterval, Real.sqrt_mul hQ.le, Real.sqrt_mul hQ.le] |
| 37 | exact ⟨mul_le_mul_of_nonneg_left hs.1 (Real.sqrt_nonneg Q), |
| 38 | mul_le_mul_of_nonneg_left hs.2 (Real.sqrt_nonneg Q)⟩ |
| 39 | |
| 40 | /-- The squared inverse path is the supplied target square curve at |
| 41 | the multiplied square time, on the closed interval. Remark 6.73, p. 141. -/ |
| 42 | theorem rescalingSquareInverseCurve_eqOn |
| 43 | {T τ₁ τ₂ : ℝ} {x y : G.Point} |
| 44 | {p : M14BackwardPath (rescalingTransport hM12 hM13 G Q hQ a) |
| 45 | (parabolicTime Q a T) (Q * τ₁) (Q * τ₂) x y} |
| 46 | (R : M14SquareRootPath (rescalingTransport hM12 hM13 G Q hQ a) p) : |
| 47 | EqOn (fun s => (rescalingPathInverse hM12 hM13 G Q hQ a p).curve (s ^ 2)) |
| 48 | (fun s => R.curve (Real.sqrt Q * s)) (M14SqrtParameterInterval τ₁ τ₂) := by |
| 49 | intro s hs |
| 50 | change (rescalingPathInverse hM12 hM13 G Q hQ a p).curve (s ^ 2) = |
| 51 | R.curve (Real.sqrt Q * s) |
| 52 | erw [R.agrees _ (rescalingSquareInverseParameter_mapsTo Q hQ τ₁ τ₂ hs)] |
| 53 | change p.curve (Q * s ^ 2) = p.curve ((Real.sqrt Q * s) ^ 2) |
| 54 | rw [mul_pow, Real.sq_sqrt hQ.le] |
| 55 | |
| 56 | /-- The inverse actual path has a smooth square representative whenever |
| 57 | the supplied target path does. Remark 6.73, p. 141. -/ |
| 58 | noncomputable def rescalingSquarePathInverse |
| 59 | {T τ₁ τ₂ : ℝ} {x y : G.Point} |
| 60 | {p : M14BackwardPath (rescalingTransport hM12 hM13 G Q hQ a) |
| 61 | (parabolicTime Q a T) (Q * τ₁) (Q * τ₂) x y} |
| 62 | (R : M14SquareRootPath (rescalingTransport hM12 hM13 G Q hQ a) p) : |
| 63 | M14SquareRootPath G (rescalingPathInverse hM12 hM13 G Q hQ a p) := by |
| 64 | apply squareRootPathOfSmoothSquare |
| 65 | have h := (R.smooth.mono R.interval_subset).comp |
| 66 | (contDiff_const.mul contDiff_id).contMDiff.contMDiffOn |
| 67 | (rescalingSquareInverseParameter_mapsTo Q hQ τ₁ τ₂) |
| 68 | exact h.congr (fun _ hs => rescalingSquareInverseCurve_eqOn hM12 hM13 G Q hQ a R hs) |
| 69 | |
| 70 | /-- Every inverse square representative has the inverse normalized |
| 71 | initial velocity, by the within chain rule at zero. Remark 6.73, p. 141. -/ |
| 72 | theorem rescalingSquareInverse_initial_velocity |
| 73 | {T τ : ℝ} {x y : G.Point} |
| 74 | {p : M14BackwardPath (rescalingTransport hM12 hM13 G Q hQ a) |
| 75 | (parabolicTime Q a T) (Q * 0) (Q * τ) x y} |
| 76 | (R : M14SquareRootPath (rescalingTransport hM12 hM13 G Q hQ a) p) |
| 77 | (R' : M14SquareRootPath G (rescalingPathInverse hM12 hM13 G Q hQ a p)) : |
| 78 | (show SpacetimeModelVector n from (R'.horizontal_velocity 0).val) = |
| 79 | Real.sqrt Q • (R.horizontal_velocity 0).val := by |
| 80 | let J := M14SqrtParameterInterval (Q * 0) (Q * τ) |
| 81 | let K := M14SqrtParameterInterval 0 τ |
| 82 | have h0 : 0 ∈ J := by simp [J, M14SqrtParameterInterval, Real.sqrt_nonneg] |
| 83 | have h0' : 0 ∈ K := by simp [K, M14SqrtParameterInterval, Real.sqrt_nonneg] |
| 84 | have hm : MapsTo (fun s => Real.sqrt Q * s) K J := |
| 85 | rescalingSquareInverseParameter_mapsTo Q hQ 0 τ |
| 86 | have heq : EqOn R'.curve (fun r => R.curve (Real.sqrt Q * r)) K := by |
| 87 | intro r hr |
| 88 | exact (R'.agrees r hr).trans (rescalingSquareInverseCurve_eqOn hM12 hM13 G Q hQ a R hr) |
| 89 | have hτ : 0 < τ := by |
| 90 | have h := p.tau_lt |
| 91 | rw [mul_zero] at h |
| 92 | exact (mul_pos_iff_of_pos_left hQ).mp h |
| 93 | have hK : UniqueMDiffWithinAt 𝓘(ℝ, ℝ) K 0 := |
| 94 | (uniqueDiffOn_Icc (Real.sqrt_lt_sqrt (by norm_num) hτ) 0 h0').uniqueMDiffWithinAt |
| 95 | have hd : HasMFDerivAt 𝓘(ℝ, ℝ) 𝓘(ℝ, ℝ) (fun r : ℝ => Real.sqrt Q * r) 0 |
| 96 | (ContinuousLinearMap.toSpanSingleton ℝ (Real.sqrt Q)) := by |
| 97 | simpa only [id_eq, mul_one] using |
| 98 | ((hasDerivAt_id (0 : ℝ)).const_mul (Real.sqrt Q)).hasFDerivAt.hasMFDerivAt |
| 99 | have hchain := mfderivWithin_comp (I := 𝓘(ℝ, ℝ)) (I' := 𝓘(ℝ, ℝ)) |
| 100 | (I'' := spacetimeModel n) (f := fun r => Real.sqrt Q * r) (g := R.curve) 0 |
| 101 | (((R.smooth.mono R.interval_subset) _ (hm h0')).mdifferentiableWithinAt (by simp)) |
| 102 | hd.mdifferentiableAt.mdifferentiableWithinAt hm hK |
| 103 | rw [mfderivWithin_eq_mfderiv hK hd.mdifferentiableAt, hd.mfderiv] at hchain |
| 104 | have hcongr := mfderivWithin_congr_of_mem (I := 𝓘(ℝ, ℝ)) (I' := spacetimeModel n) |
| 105 | (fun r hr => heq hr) h0' |
| 106 | have hv := congrArg (fun L => L (1 : ℝ)) (hcongr.trans hchain) |
| 107 | erw [ContinuousLinearMap.comp_apply, |
| 108 | ContinuousLinearMap.toSpanSingleton_apply_one, mul_zero] at hv |
| 109 | have hR := R.derivative_eq 0 h0 |
| 110 | have hR' := R'.derivative_eq 0 h0' |
| 111 | simp only [mul_zero, neg_zero, zero_smul, zero_add] at hR hR' |
| 112 | dsimp only [J, K] at hv |
| 113 | simp only [mul_zero] at hv |
| 114 | erw [hR'] at hv |
| 115 | have hlin := (mfderivWithin 𝓘(ℝ, ℝ) (spacetimeModel n) R.curve J 0).map_smul |
| 116 | (Real.sqrt Q) (1 : ℝ) |
| 117 | simp only [smul_eq_mul, mul_one] at hlin |
| 118 | dsimp only [J] at hlin |
| 119 | simp only [mul_zero] at hlin |
| 120 | erw [hlin, hR] at hv |
| 121 | exact hv |
| 122 | |
| 123 | end PoincareMT.M14 |