lean4-htt/tests/elab/decide_cbv_errors.lean
Wojciech Różowski 1f04bf4fd1
feat: add simpDecideCbv simproc for cbv decide (#12766)
This PR adds a dedicated cbv simproc for `Decidable.decide` that
directly matches on `isTrue`/`isFalse` instances, producing simpler
proof terms and avoiding unnecessary unfolding through `Decidable.rec`.

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 14:24:14 +00:00

19 lines
526 B
Text

set_option cbv.warning false
-- Success: proposition reduces to `Bool.true`
example : 1 + 1 = 2 := by decide_cbv
example : 1 ∈ [1, 2, 3] := by decide_cbv
/-- error: `decide_cbv` failed: the proposition evaluates to `false` -/
#guard_msgs (error) in
example : 1 + 1 = 3 := by decide_cbv
opaque myOpaqueBool : Bool
/--
error: `decide_cbv` failed: could not reduce the expression to a boolean value; got stuck at: ⏎
decide (myOpaqueBool = true)
-/
#guard_msgs (error) in
example : myOpaqueBool = true := by decide_cbv