Skip to content

Commit

Permalink
suffices のコード例を,多少非自明なものに変更する
Browse files Browse the repository at this point in the history
  • Loading branch information
Seasawher committed Oct 7, 2023
1 parent ad027ae commit e946162
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 9 additions & 4 deletions Examples/Suffices.lean
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
example (hPQ: P → Q) (hQR: Q → R) (hP: P) : R := by
-- `Q` を示せば十分
suffices Q from hQR this
import Mathlib.Data.Nat.Order.Lemmas

exact hPQ hP
-- ANCHOR: first
example : 13 ∣ (2 ^ 70 + 3 ^ 70) := by
-- 余りがゼロであることを示せば十分
suffices (2 ^ 70 + 3 ^ 70) % 13 = 0 from by
exact Iff.mpr (Nat.dvd_iff_div_mul_eq (2 ^ 70 + 3 ^ 70) 13) rfl

rfl
-- ANCHOR_END: first
2 changes: 1 addition & 1 deletion src/suffices.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
`apply` と似ていますが,`apply` と違って「十分条件になっていること」の証明が明らかでないときにも使うことができます.

```lean
{{#include ../Examples/Suffices.lean}}
{{#include ../Examples/Suffices.lean:first}}
```

`suffices Q from ...` という形式の場合は,証明を直接構成することが必要です.`suffices Q from by ...` とすると,タクティクによって証明を構成するモードになります.

0 comments on commit e946162

Please sign in to comment.