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/testgame/TestGame/TacticDocs.lean

250 lines
2.8 KiB
Plaintext

import GameServer.Commands
import TestGame.Tactics
TacticDoc rfl
"
2 years ago
## Beschreibung
2 years ago
`rfl` beweist ein Goal der Form `X = X`.
2 years ago
## Detail
2 years ago
`rfl` beweist jedes Goal `A = B` wenn `A` und `B` genau das gleiche sind.
Wichtig ist nicht, ob diese im Infoview gleich aussehen, sondern ob sie in
Lean gleich definiert sind.
2 years ago
## Beispiel
`rfl` kann folgenes Goal beweisen:
```
Objects
a b c :
Prove:
(a + b) * c = (a + b) * c
```
`rfl` kann auch folgendes beweisen:
```
Objects
n :
Prove:
1 + 1 = 2
```
denn Lean liest dies intern als `0.succ.succ = 0.succ.succ`.
"
TacticDoc assumption
"
## Beschreibung
`assumption` sucht nach einer Annahme, die genau dem Goal entspricht.
## Beispiel
Wenn das Goal wie folgt aussieht:
```
Objects
a b c d :
2 years ago
h : a + b = c
g : a * b = 16
t : c = 12
Prove:
2 years ago
a + b = c
```
2 years ago
dann findet `assumption` die Annahme `h`und schliesst den Beweis.
"
TacticDoc rewrite
"
## Beschreibung
Wie `rw` aber ruft `rfl` am Schluss nicht automatisch auf.
"
TacticDoc rw
"
## Beschreibung
Wenn man eine Annahme `(h : X = Y)` hat, kann man mit
`rw [h]` alle `X` im Goal durch `Y` ersetzen.
## Detail
- `rw [←h]` wendet `h` rückwärts an und ersetzt alle `Y` durch `X`.
- `rw [h, g, ←f]`: Man kann auch mehrere `rw` zusammenfassen.
- `rw [h] at h₂` ersetzt alle `X` in `h₂` zu `Y` (anstatt im Goal).
`rw` funktioniert gleichermassen mit Annahmen `(h : X = Y)` also auch
mit Theoremen/Lemmas der Form `X = Y`
## Beispiel
TODO
"
2 years ago
TacticDoc apply
"
## Beschreibung
TODO
"
2 years ago
2 years ago
TacticDoc constructor
"
## Beschreibung
TODO
"
2 years ago
2 years ago
TacticDoc rcases
"
## Beschreibung
TODO
"
2 years ago
2 years ago
TacticDoc left
"
## Beschreibung
TODO
"
TacticDoc right
"
## Beschreibung
TODO
"
2 years ago
TacticDoc simp
"
## Beschreibung
TODO
"
TacticDoc trivial
"
## Beschreibung
TODO
"
2 years ago
TacticDoc contradiction
"
## Beschreibung
2 years ago
2 years ago
TODO
"
2 years ago
TacticDoc push_neg
"
## Beschreibung
TODO
"
TacticDoc contrapose
"
## Beschreibung
TODO
"
TacticDoc revert
"
## Beschreibung
TODO
"
TacticDoc by_contra
"
## Beschreibung
TODO
"
2 years ago
TacticDoc ring
"
## Beschreibung
2 years ago
2 years ago
TODO
"
2 years ago
2 years ago
TacticDoc unfold
"
## Beschreibung
TODO
"
TacticDoc use
"
## Beschreibung
TODO
"
2 years ago
2 years ago
TacticDoc sufficesₓ
"
## Beschreibung
2 years ago
2 years ago
TODO
"
2 years ago
2 years ago
TacticDoc haveₓ
"
## Beschreibung
2 years ago
2 years ago
TODO
"
TacticDoc induction_on
"
## Summary
If `n : ` is in our objects list, then `induction_on n`
attempts to prove the current goal by induction on `n`, with the inductive
assumption in the `succ` case being `ind_hyp`.
### Example:
If your current goal is:
```
Objects
n :
Prove:
2 * n = n + n
```
then
`induction_on n`
will give us two goals:
```
Prove:
2 * 0 = 0 + 0
```
and
```
Objects
n : ,
Assumptions
ind_hyp : 2 * n = n + n
Prove:
2 * succ n = succ n + succ n
```
"
TacticDoc intro
"Useful to introduce stuff"
2 years ago
TacticSet basics := rfl induction_on intro rewrite