You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lean4game/server/nng/NNG/Doc/Definitions.lean

88 lines
2.1 KiB
Plaintext

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

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 "≠" ""