actually finish tutorial level
This commit is contained in:
@@ -10,8 +10,7 @@ TheoremTab "012"
|
||||
|
||||
namespace MyNat
|
||||
|
||||
TacticDoc rfl
|
||||
"
|
||||
/--
|
||||
## Summary
|
||||
|
||||
`rfl` proves goals of the form `X = X`.
|
||||
@@ -44,7 +43,8 @@ for pedagogical purposes; mathematicians do not distinguish between propositiona
|
||||
and definitional equality because they think about definitions in a different way
|
||||
to type theorists (`zero_add` and `add_zero` are both \"facts\" as far
|
||||
as mathematicians are concerned, and who cares what the definition of addition is).*
|
||||
"
|
||||
-/
|
||||
TacticDoc rfl
|
||||
|
||||
NewTactic rfl
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ TheoremTab "012"
|
||||
|
||||
namespace MyNat
|
||||
|
||||
TacticDoc rw "
|
||||
/--
|
||||
## Summary
|
||||
|
||||
If `h` is a proof of an equality `X = Y`, then `rw [h]` will change
|
||||
@@ -59,7 +59,6 @@ h1 : x = y + 3
|
||||
h2 : 2 * y = x
|
||||
```
|
||||
then `rw [h1] at h2` will turn `h2` into `h2 : 2 * y = y + 3`.
|
||||
-/
|
||||
|
||||
## Common errors
|
||||
|
||||
@@ -107,9 +106,10 @@ that `a + ? = ? + a`, and `add_comm a c` is a proof that `a + c = c + a`.
|
||||
If `h : X = Y` then `rw [h]` will turn all `X`s into `Y`s.
|
||||
If you only want to change the 37th occurrence of `X`
|
||||
to `Y` then do `nth_rewrite 37 [h]`.
|
||||
"
|
||||
-/
|
||||
TacticDoc rw
|
||||
|
||||
TacticDoc «repeat» "
|
||||
/--
|
||||
## Summary
|
||||
|
||||
`repeat t` repeatedly applies the tactic `t`
|
||||
@@ -135,9 +135,11 @@ If `h : X = Y` and there are several `X`s in the goal, then
|
||||
If the goal is `2 + 2 = 4` then `nth_rewrite 2 [two_eq_succ_one]`
|
||||
will change the goal to `2 + succ 1 = 4`. In contrast, `rw [two_eq_succ_one]`
|
||||
will change the goal to `succ 1 + succ 1 = 4`.
|
||||
"
|
||||
-/
|
||||
TacticDoc «repeat»
|
||||
|
||||
NewTactic rw
|
||||
|
||||
NewHiddenTactic «repeat» nth_rewrite
|
||||
|
||||
Introduction
|
||||
|
||||
@@ -8,8 +8,7 @@ Title "Numbers"
|
||||
|
||||
namespace MyNat
|
||||
|
||||
DefinitionDoc MyNat as "ℕ"
|
||||
"
|
||||
/--
|
||||
`ℕ` is the natural numbers, just called \"numbers\" in this game. It's
|
||||
defined via two rules:
|
||||
|
||||
@@ -20,20 +19,22 @@ defined via two rules:
|
||||
|
||||
*The game uses its own copy of the natural numbers, called `MyNat` with notation `ℕ`.
|
||||
It is distinct from the Lean natural numbers `Nat`, which should hopefully
|
||||
never leak into the natural number game.*"
|
||||
never leak into the natural number game.*
|
||||
-/
|
||||
DefinitionDoc MyNat as "ℕ"
|
||||
|
||||
|
||||
/-- `one_eq_succ_zero` is a proof of `1 = succ 0`." -/
|
||||
TheoremDoc MyNat.one_eq_succ_zero as "one_eq_succ_zero" in "012"
|
||||
"`one_eq_succ_zero` is a proof of `1 = succ 0`."
|
||||
|
||||
/-- `two_eq_succ_one` is a proof of `2 = succ 1`. -/
|
||||
TheoremDoc MyNat.two_eq_succ_one as "two_eq_succ_one" in "012"
|
||||
"`two_eq_succ_one` is a proof of `2 = succ 1`."
|
||||
|
||||
/-- `three_eq_succ_two` is a proof of `3 = succ 2`. -/
|
||||
TheoremDoc MyNat.three_eq_succ_two as "three_eq_succ_two" in "012"
|
||||
"`three_eq_succ_two` is a proof of `3 = succ 2`."
|
||||
|
||||
/-- `four_eq_succ_three` is a proof of `4 = succ 3`. -/
|
||||
TheoremDoc MyNat.four_eq_succ_three as "four_eq_succ_three" in "012"
|
||||
"`four_eq_succ_three` is a proof of `4 = succ 3`."
|
||||
|
||||
NewDefinition MyNat
|
||||
NewTheorem MyNat.one_eq_succ_zero MyNat.two_eq_succ_one MyNat.three_eq_succ_two
|
||||
|
||||
@@ -10,7 +10,7 @@ TheoremTab "012"
|
||||
|
||||
namespace MyNat
|
||||
|
||||
TacticDoc nth_rewrite "
|
||||
/--
|
||||
## Summary
|
||||
|
||||
If `h : X = Y` and there are several `X`s in the goal, then
|
||||
@@ -21,7 +21,8 @@ If `h : X = Y` and there are several `X`s in the goal, then
|
||||
If the goal is `2 + 2 = 4` then `nth_rewrite 2 [two_eq_succ_one]`
|
||||
will change the goal to `2 + succ 1 = 4`. In contrast, `rw [two_eq_succ_one]`
|
||||
will change the goal to `succ 1 + succ 1 = 4`.
|
||||
"
|
||||
-/
|
||||
TacticDoc nth_rewrite
|
||||
|
||||
NewHiddenTactic nth_rewrite
|
||||
|
||||
|
||||
Reference in New Issue
Block a user