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 Mathlib.Topology.OpenPartialHomeomorph.Basic |
| 2 | import Mathlib.Topology.Algebra.Group.Basic |
| 3 | |
| 4 | /-! |
| 5 | # Local shear coordinates of a continuous graph |
| 6 | |
| 7 | Vertical translation straightens a continuous graph on an open domain. |
| 8 | This supports the topological side selection at the piecewise smooth |
| 9 | straight contact in MT Claim 19.40; no smoothness is imposed on the graph. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Set |
| 15 | |
| 16 | namespace PoincareMT |
| 17 | |
| 18 | /-- The explicit shear over an open domain and its explicit inverse are continuous whenever |
| 19 | the graph function is continuous there. Source: MT Claim 19.40, pp. 470-471; |
| 20 | derivations/2026-09-27-minimal-contact-regularity.md, Section 9. -/ |
| 21 | def m64ContinuousGraphShear |
| 22 | {E F : Type*} [TopologicalSpace E] [TopologicalSpace F] |
| 23 | [AddCommGroup F] [IsTopologicalAddGroup F] |
| 24 | {h : E → F} {X : Set E} (hX : IsOpen X) (hh : ContinuousOn h X) : |
| 25 | OpenPartialHomeomorph (E × F) (E × F) where |
| 26 | toFun q := (q.1, h q.1 + q.2) |
| 27 | invFun q := (q.1, q.2 - h q.1) |
| 28 | source := X ×ˢ univ |
| 29 | target := X ×ˢ univ |
| 30 | map_source' _ hq := ⟨hq.1, mem_univ _⟩ |
| 31 | map_target' _ hq := ⟨hq.1, mem_univ _⟩ |
| 32 | left_inv' _ _ := by simp |
| 33 | right_inv' _ _ := by simp |
| 34 | open_source := hX.prod isOpen_univ |
| 35 | open_target := hX.prod isOpen_univ |
| 36 | continuousOn_toFun := continuousOn_fst.prodMk |
| 37 | ((hh.comp continuousOn_fst (fun _ hq => hq.1)).add continuousOn_snd) |
| 38 | continuousOn_invFun := continuousOn_fst.prodMk |
| 39 | (continuousOn_snd.sub (hh.comp continuousOn_fst (fun _ hq => hq.1))) |
| 40 | |
| 41 | end PoincareMT |