Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add option
tactic.customEliminators
to be able to turn off cu…
…stom 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.
- Loading branch information
Showing
3 changed files
with
66 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/-! | ||
# 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 |