[{"data":1,"prerenderedAt":4},["ShallowReactive",2],{"xp2V2crMaa":3},"# AlgoLib\n\nA [Lean 4](https://lean-lang.org/) library for **algorithms**, built on top of [Mathlib](https://github.com/leanprover-community/mathlib4). AlgoLib aims to provide machine-checked definitions, theorems, and algorithm implementations covering the standard undergraduate-through-graduate curriculum on algorithms.\n\nSince we focus on computable definitions and algorithms, we introduce new definitions for concepts already formalized in Mathlib (e.g., out definition of graphs). Our primarly goals is to provide a concise formalization of algorithms that stays close to their textbook formulation without compromising on generality. \n\n## Roadmap — v1\n\n### Theory\n\nAmong others:\n\n- **Walks & connectivity.** Walks, paths, cycles, Eulerian walks, components.\n- **Trees.** Trees and forests, Cayley's theorem on the number of labeled trees.\n- **Spectral graph theory.** Laplacian, Cheeger's inequality (upper and lower bounds), expansion / expander graphs.\n- **Matchings.** Matchings, augmenting paths, Hall's theorem, König's theorem.\n- **Colorings.** Proper vertex and edge colorings, chromatic number, basic bounds.\n- **Contractions, minors, topological minors.** Edge/vertex contractions and the minor and topological-minor relations.\n- **Embeddings & planarity.** Planar graphs, Euler's formula, Kuratowski's theorem, toroidal graphs.\n\n### Algorithms\n\n- **Flows.** Ford–Fulkerson, Edmonds–Karp, Push–Relabel.\n- **Graph traversal.** BFS, DFS.\n- **Shortest paths.** Dijkstra, Bellman–Ford, Floyd–Warshall.\n- **Minimum spanning trees.** Kruskal, Prim, Borůvka.\n- **Strongly connected components.** Tarjan / Kosaraju.\n- **Union–Find.** Disjoint-set forests with union-by-rank and path compression.\n\nEvery algorithm comes with a proof of correctness and a proof of runtime.\n\n## Repository layout\n\n```\nAlgoLib/\n├── Basic/          -- core graph structures (Graph, SimpleGraph, DiGraph, SimpleDiGraph)\n├── Theory/         -- mathematical results (walks, trees, spectral, matching, …)\n└── Algorithms/     -- algorithm implementations and correctness proofs\n```\n\n## Building\n\n```\nlake build\n```\n\nRequires the Lean toolchain pinned in `lean-toolchain`. `elan` will install it automatically.\n",1789762413852]