lean4-htt/tests/lean/run/customEliminators.lean
Kyle Miller 4bacd70b3f
feat: add option tactic.customEliminators to be able to turn off custom eliminators for induction and cases (#3655)
This was suggested by Scott Morrison to be able to help projects adjust
to `Nat` having built-in custom eliminators.
2024-03-28 01:14:17 +00:00

48 lines
667 B
Text

/-!
# Tests for the custom eliminators feature for `induction` and `cases`
-/
/-!
Test the built-in custom `Nat` eliminator.
-/
/--
error: unsolved goals
case zero
P : Nat → Prop
⊢ P 0
case succ
P : Nat → Prop
n✝ : Nat
a✝ : P n✝
⊢ P (n✝ + 1)
-/
#guard_msgs in
example (P : Nat → Prop) : P n := by
induction n
done
/-!
Turn off the built-in custom `Nat` eliminator.
-/
section
set_option tactic.customEliminators false
/--
error: unsolved goals
case zero
P : Nat → Prop
⊢ P Nat.zero
case succ
P : Nat → Prop
n✝ : Nat
n_ih✝ : P n✝
⊢ P n✝.succ
-/
#guard_msgs in
example (P : Nat → Prop) : P n := by
induction n
done
end