doc-src/IsarOverview/Isar/document/Logic.tex
author wenzelm
Fri, 17 Jun 2005 18:36:25 +0200
changeset 16459 7efee005e568
parent 15909 5f0c8a3f0226
child 17125 e6a82d1a1829
permissions -rw-r--r--
updated;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
     1
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
     2
\begin{isabellebody}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
     3
\def\isabellecontext{Logic}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
     4
\isamarkupfalse%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
     5
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
     6
\isamarkupsection{Logic \label{sec:Logic}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
     7
}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
     8
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
     9
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    10
\isamarkupsubsection{Propositional logic%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    11
}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    12
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    13
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    14
\isamarkupsubsubsection{Introduction rules%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    15
}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    16
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    17
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    18
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    19
We start with a really trivial toy proof to introduce the basic
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    20
features of structured proofs.%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    21
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    22
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    23
\isacommand{lemma}\ {\isachardoublequote}A\ {\isasymlongrightarrow}\ A{\isachardoublequote}\isanewline
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    24
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
    25
\isacommand{proof}\ {\isacharparenleft}rule\ impI{\isacharparenright}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
    26
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
    27
\isacommand{assume}\ a{\isacharcolon}\ {\isachardoublequote}A{\isachardoublequote}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
    28
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
    29
\isacommand{show}\ {\isachardoublequote}A{\isachardoublequote}\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
    30
\isacommand{by}{\isacharparenleft}rule\ a{\isacharparenright}\isanewline
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    31
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
    32
\isacommand{qed}\isamarkupfalse%
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    33
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    34
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    35
\noindent
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    36
The operational reading: the \isakeyword{assume}-\isakeyword{show}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    37
block proves \isa{A\ {\isasymLongrightarrow}\ A} (\isa{a} is a degenerate rule (no
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    38
assumptions) that proves \isa{A} outright), which rule
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    39
\isa{impI} (\isa{{\isacharparenleft}{\isacharquery}P\ {\isasymLongrightarrow}\ {\isacharquery}Q{\isacharparenright}\ {\isasymLongrightarrow}\ {\isacharquery}P\ {\isasymlongrightarrow}\ {\isacharquery}Q}) turns into the desired \isa{A\ {\isasymlongrightarrow}\ A}.  However, this text is much too detailed for comfort. Therefore
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    40
Isar implements the following principle: \begin{quote}\em Command
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    41
\isakeyword{proof} automatically tries to select an introduction rule
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    42
based on the goal and a predefined list of rules.  \end{quote} Here
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    43
\isa{impI} is applied automatically:%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    44
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    45
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    46
\isacommand{lemma}\ {\isachardoublequote}A\ {\isasymlongrightarrow}\ A{\isachardoublequote}\isanewline
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    47
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
    48
\isacommand{proof}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
    49
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
    50
\isacommand{assume}\ a{\isacharcolon}\ A\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
    51
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
    52
\isacommand{show}\ A\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
    53
\isacommand{by}{\isacharparenleft}rule\ a{\isacharparenright}\isanewline
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    54
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
    55
\isacommand{qed}\isamarkupfalse%
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    56
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    57
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    58
\noindent Single-identifier formulae such as \isa{A} need not
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    59
be enclosed in double quotes. However, we will continue to do so for
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    60
uniformity.
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    61
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    62
Trivial proofs, in particular those by assumption, should be trivial
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    63
to perform. Proof ``.'' does just that (and a bit more). Thus
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    64
naming of assumptions is often superfluous:%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    65
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    66
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    67
\isacommand{lemma}\ {\isachardoublequote}A\ {\isasymlongrightarrow}\ A{\isachardoublequote}\isanewline
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    68
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
    69
\isacommand{proof}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
    70
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
    71
\isacommand{assume}\ {\isachardoublequote}A{\isachardoublequote}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
    72
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
    73
\isacommand{show}\ {\isachardoublequote}A{\isachardoublequote}\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
    74
\isacommand{{\isachardot}}\isanewline
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    75
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
    76
\isacommand{qed}\isamarkupfalse%
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    77
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    78
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    79
To hide proofs by assumption further, \isakeyword{by}\isa{{\isacharparenleft}method{\isacharparenright}}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    80
first applies \isa{method} and then tries to solve all remaining subgoals
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    81
by assumption:%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    82
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    83
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    84
\isacommand{lemma}\ {\isachardoublequote}A\ {\isasymlongrightarrow}\ A\ {\isasymand}\ A{\isachardoublequote}\isanewline
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    85
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
    86
\isacommand{proof}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
    87
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
    88
\isacommand{assume}\ {\isachardoublequote}A{\isachardoublequote}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
    89
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
    90
\isacommand{show}\ {\isachardoublequote}A\ {\isasymand}\ A{\isachardoublequote}\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
    91
\isacommand{by}{\isacharparenleft}rule\ conjI{\isacharparenright}\isanewline
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    92
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
    93
\isacommand{qed}\isamarkupfalse%
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    94
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    95
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    96
\noindent Rule \isa{conjI} is of course \isa{{\isasymlbrakk}{\isacharquery}P{\isacharsemicolon}\ {\isacharquery}Q{\isasymrbrakk}\ {\isasymLongrightarrow}\ {\isacharquery}P\ {\isasymand}\ {\isacharquery}Q}.
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    97
A drawback of implicit proofs by assumption is that it
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    98
is no longer obvious where an assumption is used.
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    99
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   100
Proofs of the form \isakeyword{by}\isa{{\isacharparenleft}rule}~\emph{name}\isa{{\isacharparenright}}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   101
can be abbreviated to ``..''  if \emph{name} refers to one of the
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   102
predefined introduction rules (or elimination rules, see below):%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   103
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   104
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   105
\isacommand{lemma}\ {\isachardoublequote}A\ {\isasymlongrightarrow}\ A\ {\isasymand}\ A{\isachardoublequote}\isanewline
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   106
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   107
\isacommand{proof}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   108
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   109
\isacommand{assume}\ {\isachardoublequote}A{\isachardoublequote}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   110
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   111
\isacommand{show}\ {\isachardoublequote}A\ {\isasymand}\ A{\isachardoublequote}\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   112
\isacommand{{\isachardot}{\isachardot}}\isanewline
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   113
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   114
\isacommand{qed}\isamarkupfalse%
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   115
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   116
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   117
\noindent
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   118
This is what happens: first the matching introduction rule \isa{conjI}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   119
is applied (first ``.''), then the two subgoals are solved by assumption
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   120
(second ``.'').%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   121
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   122
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   123
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   124
\isamarkupsubsubsection{Elimination rules%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   125
}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   126
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   127
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   128
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   129
A typical elimination rule is \isa{conjE}, $\land$-elimination:
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   130
\begin{isabelle}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   131
\ \ \ \ \ {\isasymlbrakk}{\isacharquery}P\ {\isasymand}\ {\isacharquery}Q{\isacharsemicolon}\ {\isasymlbrakk}{\isacharquery}P{\isacharsemicolon}\ {\isacharquery}Q{\isasymrbrakk}\ {\isasymLongrightarrow}\ {\isacharquery}R{\isasymrbrakk}\ {\isasymLongrightarrow}\ {\isacharquery}R%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   132
\end{isabelle}  In the following proof it is applied
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   133
by hand, after its first (\emph{major}) premise has been eliminated via
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   134
\isa{{\isacharbrackleft}OF\ AB{\isacharbrackright}}:%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   135
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   136
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   137
\isacommand{lemma}\ {\isachardoublequote}A\ {\isasymand}\ B\ {\isasymlongrightarrow}\ B\ {\isasymand}\ A{\isachardoublequote}\isanewline
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   138
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   139
\isacommand{proof}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   140
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   141
\isacommand{assume}\ AB{\isacharcolon}\ {\isachardoublequote}A\ {\isasymand}\ B{\isachardoublequote}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   142
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   143
\isacommand{show}\ {\isachardoublequote}B\ {\isasymand}\ A{\isachardoublequote}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   144
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   145
\isacommand{proof}\ {\isacharparenleft}rule\ conjE{\isacharbrackleft}OF\ AB{\isacharbrackright}{\isacharparenright}\ \ %
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   146
\isamarkupcmt{\isa{conjE{\isacharbrackleft}OF\ AB{\isacharbrackright}}: \isa{{\isacharparenleft}{\isasymlbrakk}A{\isacharsemicolon}\ B{\isasymrbrakk}\ {\isasymLongrightarrow}\ {\isacharquery}R{\isacharparenright}\ {\isasymLongrightarrow}\ {\isacharquery}R}%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   147
}
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   148
\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   149
\ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   150
\isacommand{assume}\ {\isachardoublequote}A{\isachardoublequote}\ {\isachardoublequote}B{\isachardoublequote}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   151
\ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   152
\isacommand{show}\ {\isacharquery}thesis\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   153
\isacommand{{\isachardot}{\isachardot}}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   154
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   155
\isacommand{qed}\isanewline
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   156
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   157
\isacommand{qed}\isamarkupfalse%
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   158
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   159
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   160
\noindent Note that the term \isa{{\isacharquery}thesis} always stands for the
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   161
``current goal'', i.e.\ the enclosing \isakeyword{show} (or
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   162
\isakeyword{have}) statement.
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   163
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   164
This is too much proof text. Elimination rules should be selected
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   165
automatically based on their major premise, the formula or rather connective
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   166
to be eliminated. In Isar they are triggered by facts being fed
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   167
\emph{into} a proof. Syntax:
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   168
\begin{center}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   169
\isakeyword{from} \emph{fact} \isakeyword{show} \emph{proposition} \emph{proof}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   170
\end{center}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   171
where \emph{fact} stands for the name of a previously proved
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   172
proposition, e.g.\ an assumption, an intermediate result or some global
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   173
theorem, which may also be modified with \isa{OF} etc.
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   174
The \emph{fact} is ``piped'' into the \emph{proof}, which can deal with it
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   175
how it chooses. If the \emph{proof} starts with a plain \isakeyword{proof},
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   176
an elimination rule (from a predefined list) is applied
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   177
whose first premise is solved by the \emph{fact}. Thus the proof above
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   178
is equivalent to the following one:%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   179
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   180
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   181
\isacommand{lemma}\ {\isachardoublequote}A\ {\isasymand}\ B\ {\isasymlongrightarrow}\ B\ {\isasymand}\ A{\isachardoublequote}\isanewline
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   182
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   183
\isacommand{proof}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   184
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   185
\isacommand{assume}\ AB{\isacharcolon}\ {\isachardoublequote}A\ {\isasymand}\ B{\isachardoublequote}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   186
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   187
\isacommand{from}\ AB\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   188
\isacommand{show}\ {\isachardoublequote}B\ {\isasymand}\ A{\isachardoublequote}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   189
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   190
\isacommand{proof}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   191
\ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   192
\isacommand{assume}\ {\isachardoublequote}A{\isachardoublequote}\ {\isachardoublequote}B{\isachardoublequote}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   193
\ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   194
\isacommand{show}\ {\isacharquery}thesis\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   195
\isacommand{{\isachardot}{\isachardot}}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   196
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   197
\isacommand{qed}\isanewline
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   198
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   199
\isacommand{qed}\isamarkupfalse%
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   200
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   201
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   202
Now we come to a second important principle:
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   203
\begin{quote}\em
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   204
Try to arrange the sequence of propositions in a UNIX-like pipe,
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   205
such that the proof of each proposition builds on the previous proposition.
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   206
\end{quote}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   207
The previous proposition can be referred to via the fact \isa{this}.
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   208
This greatly reduces the need for explicit naming of propositions:%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   209
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   210
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   211
\isacommand{lemma}\ {\isachardoublequote}A\ {\isasymand}\ B\ {\isasymlongrightarrow}\ B\ {\isasymand}\ A{\isachardoublequote}\isanewline
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   212
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   213
\isacommand{proof}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   214
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   215
\isacommand{assume}\ {\isachardoublequote}A\ {\isasymand}\ B{\isachardoublequote}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   216
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   217
\isacommand{from}\ this\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   218
\isacommand{show}\ {\isachardoublequote}B\ {\isasymand}\ A{\isachardoublequote}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   219
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   220
\isacommand{proof}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   221
\ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   222
\isacommand{assume}\ {\isachardoublequote}A{\isachardoublequote}\ {\isachardoublequote}B{\isachardoublequote}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   223
\ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   224
\isacommand{show}\ {\isacharquery}thesis\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   225
\isacommand{{\isachardot}{\isachardot}}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   226
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   227
\isacommand{qed}\isanewline
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   228
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   229
\isacommand{qed}\isamarkupfalse%
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   230
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   231
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   232
\noindent Because of the frequency of \isakeyword{from}~\isa{this}, Isar provides two abbreviations:
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   233
\begin{center}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   234
\begin{tabular}{r@ {\quad=\quad}l}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   235
\isakeyword{then} & \isakeyword{from} \isa{this} \\
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   236
\isakeyword{thus} & \isakeyword{then} \isakeyword{show}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   237
\end{tabular}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   238
\end{center}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   239
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   240
Here is an alternative proof that operates purely by forward reasoning:%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   241
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   242
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   243
\isacommand{lemma}\ {\isachardoublequote}A\ {\isasymand}\ B\ {\isasymlongrightarrow}\ B\ {\isasymand}\ A{\isachardoublequote}\isanewline
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   244
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   245
\isacommand{proof}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   246
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   247
\isacommand{assume}\ ab{\isacharcolon}\ {\isachardoublequote}A\ {\isasymand}\ B{\isachardoublequote}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   248
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   249
\isacommand{from}\ ab\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   250
\isacommand{have}\ a{\isacharcolon}\ {\isachardoublequote}A{\isachardoublequote}\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   251
\isacommand{{\isachardot}{\isachardot}}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   252
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   253
\isacommand{from}\ ab\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   254
\isacommand{have}\ b{\isacharcolon}\ {\isachardoublequote}B{\isachardoublequote}\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   255
\isacommand{{\isachardot}{\isachardot}}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   256
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   257
\isacommand{from}\ b\ a\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   258
\isacommand{show}\ {\isachardoublequote}B\ {\isasymand}\ A{\isachardoublequote}\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   259
\isacommand{{\isachardot}{\isachardot}}\isanewline
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   260
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   261
\isacommand{qed}\isamarkupfalse%
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   262
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   263
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   264
\noindent It is worth examining this text in detail because it
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   265
exhibits a number of new concepts.  For a start, it is the first time
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   266
we have proved intermediate propositions (\isakeyword{have}) on the
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   267
way to the final \isakeyword{show}. This is the norm in nontrivial
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   268
proofs where one cannot bridge the gap between the assumptions and the
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   269
conclusion in one step. To understand how the proof works we need to
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   270
explain more Isar details.
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   271
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   272
Method \isa{rule} can be given a list of rules, in which case
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   273
\isa{{\isacharparenleft}rule}~\textit{rules}\isa{{\isacharparenright}} applies the first matching
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   274
rule in the list \textit{rules}. Command \isakeyword{from} can be
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   275
followed by any number of facts.  Given \isakeyword{from}~\isa{f}$_1$~\dots~\isa{f}$_n$, the proof step
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   276
\isa{{\isacharparenleft}rule}~\textit{rules}\isa{{\isacharparenright}} following a \isakeyword{have}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   277
or \isakeyword{show} searches \textit{rules} for a rule whose first
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   278
$n$ premises can be proved by \isa{f}$_1$~\dots~\isa{f}$_n$ in the
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   279
given order. Finally one needs to know that ``..'' is short for
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   280
\isa{by{\isacharparenleft}rule}~\textit{elim-rules intro-rules}\isa{{\isacharparenright}} (or
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   281
\isa{by{\isacharparenleft}rule}~\textit{intro-rules}\isa{{\isacharparenright}} if there are no facts
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   282
fed into the proof), i.e.\ elimination rules are tried before
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   283
introduction rules.
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   284
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   285
Thus in the above proof both \isakeyword{have}s are proved via
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   286
\isa{conjE} triggered by \isakeyword{from}~\isa{ab} whereas
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   287
in the \isakeyword{show} step no elimination rule is applicable and
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   288
the proof succeeds with \isa{conjI}. The latter would fail had
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   289
we written \isakeyword{from}~\isa{a\ b} instead of
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   290
\isakeyword{from}~\isa{b\ a}.
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   291
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   292
Proofs starting with a plain \isa{proof} behave the same because the
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   293
latter is short for \isa{proof\ {\isacharparenleft}rule}~\textit{elim-rules
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   294
intro-rules}\isa{{\isacharparenright}} (or \isa{proof\ {\isacharparenleft}rule}~\textit{intro-rules}\isa{{\isacharparenright}} if there are no facts fed into
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   295
the proof).%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   296
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   297
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   298
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   299
\isamarkupsubsection{More constructs%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   300
}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   301
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   302
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   303
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   304
In the previous proof of \isa{A\ {\isasymand}\ B\ {\isasymlongrightarrow}\ B\ {\isasymand}\ A} we needed to feed
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   305
more than one fact into a proof step, a frequent situation. Then the
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   306
UNIX-pipe model appears to break down and we need to name the different
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   307
facts to refer to them. But this can be avoided:%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   308
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   309
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   310
\isacommand{lemma}\ {\isachardoublequote}A\ {\isasymand}\ B\ {\isasymlongrightarrow}\ B\ {\isasymand}\ A{\isachardoublequote}\isanewline
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   311
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   312
\isacommand{proof}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   313
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   314
\isacommand{assume}\ ab{\isacharcolon}\ {\isachardoublequote}A\ {\isasymand}\ B{\isachardoublequote}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   315
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   316
\isacommand{from}\ ab\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   317
\isacommand{have}\ {\isachardoublequote}B{\isachardoublequote}\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   318
\isacommand{{\isachardot}{\isachardot}}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   319
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   320
\isacommand{moreover}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   321
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   322
\isacommand{from}\ ab\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   323
\isacommand{have}\ {\isachardoublequote}A{\isachardoublequote}\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   324
\isacommand{{\isachardot}{\isachardot}}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   325
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   326
\isacommand{ultimately}\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   327
\isacommand{show}\ {\isachardoublequote}B\ {\isasymand}\ A{\isachardoublequote}\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   328
\isacommand{{\isachardot}{\isachardot}}\isanewline
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   329
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   330
\isacommand{qed}\isamarkupfalse%
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   331
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   332
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   333
\noindent You can combine any number of facts \isa{A{\isadigit{1}}} \dots\ \isa{An} into a sequence by separating their proofs with
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   334
\isakeyword{moreover}. After the final fact, \isakeyword{ultimately} stands
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   335
for \isakeyword{from}~\isa{A{\isadigit{1}}}~\dots~\isa{An}.  This avoids having to
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   336
introduce names for all of the sequence elements.%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   337
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   338
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   339
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   340
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   341
Although we have only seen a few introduction and elimination rules so
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   342
far, Isar's predefined rules include all the usual natural deduction
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   343
rules. We conclude our exposition of propositional logic with an extended
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   344
example --- which rules are used implicitly where?%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   345
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   346
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   347
\isacommand{lemma}\ {\isachardoublequote}{\isasymnot}\ {\isacharparenleft}A\ {\isasymand}\ B{\isacharparenright}\ {\isasymlongrightarrow}\ {\isasymnot}\ A\ {\isasymor}\ {\isasymnot}\ B{\isachardoublequote}\isanewline
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   348
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   349
\isacommand{proof}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   350
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   351
\isacommand{assume}\ n{\isacharcolon}\ {\isachardoublequote}{\isasymnot}\ {\isacharparenleft}A\ {\isasymand}\ B{\isacharparenright}{\isachardoublequote}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   352
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   353
\isacommand{show}\ {\isachardoublequote}{\isasymnot}\ A\ {\isasymor}\ {\isasymnot}\ B{\isachardoublequote}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   354
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   355
\isacommand{proof}\ {\isacharparenleft}rule\ ccontr{\isacharparenright}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   356
\ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   357
\isacommand{assume}\ nn{\isacharcolon}\ {\isachardoublequote}{\isasymnot}\ {\isacharparenleft}{\isasymnot}\ A\ {\isasymor}\ {\isasymnot}\ B{\isacharparenright}{\isachardoublequote}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   358
\ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   359
\isacommand{have}\ {\isachardoublequote}{\isasymnot}\ A{\isachardoublequote}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   360
\ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   361
\isacommand{proof}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   362
\ \ \ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   363
\isacommand{assume}\ {\isachardoublequote}A{\isachardoublequote}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   364
\ \ \ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   365
\isacommand{have}\ {\isachardoublequote}{\isasymnot}\ B{\isachardoublequote}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   366
\ \ \ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   367
\isacommand{proof}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   368
\ \ \ \ \ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   369
\isacommand{assume}\ {\isachardoublequote}B{\isachardoublequote}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   370
\ \ \ \ \ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   371
\isacommand{have}\ {\isachardoublequote}A\ {\isasymand}\ B{\isachardoublequote}\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   372
\isacommand{{\isachardot}{\isachardot}}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   373
\ \ \ \ \ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   374
\isacommand{with}\ n\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   375
\isacommand{show}\ False\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   376
\isacommand{{\isachardot}{\isachardot}}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   377
\ \ \ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   378
\isacommand{qed}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   379
\ \ \ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   380
\isacommand{hence}\ {\isachardoublequote}{\isasymnot}\ A\ {\isasymor}\ {\isasymnot}\ B{\isachardoublequote}\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   381
\isacommand{{\isachardot}{\isachardot}}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   382
\ \ \ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   383
\isacommand{with}\ nn\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   384
\isacommand{show}\ False\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   385
\isacommand{{\isachardot}{\isachardot}}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   386
\ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   387
\isacommand{qed}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   388
\ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   389
\isacommand{hence}\ {\isachardoublequote}{\isasymnot}\ A\ {\isasymor}\ {\isasymnot}\ B{\isachardoublequote}\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   390
\isacommand{{\isachardot}{\isachardot}}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   391
\ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   392
\isacommand{with}\ nn\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   393
\isacommand{show}\ False\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   394
\isacommand{{\isachardot}{\isachardot}}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   395
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   396
\isacommand{qed}\isanewline
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   397
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   398
\isacommand{qed}\isamarkupfalse%
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   399
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   400
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   401
\noindent
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   402
Rule \isa{ccontr} (``classical contradiction'') is
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   403
\isa{{\isacharparenleft}{\isasymnot}\ P\ {\isasymLongrightarrow}\ False{\isacharparenright}\ {\isasymLongrightarrow}\ P}.
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   404
Apart from demonstrating the strangeness of classical
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   405
arguments by contradiction, this example also introduces two new
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   406
abbreviations:
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   407
\begin{center}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   408
\begin{tabular}{l@ {\quad=\quad}l}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   409
\isakeyword{hence} & \isakeyword{then} \isakeyword{have} \\
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   410
\isakeyword{with}~\emph{facts} &
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   411
\isakeyword{from}~\emph{facts} \isa{this}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   412
\end{tabular}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   413
\end{center}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   414
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   415
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   416
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   417
\isamarkupsubsection{Avoiding duplication%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   418
}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   419
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   420
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   421
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   422
So far our examples have been a bit unnatural: normally we want to
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   423
prove rules expressed with \isa{{\isasymLongrightarrow}}, not \isa{{\isasymlongrightarrow}}. Here is an example:%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   424
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   425
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   426
\isacommand{lemma}\ {\isachardoublequote}A\ {\isasymand}\ B\ {\isasymLongrightarrow}\ B\ {\isasymand}\ A{\isachardoublequote}\isanewline
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   427
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   428
\isacommand{proof}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   429
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   430
\isacommand{assume}\ {\isachardoublequote}A\ {\isasymand}\ B{\isachardoublequote}\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   431
\isacommand{thus}\ {\isachardoublequote}B{\isachardoublequote}\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   432
\isacommand{{\isachardot}{\isachardot}}\isanewline
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   433
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   434
\isacommand{next}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   435
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   436
\isacommand{assume}\ {\isachardoublequote}A\ {\isasymand}\ B{\isachardoublequote}\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   437
\isacommand{thus}\ {\isachardoublequote}A{\isachardoublequote}\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   438
\isacommand{{\isachardot}{\isachardot}}\isanewline
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   439
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   440
\isacommand{qed}\isamarkupfalse%
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   441
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   442
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   443
\noindent The \isakeyword{proof} always works on the conclusion,
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   444
\isa{B\ {\isasymand}\ A} in our case, thus selecting $\land$-introduction. Hence
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   445
we must show \isa{B} and \isa{A}; both are proved by
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   446
$\land$-elimination and the proofs are separated by \isakeyword{next}:
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   447
\begin{description}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   448
\item[\isakeyword{next}] deals with multiple subgoals. For example,
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   449
when showing \isa{A\ {\isasymand}\ B} we need to show both \isa{A} and \isa{B}.  Each subgoal is proved separately, in \emph{any} order. The
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   450
individual proofs are separated by \isakeyword{next}.  \footnote{Each
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   451
\isakeyword{show} must prove one of the pending subgoals.  If a
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   452
\isakeyword{show} matches multiple subgoals, e.g.\ if the subgoals
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   453
contain ?-variables, the first one is proved. Thus the order in which
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   454
the subgoals are proved can matter --- see
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   455
\S\ref{sec:CaseDistinction} for an example.}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   456
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   457
Strictly speaking \isakeyword{next} is only required if the subgoals
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   458
are proved in different assumption contexts which need to be
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   459
separated, which is not the case above. For clarity we
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   460
have employed \isakeyword{next} anyway and will continue to do so.
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   461
\end{description}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   462
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   463
This is all very well as long as formulae are small. Let us now look at some
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   464
devices to avoid repeating (possibly large) formulae. A very general method
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   465
is pattern matching:%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   466
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   467
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   468
\isacommand{lemma}\ {\isachardoublequote}large{\isacharunderscore}A\ {\isasymand}\ large{\isacharunderscore}B\ {\isasymLongrightarrow}\ large{\isacharunderscore}B\ {\isasymand}\ large{\isacharunderscore}A{\isachardoublequote}\isanewline
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   469
\ \ \ \ \ \ {\isacharparenleft}\isakeyword{is}\ {\isachardoublequote}{\isacharquery}AB\ {\isasymLongrightarrow}\ {\isacharquery}B\ {\isasymand}\ {\isacharquery}A{\isachardoublequote}{\isacharparenright}\isanewline
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   470
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   471
\isacommand{proof}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   472
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   473
\isacommand{assume}\ {\isachardoublequote}{\isacharquery}AB{\isachardoublequote}\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   474
\isacommand{thus}\ {\isachardoublequote}{\isacharquery}B{\isachardoublequote}\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   475
\isacommand{{\isachardot}{\isachardot}}\isanewline
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   476
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   477
\isacommand{next}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   478
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   479
\isacommand{assume}\ {\isachardoublequote}{\isacharquery}AB{\isachardoublequote}\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   480
\isacommand{thus}\ {\isachardoublequote}{\isacharquery}A{\isachardoublequote}\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   481
\isacommand{{\isachardot}{\isachardot}}\isanewline
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   482
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   483
\isacommand{qed}\isamarkupfalse%
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   484
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   485
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   486
\noindent Any formula may be followed by
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   487
\isa{{\isacharparenleft}}\isakeyword{is}~\emph{pattern}\isa{{\isacharparenright}} which causes the pattern
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   488
to be matched against the formula, instantiating the \isa{{\isacharquery}}-variables in
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   489
the pattern. Subsequent uses of these variables in other terms causes
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   490
them to be replaced by the terms they stand for.
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   491
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   492
We can simplify things even more by stating the theorem by means of the
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   493
\isakeyword{assumes} and \isakeyword{shows} elements which allow direct
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   494
naming of assumptions:%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   495
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   496
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   497
\isacommand{lemma}\ \isakeyword{assumes}\ AB{\isacharcolon}\ {\isachardoublequote}large{\isacharunderscore}A\ {\isasymand}\ large{\isacharunderscore}B{\isachardoublequote}\isanewline
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   498
\ \ \isakeyword{shows}\ {\isachardoublequote}large{\isacharunderscore}B\ {\isasymand}\ large{\isacharunderscore}A{\isachardoublequote}\ {\isacharparenleft}\isakeyword{is}\ {\isachardoublequote}{\isacharquery}B\ {\isasymand}\ {\isacharquery}A{\isachardoublequote}{\isacharparenright}\isanewline
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   499
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   500
\isacommand{proof}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   501
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   502
\isacommand{from}\ AB\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   503
\isacommand{show}\ {\isachardoublequote}{\isacharquery}B{\isachardoublequote}\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   504
\isacommand{{\isachardot}{\isachardot}}\isanewline
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   505
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   506
\isacommand{next}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   507
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   508
\isacommand{from}\ AB\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   509
\isacommand{show}\ {\isachardoublequote}{\isacharquery}A{\isachardoublequote}\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   510
\isacommand{{\isachardot}{\isachardot}}\isanewline
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   511
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   512
\isacommand{qed}\isamarkupfalse%
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   513
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   514
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   515
\noindent Note the difference between \isa{{\isacharquery}AB}, a term, and
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   516
\isa{AB}, a fact.
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   517
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   518
Finally we want to start the proof with $\land$-elimination so we
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   519
don't have to perform it twice, as above. Here is a slick way to
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   520
achieve this:%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   521
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   522
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   523
\isacommand{lemma}\ \isakeyword{assumes}\ AB{\isacharcolon}\ {\isachardoublequote}large{\isacharunderscore}A\ {\isasymand}\ large{\isacharunderscore}B{\isachardoublequote}\isanewline
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   524
\ \ \isakeyword{shows}\ {\isachardoublequote}large{\isacharunderscore}B\ {\isasymand}\ large{\isacharunderscore}A{\isachardoublequote}\ {\isacharparenleft}\isakeyword{is}\ {\isachardoublequote}{\isacharquery}B\ {\isasymand}\ {\isacharquery}A{\isachardoublequote}{\isacharparenright}\isanewline
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   525
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   526
\isacommand{using}\ AB\isanewline
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   527
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   528
\isacommand{proof}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   529
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   530
\isacommand{assume}\ {\isachardoublequote}{\isacharquery}A{\isachardoublequote}\ {\isachardoublequote}{\isacharquery}B{\isachardoublequote}\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   531
\isacommand{show}\ {\isacharquery}thesis\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   532
\isacommand{{\isachardot}{\isachardot}}\isanewline
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   533
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   534
\isacommand{qed}\isamarkupfalse%
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   535
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   536
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   537
\noindent Command \isakeyword{using} can appear before a proof
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   538
and adds further facts to those piped into the proof. Here \isa{AB}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   539
is the only such fact and it triggers $\land$-elimination. Another
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   540
frequent idiom is as follows:
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   541
\begin{center}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   542
\isakeyword{from} \emph{major-facts}~
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   543
\isakeyword{show} \emph{proposition}~
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   544
\isakeyword{using} \emph{minor-facts}~
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   545
\emph{proof}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   546
\end{center}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   547
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   548
Sometimes it is necessary to suppress the implicit application of rules in a
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   549
\isakeyword{proof}. For example \isakeyword{show}~\isa{A\ {\isasymor}\ B} would
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   550
trigger $\lor$-introduction, requiring us to prove \isa{A}. A simple
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   551
``\isa{{\isacharminus}}'' prevents this \emph{faux pas}:%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   552
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   553
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   554
\isacommand{lemma}\ \isakeyword{assumes}\ AB{\isacharcolon}\ {\isachardoublequote}A\ {\isasymor}\ B{\isachardoublequote}\ \isakeyword{shows}\ {\isachardoublequote}B\ {\isasymor}\ A{\isachardoublequote}\isanewline
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   555
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   556
\isacommand{proof}\ {\isacharminus}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   557
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   558
\isacommand{from}\ AB\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   559
\isacommand{show}\ {\isacharquery}thesis\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   560
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   561
\isacommand{proof}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   562
\ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   563
\isacommand{assume}\ A\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   564
\isacommand{show}\ {\isacharquery}thesis\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   565
\isacommand{{\isachardot}{\isachardot}}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   566
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   567
\isacommand{next}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   568
\ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   569
\isacommand{assume}\ B\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   570
\isacommand{show}\ {\isacharquery}thesis\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   571
\isacommand{{\isachardot}{\isachardot}}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   572
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   573
\isacommand{qed}\isanewline
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   574
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   575
\isacommand{qed}\isamarkupfalse%
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   576
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   577
\isamarkupsubsection{Predicate calculus%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   578
}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   579
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   580
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   581
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   582
Command \isakeyword{fix} introduces new local variables into a
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   583
proof. The pair \isakeyword{fix}-\isakeyword{show} corresponds to \isa{{\isasymAnd}}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   584
(the universal quantifier at the
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   585
meta-level) just like \isakeyword{assume}-\isakeyword{show} corresponds to
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   586
\isa{{\isasymLongrightarrow}}. Here is a sample proof, annotated with the rules that are
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   587
applied implicitly:%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   588
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   589
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   590
\isacommand{lemma}\ \isakeyword{assumes}\ P{\isacharcolon}\ {\isachardoublequote}{\isasymforall}x{\isachardot}\ P\ x{\isachardoublequote}\ \isakeyword{shows}\ {\isachardoublequote}{\isasymforall}x{\isachardot}\ P{\isacharparenleft}f\ x{\isacharparenright}{\isachardoublequote}\isanewline
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   591
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   592
\isacommand{proof}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ %
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   593
\isamarkupcmt{\isa{allI}: \isa{{\isacharparenleft}{\isasymAnd}x{\isachardot}\ {\isacharquery}P\ x{\isacharparenright}\ {\isasymLongrightarrow}\ {\isasymforall}x{\isachardot}\ {\isacharquery}P\ x}%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   594
}
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   595
\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   596
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   597
\isacommand{fix}\ a\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   598
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   599
\isacommand{from}\ P\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   600
\isacommand{show}\ {\isachardoublequote}P{\isacharparenleft}f\ a{\isacharparenright}{\isachardoublequote}\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   601
\isacommand{{\isachardot}{\isachardot}}\ \ %
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   602
\isamarkupcmt{\isa{allE}: \isa{{\isasymlbrakk}{\isasymforall}x{\isachardot}\ {\isacharquery}P\ x{\isacharsemicolon}\ {\isacharquery}P\ {\isacharquery}x\ {\isasymLongrightarrow}\ {\isacharquery}R{\isasymrbrakk}\ {\isasymLongrightarrow}\ {\isacharquery}R}%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   603
}
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   604
\isanewline
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   605
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   606
\isacommand{qed}\isamarkupfalse%
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   607
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   608
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   609
\noindent Note that in the proof we have chosen to call the bound
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   610
variable \isa{a} instead of \isa{x} merely to show that the choice of
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   611
local names is irrelevant.
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   612
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   613
Next we look at \isa{{\isasymexists}} which is a bit more tricky.%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   614
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   615
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   616
\isacommand{lemma}\ \isakeyword{assumes}\ Pf{\isacharcolon}\ {\isachardoublequote}{\isasymexists}x{\isachardot}\ P{\isacharparenleft}f\ x{\isacharparenright}{\isachardoublequote}\ \isakeyword{shows}\ {\isachardoublequote}{\isasymexists}y{\isachardot}\ P\ y{\isachardoublequote}\isanewline
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   617
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   618
\isacommand{proof}\ {\isacharminus}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   619
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   620
\isacommand{from}\ Pf\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   621
\isacommand{show}\ {\isacharquery}thesis\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   622
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   623
\isacommand{proof}\ \ \ \ \ \ \ \ \ \ \ \ \ \ %
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   624
\isamarkupcmt{\isa{exE}: \isa{{\isasymlbrakk}{\isasymexists}x{\isachardot}\ {\isacharquery}P\ x{\isacharsemicolon}\ {\isasymAnd}x{\isachardot}\ {\isacharquery}P\ x\ {\isasymLongrightarrow}\ {\isacharquery}Q{\isasymrbrakk}\ {\isasymLongrightarrow}\ {\isacharquery}Q}%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   625
}
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   626
\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   627
\ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   628
\isacommand{fix}\ x\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   629
\ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   630
\isacommand{assume}\ {\isachardoublequote}P{\isacharparenleft}f\ x{\isacharparenright}{\isachardoublequote}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   631
\ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   632
\isacommand{show}\ {\isacharquery}thesis\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   633
\isacommand{{\isachardot}{\isachardot}}\ \ %
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   634
\isamarkupcmt{\isa{exI}: \isa{{\isacharquery}P\ {\isacharquery}x\ {\isasymLongrightarrow}\ {\isasymexists}x{\isachardot}\ {\isacharquery}P\ x}%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   635
}
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   636
\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   637
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   638
\isacommand{qed}\isanewline
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   639
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   640
\isacommand{qed}\isamarkupfalse%
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   641
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   642
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   643
\noindent Explicit $\exists$-elimination as seen above can become
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   644
cumbersome in practice.  The derived Isar language element
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   645
\isakeyword{obtain} provides a more appealing form of generalised
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   646
existence reasoning:%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   647
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   648
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   649
\isacommand{lemma}\ \isakeyword{assumes}\ Pf{\isacharcolon}\ {\isachardoublequote}{\isasymexists}x{\isachardot}\ P{\isacharparenleft}f\ x{\isacharparenright}{\isachardoublequote}\ \isakeyword{shows}\ {\isachardoublequote}{\isasymexists}y{\isachardot}\ P\ y{\isachardoublequote}\isanewline
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   650
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   651
\isacommand{proof}\ {\isacharminus}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   652
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   653
\isacommand{from}\ Pf\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   654
\isacommand{obtain}\ x\ \isakeyword{where}\ {\isachardoublequote}P{\isacharparenleft}f\ x{\isacharparenright}{\isachardoublequote}\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   655
\isacommand{{\isachardot}{\isachardot}}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   656
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   657
\isacommand{thus}\ {\isachardoublequote}{\isasymexists}y{\isachardot}\ P\ y{\isachardoublequote}\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   658
\isacommand{{\isachardot}{\isachardot}}\isanewline
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   659
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   660
\isacommand{qed}\isamarkupfalse%
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   661
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   662
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   663
\noindent Note how the proof text follows the usual mathematical style
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   664
of concluding $P(x)$ from $\exists x. P(x)$, while carefully introducing $x$
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   665
as a new local variable.  Technically, \isakeyword{obtain} is similar to
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   666
\isakeyword{fix} and \isakeyword{assume} together with a soundness proof of
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   667
the elimination involved.
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   668
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   669
Here is a proof of a well known tautology.
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   670
Which rule is used where?%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   671
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   672
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   673
\isacommand{lemma}\ \isakeyword{assumes}\ ex{\isacharcolon}\ {\isachardoublequote}{\isasymexists}x{\isachardot}\ {\isasymforall}y{\isachardot}\ P\ x\ y{\isachardoublequote}\ \isakeyword{shows}\ {\isachardoublequote}{\isasymforall}y{\isachardot}\ {\isasymexists}x{\isachardot}\ P\ x\ y{\isachardoublequote}\isanewline
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   674
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   675
\isacommand{proof}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   676
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   677
\isacommand{fix}\ y\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   678
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   679
\isacommand{from}\ ex\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   680
\isacommand{obtain}\ x\ \isakeyword{where}\ {\isachardoublequote}{\isasymforall}y{\isachardot}\ P\ x\ y{\isachardoublequote}\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   681
\isacommand{{\isachardot}{\isachardot}}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   682
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   683
\isacommand{hence}\ {\isachardoublequote}P\ x\ y{\isachardoublequote}\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   684
\isacommand{{\isachardot}{\isachardot}}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   685
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   686
\isacommand{thus}\ {\isachardoublequote}{\isasymexists}x{\isachardot}\ P\ x\ y{\isachardoublequote}\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   687
\isacommand{{\isachardot}{\isachardot}}\isanewline
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   688
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   689
\isacommand{qed}\isamarkupfalse%
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   690
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   691
\isamarkupsubsection{Making bigger steps%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   692
}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   693
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   694
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   695
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   696
So far we have confined ourselves to single step proofs. Of course
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   697
powerful automatic methods can be used just as well. Here is an example,
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   698
Cantor's theorem that there is no surjective function from a set to its
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   699
powerset:%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   700
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   701
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   702
\isacommand{theorem}\ {\isachardoublequote}{\isasymexists}S{\isachardot}\ S\ {\isasymnotin}\ range\ {\isacharparenleft}f\ {\isacharcolon}{\isacharcolon}\ {\isacharprime}a\ {\isasymRightarrow}\ {\isacharprime}a\ set{\isacharparenright}{\isachardoublequote}\isanewline
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   703
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   704
\isacommand{proof}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   705
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   706
\isacommand{let}\ {\isacharquery}S\ {\isacharequal}\ {\isachardoublequote}{\isacharbraceleft}x{\isachardot}\ x\ {\isasymnotin}\ f\ x{\isacharbraceright}{\isachardoublequote}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   707
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   708
\isacommand{show}\ {\isachardoublequote}{\isacharquery}S\ {\isasymnotin}\ range\ f{\isachardoublequote}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   709
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   710
\isacommand{proof}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   711
\ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   712
\isacommand{assume}\ {\isachardoublequote}{\isacharquery}S\ {\isasymin}\ range\ f{\isachardoublequote}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   713
\ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   714
\isacommand{then}\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   715
\isacommand{obtain}\ y\ \isakeyword{where}\ fy{\isacharcolon}\ {\isachardoublequote}{\isacharquery}S\ {\isacharequal}\ f\ y{\isachardoublequote}\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   716
\isacommand{{\isachardot}{\isachardot}}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   717
\ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   718
\isacommand{show}\ False\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   719
\ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   720
\isacommand{proof}\ cases\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   721
\ \ \ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   722
\isacommand{assume}\ {\isachardoublequote}y\ {\isasymin}\ {\isacharquery}S{\isachardoublequote}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   723
\ \ \ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   724
\isacommand{with}\ fy\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   725
\isacommand{show}\ False\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   726
\isacommand{by}\ blast\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   727
\ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   728
\isacommand{next}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   729
\ \ \ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   730
\isacommand{assume}\ {\isachardoublequote}y\ {\isasymnotin}\ {\isacharquery}S{\isachardoublequote}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   731
\ \ \ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   732
\isacommand{with}\ fy\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   733
\isacommand{show}\ False\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   734
\isacommand{by}\ blast\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   735
\ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   736
\isacommand{qed}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   737
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   738
\isacommand{qed}\isanewline
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   739
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   740
\isacommand{qed}\isamarkupfalse%
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   741
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   742
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   743
\noindent
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   744
For a start, the example demonstrates two new constructs:
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   745
\begin{itemize}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   746
\item \isakeyword{let} introduces an abbreviation for a term, in our case
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   747
the witness for the claim.
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   748
\item Proof by \isa{cases} starts a proof by cases. Note that it remains
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   749
implicit what the two cases are: it is merely expected that the two subproofs
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   750
prove \isa{P\ {\isasymLongrightarrow}\ {\isacharquery}thesis} and \isa{{\isasymnot}P\ {\isasymLongrightarrow}\ {\isacharquery}thesis} (in that order)
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   751
for some \isa{P}.
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   752
\end{itemize}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   753
If you wonder how to \isakeyword{obtain} \isa{y}:
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   754
via the predefined elimination rule \isa{{\isasymlbrakk}b\ {\isasymin}\ range\ f{\isacharsemicolon}\ {\isasymAnd}x{\isachardot}\ b\ {\isacharequal}\ f\ x\ {\isasymLongrightarrow}\ P{\isasymrbrakk}\ {\isasymLongrightarrow}\ P}.
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   755
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   756
Method \isa{blast} is used because the contradiction does not follow easily
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   757
by just a single rule. If you find the proof too cryptic for human
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   758
consumption, here is a more detailed version; the beginning up to
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   759
\isakeyword{obtain} stays unchanged.%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   760
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   761
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   762
\isacommand{theorem}\ {\isachardoublequote}{\isasymexists}S{\isachardot}\ S\ {\isasymnotin}\ range\ {\isacharparenleft}f\ {\isacharcolon}{\isacharcolon}\ {\isacharprime}a\ {\isasymRightarrow}\ {\isacharprime}a\ set{\isacharparenright}{\isachardoublequote}\isanewline
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   763
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   764
\isacommand{proof}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   765
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   766
\isacommand{let}\ {\isacharquery}S\ {\isacharequal}\ {\isachardoublequote}{\isacharbraceleft}x{\isachardot}\ x\ {\isasymnotin}\ f\ x{\isacharbraceright}{\isachardoublequote}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   767
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   768
\isacommand{show}\ {\isachardoublequote}{\isacharquery}S\ {\isasymnotin}\ range\ f{\isachardoublequote}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   769
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   770
\isacommand{proof}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   771
\ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   772
\isacommand{assume}\ {\isachardoublequote}{\isacharquery}S\ {\isasymin}\ range\ f{\isachardoublequote}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   773
\ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   774
\isacommand{then}\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   775
\isacommand{obtain}\ y\ \isakeyword{where}\ fy{\isacharcolon}\ {\isachardoublequote}{\isacharquery}S\ {\isacharequal}\ f\ y{\isachardoublequote}\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   776
\isacommand{{\isachardot}{\isachardot}}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   777
\ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   778
\isacommand{show}\ False\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   779
\ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   780
\isacommand{proof}\ cases\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   781
\ \ \ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   782
\isacommand{assume}\ {\isachardoublequote}y\ {\isasymin}\ {\isacharquery}S{\isachardoublequote}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   783
\ \ \ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   784
\isacommand{hence}\ {\isachardoublequote}y\ {\isasymnotin}\ f\ y{\isachardoublequote}\ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   785
\isacommand{by}\ simp\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   786
\ \ \ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   787
\isacommand{hence}\ {\isachardoublequote}y\ {\isasymnotin}\ {\isacharquery}S{\isachardoublequote}\ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   788
\isacommand{by}{\isacharparenleft}simp\ add{\isacharcolon}fy{\isacharparenright}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   789
\ \ \ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   790
\isacommand{thus}\ False\ \ \ \ \ \ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   791
\isacommand{by}\ contradiction\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   792
\ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   793
\isacommand{next}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   794
\ \ \ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   795
\isacommand{assume}\ {\isachardoublequote}y\ {\isasymnotin}\ {\isacharquery}S{\isachardoublequote}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   796
\ \ \ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   797
\isacommand{hence}\ {\isachardoublequote}y\ {\isasymin}\ f\ y{\isachardoublequote}\ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   798
\isacommand{by}\ simp\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   799
\ \ \ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   800
\isacommand{hence}\ {\isachardoublequote}y\ {\isasymin}\ {\isacharquery}S{\isachardoublequote}\ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   801
\isacommand{by}{\isacharparenleft}simp\ add{\isacharcolon}fy{\isacharparenright}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   802
\ \ \ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   803
\isacommand{thus}\ False\ \ \ \ \ \ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   804
\isacommand{by}\ contradiction\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   805
\ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   806
\isacommand{qed}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   807
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   808
\isacommand{qed}\isanewline
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   809
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   810
\isacommand{qed}\isamarkupfalse%
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   811
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   812
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   813
\noindent Method \isa{contradiction} succeeds if both $P$ and
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   814
$\neg P$ are among the assumptions and the facts fed into that step, in any order.
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   815
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   816
As it happens, Cantor's theorem can be proved automatically by best-first
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   817
search. Depth-first search would diverge, but best-first search successfully
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   818
navigates through the large search space:%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   819
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   820
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   821
\isacommand{theorem}\ {\isachardoublequote}{\isasymexists}S{\isachardot}\ S\ {\isasymnotin}\ range\ {\isacharparenleft}f\ {\isacharcolon}{\isacharcolon}\ {\isacharprime}a\ {\isasymRightarrow}\ {\isacharprime}a\ set{\isacharparenright}{\isachardoublequote}\isanewline
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   822
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   823
\isacommand{by}\ best\isamarkupfalse%
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   824
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   825
\isamarkupsubsection{Raw proof blocks%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   826
}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   827
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   828
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   829
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   830
Although we have shown how to employ powerful automatic methods like
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   831
\isa{blast} to achieve bigger proof steps, there may still be the
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   832
tendency to use the default introduction and elimination rules to
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   833
decompose goals and facts. This can lead to very tedious proofs:%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   834
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   835
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   836
\isamarkupfalse%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   837
\isacommand{lemma}\ {\isachardoublequote}{\isasymforall}x\ y{\isachardot}\ A\ x\ y\ {\isasymand}\ B\ x\ y\ {\isasymlongrightarrow}\ C\ x\ y{\isachardoublequote}\isanewline
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   838
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   839
\isacommand{proof}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   840
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   841
\isacommand{fix}\ x\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   842
\isacommand{show}\ {\isachardoublequote}{\isasymforall}y{\isachardot}\ A\ x\ y\ {\isasymand}\ B\ x\ y\ {\isasymlongrightarrow}\ C\ x\ y{\isachardoublequote}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   843
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   844
\isacommand{proof}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   845
\ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   846
\isacommand{fix}\ y\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   847
\isacommand{show}\ {\isachardoublequote}A\ x\ y\ {\isasymand}\ B\ x\ y\ {\isasymlongrightarrow}\ C\ x\ y{\isachardoublequote}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   848
\ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   849
\isacommand{proof}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   850
\ \ \ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   851
\isacommand{assume}\ {\isachardoublequote}A\ x\ y\ {\isasymand}\ B\ x\ y{\isachardoublequote}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   852
\ \ \ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   853
\isacommand{show}\ {\isachardoublequote}C\ x\ y{\isachardoublequote}\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   854
\isacommand{sorry}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   855
\ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   856
\isacommand{qed}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   857
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   858
\isacommand{qed}\isanewline
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   859
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   860
\isacommand{qed}\isamarkupfalse%
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   861
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   862
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   863
\noindent Since we are only interested in the decomposition and not the
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   864
actual proof, the latter has been replaced by
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   865
\isakeyword{sorry}. Command \isakeyword{sorry} proves anything but is
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   866
only allowed in quick and dirty mode, the default interactive mode. It
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   867
is very convenient for top down proof development.
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   868
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   869
Luckily we can avoid this step by step decomposition very easily:%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   870
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   871
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   872
\isacommand{lemma}\ {\isachardoublequote}{\isasymforall}x\ y{\isachardot}\ A\ x\ y\ {\isasymand}\ B\ x\ y\ {\isasymlongrightarrow}\ C\ x\ y{\isachardoublequote}\isanewline
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   873
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   874
\isacommand{proof}\ {\isacharminus}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   875
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   876
\isacommand{have}\ {\isachardoublequote}{\isasymAnd}x\ y{\isachardot}\ {\isasymlbrakk}\ A\ x\ y{\isacharsemicolon}\ B\ x\ y\ {\isasymrbrakk}\ {\isasymLongrightarrow}\ C\ x\ y{\isachardoublequote}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   877
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   878
\isacommand{proof}\ {\isacharminus}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   879
\ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   880
\isacommand{fix}\ x\ y\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   881
\isacommand{assume}\ {\isachardoublequote}A\ x\ y{\isachardoublequote}\ {\isachardoublequote}B\ x\ y{\isachardoublequote}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   882
\ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   883
\isacommand{show}\ {\isachardoublequote}C\ x\ y{\isachardoublequote}\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   884
\isacommand{sorry}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   885
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   886
\isacommand{qed}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   887
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   888
\isacommand{thus}\ {\isacharquery}thesis\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   889
\isacommand{by}\ blast\isanewline
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   890
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   891
\isacommand{qed}\isamarkupfalse%
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   892
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   893
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   894
\noindent
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   895
This can be simplified further by \emph{raw proof blocks}, i.e.\
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   896
proofs enclosed in braces:%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   897
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   898
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   899
\isacommand{lemma}\ {\isachardoublequote}{\isasymforall}x\ y{\isachardot}\ A\ x\ y\ {\isasymand}\ B\ x\ y\ {\isasymlongrightarrow}\ C\ x\ y{\isachardoublequote}\isanewline
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   900
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   901
\isacommand{proof}\ {\isacharminus}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   902
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   903
\isacommand{{\isacharbraceleft}}\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   904
\isacommand{fix}\ x\ y\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   905
\isacommand{assume}\ {\isachardoublequote}A\ x\ y{\isachardoublequote}\ {\isachardoublequote}B\ x\ y{\isachardoublequote}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   906
\ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   907
\isacommand{have}\ {\isachardoublequote}C\ x\ y{\isachardoublequote}\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   908
\isacommand{sorry}\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   909
\isacommand{{\isacharbraceright}}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   910
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   911
\isacommand{thus}\ {\isacharquery}thesis\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   912
\isacommand{by}\ blast\isanewline
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   913
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   914
\isacommand{qed}\isamarkupfalse%
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   915
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   916
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   917
\noindent The result of the raw proof block is the same theorem
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   918
as above, namely \isa{{\isasymAnd}x\ y{\isachardot}\ {\isasymlbrakk}A\ x\ y{\isacharsemicolon}\ B\ x\ y{\isasymrbrakk}\ {\isasymLongrightarrow}\ C\ x\ y}.  Raw
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   919
proof blocks are like ordinary proofs except that they do not prove
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   920
some explicitly stated property but that the property emerges directly
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   921
out of the \isakeyword{fixe}s, \isakeyword{assume}s and
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   922
\isakeyword{have} in the block. Thus they again serve to avoid
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   923
duplication. Note that the conclusion of a raw proof block is stated with
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   924
\isakeyword{have} rather than \isakeyword{show} because it is not the
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   925
conclusion of some pending goal but some independent claim.
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   926
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   927
The general idea demonstrated in this subsection is very
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   928
important in Isar and distinguishes it from tactic-style proofs:
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   929
\begin{quote}\em
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   930
Do not manipulate the proof state into a particular form by applying
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   931
tactics but state the desired form explicitly and let the tactic verify
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   932
that from this form the original goal follows.
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   933
\end{quote}
14617
a2bcb11ce445 Added case distinction proof pattern.
nipkow
parents: 13999
diff changeset
   934
This yields more readable and also more robust proofs.
a2bcb11ce445 Added case distinction proof pattern.
nipkow
parents: 13999
diff changeset
   935
a2bcb11ce445 Added case distinction proof pattern.
nipkow
parents: 13999
diff changeset
   936
\subsubsection{General case distinctions}
a2bcb11ce445 Added case distinction proof pattern.
nipkow
parents: 13999
diff changeset
   937
a2bcb11ce445 Added case distinction proof pattern.
nipkow
parents: 13999
diff changeset
   938
As an important application of raw proof blocks we show how to deal
a2bcb11ce445 Added case distinction proof pattern.
nipkow
parents: 13999
diff changeset
   939
with general case distinctions --- more specific kinds are treated in
a2bcb11ce445 Added case distinction proof pattern.
nipkow
parents: 13999
diff changeset
   940
\S\ref{sec:CaseDistinction}. Imagine that you would like to prove some
a2bcb11ce445 Added case distinction proof pattern.
nipkow
parents: 13999
diff changeset
   941
goal by distinguishing $n$ cases $P_1$, \dots, $P_n$. You show that
a2bcb11ce445 Added case distinction proof pattern.
nipkow
parents: 13999
diff changeset
   942
the $n$ cases are exhaustive (i.e.\ $P_1 \lor \dots \lor P_n$) and
a2bcb11ce445 Added case distinction proof pattern.
nipkow
parents: 13999
diff changeset
   943
that each case $P_i$ implies the goal. Taken together, this proves the
a2bcb11ce445 Added case distinction proof pattern.
nipkow
parents: 13999
diff changeset
   944
goal. The corresponding Isar proof pattern (for $n = 3$) is very handy:%
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   945
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   946
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   947
%
14617
a2bcb11ce445 Added case distinction proof pattern.
nipkow
parents: 13999
diff changeset
   948
\renewcommand{\isamarkupcmt}[1]{#1}
a2bcb11ce445 Added case distinction proof pattern.
nipkow
parents: 13999
diff changeset
   949
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   950
\isacommand{proof}\ {\isacharminus}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   951
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   952
\isacommand{have}\ {\isachardoublequote}P\isactrlisub {\isadigit{1}}\ {\isasymor}\ P\isactrlisub {\isadigit{2}}\ {\isasymor}\ P\isactrlisub {\isadigit{3}}{\isachardoublequote}\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   953
\ %
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   954
\isamarkupcmt{\dots%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   955
}
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   956
\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   957
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   958
\isacommand{moreover}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   959
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   960
\isacommand{{\isacharbraceleft}}\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   961
\isacommand{assume}\ P\isactrlisub {\isadigit{1}}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   962
\ \ \ \ %
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   963
\isamarkupcmt{\dots%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   964
}
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   965
\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   966
\ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   967
\isacommand{have}\ {\isacharquery}thesis\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   968
\ %
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   969
\isamarkupcmt{\dots%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   970
}
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   971
\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   972
\isacommand{{\isacharbraceright}}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   973
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   974
\isacommand{moreover}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   975
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   976
\isacommand{{\isacharbraceleft}}\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   977
\isacommand{assume}\ P\isactrlisub {\isadigit{2}}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   978
\ \ \ \ %
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   979
\isamarkupcmt{\dots%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   980
}
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   981
\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   982
\ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   983
\isacommand{have}\ {\isacharquery}thesis\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   984
\ %
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   985
\isamarkupcmt{\dots%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   986
}
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   987
\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   988
\isacommand{{\isacharbraceright}}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   989
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   990
\isacommand{moreover}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   991
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   992
\isacommand{{\isacharbraceleft}}\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   993
\isacommand{assume}\ P\isactrlisub {\isadigit{3}}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   994
\ \ \ \ %
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   995
\isamarkupcmt{\dots%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   996
}
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   997
\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   998
\ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   999
\isacommand{have}\ {\isacharquery}thesis\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1000
\ %
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1001
\isamarkupcmt{\dots%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1002
}
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1003
\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1004
\isacommand{{\isacharbraceright}}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1005
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1006
\isacommand{ultimately}\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1007
\isacommand{show}\ {\isacharquery}thesis\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1008
\isacommand{by}\ blast\isanewline
14617
a2bcb11ce445 Added case distinction proof pattern.
nipkow
parents: 13999
diff changeset
  1009
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1010
\isacommand{qed}\isamarkupfalse%
14617
a2bcb11ce445 Added case distinction proof pattern.
nipkow
parents: 13999
diff changeset
  1011
%
a2bcb11ce445 Added case distinction proof pattern.
nipkow
parents: 13999
diff changeset
  1012
\renewcommand{\isamarkupcmt}[1]{{\isastylecmt--- #1}}
a2bcb11ce445 Added case distinction proof pattern.
nipkow
parents: 13999
diff changeset
  1013
%
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1014
\isamarkupsubsection{Further refinements%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1015
}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1016
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1017
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1018
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1019
This subsection discusses some further tricks that can make
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1020
life easier although they are not essential.%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1021
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1022
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1023
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1024
\isamarkupsubsubsection{\isakeyword{and}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1025
}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1026
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1027
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1028
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1029
Propositions (following \isakeyword{assume} etc) may but need not be
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1030
separated by \isakeyword{and}. This is not just for readability
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1031
(\isakeyword{from} \isa{A} \isakeyword{and} \isa{B} looks nicer than
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1032
\isakeyword{from} \isa{A} \isa{B}) but for structuring lists of propositions
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1033
into possibly named blocks. In
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1034
\begin{center}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1035
\isakeyword{assume} \isa{A:} $A_1$ $A_2$ \isakeyword{and} \isa{B:} $A_3$
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1036
\isakeyword{and} $A_4$
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1037
\end{center}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1038
label \isa{A} refers to the list of propositions $A_1$ $A_2$ and
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1039
label \isa{B} to $A_3$.%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1040
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1041
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1042
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1043
\isamarkupsubsubsection{\isakeyword{note}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1044
}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1045
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1046
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1047
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1048
If you want to remember intermediate fact(s) that cannot be
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1049
named directly, use \isakeyword{note}. For example the result of raw
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1050
proof block can be named by following it with
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1051
\isakeyword{note}~\isa{some{\isacharunderscore}name\ {\isacharequal}\ this}.  As a side effect,
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1052
\isa{this} is set to the list of facts on the right-hand side. You
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1053
can also say \isa{note\ some{\isacharunderscore}fact}, which simply sets \isa{this},
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1054
i.e.\ recalls \isa{some{\isacharunderscore}fact}, e.g.\ in a \isakeyword{moreover} sequence.%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1055
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1056
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1057
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1058
\isamarkupsubsubsection{\isakeyword{fixes}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1059
}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1060
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1061
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1062
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1063
Sometimes it is necessary to decorate a proposition with type
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1064
constraints, as in Cantor's theorem above. These type constraints tend
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1065
to make the theorem less readable. The situation can be improved a
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1066
little by combining the type constraint with an outer \isa{{\isasymAnd}}:%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1067
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1068
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1069
\isacommand{theorem}\ {\isachardoublequote}{\isasymAnd}f\ {\isacharcolon}{\isacharcolon}\ {\isacharprime}a\ {\isasymRightarrow}\ {\isacharprime}a\ set{\isachardot}\ {\isasymexists}S{\isachardot}\ S\ {\isasymnotin}\ range\ f{\isachardoublequote}\isamarkupfalse%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1070
\isamarkupfalse%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1071
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1072
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1073
\noindent However, now \isa{f} is bound and we need a
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1074
\isakeyword{fix}~\isa{f} in the proof before we can refer to \isa{f}.
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1075
This is avoided by \isakeyword{fixes}:%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1076
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1077
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1078
\isacommand{theorem}\ \isakeyword{fixes}\ f\ {\isacharcolon}{\isacharcolon}\ {\isachardoublequote}{\isacharprime}a\ {\isasymRightarrow}\ {\isacharprime}a\ set{\isachardoublequote}\ \isakeyword{shows}\ {\isachardoublequote}{\isasymexists}S{\isachardot}\ S\ {\isasymnotin}\ range\ f{\isachardoublequote}\isamarkupfalse%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1079
\isamarkupfalse%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1080
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1081
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1082
\noindent
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1083
Even better, \isakeyword{fixes} allows to introduce concrete syntax locally:%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1084
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1085
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1086
\isacommand{lemma}\ comm{\isacharunderscore}mono{\isacharcolon}\isanewline
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1087
\ \ \isakeyword{fixes}\ r\ {\isacharcolon}{\isacharcolon}\ {\isachardoublequote}{\isacharprime}a\ {\isasymRightarrow}\ {\isacharprime}a\ {\isasymRightarrow}\ bool{\isachardoublequote}\ {\isacharparenleft}\isakeyword{infix}\ {\isachardoublequote}{\isachargreater}{\isachardoublequote}\ {\isadigit{6}}{\isadigit{0}}{\isacharparenright}\ \isakeyword{and}\isanewline
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1088
\ \ \ \ \ \ \ f\ {\isacharcolon}{\isacharcolon}\ {\isachardoublequote}{\isacharprime}a\ {\isasymRightarrow}\ {\isacharprime}a\ {\isasymRightarrow}\ {\isacharprime}a{\isachardoublequote}\ \ \ {\isacharparenleft}\isakeyword{infixl}\ {\isachardoublequote}{\isacharplus}{\isacharplus}{\isachardoublequote}\ {\isadigit{7}}{\isadigit{0}}{\isacharparenright}\isanewline
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1089
\ \ \isakeyword{assumes}\ comm{\isacharcolon}\ {\isachardoublequote}{\isasymAnd}x\ y{\isacharcolon}{\isacharcolon}{\isacharprime}a{\isachardot}\ x\ {\isacharplus}{\isacharplus}\ y\ {\isacharequal}\ y\ {\isacharplus}{\isacharplus}\ x{\isachardoublequote}\ \isakeyword{and}\isanewline
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1090
\ \ \ \ \ \ \ \ \ \ mono{\isacharcolon}\ {\isachardoublequote}{\isasymAnd}x\ y\ z{\isacharcolon}{\isacharcolon}{\isacharprime}a{\isachardot}\ x\ {\isachargreater}\ y\ {\isasymLongrightarrow}\ x\ {\isacharplus}{\isacharplus}\ z\ {\isachargreater}\ y\ {\isacharplus}{\isacharplus}\ z{\isachardoublequote}\isanewline
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1091
\ \ \isakeyword{shows}\ {\isachardoublequote}x\ {\isachargreater}\ y\ {\isasymLongrightarrow}\ z\ {\isacharplus}{\isacharplus}\ x\ {\isachargreater}\ z\ {\isacharplus}{\isacharplus}\ y{\isachardoublequote}\isanewline
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1092
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1093
\isacommand{by}{\isacharparenleft}simp\ add{\isacharcolon}\ comm\ mono{\isacharparenright}\isamarkupfalse%
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1094
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1095
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1096
\noindent The concrete syntax is dropped at the end of the proof and the
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1097
theorem becomes \begin{isabelle}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1098
{\isasymlbrakk}{\isasymAnd}x\ y{\isachardot}\ {\isacharquery}f\ x\ y\ {\isacharequal}\ {\isacharquery}f\ y\ x{\isacharsemicolon}\isanewline
14617
a2bcb11ce445 Added case distinction proof pattern.
nipkow
parents: 13999
diff changeset
  1099
\isaindent{\ }{\isasymAnd}x\ y\ z{\isachardot}\ {\isacharquery}r\ x\ y\ {\isasymLongrightarrow}\ {\isacharquery}r\ {\isacharparenleft}{\isacharquery}f\ x\ z{\isacharparenright}\ {\isacharparenleft}{\isacharquery}f\ y\ z{\isacharparenright}{\isacharsemicolon}\ {\isacharquery}r\ {\isacharquery}x\ {\isacharquery}y{\isasymrbrakk}\isanewline
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1100
{\isasymLongrightarrow}\ {\isacharquery}r\ {\isacharparenleft}{\isacharquery}f\ {\isacharquery}z\ {\isacharquery}x{\isacharparenright}\ {\isacharparenleft}{\isacharquery}f\ {\isacharquery}z\ {\isacharquery}y{\isacharparenright}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1101
\end{isabelle}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1102
\tweakskip%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1103
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1104
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1105
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1106
\isamarkupsubsubsection{\isakeyword{obtain}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1107
}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1108
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1109
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1110
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1111
The \isakeyword{obtain} construct can introduce multiple
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1112
witnesses and propositions as in the following proof fragment:%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1113
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1114
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1115
\isacommand{lemma}\ \isakeyword{assumes}\ A{\isacharcolon}\ {\isachardoublequote}{\isasymexists}x\ y{\isachardot}\ P\ x\ y\ {\isasymand}\ Q\ x\ y{\isachardoublequote}\ \isakeyword{shows}\ {\isachardoublequote}R{\isachardoublequote}\isanewline
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1116
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1117
\isacommand{proof}\ {\isacharminus}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1118
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1119
\isacommand{from}\ A\ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1120
\isacommand{obtain}\ x\ y\ \isakeyword{where}\ P{\isacharcolon}\ {\isachardoublequote}P\ x\ y{\isachardoublequote}\ \isakeyword{and}\ Q{\isacharcolon}\ {\isachardoublequote}Q\ x\ y{\isachardoublequote}\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1121
\isacommand{by}\ blast\isamarkupfalse%
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1122
\isamarkupfalse%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1123
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1124
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1125
Remember also that one does not even need to start with a formula
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1126
containing \isa{{\isasymexists}} as we saw in the proof of Cantor's theorem.%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1127
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1128
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1129
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1130
\isamarkupsubsubsection{Combining proof styles%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1131
}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1132
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1133
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1134
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1135
Finally, whole ``scripts'' (tactic-based proofs in the style of
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1136
\cite{LNCS2283}) may appear in the leaves of the proof tree, although this is
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1137
best avoided.  Here is a contrived example:%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1138
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1139
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1140
\isacommand{lemma}\ {\isachardoublequote}A\ {\isasymlongrightarrow}\ {\isacharparenleft}A\ {\isasymlongrightarrow}\ B{\isacharparenright}\ {\isasymlongrightarrow}\ B{\isachardoublequote}\isanewline
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1141
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1142
\isacommand{proof}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1143
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1144
\isacommand{assume}\ a{\isacharcolon}\ {\isachardoublequote}A{\isachardoublequote}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1145
\ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1146
\isacommand{show}\ {\isachardoublequote}{\isacharparenleft}A\ {\isasymlongrightarrow}B{\isacharparenright}\ {\isasymlongrightarrow}\ B{\isachardoublequote}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1147
\ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1148
\isacommand{apply}{\isacharparenleft}rule\ impI{\isacharparenright}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1149
\ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1150
\isacommand{apply}{\isacharparenleft}erule\ impE{\isacharparenright}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1151
\ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1152
\isacommand{apply}{\isacharparenleft}rule\ a{\isacharparenright}\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1153
\ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1154
\isacommand{apply}\ assumption\isanewline
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1155
\ \ \ \ \isamarkupfalse%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1156
\isacommand{done}\isanewline
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1157
\isamarkupfalse%
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1158
\isacommand{qed}\isamarkupfalse%
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1159
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1160
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1161
\noindent You may need to resort to this technique if an
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1162
automatic step fails to prove the desired proposition.
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1163
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1164
When converting a proof from tactic-style into Isar you can proceed
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1165
in a top-down manner: parts of the proof can be left in script form
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1166
while the outer structure is already expressed in Isar.%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1167
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1168
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1169
\isamarkupfalse%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1170
\end{isabellebody}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1171
%%% Local Variables:
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1172
%%% mode: latex
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1173
%%% TeX-master: "root"
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1174
%%% End: