[{"data":1,"prerenderedAt":4},["ShallowReactive",2],{"2gXjTD5ZG4":3},"# Classification of Compact Surfaces\n\n![Classification of Surfaces](images/tcos-hero.png)\n\nThis repository contains a Lean proof of the Lean Eval challenge\n`topological_classification_of_surfaces` and shared work toward the related\n`jordan_curve` and `schoenflies` problems.  [Lean Eval problem](https://lean-lang.org/eval/problems/topological_classification_of_surfaces/)\n\nIt proves that every compact connected Hausdorff topological 2-manifold with boundary is\nhomeomorphic to the sphere, an orientable normal-form quotient, or a non-orientable normal-form\nquotient.\n\n## Authorship\n\nThis is a collaborative work of the SF LEAN meetup, undertaken as an exercise in autoformalization.  Most of the autoformalization work was done via ChatGPT Sol, with contributions from Claude Fable and other models.\n\nIf you are in the bay area, come to the [weekly meetup](https://luma.com/yi9idc15) at the SF Mox coworking space.\n\n\n## Documents\n\n- `ClassificationOfSurfaces/API.lean`: public Lean API map and preferred code entry point.\n- `docs/ARCHITECTURE.md`: proof architecture and source-file map.\n- `docs/DESIGN_DECISIONS.md`: stable design choices behind the formalization.\n- `docs/AUTOFORMALIZATION_GUIDE.md`: definition-faithfulness and maintenance rules.\n- `blueprint/src/content.tex`: theorem-by-theorem proof blueprint.\n- `CONTRIBUTING.md`: collaboration workflow.\n\n## Build\n\n```bash\nlake build\n```\n\nThe public classification proof is complete and contains no `sorry`.\n\n## Lean Eval submissions\n\nThe repository is directly submittable to Lean Eval.  Exact benchmark workspaces\nlive side by side under `LeanEval/`; Lean Eval discovers them by the `name` in\neach `lakefile.toml` and overlays only their `Submission.lean` and\n`Submission/**/*.lean` files onto pristine benchmark workspaces.\n\nThe large supporting payloads are generated from the normal source tree:\n\n```bash\npython3 port_submission.py          # refresh every ready payload\npython3 port_submission.py --check  # verify that checked-in payloads are current\npython3 port_submission.py --list   # show ready submissions and scaffolds\n```\n\n`jordan_curve` and `topological_classification_of_surfaces` are wired to complete\nproofs.  `schoenflies` has the correct workspace shape but remains a scaffold\nuntil the full theorem is proved.  See [`LeanEval/README.md`](LeanEval/README.md)\nfor the layout, local comparator commands, CI behavior, and the steps for adding\nanother shared source root.\n\nNormal pull requests build only the development project.  Apply the\n`lean-eval-submission` label when a PR's generated payloads are ready for the\nstandalone Lean Eval freshness and comparator checks; the same workflow can also\nbe started manually for any revision.\n\n## Architecture\n\nThe proof is organized around the faithful finite-cyclic polygonal-realization handoff:\n\n```lean\nGeometricTriangulation.toFiniteCyclicPresentation\nFiniteCyclicPresentation.PolygonalRealization\n```\n\nThe completed Moise–Radó route produces a faithful `GeometricTriangulation`. Its cyclic face\npresentation is homeomorphic to the geometric realization, Gallier–Xu normalization preserves the\npolygonal realization, and the three canonical endpoints realize the exact Lean-Eval\nrepresentatives:\n\n```text\nGeometricTriangulation\n  → FiniteCyclicPresentation\n  → NormalForm.canonicalPresentation\n  → vendored Lean-Eval quotient\n```\n\nThe final theorem `classification_of_surfaces`, with blueprint-facing wrapper\n`topological_classification_of_surfaces`, is the composition of these faithful homeomorphisms.\n`SurfaceCellComplex` now contains only finite incidence data; its former arbitrary realization\nfields and compatibility aliases have been removed.\n\n## Result\n\n- The repository builds with `lake build`.\n- The bottom API has concrete finite combinatorial data:\n  `SurfaceCellComplex`, signed darts, oriented triangulation edges, one-face presentations, and a\n  data-preserving triangulation-to-cell-complex conversion.\n- Standard example boundary words for the disk, annulus, torus, projective plane, and Mobius strip\n  compile as `SurfaceCellComplex` values.\n- The C0 chart-boundary seam is discharged: planar no-retraction gives Brouwer's fixed-point\n  theorem, hence invariance of domain and an unconditional `ChartBoundaryInvariant` instance.\n- The Moise/PL triangulation route is complete for compact connected Eval surfaces, including\n  surfaces with manifold boundary, and uses only the hypotheses in the Lean Eval statement.\n- The geometric triangulation is faithfully identified with its finite-cyclic polygonal quotient.\n- Gallier–Xu normalization reaches an admissible canonical presentation while preserving that\n  quotient.\n- The sphere, orientable, and nonorientable canonical presentations realize the exact vendored\n  Lean-Eval representatives.\n- `classification_of_surfaces` composes this faithful chain directly.\n",1788025896827]