Files
NNG/Game/Doc/Definitions.lean
Jon Eugster 2604c89284 big refactor
2023-05-15 15:12:35 +02:00

89 lines
2.2 KiB
Lean4
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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 "≠" ""