make statement description optional

pull/54/head
Jon Eugster 2 years ago
parent 481f2b5cbb
commit 6d93aa4752

@ -114,9 +114,9 @@ elab "Branch" t:tacticSeq : tactic => do
Arguments:
- ident: (Optional) The name of the statemtent.
- descr: The human-readable version of the lemma as string. Accepts Markdown and Mathjax.
- descr: (Optional) The human-readable version of the lemma as string. Accepts Markdown and Mathjax.
-/
elab "Statement" statementName:ident ? descr:str sig:declSig val:declVal : command => do
elab "Statement" statementName:ident ? descr:str ? sig:declSig val:declVal : command => do
let lvlIdx ← getCurLevelIdx
let defaultDeclName : Name := (← getCurGame).name ++ (← getCurWorld).name ++
@ -166,7 +166,9 @@ elab "Statement" statementName:ident ? descr:str sig:declSig val:declVal : comma
module := env.header.mainModule
goal := sig,
scope := scope,
descrText := descr.getString,
descrText := match descr with
| none => ""
| some s => s.getString
descrFormat := match statementName with
| none => "example " ++ (toString <| reprint sig.raw) ++ " := by"
| some name => (Format.join ["lemma ", reprint name.raw, " ", reprint sig.raw, " := by"]).pretty 10 -- "lemma " ++ (toString <| reprint name.raw) ++ " " ++ (Format.pretty (reprint sig.raw) 40) ++ " := by"

@ -14,8 +14,15 @@ Introduction
**Operationsleiter**: Sagt mal, könnt ihr mir hier weiterhelfen?
"
Statement "" (A B : Prop) (hb : B) : A → (A ∧ B) := by
Statement (A B : Prop) (hb : B) : A → (A ∧ B) := by
Hint "**Du**: Einen Moment, das ist eine Implikation (`\\to`),
also `A` impliziert `A und B`, soweit so gut, also eine Tautologie.
**Robo**: Die scheinen hier `tauto` auch nicht zu verstehen.
Implikationen kannst du aber mit `intro h` angehen."
intro hA
Hint "**Du**: Jetzt habe ich also angenommen, dass `A` wahr ist und muss `A ∧ B` zeigen,
das kennen wir ja schon."
constructor
assumption
assumption
@ -23,15 +30,4 @@ Statement "" (A B : Prop) (hb : B) : A → (A ∧ B) := by
NewTactic intro
DisabledTactic tauto
Hint (A : Prop) (B : Prop) (hb : B) : A → (A ∧ B) =>
"**Du**: Einen Moment, das ist eine Implikation (`\\to`),
also `A` impliziert `A und B`, soweit so gut, also eine Tautologie.
**Robo**: Die scheinen hier `tauto` auch nicht zu verstehen.
Implikationen kannst du aber mit `intro h` angehen."
Hint (A : Prop) (B : Prop) (ha : A) (hb : B) : (A ∧ B) =>
"**Du**: Jetzt habe ich also angenommen, dass `A` wahr ist und muss `A ∧ B` zeigen,
das kennen wir ja schon."
Conclusion "Der Operationsleiter nickt bedacht."

@ -11,23 +11,19 @@ Title "Revert"
Introduction
"Jemand aus der Gruppe gibt dir ein Blatt Papier mit einer Zeile Text:"
Statement
""
(A B : Prop) (ha : A) (h : A → B) : B := by
Statement "" (A B : Prop) (ha : A) (h : A → B) : B := by
Hint "**Robo**: Mit `revert {ha}` kann man die Annahme `ha` als
Implikationsprämisse vorne ans Goal anhängen, dann ist das Goal `{A} → {B}`.
**Du**: Das wirkt etwas unnatürlich.
**Robo**: Schon, ja. Aber als Tool kann das manchmal nützlich sein."
revert ha
assumption
NewTactic revert
DisabledTactic tauto
Hint (A : Prop) (B : Prop) (ha : A) (h : A → B) : B =>
"**Robo**: Mit `revert {ha}` kann man die Annahme `ha` als
Implikationsprämisse vorne ans Goal anhängen, dann ist das Goal `{A} → {B}`.
**Du**: Das wirkt etwas unnatürlich.
**Robo**: Schon, ja. Aber als Tool kann das manchmal nützlich sein."
Conclusion "**Du**: Aber das müsste doch auch anders gehen, ich hätte jetzt intuitiv
die Implikation $A \\Rightarrow B$ angewendet und behauptet, dass es genügt $A$ zu zeigen…

Loading…
Cancel
Save