lean4-htt/tests
Kim Morrison 0ba40b798b
feat: exact? uses star-indexed lemmas as fallback (#11494)
This PR re-enables star-indexed lemmas as a fallback for `exact?` and
`apply?`.

Star-indexed lemmas (those with overly-general discrimination tree keys
like `[*]`)
were previously dropped entirely for performance reasons. This caused
useful lemmas
like `Empty.elim`, `And.left`, `not_not.mp`, `Sum.elim`, and
`Function.mtr` to be
unfindable by library search.

The implementation adds a two-pass search strategy:
1. First, search using concrete discrimination keys (the current
behavior)
2. If no results are found, fall back to trying star-indexed lemmas

The star-indexed lemmas are extracted during tree initialization and
cached in an
environment extension, avoiding repeated computation.

Users can disable the fallback with `-star`:
```lean
example {α : Sort u} (h : Empty) : α := by apply? -star  -- error: no lemmas found
example {α : Sort u} (h : Empty) : α := by apply?        -- finds Empty.elim
```

🤖 Prepared with Claude Code

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-04 22:50:52 +00:00
..
bench test: add big match on nat lit benchmarks (#11502) 2025-12-04 08:21:56 +00:00
bench-radar chore: update and add benchmark metrics (#11420) 2025-11-28 14:40:43 +00:00
compiler chore: minor String API improvements (#11439) 2025-12-01 11:44:14 +00:00
elabissues
ir
lake feat: lake: resolve module clashes on import (#11270) 2025-12-03 00:46:20 +00:00
lean feat: exact? uses star-indexed lemmas as fallback (#11494) 2025-12-04 22:50:52 +00:00
pkg feat: lake: resolve module clashes on import (#11270) 2025-12-03 00:46:20 +00:00
playground
plugin
simpperf
.gitignore
common.sh
lakefile.toml
lean-toolchain