-
Notifications
You must be signed in to change notification settings - Fork 450
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR adds support for the `simp?` and `dsimp?` tactics in conversion mode. Closes #6164
- Loading branch information
Showing
3 changed files
with
62 additions
and
1 deletion.
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,29 @@ | ||
/-! | ||
# `simp?` in conversion mode | ||
Tests that `simp?` and `dsimp?` work properly in `conv` mode: namely, that each displays the | ||
appropriate suggestion and applies the corresponding simplification to the focused expression. | ||
-/ | ||
|
||
attribute [simp] Nat.two_mul | ||
|
||
/-- | ||
info: Try this: simp only [Nat.two_mul] | ||
-/ | ||
#guard_msgs in | ||
example (n : Nat) : 123 + 2 * n = 123 + (n + n) := by | ||
conv => | ||
enter [1, 2] | ||
simp? | ||
|
||
|
||
@[simp] def foo (n : Nat) := n + 1 | ||
|
||
/-- | ||
info: Try this: dsimp only [foo] | ||
-/ | ||
#guard_msgs in | ||
example (n : Nat) : foo n = n + 1 := by | ||
conv => | ||
lhs | ||
dsimp? |