algorithm world fix docstrings
This commit is contained in:
@@ -8,9 +8,8 @@ TheoremTab "+"
|
||||
|
||||
namespace MyNat
|
||||
|
||||
TheoremDoc MyNat.add_left_comm as "add_left_comm" in "+" "
|
||||
`add_left_comm a b c` is a proof that `a + (b + c) = b + (a + c)`.
|
||||
"
|
||||
/-- `add_left_comm a b c` is a proof that `a + (b + c) = b + (a + c)`. -/
|
||||
TheoremDoc MyNat.add_left_comm as "add_left_comm" in "+"
|
||||
|
||||
Introduction "Having to rearrange variables manually using commutativity and
|
||||
associativity is very tedious. We start by reminding you of this. `add_left_comm`
|
||||
|
||||
@@ -8,14 +8,15 @@ TheoremTab "+"
|
||||
|
||||
namespace MyNat
|
||||
|
||||
TacticDoc simp "
|
||||
/--
|
||||
# Overview
|
||||
|
||||
Lean's simplifier, `simp`, will rewrite every lemma
|
||||
tagged with `simp` and every lemma fed to it by the user, as much as it can.
|
||||
Furthermore, it will attempt to order variables into an internal order if fed
|
||||
lemmas such as `add_comm`, so that it does not go into an infinite loop.
|
||||
"
|
||||
-/
|
||||
TacticDoc simp
|
||||
|
||||
NewTactic simp
|
||||
|
||||
|
||||
@@ -11,12 +11,13 @@ namespace MyNat
|
||||
macro "simp_add" : tactic => `(tactic|(
|
||||
simp only [add_assoc, add_left_comm, add_comm]))
|
||||
|
||||
TacticDoc simp_add "
|
||||
/--
|
||||
# Overview
|
||||
|
||||
Our home-made tactic `simp_add` will solve arbitrary goals of
|
||||
the form `a + (b + c) + (d + e) = e + (d + (c + b)) + a`.
|
||||
"
|
||||
-/
|
||||
TacticDoc simp_add
|
||||
|
||||
NewTactic simp_add
|
||||
|
||||
|
||||
@@ -30,10 +30,8 @@ Let's use this lemma to prove `succ_inj`, the theorem which
|
||||
Peano assumed as an axiom and which we have already used extensively without justification.
|
||||
"
|
||||
|
||||
/-- `pred_succ n` is a proof of `pred (succ n) = n`. -/
|
||||
TheoremDoc MyNat.pred_succ as "pred_succ" in "Peano"
|
||||
"
|
||||
`pred_succ n` is a proof of `pred (succ n) = n`.
|
||||
"
|
||||
|
||||
NewTheorem MyNat.pred_succ
|
||||
|
||||
|
||||
@@ -27,29 +27,24 @@ you how to *prove* results like that.
|
||||
If you can turn your goal into `True`, then the `triv` tactic will solve it.
|
||||
"
|
||||
|
||||
/-- `is_zero_zero` is a proof of `is_zero 0 = True`. -/
|
||||
TheoremDoc MyNat.is_zero_zero as "is_zero_zero" in "Peano"
|
||||
"
|
||||
`is_zero_zero` is a proof of `is_zero 0 = True`.
|
||||
"
|
||||
|
||||
/-- `is_zero_succ a` is a proof of `is_zero (succ a) = False`. -/
|
||||
TheoremDoc MyNat.is_zero_succ as "is_zero_succ" in "Peano"
|
||||
"
|
||||
`is_zero_succ a` is a proof of `is_zero (succ a) = False`.
|
||||
"
|
||||
|
||||
/-- `succ_ne_zero a` is a proof of `succ a ≠ 0`. -/
|
||||
TheoremDoc MyNat.succ_ne_zero as "succ_ne_zero" in "Peano"
|
||||
"
|
||||
`succ_ne_zero a` is a proof of `succ a ≠ 0`.
|
||||
"
|
||||
|
||||
NewTheorem MyNat.is_zero_zero MyNat.is_zero_succ
|
||||
|
||||
TacticDoc triv "
|
||||
/--
|
||||
# Summary
|
||||
|
||||
`triv` will solve the goal `True`.
|
||||
-/
|
||||
TacticDoc triv
|
||||
|
||||
"
|
||||
|
||||
NewTactic triv
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ that `succ m ≠ 0` is `succ_ne_zero m`. The proof that if `h : m = n` then
|
||||
remaining job we have to do: if `a ≠ b` then `succ a ≠ succ b`.
|
||||
"
|
||||
|
||||
TacticDoc contrapose "
|
||||
/--
|
||||
# Summary
|
||||
|
||||
If you have a hypothesis
|
||||
@@ -49,13 +49,13 @@ a hypothesis
|
||||
and goal
|
||||
|
||||
`a = b`.
|
||||
"
|
||||
-/
|
||||
TacticDoc contrapose
|
||||
|
||||
NewTactic contrapose
|
||||
|
||||
TheoremDoc MyNat.succ_ne_succ as "succ_ne_succ" in "Peano" "
|
||||
`succ_ne_succ m n` is the proof that `m ≠ n → succ m ≠ succ n`.
|
||||
"
|
||||
/-- `succ_ne_succ m n` is the proof that `m ≠ n → succ m ≠ succ n`. -/
|
||||
TheoremDoc MyNat.succ_ne_succ as "succ_ne_succ" in "Peano"
|
||||
|
||||
/-- If $a \neq b$ then $\operatorname{succ}(a) \neq\operatorname{succ}(b)$. -/
|
||||
Statement succ_ne_succ (m n : ℕ) (h : m ≠ n) : succ m ≠ succ n := by
|
||||
|
||||
@@ -9,7 +9,7 @@ TheoremTab "Peano"
|
||||
|
||||
namespace MyNat
|
||||
|
||||
TacticDoc decide "
|
||||
/--
|
||||
# Summary
|
||||
|
||||
`decide` will attempt to solve a goal if it can find an algorithm which it
|
||||
@@ -20,7 +20,8 @@ can run to solve it.
|
||||
A term of type `DecidableEq ℕ` is an algorithm to decide whether two naturals
|
||||
are equal or different. Hence, once this term is made and made into an `instance`,
|
||||
the `decide` tactic can use it to solve goals of the form `a = b` or `a ≠ b`.
|
||||
"
|
||||
-/
|
||||
TacticDoc decide
|
||||
|
||||
NewTactic decide
|
||||
|
||||
|
||||
Reference in New Issue
Block a user