-
-
Notifications
You must be signed in to change notification settings - Fork 9
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 #1214 from lean-ja/Seasawher/issue1193
zify を紹介する
- Loading branch information
Showing
2 changed files
with
19 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/- # zify | ||
`zify` タクティクは、自然数 `Nat` についての命題を整数 `Int` についての命題に変換します。 | ||
-/ | ||
import Mathlib.Tactic.Zify -- `zify` タクティクを使うのに必要 | ||
import Mathlib.Tactic.GCongr | ||
|
||
example (x : Nat) (h : x ≥ 5) : 15 ≤ 3 * x := by | ||
-- 仮定とゴールを整数の不等式に変換する | ||
zify at h ⊢ | ||
|
||
-- 整数についての命題に変換した | ||
guard_hyp h : x ≥ (5 : Int) | ||
guard_target = (15 : Int) ≤ 3 * ↑x | ||
|
||
calc | ||
(15 : Int) = 3 * 5 := by rfl | ||
_ ≤ 3 * ↑x := by gcongr; decide |
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