Lean 4 fork for HoTT-compatible kernel extensions (Path types, transport, HITs). Maintained against upstream leanprover/lean4.
Find a file
Markus Himmel d6cd738ab4
feat: redefine String, part two (#10457)
This PR introduces safe alternatives to `String.Pos` and `Substring`
that can only represent valid positions/slices.

Specifically, the PR

- introduces the predicate `String.Pos.IsValid`;
- proves several nontrivial equivalent conditions for
`String.Pos.IsValid`;
- introduces `String.ValidPos`, which is a `String.Pos` with an
`IsValid` proof;
- introduces `String.Slice`, which is like `Substring` but made from
`String.ValidPos` instead of `Pos`;
- introduces `String.Pos.IsValidForSlice`, which is like
`String.Pos.IsValid` but for slices;
- introduces `String.Slice.Pos`, which is like `String.ValidPos` but for
slices;
- introduces various functions for converting between the two types of
positions.

The API added in this PR is not complete. It will be expanded in future
PRs with addional operations and verification.
2025-09-24 13:36:55 +00:00
.github chore: CI: ensure cache reuse in update-stage0 (#10359) 2025-09-12 14:56:32 +00:00
doc doc: testing Lean while avoiding rebuilds for downstream projects (#10328) 2025-09-10 13:53:34 +00:00
images
releases_drafts chore: updates to release_checklist.md (#7817) 2025-04-04 03:45:36 +00:00
script feat: scripts/Modulize.lean (#10460) 2025-09-24 11:40:17 +00:00
src feat: redefine String, part two (#10457) 2025-09-24 13:36:55 +00:00
stage0 chore: update stage0 2025-09-24 08:23:57 +00:00
tests feat: redefine String, part two (#10457) 2025-09-24 13:36:55 +00:00
.gitattributes fix: mark doc parser tests as eol=lf (#10344) 2025-09-11 11:19:01 +00:00
.gitignore feat: further release automation (#9092) 2025-06-30 05:44:10 +00:00
.gitpod.Dockerfile chore: add gitpod configuration (#6382) 2024-12-15 21:38:13 +00:00
.gitpod.yml chore: add gitpod configuration (#6382) 2024-12-15 21:38:13 +00:00
.ignore chore: ignore stage0/ (for rg etc.) 2022-03-18 15:28:20 +01:00
CMakeLists.txt chore: make USE_LAKE the default (#10016) 2025-08-21 11:43:25 +00:00
CMakePresets.json chore: fix reldebug preset (#8051) 2025-04-23 10:05:11 +00:00
CODEOWNERS chore: make datokrat code owner for iterators, ranges and slices (#9667) 2025-08-01 17:34:43 +00:00
CONTRIBUTING.md doc: triage 2024-07-26 18:24:06 +02:00
flake.lock chore: robustify Nix shell (#8141) 2025-04-28 15:08:32 +00:00
flake.nix chore: remove broken Nix build (#9910) 2025-08-14 08:31:39 +00:00
lean-toolchain doc: VS Code dev setup (#2961) 2023-11-30 08:35:03 +00:00
lean.code-workspace feat: scripts/Modulize.lean (#10460) 2025-09-24 11:40:17 +00:00
LICENSE
LICENSES feat: ship cadical (#4325) 2024-08-23 09:13:27 +00:00
README.md doc: update URLs that are currently pointing to redirects (#10397) 2025-09-17 15:50:07 +00:00
RELEASES.md chore: updates to release_checklist.md (#7817) 2025-04-04 03:45:36 +00:00

This is the repository for Lean 4.

About

Installation

See Install Lean.

Contributing

Please read our Contribution Guidelines first.

Building from Source

See Building Lean.