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.Paths.SquareRoot.Action.SquarePathPrefix |
| 2 | |
| 3 | /-! |
| 4 | # Restricting actual variations to a prefix |
| 5 | |
| 6 | Morgan-Tian Lemma 6.4 and Proposition 6.30, pp. 107-108, 118-119. |
| 7 | The original family, parameter interval and variation field are retained. |
| 8 | The new final endpoint is allowed to move with the parameter. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | |
| 13 | open Set |
| 14 | |
| 15 | universe u |
| 16 | |
| 17 | namespace PoincareMT.M14 |
| 18 | |
| 19 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 20 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 21 | {T a b c : ℝ} {x y : G.Point} {p : M14BackwardPath G T a b x y} |
| 22 | {R : M14SquareRootPath G p} |
| 23 | |
| 24 | /-- Restrict an actual variation to a nondegenerate prefix, retaining |
| 25 | the whole square family and actual field, Proposition 6.30, pp. 118-119. -/ |
| 26 | def prefixVariation (V : M14LVariationData G p R) (hac : a < c) (hcb : c ≤ b) : |
| 27 | M14LVariationData G (prefixPath p c hac hcb) (prefixSquarePath R hac hcb) := by |
| 28 | have hsub : M14SqrtParameterInterval a c ⊆ M14SqrtParameterInterval a b := |
| 29 | Icc_subset_Icc le_rfl (Real.sqrt_le_sqrt hcb) |
| 30 | refine { |
| 31 | family := V.family |
| 32 | family_velocity := V.family_velocity |
| 33 | family_at_zero := V.family_at_zero |
| 34 | radius := V.radius |
| 35 | radius_pos := V.radius_pos |
| 36 | parameterDomain := V.parameterDomain |
| 37 | parameterDomain_eq := V.parameterDomain_eq |
| 38 | parameterDomain_nonempty := V.parameterDomain_nonempty |
| 39 | family_time := fun u hu s hs => V.family_time u hu s ⟨hs.1, hs.2.trans hcb⟩ |
| 40 | family_derivative := fun u hu s hs => V.family_derivative u hu s |
| 41 | ⟨hs.1, hs.2.trans_le hcb⟩ |
| 42 | squareFamily := V.squareFamily |
| 43 | squareDomain := V.squareDomain |
| 44 | square_contains := fun z hz => V.square_contains ⟨hsub hz.1, hz.2⟩ |
| 45 | square_smooth := V.square_smooth |
| 46 | square_agrees := fun s hs u hu => V.square_agrees s (hsub hs) u hu |
| 47 | square_base := V.square_base |
| 48 | square_horizontal_velocity := V.square_horizontal_velocity |
| 49 | square_horizontal_agrees := fun s hs u hu => V.square_horizontal_agrees s (hsub hs) u hu |
| 50 | left_endpoint_fixed := V.left_endpoint_fixed |
| 51 | left_endpoint_fixed_spec := V.left_endpoint_fixed_spec |
| 52 | right_endpoint_fixed := ∀ u ∈ V.parameterDomain, V.family c u = p.curve c |
| 53 | right_endpoint_fixed_spec := Iff.rfl |
| 54 | action_integrable := ?_ } |
| 55 | intro u hu |
| 56 | apply (V.action_integrable u hu).mono_set |
| 57 | rw [uIcc_of_le hac.le, uIcc_of_le p.tau_lt.le] |
| 58 | exact Icc_subset_Icc le_rfl hcb |
| 59 | |
| 60 | /-- The frozen field is unchanged at every parameter value by the |
| 61 | prefix construction, Proposition 6.30, pp. 118-119. -/ |
| 62 | theorem variationField_prefixVariation (V : M14LVariationData G p R) |
| 63 | (hac : a < c) (hcb : c ≤ b) (s : ℝ) : |
| 64 | M14VariationField (prefixVariation V hac hcb) s = M14VariationField V s := rfl |
| 65 | |
| 66 | end PoincareMT.M14 |