Replies: 2 comments 1 reply
-
こちらの書籍ですが、以下に日本語訳がありますので、こちらを利用されると作業進めやすいかもしれないです。 |
Beta Was this translation helpful? Give feedback.
1 reply
-
とりあえず insertion sort の性質の証明をやってみたいです! 冒頭の,配列がソート済みであることの定義を書き直してみました import Mathlib.Tactic
/--
the formal definition of what "array is sorted" means.
-/
def Sorted : List Nat → Prop
| [] => true
| [_] => true
| x :: y :: as => x ≤ y ∧ Sorted (y :: as)
-- check the above definition by proving trivial results!
example : Sorted [1, 2] := by
rw [Sorted]
constructor
· norm_num
· rfl
-- [2, 1] is not sorted!
example : ¬ Sorted [2, 1] := by
dsimp [Sorted]
push_neg
intro h
contradiction |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
@aconite-ac @haruhisa-enomoto
https://softwarefoundations.cis.upenn.edu/
Software Foundations というのは Coq で書かれた教科書です.これの Lean 版はないようですが,Coq と Lean は似ているので書き直すことが比較的容易にできるのではないかと思います.
全巻を書き直すとなると大変ですし,おそらく頓挫しますが,Volume 3 の挿入ソートの話だけ,とかそういう風に部分的に翻案するのでもおもしろいと思います.
Beta Was this translation helpful? Give feedback.
All reactions