doc-src/IsarOverview/Isar/document/Logic.tex
author wenzelm
Fri, 03 Aug 2007 22:33:03 +0200
changeset 24148 2d4ee876c215
parent 19840 600c35fd1b5e
child 25412 6f56f0350f6c
permissions -rw-r--r--
named some CRITICAL sections;
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}%
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
     4
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
     5
\isadelimtheory
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
     6
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
     7
\endisadelimtheory
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
     8
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
     9
\isatagtheory
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
    10
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
    11
\endisatagtheory
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
    12
{\isafoldtheory}%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
    13
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
    14
\isadelimtheory
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
    15
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
    16
\endisadelimtheory
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    17
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    18
\isamarkupsection{Logic \label{sec:Logic}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    19
}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    20
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    21
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    22
\isamarkupsubsection{Propositional logic%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    23
}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    24
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    25
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    26
\isamarkupsubsubsection{Introduction rules%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    27
}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    28
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    29
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    30
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    31
We start with a really trivial toy proof to introduce the basic
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    32
features of structured proofs.%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    33
\end{isamarkuptext}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
    34
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
    35
\isacommand{lemma}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
    36
\ {\isachardoublequoteopen}A\ {\isasymlongrightarrow}\ A{\isachardoublequoteclose}\isanewline
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
    37
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
    38
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
    39
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
    40
\endisadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
    41
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
    42
\isatagproof
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
    43
\isacommand{proof}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
    44
\ {\isacharparenleft}rule\ impI{\isacharparenright}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
    45
\ \ \isacommand{assume}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
    46
\ a{\isacharcolon}\ {\isachardoublequoteopen}A{\isachardoublequoteclose}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
    47
\ \ \isacommand{show}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
    48
\ {\isachardoublequoteopen}A{\isachardoublequoteclose}\ \isacommand{by}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
    49
{\isacharparenleft}rule\ a{\isacharparenright}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
    50
\isacommand{qed}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
    51
%
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
    52
\endisatagproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
    53
{\isafoldproof}%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
    54
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
    55
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
    56
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
    57
\endisadelimproof
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    58
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    59
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    60
\noindent
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    61
The operational reading: the \isakeyword{assume}-\isakeyword{show}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    62
block proves \isa{A\ {\isasymLongrightarrow}\ A} (\isa{a} is a degenerate rule (no
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    63
assumptions) that proves \isa{A} outright), which rule
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    64
\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
    65
Isar implements the following principle: \begin{quote}\em Command
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    66
\isakeyword{proof} automatically tries to select an introduction rule
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    67
based on the goal and a predefined list of rules.  \end{quote} Here
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    68
\isa{impI} is applied automatically:%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    69
\end{isamarkuptext}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
    70
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
    71
\isacommand{lemma}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
    72
\ {\isachardoublequoteopen}A\ {\isasymlongrightarrow}\ A{\isachardoublequoteclose}\isanewline
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
    73
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
    74
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
    75
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
    76
\endisadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
    77
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
    78
\isatagproof
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
    79
\isacommand{proof}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
    80
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
    81
\ \ \isacommand{assume}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
    82
\ a{\isacharcolon}\ A\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
    83
\ \ \isacommand{show}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
    84
\ A\ \isacommand{by}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
    85
{\isacharparenleft}rule\ a{\isacharparenright}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
    86
\isacommand{qed}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
    87
%
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
    88
\endisatagproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
    89
{\isafoldproof}%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
    90
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
    91
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
    92
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
    93
\endisadelimproof
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 Single-identifier formulae such as \isa{A} need not
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    97
be enclosed in double quotes. However, we will continue to do so for
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    98
uniformity.
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
    99
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   100
Trivial proofs, in particular those by assumption, should be trivial
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   101
to perform. Proof ``.'' does just that (and a bit more). Thus
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   102
naming of assumptions is often superfluous:%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   103
\end{isamarkuptext}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   104
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   105
\isacommand{lemma}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   106
\ {\isachardoublequoteopen}A\ {\isasymlongrightarrow}\ A{\isachardoublequoteclose}\isanewline
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   107
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   108
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   109
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   110
\endisadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   111
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   112
\isatagproof
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   113
\isacommand{proof}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   114
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   115
\ \ \isacommand{assume}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   116
\ {\isachardoublequoteopen}A{\isachardoublequoteclose}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   117
\ \ \isacommand{show}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   118
\ {\isachardoublequoteopen}A{\isachardoublequoteclose}\ \isacommand{{\isachardot}}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   119
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   120
\isacommand{qed}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   121
%
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   122
\endisatagproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   123
{\isafoldproof}%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   124
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   125
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   126
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   127
\endisadelimproof
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   128
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   129
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   130
To hide proofs by assumption further, \isakeyword{by}\isa{{\isacharparenleft}method{\isacharparenright}}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   131
first applies \isa{method} and then tries to solve all remaining subgoals
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   132
by assumption:%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   133
\end{isamarkuptext}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   134
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   135
\isacommand{lemma}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   136
\ {\isachardoublequoteopen}A\ {\isasymlongrightarrow}\ A\ {\isasymand}\ A{\isachardoublequoteclose}\isanewline
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   137
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   138
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   139
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   140
\endisadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   141
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   142
\isatagproof
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   143
\isacommand{proof}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   144
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   145
\ \ \isacommand{assume}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   146
\ {\isachardoublequoteopen}A{\isachardoublequoteclose}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   147
\ \ \isacommand{show}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   148
\ {\isachardoublequoteopen}A\ {\isasymand}\ A{\isachardoublequoteclose}\ \isacommand{by}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   149
{\isacharparenleft}rule\ conjI{\isacharparenright}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   150
\isacommand{qed}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   151
%
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   152
\endisatagproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   153
{\isafoldproof}%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   154
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   155
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   156
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   157
\endisadelimproof
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 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
   161
A drawback of implicit proofs by assumption is that it
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   162
is no longer obvious where an assumption is used.
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   163
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   164
Proofs of the form \isakeyword{by}\isa{{\isacharparenleft}rule}~\emph{name}\isa{{\isacharparenright}}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   165
can be abbreviated to ``..''  if \emph{name} refers to one of the
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   166
predefined introduction rules (or elimination rules, see below):%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   167
\end{isamarkuptext}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   168
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   169
\isacommand{lemma}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   170
\ {\isachardoublequoteopen}A\ {\isasymlongrightarrow}\ A\ {\isasymand}\ A{\isachardoublequoteclose}\isanewline
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   171
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   172
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   173
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   174
\endisadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   175
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   176
\isatagproof
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   177
\isacommand{proof}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   178
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   179
\ \ \isacommand{assume}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   180
\ {\isachardoublequoteopen}A{\isachardoublequoteclose}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   181
\ \ \isacommand{show}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   182
\ {\isachardoublequoteopen}A\ {\isasymand}\ A{\isachardoublequoteclose}\ \isacommand{{\isachardot}{\isachardot}}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   183
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   184
\isacommand{qed}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   185
%
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   186
\endisatagproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   187
{\isafoldproof}%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   188
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   189
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   190
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   191
\endisadelimproof
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   192
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   193
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   194
\noindent
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   195
This is what happens: first the matching introduction rule \isa{conjI}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   196
is applied (first ``.''), then the two subgoals are solved by assumption
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   197
(second ``.'').%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   198
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   199
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   200
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   201
\isamarkupsubsubsection{Elimination rules%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   202
}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   203
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   204
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   205
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   206
A typical elimination rule is \isa{conjE}, $\land$-elimination:
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   207
\begin{isabelle}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   208
\ \ \ \ \ {\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
   209
\end{isabelle}  In the following proof it is applied
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   210
by hand, after its first (\emph{major}) premise has been eliminated via
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   211
\isa{{\isacharbrackleft}OF\ AB{\isacharbrackright}}:%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   212
\end{isamarkuptext}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   213
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   214
\isacommand{lemma}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   215
\ {\isachardoublequoteopen}A\ {\isasymand}\ B\ {\isasymlongrightarrow}\ B\ {\isasymand}\ A{\isachardoublequoteclose}\isanewline
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   216
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   217
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   218
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   219
\endisadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   220
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   221
\isatagproof
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   222
\isacommand{proof}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   223
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   224
\ \ \isacommand{assume}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   225
\ AB{\isacharcolon}\ {\isachardoublequoteopen}A\ {\isasymand}\ B{\isachardoublequoteclose}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   226
\ \ \isacommand{show}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   227
\ {\isachardoublequoteopen}B\ {\isasymand}\ A{\isachardoublequoteclose}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   228
\ \ \isacommand{proof}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   229
\ {\isacharparenleft}rule\ conjE{\isacharbrackleft}OF\ AB{\isacharbrackright}{\isacharparenright}\ \ %
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   230
\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
   231
}
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   232
\isanewline
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   233
\ \ \ \ \isacommand{assume}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   234
\ {\isachardoublequoteopen}A{\isachardoublequoteclose}\ {\isachardoublequoteopen}B{\isachardoublequoteclose}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   235
\ \ \ \ \isacommand{show}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   236
\ {\isacharquery}thesis\ \isacommand{{\isachardot}{\isachardot}}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   237
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   238
\ \ \isacommand{qed}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   239
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   240
\isacommand{qed}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   241
%
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   242
\endisatagproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   243
{\isafoldproof}%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   244
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   245
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   246
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   247
\endisadelimproof
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   248
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   249
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   250
\noindent Note that the term \isa{{\isacharquery}thesis} always stands for the
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   251
``current goal'', i.e.\ the enclosing \isakeyword{show} (or
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   252
\isakeyword{have}) statement.
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   253
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   254
This is too much proof text. Elimination rules should be selected
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   255
automatically based on their major premise, the formula or rather connective
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   256
to be eliminated. In Isar they are triggered by facts being fed
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   257
\emph{into} a proof. Syntax:
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   258
\begin{center}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   259
\isakeyword{from} \emph{fact} \isakeyword{show} \emph{proposition} \emph{proof}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   260
\end{center}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   261
where \emph{fact} stands for the name of a previously proved
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   262
proposition, e.g.\ an assumption, an intermediate result or some global
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   263
theorem, which may also be modified with \isa{OF} etc.
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   264
The \emph{fact} is ``piped'' into the \emph{proof}, which can deal with it
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   265
how it chooses. If the \emph{proof} starts with a plain \isakeyword{proof},
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   266
an elimination rule (from a predefined list) is applied
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   267
whose first premise is solved by the \emph{fact}. Thus the proof above
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   268
is equivalent to the following one:%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   269
\end{isamarkuptext}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   270
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   271
\isacommand{lemma}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   272
\ {\isachardoublequoteopen}A\ {\isasymand}\ B\ {\isasymlongrightarrow}\ B\ {\isasymand}\ A{\isachardoublequoteclose}\isanewline
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   273
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   274
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   275
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   276
\endisadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   277
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   278
\isatagproof
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   279
\isacommand{proof}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   280
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   281
\ \ \isacommand{assume}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   282
\ AB{\isacharcolon}\ {\isachardoublequoteopen}A\ {\isasymand}\ B{\isachardoublequoteclose}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   283
\ \ \isacommand{from}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   284
\ AB\ \isacommand{show}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   285
\ {\isachardoublequoteopen}B\ {\isasymand}\ A{\isachardoublequoteclose}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   286
\ \ \isacommand{proof}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   287
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   288
\ \ \ \ \isacommand{assume}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   289
\ {\isachardoublequoteopen}A{\isachardoublequoteclose}\ {\isachardoublequoteopen}B{\isachardoublequoteclose}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   290
\ \ \ \ \isacommand{show}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   291
\ {\isacharquery}thesis\ \isacommand{{\isachardot}{\isachardot}}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   292
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   293
\ \ \isacommand{qed}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   294
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   295
\isacommand{qed}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   296
%
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   297
\endisatagproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   298
{\isafoldproof}%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   299
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   300
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   301
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   302
\endisadelimproof
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   303
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   304
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   305
Now we come to a second important principle:
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   306
\begin{quote}\em
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   307
Try to arrange the sequence of propositions in a UNIX-like pipe,
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   308
such that the proof of each proposition builds on the previous proposition.
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   309
\end{quote}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   310
The previous proposition can be referred to via the fact \isa{this}.
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   311
This greatly reduces the need for explicit naming of propositions:%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   312
\end{isamarkuptext}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   313
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   314
\isacommand{lemma}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   315
\ {\isachardoublequoteopen}A\ {\isasymand}\ B\ {\isasymlongrightarrow}\ B\ {\isasymand}\ A{\isachardoublequoteclose}\isanewline
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   316
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   317
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   318
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   319
\endisadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   320
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   321
\isatagproof
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   322
\isacommand{proof}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   323
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   324
\ \ \isacommand{assume}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   325
\ {\isachardoublequoteopen}A\ {\isasymand}\ B{\isachardoublequoteclose}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   326
\ \ \isacommand{from}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   327
\ this\ \isacommand{show}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   328
\ {\isachardoublequoteopen}B\ {\isasymand}\ A{\isachardoublequoteclose}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   329
\ \ \isacommand{proof}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   330
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   331
\ \ \ \ \isacommand{assume}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   332
\ {\isachardoublequoteopen}A{\isachardoublequoteclose}\ {\isachardoublequoteopen}B{\isachardoublequoteclose}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   333
\ \ \ \ \isacommand{show}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   334
\ {\isacharquery}thesis\ \isacommand{{\isachardot}{\isachardot}}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   335
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   336
\ \ \isacommand{qed}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   337
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   338
\isacommand{qed}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   339
%
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   340
\endisatagproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   341
{\isafoldproof}%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   342
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   343
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   344
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   345
\endisadelimproof
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   346
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   347
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   348
\noindent Because of the frequency of \isakeyword{from}~\isa{this}, Isar provides two abbreviations:
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   349
\begin{center}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   350
\begin{tabular}{r@ {\quad=\quad}l}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   351
\isakeyword{then} & \isakeyword{from} \isa{this} \\
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   352
\isakeyword{thus} & \isakeyword{then} \isakeyword{show}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   353
\end{tabular}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   354
\end{center}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   355
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   356
Here is an alternative proof that operates purely by forward reasoning:%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   357
\end{isamarkuptext}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   358
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   359
\isacommand{lemma}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   360
\ {\isachardoublequoteopen}A\ {\isasymand}\ B\ {\isasymlongrightarrow}\ B\ {\isasymand}\ A{\isachardoublequoteclose}\isanewline
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   361
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   362
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   363
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   364
\endisadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   365
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   366
\isatagproof
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   367
\isacommand{proof}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   368
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   369
\ \ \isacommand{assume}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   370
\ ab{\isacharcolon}\ {\isachardoublequoteopen}A\ {\isasymand}\ B{\isachardoublequoteclose}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   371
\ \ \isacommand{from}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   372
\ ab\ \isacommand{have}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   373
\ a{\isacharcolon}\ {\isachardoublequoteopen}A{\isachardoublequoteclose}\ \isacommand{{\isachardot}{\isachardot}}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   374
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   375
\ \ \isacommand{from}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   376
\ ab\ \isacommand{have}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   377
\ b{\isacharcolon}\ {\isachardoublequoteopen}B{\isachardoublequoteclose}\ \isacommand{{\isachardot}{\isachardot}}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   378
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   379
\ \ \isacommand{from}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   380
\ b\ a\ \isacommand{show}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   381
\ {\isachardoublequoteopen}B\ {\isasymand}\ A{\isachardoublequoteclose}\ \isacommand{{\isachardot}{\isachardot}}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   382
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   383
\isacommand{qed}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   384
%
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   385
\endisatagproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   386
{\isafoldproof}%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   387
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   388
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   389
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   390
\endisadelimproof
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   391
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   392
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   393
\noindent It is worth examining this text in detail because it
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   394
exhibits a number of new concepts.  For a start, it is the first time
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   395
we have proved intermediate propositions (\isakeyword{have}) on the
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   396
way to the final \isakeyword{show}. This is the norm in nontrivial
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   397
proofs where one cannot bridge the gap between the assumptions and the
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   398
conclusion in one step. To understand how the proof works we need to
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   399
explain more Isar details.
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   400
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   401
Method \isa{rule} can be given a list of rules, in which case
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   402
\isa{{\isacharparenleft}rule}~\textit{rules}\isa{{\isacharparenright}} applies the first matching
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   403
rule in the list \textit{rules}. Command \isakeyword{from} can be
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   404
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
   405
\isa{{\isacharparenleft}rule}~\textit{rules}\isa{{\isacharparenright}} following a \isakeyword{have}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   406
or \isakeyword{show} searches \textit{rules} for a rule whose first
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   407
$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
   408
given order. Finally one needs to know that ``..'' is short for
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   409
\isa{by{\isacharparenleft}rule}~\textit{elim-rules intro-rules}\isa{{\isacharparenright}} (or
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   410
\isa{by{\isacharparenleft}rule}~\textit{intro-rules}\isa{{\isacharparenright}} if there are no facts
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   411
fed into the proof), i.e.\ elimination rules are tried before
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   412
introduction rules.
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   413
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   414
Thus in the above proof both \isakeyword{have}s are proved via
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   415
\isa{conjE} triggered by \isakeyword{from}~\isa{ab} whereas
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   416
in the \isakeyword{show} step no elimination rule is applicable and
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   417
the proof succeeds with \isa{conjI}. The latter would fail had
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   418
we written \isakeyword{from}~\isa{a\ b} instead of
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   419
\isakeyword{from}~\isa{b\ a}.
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   420
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   421
Proofs starting with a plain \isa{proof} behave the same because the
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   422
latter is short for \isa{proof\ {\isacharparenleft}rule}~\textit{elim-rules
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   423
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
   424
the proof).%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   425
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   426
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   427
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   428
\isamarkupsubsection{More constructs%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   429
}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   430
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   431
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   432
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   433
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
   434
more than one fact into a proof step, a frequent situation. Then the
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   435
UNIX-pipe model appears to break down and we need to name the different
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   436
facts to refer to them. But this can be avoided:%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   437
\end{isamarkuptext}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   438
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   439
\isacommand{lemma}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   440
\ {\isachardoublequoteopen}A\ {\isasymand}\ B\ {\isasymlongrightarrow}\ B\ {\isasymand}\ A{\isachardoublequoteclose}\isanewline
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   441
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   442
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   443
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   444
\endisadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   445
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   446
\isatagproof
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   447
\isacommand{proof}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   448
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   449
\ \ \isacommand{assume}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   450
\ ab{\isacharcolon}\ {\isachardoublequoteopen}A\ {\isasymand}\ B{\isachardoublequoteclose}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   451
\ \ \isacommand{from}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   452
\ ab\ \isacommand{have}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   453
\ {\isachardoublequoteopen}B{\isachardoublequoteclose}\ \isacommand{{\isachardot}{\isachardot}}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   454
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   455
\ \ \isacommand{moreover}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   456
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   457
\ \ \isacommand{from}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   458
\ ab\ \isacommand{have}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   459
\ {\isachardoublequoteopen}A{\isachardoublequoteclose}\ \isacommand{{\isachardot}{\isachardot}}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   460
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   461
\ \ \isacommand{ultimately}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   462
\ \isacommand{show}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   463
\ {\isachardoublequoteopen}B\ {\isasymand}\ A{\isachardoublequoteclose}\ \isacommand{{\isachardot}{\isachardot}}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   464
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   465
\isacommand{qed}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   466
%
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   467
\endisatagproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   468
{\isafoldproof}%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   469
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   470
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   471
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   472
\endisadelimproof
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   473
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   474
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   475
\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
   476
\isakeyword{moreover}. After the final fact, \isakeyword{ultimately} stands
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   477
for \isakeyword{from}~\isa{A{\isadigit{1}}}~\dots~\isa{An}.  This avoids having to
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   478
introduce names for all of the sequence elements.%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   479
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   480
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   481
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   482
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   483
Although we have only seen a few introduction and elimination rules so
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   484
far, Isar's predefined rules include all the usual natural deduction
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   485
rules. We conclude our exposition of propositional logic with an extended
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   486
example --- which rules are used implicitly where?%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   487
\end{isamarkuptext}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   488
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   489
\isacommand{lemma}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   490
\ {\isachardoublequoteopen}{\isasymnot}\ {\isacharparenleft}A\ {\isasymand}\ B{\isacharparenright}\ {\isasymlongrightarrow}\ {\isasymnot}\ A\ {\isasymor}\ {\isasymnot}\ B{\isachardoublequoteclose}\isanewline
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   491
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   492
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   493
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   494
\endisadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   495
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   496
\isatagproof
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   497
\isacommand{proof}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   498
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   499
\ \ \isacommand{assume}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   500
\ n{\isacharcolon}\ {\isachardoublequoteopen}{\isasymnot}\ {\isacharparenleft}A\ {\isasymand}\ B{\isacharparenright}{\isachardoublequoteclose}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   501
\ \ \isacommand{show}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   502
\ {\isachardoublequoteopen}{\isasymnot}\ A\ {\isasymor}\ {\isasymnot}\ B{\isachardoublequoteclose}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   503
\ \ \isacommand{proof}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   504
\ {\isacharparenleft}rule\ ccontr{\isacharparenright}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   505
\ \ \ \ \isacommand{assume}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   506
\ nn{\isacharcolon}\ {\isachardoublequoteopen}{\isasymnot}\ {\isacharparenleft}{\isasymnot}\ A\ {\isasymor}\ {\isasymnot}\ B{\isacharparenright}{\isachardoublequoteclose}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   507
\ \ \ \ \isacommand{have}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   508
\ {\isachardoublequoteopen}{\isasymnot}\ A{\isachardoublequoteclose}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   509
\ \ \ \ \isacommand{proof}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   510
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   511
\ \ \ \ \ \ \isacommand{assume}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   512
\ {\isachardoublequoteopen}A{\isachardoublequoteclose}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   513
\ \ \ \ \ \ \isacommand{have}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   514
\ {\isachardoublequoteopen}{\isasymnot}\ B{\isachardoublequoteclose}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   515
\ \ \ \ \ \ \isacommand{proof}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   516
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   517
\ \ \ \ \ \ \ \ \isacommand{assume}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   518
\ {\isachardoublequoteopen}B{\isachardoublequoteclose}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   519
\ \ \ \ \ \ \ \ \isacommand{have}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   520
\ {\isachardoublequoteopen}A\ {\isasymand}\ B{\isachardoublequoteclose}\ \isacommand{{\isachardot}{\isachardot}}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   521
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   522
\ \ \ \ \ \ \ \ \isacommand{with}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   523
\ n\ \isacommand{show}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   524
\ False\ \isacommand{{\isachardot}{\isachardot}}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   525
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   526
\ \ \ \ \ \ \isacommand{qed}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   527
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   528
\ \ \ \ \ \ \isacommand{hence}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   529
\ {\isachardoublequoteopen}{\isasymnot}\ A\ {\isasymor}\ {\isasymnot}\ B{\isachardoublequoteclose}\ \isacommand{{\isachardot}{\isachardot}}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   530
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   531
\ \ \ \ \ \ \isacommand{with}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   532
\ nn\ \isacommand{show}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   533
\ False\ \isacommand{{\isachardot}{\isachardot}}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   534
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   535
\ \ \ \ \isacommand{qed}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   536
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   537
\ \ \ \ \isacommand{hence}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   538
\ {\isachardoublequoteopen}{\isasymnot}\ A\ {\isasymor}\ {\isasymnot}\ B{\isachardoublequoteclose}\ \isacommand{{\isachardot}{\isachardot}}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   539
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   540
\ \ \ \ \isacommand{with}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   541
\ nn\ \isacommand{show}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   542
\ False\ \isacommand{{\isachardot}{\isachardot}}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   543
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   544
\ \ \isacommand{qed}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   545
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   546
\isacommand{qed}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   547
%
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   548
\endisatagproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   549
{\isafoldproof}%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   550
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   551
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   552
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   553
\endisadelimproof
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   554
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   555
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   556
\noindent
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   557
Rule \isa{ccontr} (``classical contradiction'') is
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   558
\isa{{\isacharparenleft}{\isasymnot}\ P\ {\isasymLongrightarrow}\ False{\isacharparenright}\ {\isasymLongrightarrow}\ P}.
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   559
Apart from demonstrating the strangeness of classical
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   560
arguments by contradiction, this example also introduces two new
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   561
abbreviations:
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   562
\begin{center}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   563
\begin{tabular}{l@ {\quad=\quad}l}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   564
\isakeyword{hence} & \isakeyword{then} \isakeyword{have} \\
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   565
\isakeyword{with}~\emph{facts} &
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   566
\isakeyword{from}~\emph{facts} \isa{this}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   567
\end{tabular}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   568
\end{center}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   569
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   570
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   571
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   572
\isamarkupsubsection{Avoiding duplication%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   573
}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   574
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   575
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   576
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   577
So far our examples have been a bit unnatural: normally we want to
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   578
prove rules expressed with \isa{{\isasymLongrightarrow}}, not \isa{{\isasymlongrightarrow}}. Here is an example:%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   579
\end{isamarkuptext}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   580
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   581
\isacommand{lemma}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   582
\ {\isachardoublequoteopen}A\ {\isasymand}\ B\ {\isasymLongrightarrow}\ B\ {\isasymand}\ A{\isachardoublequoteclose}\isanewline
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   583
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   584
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   585
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   586
\endisadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   587
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   588
\isatagproof
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   589
\isacommand{proof}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   590
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   591
\ \ \isacommand{assume}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   592
\ {\isachardoublequoteopen}A\ {\isasymand}\ B{\isachardoublequoteclose}\ \isacommand{thus}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   593
\ {\isachardoublequoteopen}B{\isachardoublequoteclose}\ \isacommand{{\isachardot}{\isachardot}}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   594
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   595
\isacommand{next}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   596
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   597
\ \ \isacommand{assume}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   598
\ {\isachardoublequoteopen}A\ {\isasymand}\ B{\isachardoublequoteclose}\ \isacommand{thus}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   599
\ {\isachardoublequoteopen}A{\isachardoublequoteclose}\ \isacommand{{\isachardot}{\isachardot}}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   600
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   601
\isacommand{qed}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   602
%
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   603
\endisatagproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   604
{\isafoldproof}%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   605
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   606
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   607
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   608
\endisadelimproof
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   609
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   610
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   611
\noindent The \isakeyword{proof} always works on the conclusion,
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   612
\isa{B\ {\isasymand}\ A} in our case, thus selecting $\land$-introduction. Hence
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   613
we must show \isa{B} and \isa{A}; both are proved by
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   614
$\land$-elimination and the proofs are separated by \isakeyword{next}:
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   615
\begin{description}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   616
\item[\isakeyword{next}] deals with multiple subgoals. For example,
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   617
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
   618
individual proofs are separated by \isakeyword{next}.  \footnote{Each
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   619
\isakeyword{show} must prove one of the pending subgoals.  If a
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   620
\isakeyword{show} matches multiple subgoals, e.g.\ if the subgoals
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   621
contain ?-variables, the first one is proved. Thus the order in which
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   622
the subgoals are proved can matter --- see
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   623
\S\ref{sec:CaseDistinction} for an example.}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   624
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   625
Strictly speaking \isakeyword{next} is only required if the subgoals
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   626
are proved in different assumption contexts which need to be
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   627
separated, which is not the case above. For clarity we
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   628
have employed \isakeyword{next} anyway and will continue to do so.
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   629
\end{description}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   630
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   631
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
   632
devices to avoid repeating (possibly large) formulae. A very general method
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   633
is pattern matching:%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   634
\end{isamarkuptext}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   635
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   636
\isacommand{lemma}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   637
\ {\isachardoublequoteopen}large{\isacharunderscore}A\ {\isasymand}\ large{\isacharunderscore}B\ {\isasymLongrightarrow}\ large{\isacharunderscore}B\ {\isasymand}\ large{\isacharunderscore}A{\isachardoublequoteclose}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   638
\ \ \ \ \ \ {\isacharparenleft}\isakeyword{is}\ {\isachardoublequoteopen}{\isacharquery}AB\ {\isasymLongrightarrow}\ {\isacharquery}B\ {\isasymand}\ {\isacharquery}A{\isachardoublequoteclose}{\isacharparenright}\isanewline
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   639
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   640
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   641
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   642
\endisadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   643
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   644
\isatagproof
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   645
\isacommand{proof}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   646
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   647
\ \ \isacommand{assume}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   648
\ {\isachardoublequoteopen}{\isacharquery}AB{\isachardoublequoteclose}\ \isacommand{thus}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   649
\ {\isachardoublequoteopen}{\isacharquery}B{\isachardoublequoteclose}\ \isacommand{{\isachardot}{\isachardot}}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   650
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   651
\isacommand{next}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   652
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   653
\ \ \isacommand{assume}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   654
\ {\isachardoublequoteopen}{\isacharquery}AB{\isachardoublequoteclose}\ \isacommand{thus}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   655
\ {\isachardoublequoteopen}{\isacharquery}A{\isachardoublequoteclose}\ \isacommand{{\isachardot}{\isachardot}}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   656
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   657
\isacommand{qed}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   658
%
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   659
\endisatagproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   660
{\isafoldproof}%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   661
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   662
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   663
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   664
\endisadelimproof
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   665
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   666
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   667
\noindent Any formula may be followed by
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   668
\isa{{\isacharparenleft}}\isakeyword{is}~\emph{pattern}\isa{{\isacharparenright}} which causes the pattern
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   669
to be matched against the formula, instantiating the \isa{{\isacharquery}}-variables in
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   670
the pattern. Subsequent uses of these variables in other terms causes
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   671
them to be replaced by the terms they stand for.
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   672
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   673
We can simplify things even more by stating the theorem by means of the
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   674
\isakeyword{assumes} and \isakeyword{shows} elements which allow direct
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   675
naming of assumptions:%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   676
\end{isamarkuptext}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   677
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   678
\isacommand{lemma}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   679
\ \isakeyword{assumes}\ AB{\isacharcolon}\ {\isachardoublequoteopen}large{\isacharunderscore}A\ {\isasymand}\ large{\isacharunderscore}B{\isachardoublequoteclose}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   680
\ \ \isakeyword{shows}\ {\isachardoublequoteopen}large{\isacharunderscore}B\ {\isasymand}\ large{\isacharunderscore}A{\isachardoublequoteclose}\ {\isacharparenleft}\isakeyword{is}\ {\isachardoublequoteopen}{\isacharquery}B\ {\isasymand}\ {\isacharquery}A{\isachardoublequoteclose}{\isacharparenright}\isanewline
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   681
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   682
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   683
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   684
\endisadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   685
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   686
\isatagproof
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   687
\isacommand{proof}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   688
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   689
\ \ \isacommand{from}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   690
\ AB\ \isacommand{show}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   691
\ {\isachardoublequoteopen}{\isacharquery}B{\isachardoublequoteclose}\ \isacommand{{\isachardot}{\isachardot}}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   692
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   693
\isacommand{next}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   694
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   695
\ \ \isacommand{from}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   696
\ AB\ \isacommand{show}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   697
\ {\isachardoublequoteopen}{\isacharquery}A{\isachardoublequoteclose}\ \isacommand{{\isachardot}{\isachardot}}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   698
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   699
\isacommand{qed}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   700
%
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   701
\endisatagproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   702
{\isafoldproof}%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   703
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   704
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   705
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   706
\endisadelimproof
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   707
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   708
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   709
\noindent Note the difference between \isa{{\isacharquery}AB}, a term, and
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   710
\isa{AB}, a fact.
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   711
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   712
Finally we want to start the proof with $\land$-elimination so we
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   713
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
   714
achieve this:%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   715
\end{isamarkuptext}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   716
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   717
\isacommand{lemma}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   718
\ \isakeyword{assumes}\ AB{\isacharcolon}\ {\isachardoublequoteopen}large{\isacharunderscore}A\ {\isasymand}\ large{\isacharunderscore}B{\isachardoublequoteclose}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   719
\ \ \isakeyword{shows}\ {\isachardoublequoteopen}large{\isacharunderscore}B\ {\isasymand}\ large{\isacharunderscore}A{\isachardoublequoteclose}\ {\isacharparenleft}\isakeyword{is}\ {\isachardoublequoteopen}{\isacharquery}B\ {\isasymand}\ {\isacharquery}A{\isachardoublequoteclose}{\isacharparenright}\isanewline
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   720
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   721
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   722
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   723
\endisadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   724
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   725
\isatagproof
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   726
\isacommand{using}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   727
\ AB\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   728
\isacommand{proof}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   729
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   730
\ \ \isacommand{assume}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   731
\ {\isachardoublequoteopen}{\isacharquery}A{\isachardoublequoteclose}\ {\isachardoublequoteopen}{\isacharquery}B{\isachardoublequoteclose}\ \isacommand{show}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   732
\ {\isacharquery}thesis\ \isacommand{{\isachardot}{\isachardot}}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   733
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   734
\isacommand{qed}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   735
%
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   736
\endisatagproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   737
{\isafoldproof}%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   738
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   739
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   740
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   741
\endisadelimproof
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   742
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   743
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   744
\noindent Command \isakeyword{using} can appear before a proof
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   745
and adds further facts to those piped into the proof. Here \isa{AB}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   746
is the only such fact and it triggers $\land$-elimination. Another
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   747
frequent idiom is as follows:
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   748
\begin{center}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   749
\isakeyword{from} \emph{major-facts}~
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   750
\isakeyword{show} \emph{proposition}~
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   751
\isakeyword{using} \emph{minor-facts}~
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   752
\emph{proof}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   753
\end{center}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   754
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   755
Sometimes it is necessary to suppress the implicit application of rules in a
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   756
\isakeyword{proof}. For example \isakeyword{show}~\isa{A\ {\isasymor}\ B} would
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   757
trigger $\lor$-introduction, requiring us to prove \isa{A}. A simple
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   758
``\isa{{\isacharminus}}'' prevents this \emph{faux pas}:%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   759
\end{isamarkuptext}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   760
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   761
\isacommand{lemma}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   762
\ \isakeyword{assumes}\ AB{\isacharcolon}\ {\isachardoublequoteopen}A\ {\isasymor}\ B{\isachardoublequoteclose}\ \isakeyword{shows}\ {\isachardoublequoteopen}B\ {\isasymor}\ A{\isachardoublequoteclose}\isanewline
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   763
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   764
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   765
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   766
\endisadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   767
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   768
\isatagproof
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   769
\isacommand{proof}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   770
\ {\isacharminus}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   771
\ \ \isacommand{from}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   772
\ AB\ \isacommand{show}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   773
\ {\isacharquery}thesis\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   774
\ \ \isacommand{proof}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   775
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   776
\ \ \ \ \isacommand{assume}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   777
\ A\ \isacommand{show}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   778
\ {\isacharquery}thesis\ \isacommand{{\isachardot}{\isachardot}}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   779
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   780
\ \ \isacommand{next}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   781
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   782
\ \ \ \ \isacommand{assume}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   783
\ B\ \isacommand{show}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   784
\ {\isacharquery}thesis\ \isacommand{{\isachardot}{\isachardot}}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   785
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   786
\ \ \isacommand{qed}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   787
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   788
\isacommand{qed}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   789
%
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   790
\endisatagproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   791
{\isafoldproof}%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   792
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   793
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   794
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   795
\endisadelimproof
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   796
%
19840
600c35fd1b5e added quoting via back quotes
nipkow
parents: 17187
diff changeset
   797
\begin{isamarkuptext}%
600c35fd1b5e added quoting via back quotes
nipkow
parents: 17187
diff changeset
   798
Too many names can easily clutter a proof.  We already learned
600c35fd1b5e added quoting via back quotes
nipkow
parents: 17187
diff changeset
   799
about \isa{this} as a means of avoiding explicit names. Another
600c35fd1b5e added quoting via back quotes
nipkow
parents: 17187
diff changeset
   800
handy device is to refer to a fact not by name but by contents: for
600c35fd1b5e added quoting via back quotes
nipkow
parents: 17187
diff changeset
   801
example, writing \isa{{\isacharbackquote}A\ {\isasymor}\ B{\isacharbackquote}} (enclosing the formula in back quotes)
600c35fd1b5e added quoting via back quotes
nipkow
parents: 17187
diff changeset
   802
refers to the fact \isa{A\ {\isasymor}\ B}
600c35fd1b5e added quoting via back quotes
nipkow
parents: 17187
diff changeset
   803
without the need to name it. Here is a simple example, a revised version
600c35fd1b5e added quoting via back quotes
nipkow
parents: 17187
diff changeset
   804
of the previous proof%
600c35fd1b5e added quoting via back quotes
nipkow
parents: 17187
diff changeset
   805
\end{isamarkuptext}%
600c35fd1b5e added quoting via back quotes
nipkow
parents: 17187
diff changeset
   806
\isamarkuptrue%
600c35fd1b5e added quoting via back quotes
nipkow
parents: 17187
diff changeset
   807
\isacommand{lemma}\isamarkupfalse%
600c35fd1b5e added quoting via back quotes
nipkow
parents: 17187
diff changeset
   808
\ \isakeyword{assumes}\ {\isachardoublequoteopen}A\ {\isasymor}\ B{\isachardoublequoteclose}\ \isakeyword{shows}\ {\isachardoublequoteopen}B\ {\isasymor}\ A{\isachardoublequoteclose}\isanewline
600c35fd1b5e added quoting via back quotes
nipkow
parents: 17187
diff changeset
   809
%
600c35fd1b5e added quoting via back quotes
nipkow
parents: 17187
diff changeset
   810
\isadelimproof
600c35fd1b5e added quoting via back quotes
nipkow
parents: 17187
diff changeset
   811
%
600c35fd1b5e added quoting via back quotes
nipkow
parents: 17187
diff changeset
   812
\endisadelimproof
600c35fd1b5e added quoting via back quotes
nipkow
parents: 17187
diff changeset
   813
%
600c35fd1b5e added quoting via back quotes
nipkow
parents: 17187
diff changeset
   814
\isatagproof
600c35fd1b5e added quoting via back quotes
nipkow
parents: 17187
diff changeset
   815
\isacommand{proof}\isamarkupfalse%
600c35fd1b5e added quoting via back quotes
nipkow
parents: 17187
diff changeset
   816
\ {\isacharminus}\isanewline
600c35fd1b5e added quoting via back quotes
nipkow
parents: 17187
diff changeset
   817
\ \ \isacommand{from}\isamarkupfalse%
600c35fd1b5e added quoting via back quotes
nipkow
parents: 17187
diff changeset
   818
\ {\isacharbackquoteopen}A\ {\isasymor}\ B{\isacharbackquoteclose}\ \isacommand{show}\isamarkupfalse%
600c35fd1b5e added quoting via back quotes
nipkow
parents: 17187
diff changeset
   819
\ {\isacharquery}thesis%
600c35fd1b5e added quoting via back quotes
nipkow
parents: 17187
diff changeset
   820
\endisatagproof
600c35fd1b5e added quoting via back quotes
nipkow
parents: 17187
diff changeset
   821
{\isafoldproof}%
600c35fd1b5e added quoting via back quotes
nipkow
parents: 17187
diff changeset
   822
%
600c35fd1b5e added quoting via back quotes
nipkow
parents: 17187
diff changeset
   823
\isadelimproof
600c35fd1b5e added quoting via back quotes
nipkow
parents: 17187
diff changeset
   824
%
600c35fd1b5e added quoting via back quotes
nipkow
parents: 17187
diff changeset
   825
\endisadelimproof
600c35fd1b5e added quoting via back quotes
nipkow
parents: 17187
diff changeset
   826
%
600c35fd1b5e added quoting via back quotes
nipkow
parents: 17187
diff changeset
   827
\begin{isamarkuptext}%
600c35fd1b5e added quoting via back quotes
nipkow
parents: 17187
diff changeset
   828
\noindent which continues as before.
600c35fd1b5e added quoting via back quotes
nipkow
parents: 17187
diff changeset
   829
600c35fd1b5e added quoting via back quotes
nipkow
parents: 17187
diff changeset
   830
Clearly, this device of quoting facts by contents is only advisable
600c35fd1b5e added quoting via back quotes
nipkow
parents: 17187
diff changeset
   831
for small formulae. In such cases it is superior to naming because the
600c35fd1b5e added quoting via back quotes
nipkow
parents: 17187
diff changeset
   832
reader immediately sees what the fact is without needing to search for
600c35fd1b5e added quoting via back quotes
nipkow
parents: 17187
diff changeset
   833
it in the preceding proof text.%
600c35fd1b5e added quoting via back quotes
nipkow
parents: 17187
diff changeset
   834
\end{isamarkuptext}%
600c35fd1b5e added quoting via back quotes
nipkow
parents: 17187
diff changeset
   835
\isamarkuptrue%
600c35fd1b5e added quoting via back quotes
nipkow
parents: 17187
diff changeset
   836
%
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   837
\isamarkupsubsection{Predicate calculus%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   838
}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   839
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   840
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   841
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   842
Command \isakeyword{fix} introduces new local variables into a
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   843
proof. The pair \isakeyword{fix}-\isakeyword{show} corresponds to \isa{{\isasymAnd}}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   844
(the universal quantifier at the
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   845
meta-level) just like \isakeyword{assume}-\isakeyword{show} corresponds to
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   846
\isa{{\isasymLongrightarrow}}. Here is a sample proof, annotated with the rules that are
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   847
applied implicitly:%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   848
\end{isamarkuptext}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   849
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   850
\isacommand{lemma}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   851
\ \isakeyword{assumes}\ P{\isacharcolon}\ {\isachardoublequoteopen}{\isasymforall}x{\isachardot}\ P\ x{\isachardoublequoteclose}\ \isakeyword{shows}\ {\isachardoublequoteopen}{\isasymforall}x{\isachardot}\ P{\isacharparenleft}f\ x{\isacharparenright}{\isachardoublequoteclose}\isanewline
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   852
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   853
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   854
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   855
\endisadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   856
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   857
\isatagproof
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   858
\isacommand{proof}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   859
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ %
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   860
\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
   861
}
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   862
\isanewline
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   863
\ \ \isacommand{fix}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   864
\ a\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   865
\ \ \isacommand{from}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   866
\ P\ \isacommand{show}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   867
\ {\isachardoublequoteopen}P{\isacharparenleft}f\ a{\isacharparenright}{\isachardoublequoteclose}\ \isacommand{{\isachardot}{\isachardot}}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   868
\ \ %
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   869
\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
   870
}
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   871
\isanewline
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   872
\isacommand{qed}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   873
%
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   874
\endisatagproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   875
{\isafoldproof}%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   876
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   877
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   878
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   879
\endisadelimproof
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   880
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   881
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   882
\noindent Note that in the proof we have chosen to call the bound
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   883
variable \isa{a} instead of \isa{x} merely to show that the choice of
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   884
local names is irrelevant.
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   885
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   886
Next we look at \isa{{\isasymexists}} which is a bit more tricky.%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   887
\end{isamarkuptext}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   888
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   889
\isacommand{lemma}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   890
\ \isakeyword{assumes}\ Pf{\isacharcolon}\ {\isachardoublequoteopen}{\isasymexists}x{\isachardot}\ P{\isacharparenleft}f\ x{\isacharparenright}{\isachardoublequoteclose}\ \isakeyword{shows}\ {\isachardoublequoteopen}{\isasymexists}y{\isachardot}\ P\ y{\isachardoublequoteclose}\isanewline
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   891
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   892
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   893
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   894
\endisadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   895
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   896
\isatagproof
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   897
\isacommand{proof}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   898
\ {\isacharminus}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   899
\ \ \isacommand{from}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   900
\ Pf\ \isacommand{show}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   901
\ {\isacharquery}thesis\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   902
\ \ \isacommand{proof}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   903
\ \ \ \ \ \ \ \ \ \ \ \ \ \ %
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   904
\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
   905
}
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   906
\isanewline
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   907
\ \ \ \ \isacommand{fix}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   908
\ x\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   909
\ \ \ \ \isacommand{assume}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   910
\ {\isachardoublequoteopen}P{\isacharparenleft}f\ x{\isacharparenright}{\isachardoublequoteclose}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   911
\ \ \ \ \isacommand{show}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   912
\ {\isacharquery}thesis\ \isacommand{{\isachardot}{\isachardot}}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   913
\ \ %
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   914
\isamarkupcmt{\isa{exI}: \isa{{\isacharquery}P\ {\isacharquery}x\ {\isasymLongrightarrow}\ {\isasymexists}x{\isachardot}\ {\isacharquery}P\ x}%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   915
}
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
   916
\isanewline
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   917
\ \ \isacommand{qed}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   918
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   919
\isacommand{qed}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   920
%
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   921
\endisatagproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   922
{\isafoldproof}%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   923
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   924
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   925
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   926
\endisadelimproof
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   927
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   928
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   929
\noindent Explicit $\exists$-elimination as seen above can become
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   930
cumbersome in practice.  The derived Isar language element
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   931
\isakeyword{obtain} provides a more appealing form of generalised
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   932
existence reasoning:%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   933
\end{isamarkuptext}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   934
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   935
\isacommand{lemma}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   936
\ \isakeyword{assumes}\ Pf{\isacharcolon}\ {\isachardoublequoteopen}{\isasymexists}x{\isachardot}\ P{\isacharparenleft}f\ x{\isacharparenright}{\isachardoublequoteclose}\ \isakeyword{shows}\ {\isachardoublequoteopen}{\isasymexists}y{\isachardot}\ P\ y{\isachardoublequoteclose}\isanewline
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   937
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   938
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   939
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   940
\endisadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   941
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   942
\isatagproof
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   943
\isacommand{proof}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   944
\ {\isacharminus}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   945
\ \ \isacommand{from}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   946
\ Pf\ \isacommand{obtain}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   947
\ x\ \isakeyword{where}\ {\isachardoublequoteopen}P{\isacharparenleft}f\ x{\isacharparenright}{\isachardoublequoteclose}\ \isacommand{{\isachardot}{\isachardot}}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   948
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   949
\ \ \isacommand{thus}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   950
\ {\isachardoublequoteopen}{\isasymexists}y{\isachardot}\ P\ y{\isachardoublequoteclose}\ \isacommand{{\isachardot}{\isachardot}}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   951
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   952
\isacommand{qed}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   953
%
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   954
\endisatagproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   955
{\isafoldproof}%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   956
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   957
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   958
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   959
\endisadelimproof
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   960
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   961
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   962
\noindent Note how the proof text follows the usual mathematical style
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   963
of concluding $P(x)$ from $\exists x. P(x)$, while carefully introducing $x$
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   964
as a new local variable.  Technically, \isakeyword{obtain} is similar to
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   965
\isakeyword{fix} and \isakeyword{assume} together with a soundness proof of
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   966
the elimination involved.
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   967
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   968
Here is a proof of a well known tautology.
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   969
Which rule is used where?%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
   970
\end{isamarkuptext}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   971
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   972
\isacommand{lemma}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   973
\ \isakeyword{assumes}\ ex{\isacharcolon}\ {\isachardoublequoteopen}{\isasymexists}x{\isachardot}\ {\isasymforall}y{\isachardot}\ P\ x\ y{\isachardoublequoteclose}\ \isakeyword{shows}\ {\isachardoublequoteopen}{\isasymforall}y{\isachardot}\ {\isasymexists}x{\isachardot}\ P\ x\ y{\isachardoublequoteclose}\isanewline
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   974
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   975
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   976
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   977
\endisadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   978
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   979
\isatagproof
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   980
\isacommand{proof}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   981
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   982
\ \ \isacommand{fix}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   983
\ y\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   984
\ \ \isacommand{from}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   985
\ ex\ \isacommand{obtain}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   986
\ x\ \isakeyword{where}\ {\isachardoublequoteopen}{\isasymforall}y{\isachardot}\ P\ x\ y{\isachardoublequoteclose}\ \isacommand{{\isachardot}{\isachardot}}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   987
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   988
\ \ \isacommand{hence}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   989
\ {\isachardoublequoteopen}P\ x\ y{\isachardoublequoteclose}\ \isacommand{{\isachardot}{\isachardot}}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   990
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   991
\ \ \isacommand{thus}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   992
\ {\isachardoublequoteopen}{\isasymexists}x{\isachardot}\ P\ x\ y{\isachardoublequoteclose}\ \isacommand{{\isachardot}{\isachardot}}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   993
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   994
\isacommand{qed}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
   995
%
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   996
\endisatagproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   997
{\isafoldproof}%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   998
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
   999
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1000
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1001
\endisadelimproof
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1002
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1003
\isamarkupsubsection{Making bigger steps%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1004
}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1005
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1006
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1007
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1008
So far we have confined ourselves to single step proofs. Of course
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1009
powerful automatic methods can be used just as well. Here is an example,
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1010
Cantor's theorem that there is no surjective function from a set to its
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1011
powerset:%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1012
\end{isamarkuptext}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1013
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1014
\isacommand{theorem}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1015
\ {\isachardoublequoteopen}{\isasymexists}S{\isachardot}\ S\ {\isasymnotin}\ range\ {\isacharparenleft}f\ {\isacharcolon}{\isacharcolon}\ {\isacharprime}a\ {\isasymRightarrow}\ {\isacharprime}a\ set{\isacharparenright}{\isachardoublequoteclose}\isanewline
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1016
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1017
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1018
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1019
\endisadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1020
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1021
\isatagproof
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1022
\isacommand{proof}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1023
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1024
\ \ \isacommand{let}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1025
\ {\isacharquery}S\ {\isacharequal}\ {\isachardoublequoteopen}{\isacharbraceleft}x{\isachardot}\ x\ {\isasymnotin}\ f\ x{\isacharbraceright}{\isachardoublequoteclose}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1026
\ \ \isacommand{show}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1027
\ {\isachardoublequoteopen}{\isacharquery}S\ {\isasymnotin}\ range\ f{\isachardoublequoteclose}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1028
\ \ \isacommand{proof}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1029
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1030
\ \ \ \ \isacommand{assume}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1031
\ {\isachardoublequoteopen}{\isacharquery}S\ {\isasymin}\ range\ f{\isachardoublequoteclose}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1032
\ \ \ \ \isacommand{then}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1033
\ \isacommand{obtain}\isamarkupfalse%
19840
600c35fd1b5e added quoting via back quotes
nipkow
parents: 17187
diff changeset
  1034
\ y\ \isakeyword{where}\ {\isachardoublequoteopen}{\isacharquery}S\ {\isacharequal}\ f\ y{\isachardoublequoteclose}\ \isacommand{{\isachardot}{\isachardot}}\isamarkupfalse%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1035
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1036
\ \ \ \ \isacommand{show}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1037
\ False\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1038
\ \ \ \ \isacommand{proof}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1039
\ cases\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1040
\ \ \ \ \ \ \isacommand{assume}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1041
\ {\isachardoublequoteopen}y\ {\isasymin}\ {\isacharquery}S{\isachardoublequoteclose}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1042
\ \ \ \ \ \ \isacommand{with}\isamarkupfalse%
19840
600c35fd1b5e added quoting via back quotes
nipkow
parents: 17187
diff changeset
  1043
\ {\isacharbackquoteopen}{\isacharquery}S\ {\isacharequal}\ f\ y{\isacharbackquoteclose}\ \isacommand{show}\isamarkupfalse%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1044
\ False\ \isacommand{by}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1045
\ blast\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1046
\ \ \ \ \isacommand{next}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1047
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1048
\ \ \ \ \ \ \isacommand{assume}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1049
\ {\isachardoublequoteopen}y\ {\isasymnotin}\ {\isacharquery}S{\isachardoublequoteclose}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1050
\ \ \ \ \ \ \isacommand{with}\isamarkupfalse%
19840
600c35fd1b5e added quoting via back quotes
nipkow
parents: 17187
diff changeset
  1051
\ {\isacharbackquoteopen}{\isacharquery}S\ {\isacharequal}\ f\ y{\isacharbackquoteclose}\ \isacommand{show}\isamarkupfalse%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1052
\ False\ \isacommand{by}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1053
\ blast\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1054
\ \ \ \ \isacommand{qed}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1055
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1056
\ \ \isacommand{qed}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1057
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1058
\isacommand{qed}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1059
%
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1060
\endisatagproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1061
{\isafoldproof}%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1062
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1063
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1064
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1065
\endisadelimproof
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1066
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1067
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1068
\noindent
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1069
For a start, the example demonstrates two new constructs:
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1070
\begin{itemize}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1071
\item \isakeyword{let} introduces an abbreviation for a term, in our case
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1072
the witness for the claim.
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1073
\item Proof by \isa{cases} starts a proof by cases. Note that it remains
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1074
implicit what the two cases are: it is merely expected that the two subproofs
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1075
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
  1076
for some \isa{P}.
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1077
\end{itemize}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1078
If you wonder how to \isakeyword{obtain} \isa{y}:
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1079
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
  1080
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1081
Method \isa{blast} is used because the contradiction does not follow easily
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1082
by just a single rule. If you find the proof too cryptic for human
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1083
consumption, here is a more detailed version; the beginning up to
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1084
\isakeyword{obtain} stays unchanged.%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1085
\end{isamarkuptext}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1086
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1087
\isacommand{theorem}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1088
\ {\isachardoublequoteopen}{\isasymexists}S{\isachardot}\ S\ {\isasymnotin}\ range\ {\isacharparenleft}f\ {\isacharcolon}{\isacharcolon}\ {\isacharprime}a\ {\isasymRightarrow}\ {\isacharprime}a\ set{\isacharparenright}{\isachardoublequoteclose}\isanewline
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1089
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1090
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1091
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1092
\endisadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1093
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1094
\isatagproof
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1095
\isacommand{proof}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1096
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1097
\ \ \isacommand{let}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1098
\ {\isacharquery}S\ {\isacharequal}\ {\isachardoublequoteopen}{\isacharbraceleft}x{\isachardot}\ x\ {\isasymnotin}\ f\ x{\isacharbraceright}{\isachardoublequoteclose}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1099
\ \ \isacommand{show}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1100
\ {\isachardoublequoteopen}{\isacharquery}S\ {\isasymnotin}\ range\ f{\isachardoublequoteclose}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1101
\ \ \isacommand{proof}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1102
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1103
\ \ \ \ \isacommand{assume}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1104
\ {\isachardoublequoteopen}{\isacharquery}S\ {\isasymin}\ range\ f{\isachardoublequoteclose}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1105
\ \ \ \ \isacommand{then}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1106
\ \isacommand{obtain}\isamarkupfalse%
19840
600c35fd1b5e added quoting via back quotes
nipkow
parents: 17187
diff changeset
  1107
\ y\ \isakeyword{where}\ {\isachardoublequoteopen}{\isacharquery}S\ {\isacharequal}\ f\ y{\isachardoublequoteclose}\ \isacommand{{\isachardot}{\isachardot}}\isamarkupfalse%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1108
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1109
\ \ \ \ \isacommand{show}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1110
\ False\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1111
\ \ \ \ \isacommand{proof}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1112
\ cases\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1113
\ \ \ \ \ \ \isacommand{assume}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1114
\ {\isachardoublequoteopen}y\ {\isasymin}\ {\isacharquery}S{\isachardoublequoteclose}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1115
\ \ \ \ \ \ \isacommand{hence}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1116
\ {\isachardoublequoteopen}y\ {\isasymnotin}\ f\ y{\isachardoublequoteclose}\ \ \ \isacommand{by}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1117
\ simp\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1118
\ \ \ \ \ \ \isacommand{hence}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1119
\ {\isachardoublequoteopen}y\ {\isasymnotin}\ {\isacharquery}S{\isachardoublequoteclose}\ \ \ \ \isacommand{by}\isamarkupfalse%
19840
600c35fd1b5e added quoting via back quotes
nipkow
parents: 17187
diff changeset
  1120
{\isacharparenleft}simp\ add{\isacharcolon}\ {\isacharbackquoteopen}{\isacharquery}S\ {\isacharequal}\ f\ y{\isacharbackquoteclose}{\isacharparenright}\isanewline
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1121
\ \ \ \ \ \ \isacommand{thus}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1122
\ False\ \ \ \ \ \ \ \ \ \isacommand{by}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1123
\ contradiction\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1124
\ \ \ \ \isacommand{next}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1125
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1126
\ \ \ \ \ \ \isacommand{assume}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1127
\ {\isachardoublequoteopen}y\ {\isasymnotin}\ {\isacharquery}S{\isachardoublequoteclose}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1128
\ \ \ \ \ \ \isacommand{hence}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1129
\ {\isachardoublequoteopen}y\ {\isasymin}\ f\ y{\isachardoublequoteclose}\ \ \ \isacommand{by}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1130
\ simp\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1131
\ \ \ \ \ \ \isacommand{hence}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1132
\ {\isachardoublequoteopen}y\ {\isasymin}\ {\isacharquery}S{\isachardoublequoteclose}\ \ \ \ \isacommand{by}\isamarkupfalse%
19840
600c35fd1b5e added quoting via back quotes
nipkow
parents: 17187
diff changeset
  1133
{\isacharparenleft}simp\ add{\isacharcolon}\ {\isacharbackquoteopen}{\isacharquery}S\ {\isacharequal}\ f\ y{\isacharbackquoteclose}{\isacharparenright}\isanewline
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1134
\ \ \ \ \ \ \isacommand{thus}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1135
\ False\ \ \ \ \ \ \ \ \ \isacommand{by}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1136
\ contradiction\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1137
\ \ \ \ \isacommand{qed}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1138
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1139
\ \ \isacommand{qed}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1140
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1141
\isacommand{qed}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1142
%
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1143
\endisatagproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1144
{\isafoldproof}%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1145
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1146
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1147
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1148
\endisadelimproof
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1149
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1150
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1151
\noindent Method \isa{contradiction} succeeds if both $P$ and
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1152
$\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
  1153
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1154
As it happens, Cantor's theorem can be proved automatically by best-first
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1155
search. Depth-first search would diverge, but best-first search successfully
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1156
navigates through the large search space:%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1157
\end{isamarkuptext}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1158
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1159
\isacommand{theorem}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1160
\ {\isachardoublequoteopen}{\isasymexists}S{\isachardot}\ S\ {\isasymnotin}\ range\ {\isacharparenleft}f\ {\isacharcolon}{\isacharcolon}\ {\isacharprime}a\ {\isasymRightarrow}\ {\isacharprime}a\ set{\isacharparenright}{\isachardoublequoteclose}\isanewline
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1161
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1162
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1163
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1164
\endisadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1165
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1166
\isatagproof
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1167
\isacommand{by}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1168
\ best%
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1169
\endisatagproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1170
{\isafoldproof}%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1171
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1172
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1173
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1174
\endisadelimproof
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1175
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1176
\isamarkupsubsection{Raw proof blocks%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1177
}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1178
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1179
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1180
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1181
Although we have shown how to employ powerful automatic methods like
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1182
\isa{blast} to achieve bigger proof steps, there may still be the
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1183
tendency to use the default introduction and elimination rules to
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1184
decompose goals and facts. This can lead to very tedious proofs:%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1185
\end{isamarkuptext}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1186
\isamarkuptrue%
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1187
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1188
\isadelimML
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1189
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1190
\endisadelimML
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1191
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1192
\isatagML
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1193
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1194
\endisatagML
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1195
{\isafoldML}%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1196
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1197
\isadelimML
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1198
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1199
\endisadelimML
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1200
\isacommand{lemma}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1201
\ {\isachardoublequoteopen}{\isasymforall}x\ y{\isachardot}\ A\ x\ y\ {\isasymand}\ B\ x\ y\ {\isasymlongrightarrow}\ C\ x\ y{\isachardoublequoteclose}\isanewline
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1202
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1203
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1204
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1205
\endisadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1206
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1207
\isatagproof
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1208
\isacommand{proof}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1209
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1210
\ \ \isacommand{fix}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1211
\ x\ \isacommand{show}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1212
\ {\isachardoublequoteopen}{\isasymforall}y{\isachardot}\ A\ x\ y\ {\isasymand}\ B\ x\ y\ {\isasymlongrightarrow}\ C\ x\ y{\isachardoublequoteclose}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1213
\ \ \isacommand{proof}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1214
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1215
\ \ \ \ \isacommand{fix}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1216
\ y\ \isacommand{show}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1217
\ {\isachardoublequoteopen}A\ x\ y\ {\isasymand}\ B\ x\ y\ {\isasymlongrightarrow}\ C\ x\ y{\isachardoublequoteclose}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1218
\ \ \ \ \isacommand{proof}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1219
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1220
\ \ \ \ \ \ \isacommand{assume}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1221
\ {\isachardoublequoteopen}A\ x\ y\ {\isasymand}\ B\ x\ y{\isachardoublequoteclose}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1222
\ \ \ \ \ \ \isacommand{show}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1223
\ {\isachardoublequoteopen}C\ x\ y{\isachardoublequoteclose}\ \isacommand{sorry}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1224
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1225
\ \ \ \ \isacommand{qed}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1226
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1227
\ \ \isacommand{qed}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1228
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1229
\isacommand{qed}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1230
%
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1231
\endisatagproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1232
{\isafoldproof}%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1233
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1234
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1235
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1236
\endisadelimproof
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1237
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1238
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1239
\noindent Since we are only interested in the decomposition and not the
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1240
actual proof, the latter has been replaced by
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1241
\isakeyword{sorry}. Command \isakeyword{sorry} proves anything but is
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1242
only allowed in quick and dirty mode, the default interactive mode. It
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1243
is very convenient for top down proof development.
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1244
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1245
Luckily we can avoid this step by step decomposition very easily:%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1246
\end{isamarkuptext}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1247
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1248
\isacommand{lemma}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1249
\ {\isachardoublequoteopen}{\isasymforall}x\ y{\isachardot}\ A\ x\ y\ {\isasymand}\ B\ x\ y\ {\isasymlongrightarrow}\ C\ x\ y{\isachardoublequoteclose}\isanewline
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1250
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1251
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1252
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1253
\endisadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1254
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1255
\isatagproof
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1256
\isacommand{proof}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1257
\ {\isacharminus}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1258
\ \ \isacommand{have}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1259
\ {\isachardoublequoteopen}{\isasymAnd}x\ y{\isachardot}\ {\isasymlbrakk}\ A\ x\ y{\isacharsemicolon}\ B\ x\ y\ {\isasymrbrakk}\ {\isasymLongrightarrow}\ C\ x\ y{\isachardoublequoteclose}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1260
\ \ \isacommand{proof}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1261
\ {\isacharminus}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1262
\ \ \ \ \isacommand{fix}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1263
\ x\ y\ \isacommand{assume}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1264
\ {\isachardoublequoteopen}A\ x\ y{\isachardoublequoteclose}\ {\isachardoublequoteopen}B\ x\ y{\isachardoublequoteclose}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1265
\ \ \ \ \isacommand{show}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1266
\ {\isachardoublequoteopen}C\ x\ y{\isachardoublequoteclose}\ \isacommand{sorry}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1267
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1268
\ \ \isacommand{qed}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1269
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1270
\ \ \isacommand{thus}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1271
\ {\isacharquery}thesis\ \isacommand{by}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1272
\ blast\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1273
\isacommand{qed}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1274
%
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1275
\endisatagproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1276
{\isafoldproof}%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1277
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1278
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1279
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1280
\endisadelimproof
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1281
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1282
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1283
\noindent
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1284
This can be simplified further by \emph{raw proof blocks}, i.e.\
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1285
proofs enclosed in braces:%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1286
\end{isamarkuptext}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1287
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1288
\isacommand{lemma}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1289
\ {\isachardoublequoteopen}{\isasymforall}x\ y{\isachardot}\ A\ x\ y\ {\isasymand}\ B\ x\ y\ {\isasymlongrightarrow}\ C\ x\ y{\isachardoublequoteclose}\isanewline
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1290
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1291
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1292
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1293
\endisadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1294
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1295
\isatagproof
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1296
\isacommand{proof}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1297
\ {\isacharminus}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1298
\ \ \isacommand{{\isacharbraceleft}}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1299
\ \isacommand{fix}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1300
\ x\ y\ \isacommand{assume}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1301
\ {\isachardoublequoteopen}A\ x\ y{\isachardoublequoteclose}\ {\isachardoublequoteopen}B\ x\ y{\isachardoublequoteclose}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1302
\ \ \ \ \isacommand{have}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1303
\ {\isachardoublequoteopen}C\ x\ y{\isachardoublequoteclose}\ \isacommand{sorry}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1304
\ \isacommand{{\isacharbraceright}}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1305
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1306
\ \ \isacommand{thus}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1307
\ {\isacharquery}thesis\ \isacommand{by}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1308
\ blast\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1309
\isacommand{qed}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1310
%
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1311
\endisatagproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1312
{\isafoldproof}%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1313
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1314
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1315
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1316
\endisadelimproof
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1317
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1318
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1319
\noindent The result of the raw proof block is the same theorem
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1320
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
  1321
proof blocks are like ordinary proofs except that they do not prove
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1322
some explicitly stated property but that the property emerges directly
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1323
out of the \isakeyword{fixe}s, \isakeyword{assume}s and
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1324
\isakeyword{have} in the block. Thus they again serve to avoid
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1325
duplication. Note that the conclusion of a raw proof block is stated with
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1326
\isakeyword{have} rather than \isakeyword{show} because it is not the
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1327
conclusion of some pending goal but some independent claim.
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1328
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1329
The general idea demonstrated in this subsection is very
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1330
important in Isar and distinguishes it from tactic-style proofs:
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1331
\begin{quote}\em
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1332
Do not manipulate the proof state into a particular form by applying
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1333
tactics but state the desired form explicitly and let the tactic verify
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1334
that from this form the original goal follows.
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1335
\end{quote}
14617
a2bcb11ce445 Added case distinction proof pattern.
nipkow
parents: 13999
diff changeset
  1336
This yields more readable and also more robust proofs.
a2bcb11ce445 Added case distinction proof pattern.
nipkow
parents: 13999
diff changeset
  1337
a2bcb11ce445 Added case distinction proof pattern.
nipkow
parents: 13999
diff changeset
  1338
\subsubsection{General case distinctions}
a2bcb11ce445 Added case distinction proof pattern.
nipkow
parents: 13999
diff changeset
  1339
a2bcb11ce445 Added case distinction proof pattern.
nipkow
parents: 13999
diff changeset
  1340
As an important application of raw proof blocks we show how to deal
a2bcb11ce445 Added case distinction proof pattern.
nipkow
parents: 13999
diff changeset
  1341
with general case distinctions --- more specific kinds are treated in
a2bcb11ce445 Added case distinction proof pattern.
nipkow
parents: 13999
diff changeset
  1342
\S\ref{sec:CaseDistinction}. Imagine that you would like to prove some
a2bcb11ce445 Added case distinction proof pattern.
nipkow
parents: 13999
diff changeset
  1343
goal by distinguishing $n$ cases $P_1$, \dots, $P_n$. You show that
a2bcb11ce445 Added case distinction proof pattern.
nipkow
parents: 13999
diff changeset
  1344
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
  1345
that each case $P_i$ implies the goal. Taken together, this proves the
a2bcb11ce445 Added case distinction proof pattern.
nipkow
parents: 13999
diff changeset
  1346
goal. The corresponding Isar proof pattern (for $n = 3$) is very handy:%
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1347
\end{isamarkuptext}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1348
\isamarkuptrue%
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1349
%
14617
a2bcb11ce445 Added case distinction proof pattern.
nipkow
parents: 13999
diff changeset
  1350
\renewcommand{\isamarkupcmt}[1]{#1}
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1351
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1352
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1353
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1354
\endisadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1355
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1356
\isatagproof
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1357
\isacommand{proof}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1358
\ {\isacharminus}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1359
\ \ \isacommand{have}\isamarkupfalse%
17181
5f42dd5e6570 updated;
wenzelm
parents: 17175
diff changeset
  1360
\ {\isachardoublequoteopen}P\isactrlisub {\isadigit{1}}\ {\isasymor}\ P\isactrlisub {\isadigit{2}}\ {\isasymor}\ P\isactrlisub {\isadigit{3}}{\isachardoublequoteclose}\ \ %
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1361
\isamarkupcmt{\dots%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1362
}
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1363
\isanewline
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1364
\ \ \isacommand{moreover}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1365
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1366
\ \ \isacommand{{\isacharbraceleft}}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1367
\ \isacommand{assume}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1368
\ P\isactrlisub {\isadigit{1}}\isanewline
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1369
\ \ \ \ %
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1370
\isamarkupcmt{\dots%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1371
}
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1372
\isanewline
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1373
\ \ \ \ \isacommand{have}\isamarkupfalse%
17181
5f42dd5e6570 updated;
wenzelm
parents: 17175
diff changeset
  1374
\ {\isacharquery}thesis\ \ %
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1375
\isamarkupcmt{\dots%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1376
}
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1377
\ \isacommand{{\isacharbraceright}}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1378
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1379
\ \ \isacommand{moreover}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1380
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1381
\ \ \isacommand{{\isacharbraceleft}}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1382
\ \isacommand{assume}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1383
\ P\isactrlisub {\isadigit{2}}\isanewline
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1384
\ \ \ \ %
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1385
\isamarkupcmt{\dots%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1386
}
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1387
\isanewline
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1388
\ \ \ \ \isacommand{have}\isamarkupfalse%
17181
5f42dd5e6570 updated;
wenzelm
parents: 17175
diff changeset
  1389
\ {\isacharquery}thesis\ \ %
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1390
\isamarkupcmt{\dots%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1391
}
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1392
\ \isacommand{{\isacharbraceright}}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1393
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1394
\ \ \isacommand{moreover}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1395
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1396
\ \ \isacommand{{\isacharbraceleft}}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1397
\ \isacommand{assume}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1398
\ P\isactrlisub {\isadigit{3}}\isanewline
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1399
\ \ \ \ %
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1400
\isamarkupcmt{\dots%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1401
}
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1402
\isanewline
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1403
\ \ \ \ \isacommand{have}\isamarkupfalse%
17181
5f42dd5e6570 updated;
wenzelm
parents: 17175
diff changeset
  1404
\ {\isacharquery}thesis\ \ %
16459
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1405
\isamarkupcmt{\dots%
7efee005e568 updated;
wenzelm
parents: 15909
diff changeset
  1406
}
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1407
\ \isacommand{{\isacharbraceright}}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1408
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1409
\ \ \isacommand{ultimately}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1410
\ \isacommand{show}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1411
\ {\isacharquery}thesis\ \isacommand{by}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1412
\ blast\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1413
\isacommand{qed}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1414
%
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1415
\endisatagproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1416
{\isafoldproof}%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1417
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1418
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1419
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1420
\endisadelimproof
14617
a2bcb11ce445 Added case distinction proof pattern.
nipkow
parents: 13999
diff changeset
  1421
%
a2bcb11ce445 Added case distinction proof pattern.
nipkow
parents: 13999
diff changeset
  1422
\renewcommand{\isamarkupcmt}[1]{{\isastylecmt--- #1}}
a2bcb11ce445 Added case distinction proof pattern.
nipkow
parents: 13999
diff changeset
  1423
%
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1424
\isamarkupsubsection{Further refinements%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1425
}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1426
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1427
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1428
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1429
This subsection discusses some further tricks that can make
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1430
life easier although they are not essential.%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1431
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1432
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1433
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1434
\isamarkupsubsubsection{\isakeyword{and}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1435
}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1436
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1437
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1438
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1439
Propositions (following \isakeyword{assume} etc) may but need not be
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1440
separated by \isakeyword{and}. This is not just for readability
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1441
(\isakeyword{from} \isa{A} \isakeyword{and} \isa{B} looks nicer than
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1442
\isakeyword{from} \isa{A} \isa{B}) but for structuring lists of propositions
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1443
into possibly named blocks. In
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1444
\begin{center}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1445
\isakeyword{assume} \isa{A:} $A_1$ $A_2$ \isakeyword{and} \isa{B:} $A_3$
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1446
\isakeyword{and} $A_4$
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1447
\end{center}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1448
label \isa{A} refers to the list of propositions $A_1$ $A_2$ and
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1449
label \isa{B} to $A_3$.%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1450
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1451
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1452
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1453
\isamarkupsubsubsection{\isakeyword{note}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1454
}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1455
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1456
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1457
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1458
If you want to remember intermediate fact(s) that cannot be
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1459
named directly, use \isakeyword{note}. For example the result of raw
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1460
proof block can be named by following it with
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1461
\isakeyword{note}~\isa{some{\isacharunderscore}name\ {\isacharequal}\ this}.  As a side effect,
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1462
\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
  1463
can also say \isa{note\ some{\isacharunderscore}fact}, which simply sets \isa{this},
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1464
i.e.\ recalls \isa{some{\isacharunderscore}fact}, e.g.\ in a \isakeyword{moreover} sequence.%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1465
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1466
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1467
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1468
\isamarkupsubsubsection{\isakeyword{fixes}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1469
}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1470
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1471
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1472
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1473
Sometimes it is necessary to decorate a proposition with type
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1474
constraints, as in Cantor's theorem above. These type constraints tend
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1475
to make the theorem less readable. The situation can be improved a
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1476
little by combining the type constraint with an outer \isa{{\isasymAnd}}:%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1477
\end{isamarkuptext}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1478
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1479
\isacommand{theorem}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1480
\ {\isachardoublequoteopen}{\isasymAnd}f\ {\isacharcolon}{\isacharcolon}\ {\isacharprime}a\ {\isasymRightarrow}\ {\isacharprime}a\ set{\isachardot}\ {\isasymexists}S{\isachardot}\ S\ {\isasymnotin}\ range\ f{\isachardoublequoteclose}%
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1481
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1482
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1483
\endisadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1484
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1485
\isatagproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1486
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1487
\endisatagproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1488
{\isafoldproof}%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1489
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1490
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1491
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1492
\endisadelimproof
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1493
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1494
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1495
\noindent However, now \isa{f} is bound and we need a
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1496
\isakeyword{fix}~\isa{f} in the proof before we can refer to \isa{f}.
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1497
This is avoided by \isakeyword{fixes}:%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1498
\end{isamarkuptext}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1499
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1500
\isacommand{theorem}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1501
\ \isakeyword{fixes}\ f\ {\isacharcolon}{\isacharcolon}\ {\isachardoublequoteopen}{\isacharprime}a\ {\isasymRightarrow}\ {\isacharprime}a\ set{\isachardoublequoteclose}\ \isakeyword{shows}\ {\isachardoublequoteopen}{\isasymexists}S{\isachardot}\ S\ {\isasymnotin}\ range\ f{\isachardoublequoteclose}%
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1502
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1503
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1504
\endisadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1505
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1506
\isatagproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1507
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1508
\endisatagproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1509
{\isafoldproof}%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1510
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1511
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1512
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1513
\endisadelimproof
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1514
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1515
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1516
\noindent
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1517
Even better, \isakeyword{fixes} allows to introduce concrete syntax locally:%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1518
\end{isamarkuptext}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1519
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1520
\isacommand{lemma}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1521
\ comm{\isacharunderscore}mono{\isacharcolon}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1522
\ \ \isakeyword{fixes}\ r\ {\isacharcolon}{\isacharcolon}\ {\isachardoublequoteopen}{\isacharprime}a\ {\isasymRightarrow}\ {\isacharprime}a\ {\isasymRightarrow}\ bool{\isachardoublequoteclose}\ {\isacharparenleft}\isakeyword{infix}\ {\isachardoublequoteopen}{\isachargreater}{\isachardoublequoteclose}\ {\isadigit{6}}{\isadigit{0}}{\isacharparenright}\ \isakeyword{and}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1523
\ \ \ \ \ \ \ f\ {\isacharcolon}{\isacharcolon}\ {\isachardoublequoteopen}{\isacharprime}a\ {\isasymRightarrow}\ {\isacharprime}a\ {\isasymRightarrow}\ {\isacharprime}a{\isachardoublequoteclose}\ \ \ {\isacharparenleft}\isakeyword{infixl}\ {\isachardoublequoteopen}{\isacharplus}{\isacharplus}{\isachardoublequoteclose}\ {\isadigit{7}}{\isadigit{0}}{\isacharparenright}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1524
\ \ \isakeyword{assumes}\ comm{\isacharcolon}\ {\isachardoublequoteopen}{\isasymAnd}x\ y{\isacharcolon}{\isacharcolon}{\isacharprime}a{\isachardot}\ x\ {\isacharplus}{\isacharplus}\ y\ {\isacharequal}\ y\ {\isacharplus}{\isacharplus}\ x{\isachardoublequoteclose}\ \isakeyword{and}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1525
\ \ \ \ \ \ \ \ \ \ mono{\isacharcolon}\ {\isachardoublequoteopen}{\isasymAnd}x\ y\ z{\isacharcolon}{\isacharcolon}{\isacharprime}a{\isachardot}\ x\ {\isachargreater}\ y\ {\isasymLongrightarrow}\ x\ {\isacharplus}{\isacharplus}\ z\ {\isachargreater}\ y\ {\isacharplus}{\isacharplus}\ z{\isachardoublequoteclose}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1526
\ \ \isakeyword{shows}\ {\isachardoublequoteopen}x\ {\isachargreater}\ y\ {\isasymLongrightarrow}\ z\ {\isacharplus}{\isacharplus}\ x\ {\isachargreater}\ z\ {\isacharplus}{\isacharplus}\ y{\isachardoublequoteclose}\isanewline
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1527
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1528
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1529
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1530
\endisadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1531
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1532
\isatagproof
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1533
\isacommand{by}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1534
{\isacharparenleft}simp\ add{\isacharcolon}\ comm\ mono{\isacharparenright}%
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1535
\endisatagproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1536
{\isafoldproof}%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1537
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1538
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1539
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1540
\endisadelimproof
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1541
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1542
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1543
\noindent The concrete syntax is dropped at the end of the proof and the
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1544
theorem becomes \begin{isabelle}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1545
{\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
  1546
\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
  1547
{\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
  1548
\end{isabelle}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1549
\tweakskip%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1550
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1551
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1552
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1553
\isamarkupsubsubsection{\isakeyword{obtain}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1554
}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1555
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1556
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1557
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1558
The \isakeyword{obtain} construct can introduce multiple
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1559
witnesses and propositions as in the following proof fragment:%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1560
\end{isamarkuptext}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1561
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1562
\isacommand{lemma}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1563
\ \isakeyword{assumes}\ A{\isacharcolon}\ {\isachardoublequoteopen}{\isasymexists}x\ y{\isachardot}\ P\ x\ y\ {\isasymand}\ Q\ x\ y{\isachardoublequoteclose}\ \isakeyword{shows}\ {\isachardoublequoteopen}R{\isachardoublequoteclose}\isanewline
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1564
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1565
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1566
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1567
\endisadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1568
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1569
\isatagproof
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1570
\isacommand{proof}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1571
\ {\isacharminus}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1572
\ \ \isacommand{from}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1573
\ A\ \isacommand{obtain}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1574
\ x\ y\ \isakeyword{where}\ P{\isacharcolon}\ {\isachardoublequoteopen}P\ x\ y{\isachardoublequoteclose}\ \isakeyword{and}\ Q{\isacharcolon}\ {\isachardoublequoteopen}Q\ x\ y{\isachardoublequoteclose}\ \ \isacommand{by}\isamarkupfalse%
17181
5f42dd5e6570 updated;
wenzelm
parents: 17175
diff changeset
  1575
\ blast%
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1576
\endisatagproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1577
{\isafoldproof}%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1578
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1579
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1580
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1581
\endisadelimproof
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1582
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1583
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1584
Remember also that one does not even need to start with a formula
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1585
containing \isa{{\isasymexists}} as we saw in the proof of Cantor's theorem.%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1586
\end{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1587
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1588
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1589
\isamarkupsubsubsection{Combining proof styles%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1590
}
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1591
\isamarkuptrue%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1592
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1593
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1594
Finally, whole ``scripts'' (tactic-based proofs in the style of
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1595
\cite{LNCS2283}) may appear in the leaves of the proof tree, although this is
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1596
best avoided.  Here is a contrived example:%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1597
\end{isamarkuptext}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1598
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1599
\isacommand{lemma}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1600
\ {\isachardoublequoteopen}A\ {\isasymlongrightarrow}\ {\isacharparenleft}A\ {\isasymlongrightarrow}\ B{\isacharparenright}\ {\isasymlongrightarrow}\ B{\isachardoublequoteclose}\isanewline
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1601
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1602
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1603
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1604
\endisadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1605
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1606
\isatagproof
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1607
\isacommand{proof}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1608
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1609
\ \ \isacommand{assume}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1610
\ a{\isacharcolon}\ {\isachardoublequoteopen}A{\isachardoublequoteclose}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1611
\ \ \isacommand{show}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1612
\ {\isachardoublequoteopen}{\isacharparenleft}A\ {\isasymlongrightarrow}B{\isacharparenright}\ {\isasymlongrightarrow}\ B{\isachardoublequoteclose}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1613
\ \ \ \ \isacommand{apply}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1614
{\isacharparenleft}rule\ impI{\isacharparenright}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1615
\ \ \ \ \isacommand{apply}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1616
{\isacharparenleft}erule\ impE{\isacharparenright}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1617
\ \ \ \ \isacommand{apply}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1618
{\isacharparenleft}rule\ a{\isacharparenright}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1619
\ \ \ \ \isacommand{apply}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1620
\ assumption\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1621
\ \ \ \ \isacommand{done}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1622
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1623
\isacommand{qed}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1624
%
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1625
\endisatagproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1626
{\isafoldproof}%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1627
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1628
\isadelimproof
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1629
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1630
\endisadelimproof
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1631
%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1632
\begin{isamarkuptext}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1633
\noindent You may need to resort to this technique if an
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1634
automatic step fails to prove the desired proposition.
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1635
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1636
When converting a proof from tactic-style into Isar you can proceed
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1637
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
  1638
while the outer structure is already expressed in Isar.%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1639
\end{isamarkuptext}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17125
diff changeset
  1640
\isamarkuptrue%
17125
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1641
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1642
\isadelimtheory
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1643
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1644
\endisadelimtheory
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1645
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1646
\isatagtheory
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1647
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1648
\endisatagtheory
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1649
{\isafoldtheory}%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1650
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1651
\isadelimtheory
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1652
%
e6a82d1a1829 updated;
wenzelm
parents: 16459
diff changeset
  1653
\endisadelimtheory
13999
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1654
\end{isabellebody}%
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1655
%%% Local Variables:
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1656
%%% mode: latex
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1657
%%% TeX-master: "root"
454a2ad0c381 IsarOverview moved one level up
kleing
parents:
diff changeset
  1658
%%% End: