Lean 4 fork for HoTT-compatible kernel extensions (Path types, transport, HITs). Maintained against upstream leanprover/lean4.
This PR adds theorems showing the consistency between `find?` and the various index-finding functions. The theorems establish bidirectional relationships between finding elements and finding their indices. **Forward direction** (find? in terms of index): - `find?_eq_map_findFinIdx?_getElem`: `xs.find? p = (xs.findFinIdx? p).map (xs[·])` - `find?_eq_bind_findIdx?_getElem?`: `xs.find? p = (xs.findIdx? p).bind (xs[·]?)` - `find?_eq_getElem?_findIdx`: `xs.find? p = xs[xs.findIdx p]?` **Reverse direction** (index in terms of find?): - `findIdx?_eq_bind_find?_idxOf?`: `xs.findIdx? p = (xs.find? p).bind (xs.idxOf?)` - `findFinIdx?_eq_bind_find?_finIdxOf?`: `xs.findFinIdx? p = (xs.find? p).bind (xs.finIdxOf?)` - `findIdx_eq_getD_bind_find?_idxOf?`: `xs.findIdx p = ((xs.find? p).bind (xs.idxOf?)).getD xs.length` All theorems are provided for `List`, `Array`, and `Vector` (where applicable). Requested at https://leanprover.zulipchat.com/#narrow/channel/113488-general/topic/show.20that.20Array.2Efind.3F.20and.20Array.2EfindFinIdx.3F.20consistent/near/567340199 🤖 Prepared with Claude Code Co-authored-by: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .claude | ||
| .github | ||
| doc | ||
| images | ||
| releases_drafts | ||
| script | ||
| src | ||
| stage0 | ||
| tests | ||
| .gitattributes | ||
| .gitignore | ||
| .gitpod.Dockerfile | ||
| .gitpod.yml | ||
| .ignore | ||
| CMakeLists.txt | ||
| CMakePresets.json | ||
| CODEOWNERS | ||
| CONTRIBUTING.md | ||
| flake.lock | ||
| flake.nix | ||
| lean-toolchain | ||
| lean.code-workspace | ||
| LICENSE | ||
| LICENSES | ||
| README.md | ||
| RELEASES.md | ||
This is the repository for Lean 4.
About
- Quickstart
- Homepage
- Theorem Proving Tutorial
- Functional Programming in Lean
- Documentation Overview
- Language Reference
- Release notes starting at v4.0.0-m3
- Examples
- External Contribution Guidelines
Installation
See Install Lean.
Contributing
Please read our Contribution Guidelines first.
Building from Source
See Building Lean.