Skip to content

Commit

Permalink
actually finish tutorial level
Browse files Browse the repository at this point in the history
  • Loading branch information
kbuzzard committed Jan 24, 2024
1 parent 8ef6a85 commit e180fc9
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 17 deletions.
6 changes: 3 additions & 3 deletions Game/Levels/Tutorial/L01rfl.lean
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ TheoremTab "012"

namespace MyNat

TacticDoc rfl
"
/--
## Summary
`rfl` proves goals of the form `X = X`.
Expand Down Expand Up @@ -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

Expand Down
12 changes: 7 additions & 5 deletions Game/Levels/Tutorial/L02rw.lean
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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`
Expand All @@ -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
Expand Down
15 changes: 8 additions & 7 deletions Game/Levels/Tutorial/L03two_eq_ss0.lean
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
5 changes: 3 additions & 2 deletions Game/Levels/Tutorial/L08twoaddtwo.lean
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down

0 comments on commit e180fc9

Please sign in to comment.