lean4-htt/src
Joachim Breitner 720cbd6434
feat: theorems are opaque (#12973)
This PR makes theorems opaque in almost all ways, including in the
kernel.

Already now, because of proof irrelevance, theorems are almost never
unfolded. Furthermore, the import handling allows conflicting theorem
declaration with same type and different values. This is sound, but
would be confusing if the value, and thus the import order, matters for
completeness.

So with this change, a `theorem` becomes more like an `opaque`: It has a
value (for soundness), but it is never unfolded during reduction or type
checking. There are still some places in meta code that have to peek
into theorems (e.g. `FunInd`, wfrec processing), but these are code
transformations, not reduction.

One place where reducing proofs is necessary is reducing `Acc.rec`
eliminating into Type. With this change, all proofs that need to be
reducable that way have to be `def`, not `theorem`. This is already the
case due to the module system. This does not affect uses of `Acc` via
well-founded recursion, because that has already been made opaque in
#5182. This moves the reduction behavior of `Acc.rec` further into the
“supported by the theory but not relied upon by regular Lean“ corner.

Fixes #12804

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-23 13:57:07 +00:00
..
bin perf: separate meta and non-meta initializers (#12016) 2026-02-26 08:05:19 +00:00
cmake chore: reformat all cmake files (#12218) 2026-01-28 18:23:08 +00:00
include/lean feat: increase default stack size from 8MB to 1GB (#12971) 2026-03-20 15:40:00 +00:00
Init chore: lemmas about BEq on List String.Slice (#13061) 2026-03-23 13:34:46 +00:00
initialize
kernel feat: theorems are opaque (#12973) 2026-03-23 13:57:07 +00:00
lake feat: unfold and rewrap instances in inferInstanceAs and deriving 2026-03-22 13:25:46 +01:00
Lean feat: theorems are opaque (#12973) 2026-03-23 13:57:07 +00:00
library feat: increase default stack size from 8MB to 1GB (#12971) 2026-03-20 15:40:00 +00:00
runtime feat: increase default stack size from 8MB to 1GB (#12971) 2026-03-20 15:40:00 +00:00
shell chore: move test suite setup to tests/CMakeLists.txt (#12278) 2026-02-03 13:22:20 +00:00
Std chore: variants of String.toNat? lemmas (#13057) 2026-03-23 09:32:32 +00:00
util chore: update to c++20 (#12117) 2026-02-11 01:17:40 +00:00
cadical.mk
CMakeLists.txt feat: experimental option to move non-meta compilation out of lean build step (#10291) 2026-03-20 10:39:39 +00:00
config.h.in
githash.h.in
Init.lean feat: add cbv_simproc infrastructure for user-extensible cbv simplification procedures (#12597) 2026-03-10 10:59:13 +00:00
lakefile.toml.in chore: pass the previous stage libLake as plugin (#13000) 2026-03-20 12:23:20 +00:00
lean-toolchain chore: relative lean-toolchains (#12652) 2026-02-25 10:23:35 +00:00
Lean.lean refactor: move getOriginalConstKind? into its own module to avoid future import cycle (#12265) 2026-02-01 16:18:51 +00:00
lean.mk.in
Leanc.lean
LeanChecker.lean refactor: remove Lean.Environment.replay from core (#12972) 2026-03-18 22:11:42 +00:00
LeanIR.lean feat: experimental option to move non-meta compilation out of lean build step (#10291) 2026-03-20 10:39:39 +00:00
out
Std.lean
stdlib.make.in feat: experimental option to move non-meta compilation out of lean build step (#10291) 2026-03-20 10:39:39 +00:00
stdlib_flags.h chore: consistent build flags between USE_LAKE ON and OFF (#12941) 2026-03-17 11:02:55 +00:00
version.h.in