# HG changeset patch # User Christian Urban # Date 1223571530 14400 # Node ID 2356e5c70d98b5df83c3840b3050c167704e6b5c # Parent 5ae6a1bb91c9e15024a4b74904c547896e4e0b1f added a proof and tuned the rest diff -r 5ae6a1bb91c9 -r 2356e5c70d98 CookBook/FirstSteps.thy --- a/CookBook/FirstSteps.thy Mon Oct 06 10:11:08 2008 -0400 +++ b/CookBook/FirstSteps.thy Thu Oct 09 12:58:50 2008 -0400 @@ -168,10 +168,11 @@ some data structure and return it. Instead, it is literally replaced with the value representing the theory name. - In a similar way you can use antiquotations to refer to theorems: + In a similar way you can use antiquotations to refer to theorems or simpsets: *} ML {* @{thm allI} *} +ML {* @{simpset} *} text {* In the course of this introduction, we will learn more about @@ -412,7 +413,7 @@ shows "Q t" (*<*)oops(*>*) text {* - on the ML level:\footnote{Note that @{text "|>"} is just reverse + on the ML level:\footnote{Note that @{text "|>"} is reverse application. This combinator, and several variants are defined in @{ML_file "Pure/General/basics.ML"}.} @@ -440,6 +441,22 @@ text {* + This code-snippet constructs the following proof: + + \[ + \infer[(@{text "\"}$-$intro)]{\vdash @{prop "(\x. P x \ Q x) \ P t \ Q t"}} + {\infer[(@{text "\"}$-$intro)]{@{prop "\x. P x \ Q x"} \vdash @{prop "P t \ Q t"}} + {\infer[(@{text "\"}$-$elim)]{@{prop "\x. P x \ Q x"}, @{prop "P t"} \vdash @{prop "Q t"}} + {\infer[(@{text "\"}$-$elim)]{@{prop "\x. P x \ Q x"} \vdash @{prop "P t \ Q t"}} + {\infer[(assume)]{@{prop "\x. P x \ Q x"} \vdash @{prop "\x. P x \ Q x"}}{}} + & + \infer[(assume)]{@{prop "P t"} \vdash @{prop "P t"}}{} + } + } + } + \] + + \begin{readmore} For how the functions @{text "assume"}, @{text "forall_elim"} etc work see \isccite{sec:thms}. The basic functions for theorems are defined in @@ -468,6 +485,8 @@ misinterpreted as open subgoals. The protection @{text "# :: prop \ prop"} is just the identity function and used as a syntactic marker. + (FIXME: maybe show how this is printed on the screen) + \begin{readmore} For more on goals see \isccite{sec:tactical-goals}. \end{readmore} @@ -502,13 +521,12 @@ text {* - - To start the proof, the function @{ML "Goal.prove"}~@{text "ctxt params assms goal tac"} - sets up a goal state for proving @{text goal} under the assumptions @{text assms} with - the variables @{text params} that will be generalised once the - goal is proved; @{text "tac"} is a function that returns a tactic having some funny - input parameters (FIXME by possibly having an explanation in the implementation-manual). - + To start the proof, the function @{ML "Goal.prove"}~@{text "ctxt xs As C tac"} sets + up a goal state for proving the goal @{text C} under the assumptions @{text As} + (empty in the proof at hand) + with the variables @{text xs} that will be generalised once the + goal is proved. The @{text "tac"} is the tactic which proves the goal and which + can make use of the local assumptions. *} @@ -527,6 +545,15 @@ end *} +text {* + + \begin{readmore} + To learn more about the function @{ML Goal.prove} see \isccite{sec:results}. + \end{readmore} + +*} + + text {* An alternative way to transcribe this proof is as follows *} ML {* @@ -543,10 +570,11 @@ end *} +text {* (FIXME: are there any advantages/disadvantages about this way?) *} + section {* Storing Theorems *} section {* Theorem Attributes *} -text {* Was changing theorems. *} end \ No newline at end of file diff -r 5ae6a1bb91c9 -r 2356e5c70d98 CookBook/document/proof.sty --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CookBook/document/proof.sty Thu Oct 09 12:58:50 2008 -0400 @@ -0,0 +1,278 @@ +% proof.sty (Proof Figure Macros) +% +% version 3.0 (for both LaTeX 2.09 and LaTeX 2e) +% Mar 6, 1997 +% Copyright (C) 1990 -- 1997, Makoto Tatsuta (tatsuta@kusm.kyoto-u.ac.jp) +% +% This program is free software; you can redistribute it or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either versions 1, or (at your option) +% any later version. +% +% This program is distributed in the hope that it will be useful +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% Usage: +% In \documentstyle, specify an optional style `proof', say, +% \documentstyle[proof]{article}. +% +% The following macros are available: +% +% In all the following macros, all the arguments such as +% and are processed in math mode. +% +% \infer +% draws an inference. +% +% Use & in to delimit upper formulae. +% consists more than 0 formulae. +% +% \infer returns \hbox{ ... } or \vbox{ ... } and +% sets \@LeftOffset and \@RightOffset globally. +% +% \infer[