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.Spacetime.Horizontal.Basic |
| 2 | import PoincareLib.Geometry.Riemannian.Curvature.Calculus |
| 3 | import PoincareLib.Geometry.Spacetime.Horizontal.Connection |
| 4 | |
| 5 | /-! Ported from Mapher06/Poincare-MorganTian, `PoincareMT/Statements/M12HorizontalTheory.lean`, |
| 6 | revision `b2c3c64781fee22edfd683a224d4f8d280e2e9ce`. Declaration bodies are unchanged; |
| 7 | only imports and module placement differ. See |
| 8 | `references/ricci-flow/mapher/spacetime-port.json`. -/ |
| 9 | |
| 10 | /-! |
| 11 | # Horizontal calculus and its actual connection witness |
| 12 | |
| 13 | Morgan-Tian Theorem 1.2 and formula (1.1), pp. 3-4, and Definition 3.36 |
| 14 | with Remark 3.37, pp. 60-61. These are conclusions of M12 over its supplied |
| 15 | adapted cover. The horizontal connection agrees with the raw derivative on |
| 16 | local smooth sections. Its metric defect is the time differential times |
| 17 | the actual metric Lie derivative. |
| 18 | -/ |
| 19 | |
| 20 | set_option autoImplicit false |
| 21 | |
| 22 | open scoped Manifold ContDiff Bundle |
| 23 | |
| 24 | universe u |
| 25 | |
| 26 | namespace PoincareMT |
| 27 | |
| 28 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 29 | {I : SpacetimeInterval} {F : GeneralizedFlowSpacetime n X time I} |
| 30 | {S : ∀ t : ℝ, SpacetimeSliceGeometry F t} |
| 31 | |
| 32 | /-- An actual smooth connection on H, characterized on local smooth sections. |
| 33 | Existence of this record is a theorem conclusion, with no construction hidden here. -/ |
| 34 | structure SpacetimeHorizontalConnection (D : LeafwiseLeviCivitaFamily F S) where |
| 35 | connection : CovariantDerivative (spacetimeModel n) (EuclideanSpace ℝ (Fin n)) |
| 36 | F.Horizontal |
| 37 | smooth : CovariantDerivative.ContMDiffCovariantDerivative connection ∞ |
| 38 | local_smooth : ∀ U : Set F.Point, IsOpen U → |
| 39 | ContMDiffCovariantDerivativeOn (I := spacetimeModel n) (V := F.Horizontal) |
| 40 | (EuclideanSpace ℝ (Fin n)) ∞ connection.toFun U |
| 41 | raw_eq : ∀ U : Set F.Point, IsOpen U → |
| 42 | ∀ V : HorizontalSection F, IsSmoothHorizontalSectionOn F V U → |
| 43 | ∀ p ∈ U, connection V p = rawHorizontalCovariantDerivative D V p |
| 44 | time_eq : ∀ U : Set F.Point, IsOpen U → |
| 45 | ∀ V : HorizontalSection F, IsSmoothHorizontalSectionOn F V U → |
| 46 | ∀ p ∈ U, (connection V p (F.timeVector p)).val = |
| 47 | VectorField.mlieBracket (spacetimeModel n) |
| 48 | (show (q : F.Point) → TangentSpace (spacetimeModel n) q from F.timeVector) |
| 49 | (horizontalSectionVectorField F V) p |
| 50 | horizontal_eq : ∀ U : Set F.Point, IsOpen U → |
| 51 | ∀ V : HorizontalSection F, IsSmoothHorizontalSectionOn F V U → |
| 52 | ∀ p ∈ U, ∀ v : F.Horizontal p, |
| 53 | connection V p v.val = rawLeafwiseCovariantDerivative D V p v |
| 54 | metric_defect : ∀ U : Set F.Point, IsOpen U → |
| 55 | ∀ V W : HorizontalSection F, |
| 56 | IsSmoothHorizontalSectionOn F V U → IsSmoothHorizontalSectionOn F W U → |
| 57 | ∀ p ∈ U, ∀ Z : TangentSpace (spacetimeModel n) p, |
| 58 | mvfderiv (spacetimeModel n) |
| 59 | (fun q : F.Point ↦ F.horizontalMetric.inner q (V q) (W q)) p Z - |
| 60 | F.horizontalMetric.inner p (connection V p Z) (W p) - |
| 61 | F.horizontalMetric.inner p (V p) (connection W p Z) = |
| 62 | (show ℝ from mfderiv (spacetimeModel n) 𝓘(ℝ) F.timeFunction p Z) * |
| 63 | horizontalMetricLieDerivative F p (V p) (W p) |
| 64 | |
| 65 | /-- Concrete regularity, tensor, and regular-section conclusions for the selected |
| 66 | slice connections. Every operator is the actual preceding raw definition. -/ |
| 67 | structure HorizontalRicciCalculus (D : LeafwiseLeviCivitaFamily F S) : Prop where |
| 68 | lie_tensor : IsSmoothHorizontalCovariantTensor F (k := 2) |
| 69 | (fun p v ↦ horizontalMetricLieDerivative F p (v 0) (v 1)) |
| 70 | lie_symmetric : ∀ p : F.Point, ∀ u v : F.Horizontal p, |
| 71 | horizontalMetricLieDerivative F p u v = horizontalMetricLieDerivative F p v u |
| 72 | lie_on_fields : ∀ U : Set F.Point, IsOpen U → |
| 73 | ∀ V W : HorizontalSection F, |
| 74 | IsSmoothHorizontalSectionOn F V U → IsSmoothHorizontalSectionOn F W U → |
| 75 | ∀ p ∈ U, horizontalMetricLieDerivative F p (V p) (W p) = |
| 76 | horizontalMetricLieDerivativeOnFields F V W p |
| 77 | time_bracket_horizontal : ∀ U : Set F.Point, IsOpen U → |
| 78 | ∀ V : HorizontalSection F, IsSmoothHorizontalSectionOn F V U → |
| 79 | ∀ p ∈ U, mfderiv (spacetimeModel n) 𝓘(ℝ) F.timeFunction p |
| 80 | (VectorField.mlieBracket (spacetimeModel n) |
| 81 | (show (q : F.Point) → TangentSpace (spacetimeModel n) q from F.timeVector) |
| 82 | (horizontalSectionVectorField F V) p) = 0 |
| 83 | riemann_tensor : IsSmoothHorizontalCovariantTensor F (k := 4) |
| 84 | (fun p v ↦ horizontalRiemann D p (v 0) (v 1) (v 2) (v 3)) |
| 85 | ricci_tensor : IsSmoothHorizontalCovariantTensor F (k := 2) |
| 86 | (fun p v ↦ horizontalRicci D p (v 0) (v 1)) |
| 87 | ricci_symmetric : ∀ p : F.Point, ∀ u v : F.Horizontal p, |
| 88 | horizontalRicci D p u v = horizontalRicci D p v u |
| 89 | scalar_smooth : ContMDiff (spacetimeModel n) 𝓘(ℝ) ∞ (horizontalScalarCurvature D) |
| 90 | normSq_smooth : ContMDiff (spacetimeModel n) 𝓘(ℝ) ∞ (horizontalCurvatureNormSq D) |
| 91 | norm_continuous : Continuous (horizontalCurvatureNorm D) |
| 92 | slice_calculus : ∀ t : ℝ, (D.sliceConnection t).CurvatureTensorCalculus |
| 93 | riemann_choice : ∀ D' : LeafwiseLeviCivitaFamily F S, |
| 94 | ∀ p : F.Point, ∀ u v w z : F.Horizontal p, |
| 95 | horizontalRiemann D p u v w z = horizontalRiemann D' p u v w z |
| 96 | ricci_choice : ∀ D' : LeafwiseLeviCivitaFamily F S, |
| 97 | ∀ p : F.Point, ∀ u v : F.Horizontal p, |
| 98 | horizontalRicci D p u v = horizontalRicci D' p u v |
| 99 | scalar_choice : ∀ D' : LeafwiseLeviCivitaFamily F S, ∀ p : F.Point, |
| 100 | horizontalScalarCurvature D p = horizontalScalarCurvature D' p |
| 101 | norm_choice : ∀ D' : LeafwiseLeviCivitaFamily F S, ∀ p : F.Point, |
| 102 | horizontalCurvatureNorm D p = horizontalCurvatureNorm D' p |
| 103 | normSq_choice : ∀ D' : LeafwiseLeviCivitaFamily F S, ∀ p : F.Point, |
| 104 | horizontalCurvatureNormSq D p = horizontalCurvatureNormSq D' p |
| 105 | equation_choice : ∀ D' : LeafwiseLeviCivitaFamily F S, |
| 106 | IntrinsicGeneralizedRicciEquation D ↔ IntrinsicGeneralizedRicciEquation D' |
| 107 | leafwise_smooth : ∀ U : Set F.Point, IsOpen U → |
| 108 | ∀ V : HorizontalSection F, IsSmoothHorizontalSectionOn F V U → |
| 109 | ContMDiffOn (spacetimeModel n) |
| 110 | ((spacetimeModel n).prod |
| 111 | 𝓘(ℝ, EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n))) ∞ |
| 112 | (fun p : F.Point ↦ Bundle.TotalSpace.mk' |
| 113 | (EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n)) |
| 114 | (E := fun q : F.Point ↦ F.Horizontal q →L[ℝ] F.Horizontal q) |
| 115 | p (rawLeafwiseCovariantDerivative D V p)) U |
| 116 | leafwise_apply_smooth : ∀ U : Set F.Point, IsOpen U → |
| 117 | ∀ V W : HorizontalSection F, |
| 118 | IsSmoothHorizontalSectionOn F V U → IsSmoothHorizontalSectionOn F W U → |
| 119 | IsSmoothHorizontalSectionOn F (fun p ↦ rawLeafwiseCovariantDerivative D W p (V p)) U |
| 120 | leafwise_choice : ∀ D' : LeafwiseLeviCivitaFamily F S, |
| 121 | ∀ U : Set F.Point, IsOpen U → |
| 122 | ∀ V : HorizontalSection F, IsSmoothHorizontalSectionOn F V U → |
| 123 | ∀ p ∈ U, rawLeafwiseCovariantDerivative D V p = |
| 124 | rawLeafwiseCovariantDerivative D' V p |
| 125 | horizontal_choice : ∀ D' : LeafwiseLeviCivitaFamily F S, |
| 126 | ∀ U : Set F.Point, IsOpen U → |
| 127 | ∀ V : HorizontalSection F, IsSmoothHorizontalSectionOn F V U → |
| 128 | ∀ p ∈ U, rawHorizontalCovariantDerivative D V p = |
| 129 | rawHorizontalCovariantDerivative D' V p |
| 130 | horizontal_connection : Nonempty (SpacetimeHorizontalConnection D) |
| 131 | |
| 132 | end PoincareMT |