A formal specification and implementation of B+ Trees using the Lean 4 theorem prover.
BPlusTreeLean/Basic.lean- Basic definitions and utilitiesBPlusTreeLean/BPlusTree.lean- B+ Tree specification with invariants and theoremslakefile.lean- Lake build configurationlean-toolchain- Lean version specification
- Install Lean 4 and Lake: https://leanprover.github.io/lean4/doc/quickstart.html
- Build the project:
lake build - Open in VS Code with the Lean 4 extension
- Node size invariants
- Key ordering requirements
- Tree height bounds
- Operation correctness theorems
Use sorry placeholders to incrementally prove theorems as you learn Lean.