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