[{"data":1,"prerenderedAt":4},["ShallowReactive",2],{"YnTVfOeOzk":3},"# classifying compact connected 1-manifolds\n\nA Lean 4 and [mathlib](https://github.com/leanprover-community/mathlib4) proof of\nthe classification of compact connected 1-manifolds with boundary:\n\n> **Theorem** (`classification`, in `OneMfld/Classification.lean`).\n> Every compact, connected, Hausdorff topological space charted on `ℝ≥0` is\n> homeomorphic to the circle or to the closed unit interval.\n\n```lean\nnoncomputable def classification [TopologicalSpace M] [ConnectedSpace M]\n    [T2Space M] [CompactSpace M] (ht : ChartedSpace NNReal M) :\n    (M ≃ₜ Circle) ⊕ (M ≃ₜ ↑UnitInterval)\n```\n\n`#print axioms classification` reports only `[propext, Classical.choice, Quot.sound]`\n\nThere are no `sorry`s in the repository.\n\n## Structure of the proof\n\nFollowing [Gale's \"take-home exam\"](https://doi.org/10.2307/2322421) argument:\n\n1. **Normalization** (`NiceCharts`, `ClassifyInterval`, `IntervalCharts`,\n   `FiniteIntervalCharts`): every chart can be shrunk so its target is an open interval\n   `Ioo x y` (interior chart) or `Iio x` (boundary chart) in `ℝ≥0`, and compactness\n   yields a finite atlas of such charts.\n2. **Induction on atlas size** (`Classification`): repeatedly merge two overlapping\n   charts into one, or recognize the terminal cases.\n3. **The outer-overlap lemma** (`Outer`): the image of any component of the overlap of\n   two interval charts is an end-segment of the chart target — otherwise its closure\n   would be trapped in the chart by a compactness argument, contradicting that it must\n   escape into the other chart (`ClosureOverlap`).\n4. **End-matching** (`GlueCore`, `TwoComponents`): the transition map on a component is\n   strictly monotone in the direction forced by which interval-ends are interior; the\n   wrong direction would give the overlap two distinct limit points at once,\n   contradicting Hausdorffness.\n5. **Gluing** (`GlueNNReal`, `GlueUI`, `ClassifyOverlaps`): two charts with connected\n   overlap merge via `OpenPartialHomeomorph.piecewise`; two boundary charts glue onto\n   the closed unit interval, exhibiting `M ≃ₜ [0,1]`.\n6. **The circle** (`TwoComponents`, `CircleBlocks`, `CircleGlue`): a disconnected\n   overlap has exactly two components, one at each end of each chart; the two charts\n   then embed as overlapping arcs of `AddCircle 1` and glue to a chart of `M` onto the\n   whole circle, exhibiting `M ≃ₜ Circle`.\n\n## Building\n\nWith [elan](https://github.com/leanprover/elan) installed:\n\n```\nlake exe cache get   # fetch mathlib build cache\nlake build\n```\n\nThe toolchain (`lean-toolchain`) and mathlib version (`lake-manifest.json`) are pinned.\n",1789154851956]