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.Measure.Transport.DisjointImages |
| 2 | import Mathlib.MeasureTheory.Integral.IntegrableOn |
| 3 | |
| 4 | /-! |
| 5 | # Exact calibrated transport on a stable source subset |
| 6 | |
| 7 | The supplied full-carrier transport applies to the indicator of an |
| 8 | actual stable image. Stable injectivity identifies its source indicator, |
| 9 | giving both restricted integrability and the exact signed integral. |
| 10 | Morgan-Tian Lemma 6.71 and Proposition 6.81, pp. 141, 145-146. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set MeasureTheory |
| 16 | |
| 17 | universe u |
| 18 | |
| 19 | namespace PoincareMT.M14 |
| 20 | |
| 21 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 22 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 23 | {T τ : ℝ} {x : G.Point} {E : M14ExponentialFamily G T x} |
| 24 | {H : M14StableSet G T τ x E} |
| 25 | |
| 26 | /-- Every measurable stable source subset satisfies the same exact |
| 27 | integrability equivalence and signed change of variables as the full |
| 28 | carrier, Lemma 6.71 and Proposition 6.81, pp. 141, 145-146. -/ |
| 29 | theorem measureData_change_of_variables_subset (D : M14MeasureJacobianData G T τ x E H) |
| 30 | {W : Set (G.Horizontal x)} (hW : W ⊆ H.carrier) (hm : MeasurableSet W) |
| 31 | (φ : (G.slices (T - τ)).Point → ℝ) (hφ : Measurable φ) : |
| 32 | (IntegrableOn (fun Z => φ (H.endpoint_slice_map Z) * D.jacobian Z) W D.sourceMeasure ↔ |
| 33 | IntegrableOn φ (H.endpoint_slice_map '' W) |
| 34 | (calibratedMetricVolume (G.slices (T - τ)).metricOnPoints)) ∧ |
| 35 | (∫ Z in W, φ (H.endpoint_slice_map Z) * D.jacobian Z ∂D.sourceMeasure) = |
| 36 | ∫ q in H.endpoint_slice_map '' W, φ q |
| 37 | ∂calibratedMetricVolume (G.slices (T - τ)).metricOnPoints := by |
| 38 | classical |
| 39 | let V := H.endpoint_slice_map '' W |
| 40 | have hV : MeasurableSet V := stable_slice_image_measurable H hW hm |
| 41 | have hVsub : V ⊆ H.endpoint_slice_map '' H.carrier := image_mono hW |
| 42 | let f := fun Z => φ (H.endpoint_slice_map Z) * D.jacobian Z |
| 43 | have heq : EqOn (fun Z => V.indicator φ (H.endpoint_slice_map Z) * D.jacobian Z) |
| 44 | (W.indicator f) H.carrier := by |
| 45 | intro Z hZ |
| 46 | change V.indicator φ (H.endpoint_slice_map Z) * D.jacobian Z = W.indicator f Z |
| 47 | by_cases hZW : Z ∈ W |
| 48 | · rw [indicator_of_mem (show H.endpoint_slice_map Z ∈ V from ⟨Z, hZW, rfl⟩), |
| 49 | indicator_of_mem hZW] |
| 50 | · have hZV : H.endpoint_slice_map Z ∉ V := by |
| 51 | rintro ⟨Y, hYW, hYZ⟩ |
| 52 | exact hZW ((stable_slice_endpoint_injective H (hW hYW) hZ hYZ) ▸ hYW) |
| 53 | rw [indicator_of_notMem hZV, indicator_of_notMem hZW, zero_mul] |
| 54 | have hsource : IntegrableOn (fun Z => V.indicator φ (H.endpoint_slice_map Z) * D.jacobian Z) |
| 55 | H.carrier D.sourceMeasure ↔ IntegrableOn f W D.sourceMeasure := by |
| 56 | rw [integrableOn_congr_fun heq D.carrier_measurable, integrableOn_indicator_iff hm, |
| 57 | inter_eq_left.mpr hW] |
| 58 | have htarget : IntegrableOn (V.indicator φ) (H.endpoint_slice_map '' H.carrier) |
| 59 | (calibratedMetricVolume (G.slices (T - τ)).metricOnPoints) ↔ |
| 60 | IntegrableOn φ V (calibratedMetricVolume (G.slices (T - τ)).metricOnPoints) := by |
| 61 | rw [integrableOn_indicator_iff hV, inter_eq_left.mpr hVsub] |
| 62 | have hsourceIntegral : |
| 63 | (∫ Z in H.carrier, V.indicator φ (H.endpoint_slice_map Z) * D.jacobian Z |
| 64 | ∂D.sourceMeasure) = ∫ Z in W, f Z ∂D.sourceMeasure := by |
| 65 | rw [setIntegral_congr_fun D.carrier_measurable heq, setIntegral_indicator hm, |
| 66 | inter_eq_right.mpr hW] |
| 67 | have htargetIntegral : |
| 68 | (∫ q in H.endpoint_slice_map '' H.carrier, V.indicator φ q |
| 69 | ∂calibratedMetricVolume (G.slices (T - τ)).metricOnPoints) = |
| 70 | ∫ q in V, φ q ∂calibratedMetricVolume (G.slices (T - τ)).metricOnPoints := by |
| 71 | rw [setIntegral_indicator hV, inter_eq_right.mpr hVsub] |
| 72 | obtain ⟨hint, heqIntegral⟩ := D.change_of_variables (V.indicator φ) (hφ.indicator hV) |
| 73 | exact ⟨hsource.symm.trans (hint.trans htarget), |
| 74 | hsourceIntegral.symm.trans (heqIntegral.trans htargetIntegral)⟩ |
| 75 | |
| 76 | end PoincareMT.M14 |