lean4-htt/src
Joachim Breitner afcf52e623
feat: .ctorIdx for all inductives (#9951)
This PR generates `.ctorIdx` functions for all inductive types, not just
enumeration types. This can be a building block for other constructions
(`BEq`, `noConfusion`) that are size-efficient even for large
inductives.

It also renames it from `.toCtorIdx` to `.ctorIdx`, which is the more
idiomatic naming.
The old name exists as an alias, with a deprecation attribute to be
added after the next
stage0 update.

These functions can arguably compiled down to a rather efficient tag
lookup, rather than a `case` statement. This is future work (but
hopefully near future).

For a fair number of basic types the compiler is not able to compile a
function using `casesOn` until further definitions have been defined.
This therefore (ab)uses the `genInjectivity` flag and
`gen_injective_theorems%` command to also control the generation of this
construct.

For (slightly) more efficient kernel reduction one could use `.rec`
rather than `.casesOn`. I did not do that yet, also because it
complicates compilation.
2025-08-25 10:47:06 +00:00
..
bin
cmake chore: fix spelling errors (#10042) 2025-08-22 07:23:12 +00:00
include/lean feat: add array access functions that return a borrowed result (#9864) 2025-08-12 04:25:14 +00:00
Init feat: .ctorIdx for all inductives (#9951) 2025-08-25 10:47:06 +00:00
initialize feat: remove the old compiler (#9275) 2025-07-09 06:00:46 +00:00
kernel feat: kernel hint for proof-by-reflection (#9865) 2025-08-12 19:24:47 +00:00
lake feat: add a stop position field to the parser (#10043) 2025-08-23 18:29:51 +00:00
Lean feat: .ctorIdx for all inductives (#9951) 2025-08-25 10:47:06 +00:00
library chore: remove unused FnBody.mdata constructor (#9564) 2025-07-26 15:20:13 +00:00
runtime refactor: implement IO.waitAny using Lean (#9732) 2025-08-06 13:09:15 +00:00
shell
Std feat: replace Std.Internal.Rat (#9979) 2025-08-23 12:07:01 +00:00
util chore: have shell.cpp use library/util.h rather than library/compiler… (#9269) 2025-07-09 01:41:04 +00:00
cadical.mk
CMakeLists.txt chore: make USE_LAKE the default (#10016) 2025-08-21 11:43:25 +00:00
config.h.in
githash.h.in
Init.lean chore: module-ize Init.lean 2025-06-29 16:52:13 +02:00
lakefile.toml.in fix: include all of Lake.Util in core build (#10090) 2025-08-23 22:55:39 +00:00
lean-toolchain
Lean.lean refactor: module-ize Lean (#9330) 2025-07-25 12:02:51 +00:00
lean.mk.in
Leanc.lean
Std.lean chore: add module keyword to grind tests (#10036) 2025-08-21 22:02:08 +00:00
stdlib.make.in chore: avoid calling into lake twice from CMake build (#9688) 2025-08-02 20:48:45 +00:00
stdlib_flags.h chore: remove old documentation site (#7974) 2025-05-14 14:31:33 +00:00
version.h.in