-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1045 from lean-ja/Seasawher/issue1041
simp_all を独立したタクティクとして紹介する
- Loading branch information
Showing
3 changed files
with
27 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/- # simp_all | ||
`simp_all` タクティクは、`simp` タクティクの派生で、仮定とゴールに対してこれ以上適用できなくなるまで `simp` を適用します。 | ||
`simp at *` と似ていますが、`simp_all` は簡約された仮定を再び簡約に使うなど再帰的な挙動をします。 | ||
-/ | ||
|
||
example (P : Nat → Bool) | ||
(h1 : P (if 0 + 0 = 0 then 1 else 2)) | ||
(h2 : P (if P 1 then 0 else 1) ) : P 0 := by | ||
simp at * | ||
|
||
-- まだゴールが残っている | ||
show P 0 | ||
|
||
simp [h1] at h2 | ||
assumption | ||
|
||
example (P : Nat → Bool) | ||
(h1 : P (if 0 + 0 = 0 then 1 else 2)) | ||
(h2 : P (if P 1 then 0 else 1) ) : P 0 := by | ||
-- 一発で終わる。 | ||
-- h1 を簡約した後で、h2 を「簡約後の h1」を使って簡約し、 | ||
-- ゴールと仮定が一致していることを確認するという挙動をする。 | ||
simp_all |
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