# HG changeset patch # User wenzelm # Date 1157978125 -7200 # Node ID de0b523b0d62e89f5445c4ec9e0a9d3a96bd5f59 # Parent 11da1ce8dbd8b92ab34d5384fd5777eef43c4d47 more rules; diff -r 11da1ce8dbd8 -r de0b523b0d62 doc-src/IsarImplementation/Thy/logic.thy --- a/doc-src/IsarImplementation/Thy/logic.thy Mon Sep 11 14:28:47 2006 +0200 +++ b/doc-src/IsarImplementation/Thy/logic.thy Mon Sep 11 14:35:25 2006 +0200 @@ -200,15 +200,13 @@ and application @{text "t u"}, while types are usually implicit thanks to type-inference. - Terms of type @{text "prop"} are called - propositions. Logical statements are composed via @{text "\x :: - \. B(x)"} and @{text "A \ B"}. - \[ - \infer{@{text "(\x\<^sub>\. t): \ \ \"}}{@{text "t: \"}} + \infer{@{text "a\<^isub>\ :: \"}}{} \qquad - \infer{@{text "(t u): \"}}{@{text "t: \ \ \"} & @{text "u: \"}} + \infer{@{text "(\x\<^sub>\. t) :: \ \ \"}}{@{text "t :: \"}} + \qquad + \infer{@{text "t u :: \"}}{@{text "t :: \ \ \"} & @{text "u :: \"}} \] *} @@ -228,60 +226,60 @@ section {* Theorems \label{sec:thms} *} text {* - - Primitive reasoning operates on judgments of the form @{text "\ \ - \"}, with standard introduction and elimination rules for @{text - "\"} and @{text "\"} that refer to fixed parameters @{text "x"} and - hypotheses @{text "A"} from the context @{text "\"}. The - corresponding proof terms are left implicit in the classic - ``LCF-approach'', although they could be exploited separately - \cite{Berghofer-Nipkow:2000}. + \glossary{Proposition}{A \seeglossary{term} of \seeglossary{type} + @{text "prop"}. Internally, there is nothing special about + propositions apart from their type, but the concrete syntax enforces + a clear distinction. Propositions are structured via implication + @{text "A \ B"} or universal quantification @{text "\x. B x"} --- + anything else is considered atomic. The canonical form for + propositions is that of a \seeglossary{Hereditary Harrop Formula}. FIXME} - The framework also provides definitional equality @{text "\ :: \ \ \ - \ prop"}, with @{text "\\\"}-conversion rules. The internal - conjunction @{text "& :: prop \ prop \ prop"} enables the view of - assumptions and conclusions emerging uniformly as simultaneous - statements. - - + \glossary{Theorem}{A proven proposition within a certain theory and + proof context, formally @{text "\ \\<^sub>\ \"}; both contexts are + rarely spelled out explicitly. Theorems are usually normalized + according to the \seeglossary{HHF} format. FIXME} - FIXME + \glossary{Fact}{Sometimes used interchangably for + \seeglossary{theorem}. Strictly speaking, a list of theorems, + essentially an extra-logical conjunction. Facts emerge either as + local assumptions, or as results of local goal statements --- both + may be simultaneous, hence the list representation. FIXME} -\glossary{Proposition}{A \seeglossary{term} of \seeglossary{type} -@{text "prop"}. Internally, there is nothing special about -propositions apart from their type, but the concrete syntax enforces a -clear distinction. Propositions are structured via implication @{text -"A \ B"} or universal quantification @{text "\x. B x"} --- anything -else is considered atomic. The canonical form for propositions is -that of a \seeglossary{Hereditary Harrop Formula}.} + \glossary{Schematic variable}{FIXME} + + \glossary{Fixed variable}{A variable that is bound within a certain + proof context; an arbitrary-but-fixed entity within a portion of + proof text. FIXME} -\glossary{Theorem}{A proven proposition within a certain theory and -proof context, formally @{text "\ \\<^sub>\ \"}; both contexts are -rarely spelled out explicitly. Theorems are usually normalized -according to the \seeglossary{HHF} format.} + \glossary{Free variable}{Synonymous for \seeglossary{fixed + variable}. FIXME} + + \glossary{Bound variable}{FIXME} -\glossary{Fact}{Sometimes used interchangably for -\seeglossary{theorem}. Strictly speaking, a list of theorems, -essentially an extra-logical conjunction. Facts emerge either as -local assumptions, or as results of local goal statements --- both may -be simultaneous, hence the list representation.} + \glossary{Variable}{See \seeglossary{schematic variable}, + \seeglossary{fixed variable}, \seeglossary{bound variable}, or + \seeglossary{type variable}. The distinguishing feature of + different variables is their binding scope. FIXME} -\glossary{Schematic variable}{FIXME} + A \emph{proposition} is a well-formed term of type @{text "prop"}. + The connectives of minimal logic are declared as constants of the + basic theory: -\glossary{Fixed variable}{A variable that is bound within a certain -proof context; an arbitrary-but-fixed entity within a portion of proof -text.} - -\glossary{Free variable}{Synonymous for \seeglossary{fixed variable}.} + \smallskip + \begin{tabular}{ll} + @{text "all :: (\ \ prop) \ prop"} & universal quantification (binder @{text "\"}) \\ + @{text "\ :: prop \ prop \ prop"} & implication (right associative infix) \\ + \end{tabular} -\glossary{Bound variable}{FIXME} + \medskip A \emph{theorem} is a proven proposition, depending on a + collection of assumptions, and axioms from the theory context. The + judgment @{text "A\<^isub>1, \, A\<^isub>n \ B"} is defined + inductively by the primitive inferences given in + \figref{fig:prim-rules}; there is a global syntactic restriction + that the hypotheses may not contain schematic variables. -\glossary{Variable}{See \seeglossary{schematic variable}, -\seeglossary{fixed variable}, \seeglossary{bound variable}, or -\seeglossary{type variable}. The distinguishing feature of different -variables is their binding scope.} - - + \begin{figure}[htb] + \begin{center} \[ \infer[@{text "(axiom)"}]{@{text "\ A"}}{@{text "A \ \"}} \qquad @@ -297,40 +295,103 @@ \qquad \infer[@{text "(\_elim)"}]{@{text "\\<^sub>1 \ \\<^sub>2 \ B"}}{@{text "\\<^sub>1 \ A \ B"} & @{text "\\<^sub>2 \ A"}} \] + \caption{Primitive inferences of the Pure logic}\label{fig:prim-rules} + \end{center} + \end{figure} + The introduction and elimination rules for @{text "\"} and @{text + "\"} are analogous to formation of (dependently typed) @{text + "\"}-terms representing the underlying proof objects. Proof terms + are \emph{irrelevant} in the Pure logic, they may never occur within + propositions, i.e.\ the @{text "\"} arrow of the framework is a + non-dependent one. - Admissible rules: + Also note that fixed parameters as in @{text "\_intro"} need not be + recorded in the context @{text "\"}, since syntactic types are + always inhabitable. An ``assumption'' @{text "x :: \"} is logically + vacuous, because @{text "\"} is always non-empty. This is the deeper + reason why @{text "\"} only consists of hypothetical proofs, but no + hypothetical terms. + + The corresponding proof terms are left implicit in the classic + ``LCF-approach'', although they could be exploited separately + \cite{Berghofer-Nipkow:2000}. The implementation provides a runtime + option to control the generation of full proof terms. + + \medskip The axiomatization of a theory is implicitly closed by + forming all instances of type and term variables: @{text "\ A\"} for + any substirution instance of axiom @{text "\ A"}. By pushing + substitution through derivations inductively, we get admissible + substitution rules for theorems shown in \figref{fig:subst-rules}. + + \begin{figure}[htb] + \begin{center} \[ - \infer[@{text "(generalize_type)"}]{@{text "\ \ B[?\]"}}{@{text "\ \ B[\]"} & @{text "\ \ \"}} - \qquad - \infer[@{text "(generalize_term)"}]{@{text "\ \ B[?x]"}}{@{text "\ \ B[x]"} & @{text "x \ \"}} + \infer{@{text "\ \ B[?\]"}}{@{text "\ \ B[\]"} & @{text "\ \ \"}} + \quad + \infer[\quad@{text "(generalize)"}]{@{text "\ \ B[?x]"}}{@{text "\ \ B[x]"} & @{text "x \ \"}} \] \[ - \infer[@{text "(instantiate_type)"}]{@{text "\ \ B[\]"}}{@{text "\ \ B[?\]"}} - \qquad - \infer[@{text "(instantiate_term)"}]{@{text "\ \ B[t]"}}{@{text "\ \ B[?x]"}} + \infer{@{text "\ \ B[\]"}}{@{text "\ \ B[?\]"}} + \quad + \infer[\quad@{text "(instantiate)"}]{@{text "\ \ B[t]"}}{@{text "\ \ B[?x]"}} \] + \caption{Admissible substitution rules}\label{fig:subst-rules} + \end{center} + \end{figure} Note that @{text "instantiate_term"} could be derived using @{text "\_intro/elim"}, but this is not how it is implemented. The type - instantiation rule is a genuine admissible one, due to the lack of true - polymorphism in the logic. - + instantiation rule is a genuine admissible one, due to the lack of + true polymorphism in the logic. - Equality and logical equivalence: + Since @{text "\"} may never contain any schematic variables, the + @{text "instantiate"} do not require an explicit side-condition. In + principle, variables could be substituted in hypotheses as well, but + this could disrupt monotonicity of the basic calculus: derivations + could leave the current proof context. - \smallskip + \medskip The framework also provides builtin equality @{text "\"}, + which is conceptually axiomatized shown in \figref{fig:equality}, + although the implementation provides derived rules directly: + + \begin{figure}[htb] + \begin{center} \begin{tabular}{ll} @{text "\ :: \ \ \ \ prop"} & equality relation (infix) \\ + @{text "\ (\x. b x) a \ b a"} & @{text "\"}-conversion \\ @{text "\ x \ x"} & reflexivity law \\ @{text "\ x \ y \ P x \ P y"} & substitution law \\ @{text "\ (\x. f x \ g x) \ f \ g"} & extensionality \\ @{text "\ (A \ B) \ (B \ A) \ A \ B"} & coincidence with equivalence \\ \end{tabular} - \smallskip + \caption{Conceptual axiomatization of equality.}\label{fig:equality} + \end{center} + \end{figure} + + Since the basic representation of terms already accounts for @{text + "\"}-conversion, Pure equality essentially acts like @{text + "\\\"}-equivalence on terms, while coinciding with bi-implication. + \medskip Conjunction is defined in Pure as a derived connective, see + \figref{fig:conjunction}. This is occasionally useful to represent + simultaneous statements behind the scenes --- framework conjunction + is usually not exposed to the user. + \begin{figure}[htb] + \begin{center} + \begin{tabular}{ll} + @{text "& :: prop \ prop \ prop"} & conjunction (hidden) \\ + @{text "\ A & B \ (\C. (A \ B \ C) \ C)"} \\ + \end{tabular} + \caption{Definition of conjunction.}\label{fig:equality} + \end{center} + \end{figure} + + The definition allows to derive the usual introduction @{text "\ A \ + B \ A & B"}, and destructions @{text "A & B \ A"} and @{text "A & B + \ B"}. *}