Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flexible リンタの警告を消す #947

Merged
merged 1 commit into from
Oct 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Examples/Tactic/Simp.lean
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ namespace Simp --#

variable {P Q R : Prop}

set_option linter.flexible false in --#

example : (P ∨ Q ∨ R) ∧ R ↔ R := by
-- simp だけでは証明が終わらない
simp
Expand Down Expand Up @@ -61,7 +63,7 @@ use `set_option maxRecDepth <num>` to increase limit
use `set_option diagnostics true` to get diagnostic information
-/
#guard_msgs in
example (n m : Nat) : (n + 0) * m = n * m := by simp
example (n m : Nat) : (n + 0) * m = n * m := by simp

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

example (h : n + 0 + 0 = m) : n = m + (0 * n) := by
simp at h ⊢
simp only [add_zero, zero_mul] at h ⊢
assumption

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

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