big refactor

This commit is contained in:
Jon Eugster
2023-05-15 15:05:02 +02:00
parent e81546a18d
commit 2604c89284
127 changed files with 585 additions and 770 deletions

View File

@@ -25,4 +25,4 @@ RUN lake clean && lake build
WORKDIR /game/lake-packages/GameServer/server/build/bin/ WORKDIR /game/lake-packages/GameServer/server/build/bin/
CMD ./gameserver --server /game/ NNG NNG CMD ./gameserver --server /game/ Game Game

View File

@@ -1,15 +1,15 @@
import GameServer.Commands import GameServer.Commands
import NNG.Levels.Tutorial import Game.Levels.Tutorial
import NNG.Levels.Addition import Game.Levels.Addition
import NNG.Levels.Multiplication import Game.Levels.Multiplication
import NNG.Levels.Power import Game.Levels.Power
import NNG.Levels.Function import Game.Levels.Function
import NNG.Levels.Proposition import Game.Levels.Proposition
import NNG.Levels.AdvProposition import Game.Levels.AdvProposition
import NNG.Levels.AdvAddition import Game.Levels.AdvAddition
import NNG.Levels.AdvMultiplication import Game.Levels.AdvMultiplication
--import NNG.Levels.Inequality --import Game.Levels.Inequality
Game "NNG" Game "NNG"
Title "Natural Number Game" Title "Natural Number Game"

88
Game/Doc/Definitions.lean Normal file
View File

@@ -0,0 +1,88 @@
import GameServer.Commands
-- DefinitionDoc MyNat as ""
-- "
-- The Natural Numbers. These are constructed through:
-- * `(0 : )`, an element called zero.
-- * `(succ : )`, the successor function , i.e. one is `succ 0` and two is `succ (succ 0)`.
-- * `induction` (or `rcases`), tactics to treat the cases $n = 0$ and `n = m + 1` seperately.
-- ## Game Modifications
-- This notation is for our own version of the natural numbers, called `MyNat`.
-- The natural numbers implemented in Lean's core are called `Nat`.
-- If you end up getting someting of type `Nat` in this game, you probably
-- need to write `(4 : )` to force it to be of type `MyNat`.
-- *Write with `\\N`.*
-- "
-- DefinitionDoc Add as "+" "
-- Addition on `` is defined through two axioms:
-- * `add_zero (a : ) : a + 0 = a`
-- * `add_succ (a d : ) : a + succ d = succ (a + d)`
-- "
-- DefinitionDoc Pow as "^" "
-- Power on `` is defined through two axioms:
-- * `pow_zero (a : ) : a ^ 0 = 1`
-- * `pow_succ (a b : ) : a ^ succ b = a ^ b * a`
-- ## Game-specific notes
-- Note that you might need to manually specify the type of the first number:
-- ```
-- (2 : ) ^ 1
-- ```
-- If you write `2 ^ 1` then lean will try to work in it's inbuild `Nat`, not in
-- the game's natural numbers `MyNat`.
-- "
-- DefinitionDoc One as "1" "
-- `1 : ` is by definition `succ 0`. Use `one_eq_succ_zero`
-- to change between the two.
-- "
-- DefinitionDoc False as "False" "
-- `False` is a proposition that that is always false, in contrast to `True` which is always true.
-- A proof of `False`, i.e. `(h : False)` is used to implement a contradiction: From a proof of `False`
-- anything follows, *ad absurdum*.
-- For example, \"not\" (`¬ A`) is therefore implemented as `A → False`.
-- (\"If `A` is true then we have a contradiction.\")
-- "
-- DefinitionDoc Not as "¬" "
-- Logical \"not\" is implemented as `¬ A := A → False`.
-- *Write with `\\n`.*
-- "
-- DefinitionDoc And as "∧" "
-- (missing)
-- *Write with `\\and`.*
-- "
-- DefinitionDoc Or as "" "
-- (missing)
-- *Write with `\\or`.*
-- "
-- DefinitionDoc Iff as "↔" "
-- (missing)
-- *Write with `\\iff`.*
-- "
-- DefinitionDoc Mul as "*" ""
-- DefinitionDoc Ne as "≠" ""

190
Game/Doc/Tactics.lean Normal file
View File

@@ -0,0 +1,190 @@
import GameServer.Commands
-- TacticDoc rfl
-- "
-- ## Summary
-- `rfl` proves goals of the form `X = X`.
-- ## Details
-- The `rfl` tactic will close any goal of the form `A = B`
-- where `A` and `B` are *exactly the same thing*.
-- ## Example:
-- If it looks like this in the top right hand box:
-- ```
-- Objects:
-- a b c d :
-- Goal:
-- (a + b) * (c + d) = (a + b) * (c + d)
-- ```
-- then `rfl` will close the goal and solve the level.
-- ## Game modifications
-- `rfl` in this game is weakened.
-- The real `rfl` could also proof goals of the form `A = B` where the
-- two sides are not *exactly identical* but merely
-- *\"definitionally equal\"*. That means the real `rfl`
-- could prove things like `a + 0 = a`.
-- "
-- TacticDoc rw
-- "
-- ## Summary
-- If `h` is a proof of `X = Y`, then `rw [h]` will change
-- all `X`s in the goal to `Y`s.
-- ### Variants
-- * `rw [← h]` (changes `Y` to `X`)
-- * `rw [h] at h2` (changes `X` to `Y` in hypothesis `h2` instead of the goal)
-- * `rw [h] at *` (changes `X` to `Y` in the goal and all hypotheses)
-- ## Details
-- The `rw` tactic is a way to do \"substituting in\". There
-- are two distinct situations where use this tactics.
-- 1) If `h : A = B` is a hypothesis (i.e., a proof of `A = B`)
-- in your local context (the box in the top right)
-- and if your goal contains one or more `A`s, then `rw [h]`
-- will change them all to `B`'s.
-- 2) The `rw` tactic will also work with proofs of theorems
-- which are equalities (look for them in the drop down
-- menu on the left, within Theorem Statements).
-- For example, in world 1 level 4
-- we learn about `add_zero x : x + 0 = x`, and `rw [add_zero]`
-- will change `x + 0` into `x` in your goal (or fail with
-- an error if Lean cannot find `x + 0` in the goal).
-- Important note: if `h` is not a proof of the form `A = B`
-- or `A ↔ B` (for example if `h` is a function, an implication,
-- or perhaps even a proposition itself rather than its proof),
-- then `rw` is not the tactic you want to use. For example,
-- `rw (P = Q)` is never correct: `P = Q` is the true-false
-- statement itself, not the proof.
-- If `h : P = Q` is its proof, then `rw [h]` will work.
-- Pro tip 1: If `h : A = B` and you want to change
-- `B`s to `A`s instead, try `rw ←h` (get the arrow with `\\l` and
-- note that this is a small letter L, not a number 1).
-- ### Example:
-- If it looks like this in the top right hand box:
-- ```
-- Objects:
-- x y :
-- Assumptions:
-- h : x = y + y
-- Goal:
-- succ (x + 0) = succ (y + y)
-- ```
-- then
-- `rw [add_zero]`
-- will change the goal into `succ x = succ (y + y)`, and then
-- `rw [h]`
-- will change the goal into `succ (y + y) = succ (y + y)`, which
-- can be solved with `rfl`.
-- ### Example:
-- You can use `rw` to change a hypothesis as well.
-- For example, if your local context looks like this:
-- ```
-- Objects:
-- x y :
-- Assumptions:
-- h1 : x = y + 3
-- h2 : 2 * y = x
-- Goal:
-- y = 3
-- ```
-- then `rw [h1] at h2` will turn `h2` into `h2 : 2 * y = y + 3`.
-- ## Game modifications
-- The real `rw` tactic does automatically try to call `rfl` afterwards. We disabled this
-- feature for the game.
-- "
-- TacticDoc induction
-- "
-- "
-- TacticDoc exact
-- "
-- "
-- TacticDoc apply
-- "
-- "
-- TacticDoc intro
-- "
-- "
-- TacticDoc «have»
-- "
-- "
-- TacticDoc constructor
-- "
-- "
-- TacticDoc rcases
-- "
-- "
-- TacticDoc left
-- "
-- "
-- TacticDoc revert
-- "
-- "
-- TacticDoc tauto
-- "
-- "
-- TacticDoc use
-- "
-- "
-- TacticDoc right
-- "
-- "
-- TacticDoc by_cases
-- "
-- "
-- TacticDoc contradiction
-- "
-- "
-- TacticDoc exfalso
-- "
-- "
-- TacticDoc simp
-- "
-- "
-- TacticDoc «repeat»
-- "
-- "

View File

@@ -1,4 +1,4 @@
import NNG.Levels.Addition.Level_6 import Game.Levels.Addition.Level_6
Game "NNG" Game "NNG"
World "Addition" World "Addition"
@@ -33,4 +33,4 @@ a reminder of the things you're now equipped with which we'll need in this world
You will also find all this information in your Inventory to read the documentation. You will also find all this information in your Inventory to read the documentation.
" "

View File

@@ -1,11 +1,12 @@
import NNG.Metadata import Game.Metadata
import NNG.MyNat.Addition import Game.MyNat.Addition
Game "NNG" Game "NNG"
World "Addition" World "Addition"
Level 1 Level 1
Title "the induction tactic." Title "the induction tactic."
--namespace MyNat
open MyNat open MyNat
Introduction Introduction
@@ -33,7 +34,6 @@ To prove `0 + n = n` we need to use induction on $n$. While we're here,
note that `zero_add` is about zero add something, and `add_zero` is about something add zero. note that `zero_add` is about zero add something, and `add_zero` is about something add zero.
The names of the proofs tell you what the theorems are. Anyway, let's prove `0 + n = n`. The names of the proofs tell you what the theorems are. Anyway, let's prove `0 + n = n`.
" "
Statement MyNat.zero_add Statement MyNat.zero_add
"For all natural numbers $n$, we have $0 + n = n$." "For all natural numbers $n$, we have $0 + n = n$."
(n : ) : 0 + n = n := by (n : ) : 0 + n = n := by

View File

@@ -1,4 +1,4 @@
import NNG.Levels.Addition.Level_1 import Game.Levels.Addition.Level_1
Game "NNG" Game "NNG"
World "Addition" World "Addition"

View File

@@ -1,4 +1,4 @@
import NNG.Levels.Addition.Level_2 import Game.Levels.Addition.Level_2
Game "NNG" Game "NNG"
World "Addition" World "Addition"

View File

@@ -1,4 +1,4 @@
import NNG.Levels.Addition.Level_3 import Game.Levels.Addition.Level_3
Game "NNG" Game "NNG"
World "Addition" World "Addition"

View File

@@ -1,4 +1,4 @@
import NNG.Levels.Addition.Level_4 import Game.Levels.Addition.Level_4
Game "NNG" Game "NNG"
World "Addition" World "Addition"

View File

@@ -1,4 +1,4 @@
import NNG.Levels.Addition.Level_5 import Game.Levels.Addition.Level_5
Game "NNG" Game "NNG"
World "Addition" World "Addition"

View File

@@ -1,4 +1,4 @@
import NNG.Levels.AdvAddition.Level_13 import Game.Levels.AdvAddition.Level_13
Game "NNG" Game "NNG"
World "AdvAddition" World "AdvAddition"
@@ -25,4 +25,4 @@ For `zero_ne_succ` the trick is that $X\\ne Y$ is *defined to mean*
$X = Y\\implies{\\tt False}$. If you have played through proposition world, $X = Y\\implies{\\tt False}$. If you have played through proposition world,
you now have the required Lean skills (i.e., you know the required you now have the required Lean skills (i.e., you know the required
tactics) to work with these implications. tactics) to work with these implications.
" "

View File

@@ -1,6 +1,6 @@
import NNG.Metadata import Game.Metadata
import NNG.MyNat.AdvAddition import Game.MyNat.AdvAddition
import NNG.Levels.Addition import Game.Levels.Addition
Game "NNG" Game "NNG"
World "AdvAddition" World "AdvAddition"

View File

@@ -1,4 +1,4 @@
import NNG.Levels.AdvAddition.Level_9 import Game.Levels.AdvAddition.Level_9
import Std.Tactic.RCases import Std.Tactic.RCases
Game "NNG" Game "NNG"

View File

@@ -1,4 +1,4 @@
import NNG.Levels.AdvAddition.Level_10 import Game.Levels.AdvAddition.Level_10
Game "NNG" Game "NNG"
World "AdvAddition" World "AdvAddition"

View File

@@ -1,4 +1,4 @@
import NNG.Levels.AdvAddition.Level_11 import Game.Levels.AdvAddition.Level_11
Game "NNG" Game "NNG"

View File

@@ -1,4 +1,4 @@
import NNG.Levels.AdvAddition.Level_12 import Game.Levels.AdvAddition.Level_12
Game "NNG" Game "NNG"
World "AdvAddition" World "AdvAddition"

View File

@@ -1,4 +1,4 @@
import NNG.Levels.AdvAddition.Level_1 import Game.Levels.AdvAddition.Level_1
Game "NNG" Game "NNG"

View File

@@ -1,4 +1,4 @@
import NNG.Levels.AdvAddition.Level_2 import Game.Levels.AdvAddition.Level_2
Game "NNG" Game "NNG"

View File

@@ -1,4 +1,4 @@
import NNG.Levels.AdvAddition.Level_3 import Game.Levels.AdvAddition.Level_3
Game "NNG" Game "NNG"
World "AdvAddition" World "AdvAddition"

View File

@@ -1,4 +1,4 @@
import NNG.Levels.AdvAddition.Level_4 import Game.Levels.AdvAddition.Level_4
Game "NNG" Game "NNG"

View File

@@ -1,4 +1,4 @@
import NNG.Levels.AdvAddition.Level_5 import Game.Levels.AdvAddition.Level_5
Game "NNG" Game "NNG"
World "AdvAddition" World "AdvAddition"

View File

@@ -1,4 +1,4 @@
import NNG.Levels.AdvAddition.Level_6 import Game.Levels.AdvAddition.Level_6
Game "NNG" Game "NNG"
World "AdvAddition" World "AdvAddition"

View File

@@ -1,4 +1,4 @@
import NNG.Levels.AdvAddition.Level_7 import Game.Levels.AdvAddition.Level_7
Game "NNG" Game "NNG"

View File

@@ -1,4 +1,4 @@
import NNG.Levels.AdvAddition.Level_8 import Game.Levels.AdvAddition.Level_8
Game "NNG" Game "NNG"
World "AdvAddition" World "AdvAddition"

View File

@@ -1,7 +1,7 @@
import NNG.Levels.AdvMultiplication.Level_1 import Game.Levels.AdvMultiplication.Level_1
import NNG.Levels.AdvMultiplication.Level_2 import Game.Levels.AdvMultiplication.Level_2
import NNG.Levels.AdvMultiplication.Level_3 import Game.Levels.AdvMultiplication.Level_3
import NNG.Levels.AdvMultiplication.Level_4 import Game.Levels.AdvMultiplication.Level_4
Game "NNG" Game "NNG"
@@ -14,4 +14,4 @@ Welcome to Advanced Multiplication World! Before attempting this
world you should have completed seven other worlds, including world you should have completed seven other worlds, including
Multiplication World and Advanced Addition World. There are four Multiplication World and Advanced Addition World. There are four
levels in this world. levels in this world.
" "

View File

@@ -1,5 +1,5 @@
import NNG.Levels.Multiplication import Game.Levels.Multiplication
import NNG.Levels.AdvAddition import Game.Levels.AdvAddition
Game "NNG" Game "NNG"
World "AdvMultiplication" World "AdvMultiplication"

View File

@@ -1,4 +1,4 @@
import NNG.Levels.AdvMultiplication.Level_1 import Game.Levels.AdvMultiplication.Level_1
Game "NNG" Game "NNG"
World "AdvMultiplication" World "AdvMultiplication"

View File

@@ -1,4 +1,4 @@
import NNG.Levels.AdvMultiplication.Level_2 import Game.Levels.AdvMultiplication.Level_2
Game "NNG" Game "NNG"

View File

@@ -1,4 +1,4 @@
import NNG.Levels.AdvMultiplication.Level_3 import Game.Levels.AdvMultiplication.Level_3
Game "NNG" Game "NNG"
World "AdvMultiplication" World "AdvMultiplication"

View File

@@ -0,0 +1,23 @@
import Game.Levels.AdvProposition.Level_1
import Game.Levels.AdvProposition.Level_2
import Game.Levels.AdvProposition.Level_3
import Game.Levels.AdvProposition.Level_4
import Game.Levels.AdvProposition.Level_5
import Game.Levels.AdvProposition.Level_6
import Game.Levels.AdvProposition.Level_7
import Game.Levels.AdvProposition.Level_8
import Game.Levels.AdvProposition.Level_9
import Game.Levels.AdvProposition.Level_10
Game "NNG"
World "AdvProposition"
Title "Advanced Proposition World"
Introduction
"
In this world we will learn five key tactics needed to solve all the
levels of the Natural Number Game, namely `constructor`, `rcases`, `left`, `right`, and `exfalso`.
These, and `use` (which we'll get to in Inequality World) are all the
tactics you will need to beat all the levels of the game.
"

View File

@@ -1,5 +1,5 @@
import NNG.Metadata import Game.Metadata
import NNG.MyNat.Addition import Game.MyNat.Addition
Game "NNG" Game "NNG"
World "AdvProposition" World "AdvProposition"

View File

@@ -1,5 +1,5 @@
import NNG.Metadata import Game.Metadata
import NNG.MyNat.Addition import Game.MyNat.Addition
Game "NNG" Game "NNG"
World "AdvProposition" World "AdvProposition"
@@ -19,7 +19,7 @@ constructive logic).
Statement Statement
"If $P$ and $Q$ are true/false statements, then "If $P$ and $Q$ are true/false statements, then
$$(\\lnot Q\\implies \\lnot P)\\implies(P\\implies Q).$$ $$(\\lnot Q\\implies \\lnot P)\\implies(P\\implies Q).$$
" "
(P Q : Prop) : (¬ Q ¬ P) (P Q) := by (P Q : Prop) : (¬ Q ¬ P) (P Q) := by
Hint "For example, you could start as always with Hint "For example, you could start as always with
@@ -62,4 +62,3 @@ Get to it via the main menu.
-- In fact the tactic `tauto` just kills this goal (and many other logic goals) immediately. You'll be -- In fact the tactic `tauto` just kills this goal (and many other logic goals) immediately. You'll be
-- able to use it from now on. -- able to use it from now on.

View File

@@ -1,5 +1,5 @@
import NNG.Metadata import Game.Metadata
import NNG.MyNat.Addition import Game.MyNat.Addition
Game "NNG" Game "NNG"
World "AdvProposition" World "AdvProposition"
@@ -46,4 +46,3 @@ Statement -- and_symm
exact p exact p
NewTactic rcases NewTactic rcases

View File

@@ -1,5 +1,5 @@
import NNG.Metadata import Game.Metadata
import NNG.MyNat.Addition import Game.MyNat.Addition
Game "NNG" Game "NNG"
World "AdvProposition" World "AdvProposition"
@@ -18,7 +18,7 @@ Statement --and_trans
$Q\\land R$ together imply $P\\land R$." $Q\\land R$ together imply $P\\land R$."
(P Q R : Prop) : P Q Q R P R := by (P Q R : Prop) : P Q Q R P R := by
Hint "Here's a trick: Hint "Here's a trick:
Your first steps would probably be Your first steps would probably be
``` ```
intro h intro h

View File

@@ -1,5 +1,5 @@
import NNG.Metadata import Game.Metadata
import NNG.MyNat.Addition import Game.MyNat.Addition
Game "NNG" Game "NNG"
World "AdvProposition" World "AdvProposition"

View File

@@ -1,5 +1,5 @@
import NNG.Metadata import Game.Metadata
import NNG.MyNat.Addition import Game.MyNat.Addition
Game "NNG" Game "NNG"
World "AdvProposition" World "AdvProposition"

View File

@@ -1,5 +1,5 @@
import NNG.Metadata import Game.Metadata
import NNG.MyNat.Addition import Game.MyNat.Addition
Game "NNG" Game "NNG"
World "AdvProposition" World "AdvProposition"
@@ -36,4 +36,3 @@ Statement
NewTactic left right NewTactic left right
NewDefinition Or NewDefinition Or

View File

@@ -1,5 +1,5 @@
import NNG.Metadata import Game.Metadata
import NNG.MyNat.Addition import Game.MyNat.Addition
Game "NNG" Game "NNG"
World "AdvProposition" World "AdvProposition"

View File

@@ -1,5 +1,5 @@
import NNG.Metadata import Game.Metadata
import NNG.MyNat.Addition import Game.MyNat.Addition
Game "NNG" Game "NNG"
World "AdvProposition" World "AdvProposition"

View File

@@ -1,5 +1,5 @@
import NNG.Metadata import Game.Metadata
import NNG.MyNat.Addition import Game.MyNat.Addition
Game "NNG" Game "NNG"
World "AdvProposition" World "AdvProposition"

View File

@@ -1,12 +1,12 @@
import NNG.Levels.Function.Level_1 import Game.Levels.Function.Level_1
import NNG.Levels.Function.Level_2 import Game.Levels.Function.Level_2
import NNG.Levels.Function.Level_3 import Game.Levels.Function.Level_3
import NNG.Levels.Function.Level_4 import Game.Levels.Function.Level_4
import NNG.Levels.Function.Level_5 import Game.Levels.Function.Level_5
import NNG.Levels.Function.Level_6 import Game.Levels.Function.Level_6
import NNG.Levels.Function.Level_7 import Game.Levels.Function.Level_7
import NNG.Levels.Function.Level_8 import Game.Levels.Function.Level_8
import NNG.Levels.Function.Level_9 import Game.Levels.Function.Level_9
Game "NNG" Game "NNG"
@@ -38,4 +38,4 @@ internally Lean stores $P$ as a \"Type\" and $p$ as a \"term\", and it uses `p :
to mean \"$p$ is a term of type $P$\", Lean's way of expressing the idea that $p$ to mean \"$p$ is a term of type $P$\", Lean's way of expressing the idea that $p$
is an element of the set $P$. You have seen this already – Lean has is an element of the set $P$. You have seen this already – Lean has
been writing `n : ` to mean that $n$ is a natural number. been writing `n : ` to mean that $n$ is a natural number.
" "

View File

@@ -1,4 +1,4 @@
import NNG.Metadata import Game.Metadata
-- TODO: Cannot import level from different world. -- TODO: Cannot import level from different world.

View File

@@ -1,5 +1,5 @@
import NNG.Metadata import Game.Metadata
import NNG.MyNat.Multiplication import Game.MyNat.Multiplication
Game "NNG" Game "NNG"
World "Function" World "Function"

View File

@@ -1,4 +1,4 @@
import NNG.Metadata import Game.Metadata
Game "NNG" Game "NNG"
World "Function" World "Function"

View File

@@ -1,4 +1,4 @@
import NNG.Metadata import Game.Metadata
Game "NNG" Game "NNG"
World "Function" World "Function"

View File

@@ -1,4 +1,4 @@
import NNG.Metadata import Game.Metadata
Game "NNG" Game "NNG"
World "Function" World "Function"

View File

@@ -1,4 +1,4 @@
import NNG.Metadata import Game.Metadata
Game "NNG" Game "NNG"
World "Function" World "Function"

View File

@@ -1,4 +1,4 @@
import NNG.Metadata import Game.Metadata
Game "NNG" Game "NNG"
World "Function" World "Function"
@@ -20,7 +20,7 @@ functor.
" "
Statement Statement
"Whatever the sets $P$ and $Q$ and $F$ are, we "Whatever the sets $P$ and $Q$ and $F$ are, we
make an element of $\\operatorname{Hom}(\\operatorname{Hom}(P,Q), make an element of $\\operatorname{Hom}(\\operatorname{Hom}(P,Q),
\\operatorname{Hom}(\\operatorname{Hom}(Q,F),\\operatorname{Hom}(P,F)))$." \\operatorname{Hom}(\\operatorname{Hom}(Q,F),\\operatorname{Hom}(P,F)))$."
(P Q F : Type) : (P Q) ((Q F) (P F)) := by (P Q F : Type) : (P Q) ((Q F) (P F)) := by

View File

@@ -1,4 +1,4 @@
import NNG.Metadata import Game.Metadata
Game "NNG" Game "NNG"
World "Function" World "Function"

View File

@@ -1,4 +1,4 @@
import NNG.Metadata import Game.Metadata
Game "NNG" Game "NNG"
World "Function" World "Function"

View File

@@ -1,20 +1,20 @@
import NNG.Levels.Inequality.Level_1 import Game.Levels.Inequality.Level_1
-- import NNG.Levels.Inequality.Level_2 -- import Game.Levels.Inequality.Level_2
-- import NNG.Levels.Inequality.Level_3 -- import Game.Levels.Inequality.Level_3
-- import NNG.Levels.Inequality.Level_4 -- import Game.Levels.Inequality.Level_4
-- import NNG.Levels.Inequality.Level_5 -- import Game.Levels.Inequality.Level_5
-- import NNG.Levels.Inequality.Level_6 -- import Game.Levels.Inequality.Level_6
-- import NNG.Levels.Inequality.Level_7 -- import Game.Levels.Inequality.Level_7
-- import NNG.Levels.Inequality.Level_8 -- import Game.Levels.Inequality.Level_8
-- import NNG.Levels.Inequality.Level_9 -- import Game.Levels.Inequality.Level_9
-- import NNG.Levels.Inequality.Level_10 -- import Game.Levels.Inequality.Level_10
-- import NNG.Levels.Inequality.Level_11 -- import Game.Levels.Inequality.Level_11
-- import NNG.Levels.Inequality.Level_12 -- import Game.Levels.Inequality.Level_12
-- import NNG.Levels.Inequality.Level_13 -- import Game.Levels.Inequality.Level_13
-- import NNG.Levels.Inequality.Level_14 -- import Game.Levels.Inequality.Level_14
-- import NNG.Levels.Inequality.Level_15 -- import Game.Levels.Inequality.Level_15
-- import NNG.Levels.Inequality.Level_16 -- import Game.Levels.Inequality.Level_16
-- import NNG.Levels.Inequality.Level_17 -- import Game.Levels.Inequality.Level_17
Game "NNG" Game "NNG"
World "Inequality" World "Inequality"
@@ -28,7 +28,7 @@ A new import, giving us a new definition. If `a` and `b` are naturals,
` (c : mynat), b = a + c` ` (c : mynat), b = a + c`
The upside-down E means \"there exists\". So in words, $a\\le b$ The upside-down E means \"there exists\". So in words, $a\\le b$
if and only if there exists a natural $c$ such that $b=a+c$. if and only if there exists a natural $c$ such that $b=a+c$.
If you really want to change an `a b` to ` c, b = a + c` then If you really want to change an `a b` to ` c, b = a + c` then
you can do so with `rw le_iff_exists_add`: you can do so with `rw le_iff_exists_add`:
@@ -46,5 +46,5 @@ example of this below.
A new construction like `` means that we need to learn how to manipulate it. A new construction like `` means that we need to learn how to manipulate it.
There are two situations. Firstly we need to know how to solve a goal There are two situations. Firstly we need to know how to solve a goal
of the form ` c, ...`, and secondly we need to know how to use a hypothesis of the form ` c, ...`, and secondly we need to know how to use a hypothesis
of the form ` c, ...`. of the form ` c, ...`.
" "

View File

@@ -1,6 +1,6 @@
import NNG.Metadata import Game.Metadata
import NNG.MyNat.LE import Game.MyNat.LE
import NNG.Tactic.Use import Game.Tactic.Use
--import Mathlib.Tactic.Ring --import Mathlib.Tactic.Ring
Game "NNG" Game "NNG"

View File

@@ -1,6 +1,6 @@
import NNG.Metadata import Game.Metadata
import NNG.MyNat.LE import Game.MyNat.LE
import NNG.Tactic.Use import Game.Tactic.Use
Game "NNG" Game "NNG"
World "Inequality" World "Inequality"

View File

@@ -1,6 +1,6 @@
import NNG.Metadata import Game.Metadata
import NNG.MyNat.LE import Game.MyNat.LE
import NNG.Tactic.Use import Game.Tactic.Use
Game "NNG" Game "NNG"
World "Inequality" World "Inequality"

View File

@@ -1,6 +1,6 @@
import NNG.Metadata import Game.Metadata
import NNG.MyNat.LE import Game.MyNat.LE
import NNG.Tactic.Use import Game.Tactic.Use
Game "NNG" Game "NNG"
World "Inequality" World "Inequality"

View File

@@ -1,6 +1,6 @@
import NNG.Metadata import Game.Metadata
import NNG.MyNat.LE import Game.MyNat.LE
import NNG.Tactic.Use import Game.Tactic.Use
Game "NNG" Game "NNG"
World "Inequality" World "Inequality"

View File

@@ -1,6 +1,6 @@
import NNG.Metadata import Game.Metadata
import NNG.MyNat.LE import Game.MyNat.LE
import NNG.Tactic.Use import Game.Tactic.Use
Game "NNG" Game "NNG"
World "Inequality" World "Inequality"

View File

@@ -1,6 +1,6 @@
import NNG.Metadata import Game.Metadata
import NNG.MyNat.LE import Game.MyNat.LE
import NNG.Tactic.Use import Game.Tactic.Use
Game "NNG" Game "NNG"
World "Inequality" World "Inequality"

View File

@@ -1,6 +1,6 @@
import NNG.Metadata import Game.Metadata
import NNG.MyNat.LE import Game.MyNat.LE
import NNG.Tactic.Use import Game.Tactic.Use
Game "NNG" Game "NNG"
World "Inequality" World "Inequality"

View File

@@ -1,6 +1,6 @@
import NNG.Metadata import Game.Metadata
import NNG.MyNat.LE import Game.MyNat.LE
import NNG.Tactic.Use import Game.Tactic.Use
Game "NNG" Game "NNG"
World "Inequality" World "Inequality"

View File

@@ -1,5 +1,5 @@
import NNG.Metadata import Game.Metadata
import NNG.MyNat.LE import Game.MyNat.LE
import Mathlib.Tactic.Use import Mathlib.Tactic.Use
Game "NNG" Game "NNG"

View File

@@ -1,6 +1,6 @@
import NNG.Metadata import Game.Metadata
import NNG.MyNat.LE import Game.MyNat.LE
import NNG.Tactic.Use import Game.Tactic.Use
import Std.Tactic.RCases import Std.Tactic.RCases
Game "NNG" Game "NNG"

View File

@@ -1,6 +1,6 @@
import NNG.Metadata import Game.Metadata
import NNG.MyNat.LE import Game.MyNat.LE
import NNG.Tactic.Use import Game.Tactic.Use
Game "NNG" Game "NNG"
World "Inequality" World "Inequality"

View File

@@ -1,6 +1,6 @@
import NNG.Metadata import Game.Metadata
import NNG.MyNat.LE import Game.MyNat.LE
import NNG.Tactic.Use import Game.Tactic.Use
Game "NNG" Game "NNG"
World "Inequality" World "Inequality"

View File

@@ -1,6 +1,6 @@
import NNG.Metadata import Game.Metadata
import NNG.MyNat.LE import Game.MyNat.LE
import NNG.Tactic.Use import Game.Tactic.Use
Game "NNG" Game "NNG"
World "Inequality" World "Inequality"

View File

@@ -1,6 +1,6 @@
import NNG.Metadata import Game.Metadata
import NNG.MyNat.LE import Game.MyNat.LE
import NNG.Tactic.Use import Game.Tactic.Use
Game "NNG" Game "NNG"
World "Inequality" World "Inequality"

View File

@@ -1,6 +1,6 @@
import NNG.Metadata import Game.Metadata
import NNG.MyNat.LE import Game.MyNat.LE
import NNG.Tactic.Use import Game.Tactic.Use
Game "NNG" Game "NNG"
World "Inequality" World "Inequality"

View File

@@ -1,6 +1,6 @@
import NNG.Metadata import Game.Metadata
import NNG.MyNat.LE import Game.MyNat.LE
import NNG.Tactic.Use import Game.Tactic.Use
Game "NNG" Game "NNG"
World "Inequality" World "Inequality"

View File

@@ -1,12 +1,12 @@
import NNG.Levels.Multiplication.Level_1 import Game.Levels.Multiplication.Level_1
import NNG.Levels.Multiplication.Level_2 import Game.Levels.Multiplication.Level_2
import NNG.Levels.Multiplication.Level_3 import Game.Levels.Multiplication.Level_3
import NNG.Levels.Multiplication.Level_4 import Game.Levels.Multiplication.Level_4
import NNG.Levels.Multiplication.Level_5 import Game.Levels.Multiplication.Level_5
import NNG.Levels.Multiplication.Level_6 import Game.Levels.Multiplication.Level_6
import NNG.Levels.Multiplication.Level_7 import Game.Levels.Multiplication.Level_7
import NNG.Levels.Multiplication.Level_8 import Game.Levels.Multiplication.Level_8
import NNG.Levels.Multiplication.Level_9 import Game.Levels.Multiplication.Level_9
Game "NNG" Game "NNG"
@@ -34,4 +34,4 @@ is commutative and associative, but as well as that we will
need to prove facts about the relationship between multiplication need to prove facts about the relationship between multiplication
and addition, for example `a * (b + c) = a * b + a * c`, so now and addition, for example `a * (b + c) = a * b + a * c`, so now
there is a lot more to do. Good luck! there is a lot more to do. Good luck!
" "

View File

@@ -1,5 +1,5 @@
import NNG.MyNat.Multiplication import Game.MyNat.Multiplication
import NNG.Levels.Addition import Game.Levels.Addition
Game "NNG" Game "NNG"
World "Multiplication" World "Multiplication"

View File

@@ -1,4 +1,4 @@
import NNG.Levels.Multiplication.Level_1 import Game.Levels.Multiplication.Level_1
Game "NNG" Game "NNG"
World "Multiplication" World "Multiplication"

View File

@@ -1,4 +1,4 @@
import NNG.Levels.Multiplication.Level_2 import Game.Levels.Multiplication.Level_2
Game "NNG" Game "NNG"
World "Multiplication" World "Multiplication"

View File

@@ -1,4 +1,4 @@
import NNG.Levels.Multiplication.Level_3 import Game.Levels.Multiplication.Level_3
Game "NNG" Game "NNG"
World "Multiplication" World "Multiplication"

View File

@@ -1,4 +1,4 @@
import NNG.Levels.Multiplication.Level_4 import Game.Levels.Multiplication.Level_4
Game "NNG" Game "NNG"
World "Multiplication" World "Multiplication"

View File

@@ -1,4 +1,4 @@
import NNG.Levels.Multiplication.Level_5 import Game.Levels.Multiplication.Level_5
Game "NNG" Game "NNG"
World "Multiplication" World "Multiplication"

View File

@@ -1,4 +1,4 @@
import NNG.Levels.Multiplication.Level_6 import Game.Levels.Multiplication.Level_6
Game "NNG" Game "NNG"
World "Multiplication" World "Multiplication"

View File

@@ -1,4 +1,4 @@
import NNG.Levels.Multiplication.Level_7 import Game.Levels.Multiplication.Level_7
Game "NNG" Game "NNG"
World "Multiplication" World "Multiplication"
@@ -43,4 +43,4 @@ level of the world, and then we can beef up the power of `simp`.
" "
-- TODO: collectible -- TODO: collectible
-- instance mynat.comm_semiring : comm_semiring mynat := by structure_helper -- instance mynat.comm_semiring : comm_semiring mynat := by structure_helper

View File

@@ -1,4 +1,4 @@
import NNG.Levels.Multiplication.Level_8 import Game.Levels.Multiplication.Level_8
Game "NNG" Game "NNG"
World "Multiplication" World "Multiplication"

View File

@@ -1,4 +1,4 @@
import NNG.Levels.Power.Level_8 import Game.Levels.Power.Level_8
Game "NNG" Game "NNG"
World "Power" World "Power"
@@ -26,4 +26,4 @@ Collectibles are indication that we are proving the right things.
The levels in this world were designed by Sian Carey, a UROP student The levels in this world were designed by Sian Carey, a UROP student
at Imperial College London, funded by a Mary Lister McCammon Fellowship, at Imperial College London, funded by a Mary Lister McCammon Fellowship,
in the summer of 2019. Thanks Sian! in the summer of 2019. Thanks Sian!
" "

View File

@@ -1,5 +1,5 @@
import NNG.Levels.Multiplication import Game.Levels.Multiplication
import NNG.MyNat.Power import Game.MyNat.Power
Game "NNG" Game "NNG"
World "Power" World "Power"

View File

@@ -1,4 +1,4 @@
import NNG.Levels.Power.Level_1 import Game.Levels.Power.Level_1
Game "NNG" Game "NNG"
World "Power" World "Power"

View File

@@ -1,4 +1,4 @@
import NNG.Levels.Power.Level_2 import Game.Levels.Power.Level_2
Game "NNG" Game "NNG"
World "Power" World "Power"

View File

@@ -1,4 +1,4 @@
import NNG.Levels.Power.Level_3 import Game.Levels.Power.Level_3
Game "NNG" Game "NNG"

View File

@@ -1,4 +1,4 @@
import NNG.Levels.Power.Level_4 import Game.Levels.Power.Level_4
Game "NNG" Game "NNG"

View File

@@ -1,4 +1,4 @@
import NNG.Levels.Power.Level_5 import Game.Levels.Power.Level_5
Game "NNG" Game "NNG"
World "Power" World "Power"

View File

@@ -1,4 +1,4 @@
import NNG.Levels.Power.Level_6 import Game.Levels.Power.Level_6
Game "NNG" Game "NNG"
World "Power" World "Power"

View File

@@ -1,4 +1,4 @@
import NNG.Levels.Power.Level_7 import Game.Levels.Power.Level_7
-- import Mathlib.Tactic.Ring -- import Mathlib.Tactic.Ring
Game "NNG" Game "NNG"

View File

@@ -1,12 +1,12 @@
import NNG.Levels.Proposition.Level_1 import Game.Levels.Proposition.Level_1
import NNG.Levels.Proposition.Level_2 import Game.Levels.Proposition.Level_2
import NNG.Levels.Proposition.Level_3 import Game.Levels.Proposition.Level_3
import NNG.Levels.Proposition.Level_4 import Game.Levels.Proposition.Level_4
import NNG.Levels.Proposition.Level_5 import Game.Levels.Proposition.Level_5
import NNG.Levels.Proposition.Level_6 import Game.Levels.Proposition.Level_6
import NNG.Levels.Proposition.Level_7 import Game.Levels.Proposition.Level_7
import NNG.Levels.Proposition.Level_8 import Game.Levels.Proposition.Level_8
import NNG.Levels.Proposition.Level_9 -- `cc` is not ported import Game.Levels.Proposition.Level_9 -- `cc` is not ported
Game "NNG" Game "NNG"
@@ -45,4 +45,4 @@ Here `P` is the true/false statement (the statement of proposition), and `p` is
It's like `P` being the set and `p` being the element. In fact computer scientists It's like `P` being the set and `p` being the element. In fact computer scientists
sometimes think about the following analogy: propositions are like sets, sometimes think about the following analogy: propositions are like sets,
and their proofs are like their elements. and their proofs are like their elements.
" "

View File

@@ -1,5 +1,5 @@
import NNG.Metadata import Game.Metadata
import NNG.MyNat.Addition import Game.MyNat.Addition
Game "NNG" Game "NNG"
World "Proposition" World "Proposition"

View File

@@ -1,5 +1,5 @@
import NNG.Metadata import Game.Metadata
import NNG.MyNat.Addition import Game.MyNat.Addition
Game "NNG" Game "NNG"
World "Proposition" World "Proposition"
@@ -31,7 +31,7 @@ discovered by Goedel -- these are not relevant here. Imagine we are
working in a fixed model of mathematics, and when I say \"proof\" working in a fixed model of mathematics, and when I say \"proof\"
I actually mean \"truth in the model\", or \"proof in the metatheory\". I actually mean \"truth in the model\", or \"proof in the metatheory\".
## Rule of thumb: ## Rule of thumb:
If your goal is to prove `P Q` (i.e. that $P\\implies Q$) If your goal is to prove `P Q` (i.e. that $P\\implies Q$)
then `intro p`, meaning \"assume $p$ is a proof of $P$\", will make progress. then `intro p`, meaning \"assume $p$ is a proof of $P$\", will make progress.

View File

@@ -1,5 +1,5 @@
import NNG.Metadata import Game.Metadata
import NNG.MyNat.Addition import Game.MyNat.Addition
Game "NNG" Game "NNG"
World "Proposition" World "Proposition"

View File

@@ -1,5 +1,5 @@
import NNG.Metadata import Game.Metadata
import NNG.MyNat.Addition import Game.MyNat.Addition
Game "NNG" Game "NNG"
World "Proposition" World "Proposition"

View File

@@ -1,5 +1,5 @@
import NNG.Metadata import Game.Metadata
import NNG.MyNat.Addition import Game.MyNat.Addition
Game "NNG" Game "NNG"
World "Proposition" World "Proposition"
@@ -71,7 +71,7 @@ $P\\implies Q\\implies R$ (they are not really interested in proving abstract
propositions, they would rather work with concrete ones such as Fermat's Last Theorem), propositions, they would rather work with concrete ones such as Fermat's Last Theorem),
so they do not have a convention for where the brackets go. It's important to so they do not have a convention for where the brackets go. It's important to
remember Lean's convention though, or else you will get confused. If your goal remember Lean's convention though, or else you will get confused. If your goal
is `P Q R` then you need to know whether `intro h` will create `h : P` or `h : P Q`. is `P Q R` then you need to know whether `intro h` will create `h : P` or `h : P Q`.
Make sure you understand which one. Make sure you understand which one.
" "

View File

@@ -1,5 +1,5 @@
import NNG.Metadata import Game.Metadata
import NNG.MyNat.Addition import Game.MyNat.Addition
Game "NNG" Game "NNG"
World "Proposition" World "Proposition"

View File

@@ -1,5 +1,5 @@
import NNG.Metadata import Game.Metadata
import NNG.MyNat.Addition import Game.MyNat.Addition
Game "NNG" Game "NNG"
World "Proposition" World "Proposition"
@@ -24,4 +24,3 @@ Statement
apply hqr apply hqr
apply hpq apply hpq
exact p exact p

View File

@@ -1,5 +1,5 @@
import NNG.Metadata import Game.Metadata
import NNG.MyNat.Addition import Game.MyNat.Addition
Game "NNG" Game "NNG"
World "Proposition" World "Proposition"
@@ -69,4 +69,4 @@ NewTactic «repeat»
NewDefinition False Not NewDefinition False Not
Conclusion "If you used `rw [Not]` or `rw [Not] at h` anywhere, go through your proof in Conclusion "If you used `rw [Not]` or `rw [Not] at h` anywhere, go through your proof in
the \"Editor Mode\" and delete them all. Observe that your proof still works." the \"Editor Mode\" and delete them all. Observe that your proof still works."

View File

@@ -1,5 +1,5 @@
import NNG.Metadata import Game.Metadata
import NNG.MyNat.Addition import Game.MyNat.Addition
Game "NNG" Game "NNG"
World "Proposition" World "Proposition"

View File

@@ -1,7 +1,7 @@
import NNG.Levels.Tutorial.Level_1 import Game.Levels.Tutorial.Level_1
import NNG.Levels.Tutorial.Level_2 import Game.Levels.Tutorial.Level_2
import NNG.Levels.Tutorial.Level_3 import Game.Levels.Tutorial.Level_3
import NNG.Levels.Tutorial.Level_4 import Game.Levels.Tutorial.Level_4
Game "NNG" Game "NNG"
World "Tutorial" World "Tutorial"
@@ -12,4 +12,4 @@ Introduction
In this world we start introducing the natural numbers `` and addition. In this world we start introducing the natural numbers `` and addition.
Click on \"Next\" to dive right into it! Click on \"Next\" to dive right into it!
" "

View File

@@ -1,5 +1,5 @@
import NNG.Metadata import Game.Metadata
import NNG.MyNat.Multiplication import Game.MyNat.Multiplication
Game "NNG" Game "NNG"
World "Tutorial" World "Tutorial"

Some files were not shown because too many files have changed in this diff Show More