Skip to content

Commit 6966144

Browse files
authored
Merge pull request #947 from lean-ja/simp-warn
`flexible` リンタの警告を消す
2 parents 061fcf7 + e44ba69 commit 6966144

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Examples/Tactic/Simp.lean

+5-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ namespace Simp --#
88

99
variable {P Q R : Prop}
1010

11+
set_option linter.flexible false in --#
12+
1113
example : (P ∨ Q ∨ R) ∧ R ↔ R := by
1214
-- simp だけでは証明が終わらない
1315
simp
@@ -61,7 +63,7 @@ use `set_option maxRecDepth <num>` to increase limit
6163
use `set_option diagnostics true` to get diagnostic information
6264
-/
6365
#guard_msgs in
64-
example (n m : Nat) : (n + 0) * m = n * m := by simp
66+
example (n m : Nat) : (n + 0) * m = n * m := by simp
6567

6668
end
6769
/- ## simp で使用できる構文
@@ -78,7 +80,7 @@ example (h : R) : (P ∨ Q ∨ R) ∧ R := by
7880
variable {n m : Nat}
7981

8082
example (h : n + 0 + 0 = m) : n = m + (0 * n) := by
81-
simp at h ⊢
83+
simp only [add_zero, zero_mul] at h ⊢
8284
assumption
8385

8486
/- ローカルコンテキストとゴールをまとめて全部単純化したい場合は `simp at *` とします。 -/
@@ -104,6 +106,7 @@ example : (P ∨ Q ∨ R) ∧ R ↔ R := by
104106
`simp` の設定で `arith` を有効にすると、算術的な単純化もできるようになります。
105107
これはよく使用されるので、`simp_arith` という省略形が用意されています。
106108
-/
109+
set_option linter.flexible false in --#
107110

108111
example {x y : Nat} : 0 < 1 + x ∧ x + y + 2 ≥ y + 1 := by
109112
-- `simp` だけでは証明が終わらない

0 commit comments

Comments
 (0)