doc-src/Logics/ZF.tex
author lcp
Fri, 12 Nov 1993 10:41:13 +0100
changeset 114 96c627d2815e
parent 111 1b3cddf41b2d
child 131 bb0caac13eff
permissions -rw-r--r--
Misc updates
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
     1
%% $Id$
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
     2
%%%See grant/bra/Lib/ZF.tex for lfp figure
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
     3
\chapter{Zermelo-Fraenkel set theory}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
     4
The directory~\ttindexbold{ZF} implements Zermelo-Fraenkel set
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
     5
theory~\cite{halmos60,suppes72} as an extension of~\ttindex{FOL}, classical
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
     6
first-order logic.  The theory includes a collection of derived natural
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
     7
deduction rules, for use with Isabelle's classical reasoning module.  Much
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
     8
of it is based on the work of No\"el~\cite{noel}.  The theory has the {\ML}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
     9
identifier \ttindexbold{ZF.thy}.  However, many further theories
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    10
are defined, introducing the natural numbers, etc.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    11
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    12
A tremendous amount of set theory has been formally developed, including
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    13
the basic properties of relations, functions and ordinals.  Significant
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    14
results have been proved, such as the Schr\"oder-Bernstein Theorem and the
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    15
Recursion Theorem.  General methods have been developed for solving
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    16
recursion equations over monotonic functors; these have been applied to
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    17
yield constructions of lists and trees.  Thus, we may even regard set
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    18
theory as a computational logic.  It admits recursive definitions of
111
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
    19
functions and types.  It has much in common with Martin-L\"of type theory,
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    20
although of course it is classical.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    21
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    22
Because {\ZF} is an extension of {\FOL}, it provides the same packages,
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    23
namely \ttindex{hyp_subst_tac}, the simplifier, and the classical reasoning
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    24
module.  The main simplification set is called \ttindexbold{ZF_ss}.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    25
Several classical rule sets are defined, including \ttindexbold{lemmas_cs},
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    26
\ttindexbold{upair_cs} and~\ttindexbold{ZF_cs}.  See the files on directory
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    27
{\tt ZF} for details.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    28
111
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
    29
Isabelle/ZF now has a flexible package for handling inductive definitions,
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
    30
such as inference systems, and datatype definitions, such as lists and
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
    31
trees.  Moreover it also handles co-inductive definitions, such as
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
    32
bisimulation relations, and co-datatype definitions, such as streams.  A
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
    33
recent paper describes the package~\cite{paulson-fixedpt}.  
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
    34
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
    35
Recent reports describe Isabelle/ZF less formally than this
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
    36
chapter~\cite{paulson-set-I,paulson-set-II}.  Isabelle/ZF employs a novel
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
    37
treatment of non-well-founded data structures within the standard ZF axioms
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
    38
including the Axiom of Foundation, but no report describes this treatment.
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
    39
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    40
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    41
\section{Which version of axiomatic set theory?}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    42
Resolution theorem provers can work in set theory, using the
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    43
Bernays-G\"odel axiom system~(BG) because it is
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    44
finite~\cite{boyer86,quaife92}.  {\ZF} does not have a finite axiom system
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    45
(because of its Axiom Scheme of Replacement) and is therefore unsuitable
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    46
for classical resolution.  Since Isabelle has no difficulty with axiom
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    47
schemes, we may adopt either axiom system.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    48
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    49
These two theories differ in their treatment of {\bf classes}, which are
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    50
collections that are ``too big'' to be sets.  The class of all sets,~$V$,
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    51
cannot be a set without admitting Russell's Paradox.  In BG, both classes
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    52
and sets are individuals; $x\in V$ expresses that $x$ is a set.  In {\ZF}, all
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    53
variables denote sets; classes are identified with unary predicates.  The
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    54
two systems define essentially the same sets and classes, with similar
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    55
properties.  In particular, a class cannot belong to another class (let
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    56
alone a set).
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    57
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    58
Modern set theorists tend to prefer {\ZF} because they are mainly concerned
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    59
with sets, rather than classes.  BG requires tiresome proofs that various
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    60
collections are sets; for instance, showing $x\in\{x\}$ requires showing that
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    61
$x$ is a set.  {\ZF} does not have this problem.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    62
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    63
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    64
\begin{figure} 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    65
\begin{center}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    66
\begin{tabular}{rrr} 
111
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
    67
  \it name      &\it meta-type  & \it description \\ 
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
    68
  \idx{0}       & $i$           & empty set\\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
    69
  \idx{cons}    & $[i,i]\To i$  & finite set constructor\\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
    70
  \idx{Upair}   & $[i,i]\To i$  & unordered pairing\\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
    71
  \idx{Pair}    & $[i,i]\To i$  & ordered pairing\\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
    72
  \idx{Inf}     & $i$   & infinite set\\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
    73
  \idx{Pow}     & $i\To i$      & powerset\\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
    74
  \idx{Union} \idx{Inter} & $i\To i$    & set union/intersection \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
    75
  \idx{split}   & $[[i,i]\To i, i] \To i$ & generalized projection\\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
    76
  \idx{fst} \idx{snd}   & $i\To i$      & projections\\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
    77
  \idx{converse}& $i\To i$      & converse of a relation\\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
    78
  \idx{succ}    & $i\To i$      & successor\\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
    79
  \idx{Collect} & $[i,i\To o]\To i$     & separation\\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
    80
  \idx{Replace} & $[i, [i,i]\To o] \To i$       & replacement\\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
    81
  \idx{PrimReplace} & $[i, [i,i]\To o] \To i$   & primitive replacement\\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
    82
  \idx{RepFun}  & $[i, i\To i] \To i$   & functional replacement\\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
    83
  \idx{Pi} \idx{Sigma}  & $[i,i\To i]\To i$     & general product/sum\\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
    84
  \idx{domain}  & $i\To i$      & domain of a relation\\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
    85
  \idx{range}   & $i\To i$      & range of a relation\\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
    86
  \idx{field}   & $i\To i$      & field of a relation\\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
    87
  \idx{Lambda}  & $[i, i\To i]\To i$    & $\lambda$-abstraction\\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
    88
  \idx{restrict}& $[i, i] \To i$        & restriction of a function\\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
    89
  \idx{The}     & $[i\To o]\To i$       & definite description\\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
    90
  \idx{if}      & $[o,i,i]\To i$        & conditional\\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
    91
  \idx{Ball} \idx{Bex}  & $[i, i\To o]\To o$    & bounded quantifiers
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    92
\end{tabular}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    93
\end{center}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    94
\subcaption{Constants}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    95
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    96
\begin{center}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    97
\indexbold{*"`"`}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    98
\indexbold{*"-"`"`}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    99
\indexbold{*"`}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   100
\indexbold{*"-}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   101
\indexbold{*":}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   102
\indexbold{*"<"=}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   103
\begin{tabular}{rrrr} 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   104
  \it symbol  & \it meta-type & \it precedence & \it description \\ 
111
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   105
  \tt ``        & $[i,i]\To i$  &  Left 90      & image \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   106
  \tt -``       & $[i,i]\To i$  &  Left 90      & inverse image \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   107
  \tt `         & $[i,i]\To i$  &  Left 90      & application \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   108
  \idx{Int}     & $[i,i]\To i$  &  Left 70      & intersection ($\inter$) \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   109
  \idx{Un}      & $[i,i]\To i$  &  Left 65      & union ($\union$) \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   110
  \tt -         & $[i,i]\To i$  &  Left 65      & set difference ($-$) \\[1ex]
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   111
  \tt:          & $[i,i]\To o$  &  Left 50      & membership ($\in$) \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   112
  \tt <=        & $[i,i]\To o$  &  Left 50      & subset ($\subseteq$) 
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   113
\end{tabular}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   114
\end{center}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   115
\subcaption{Infixes}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   116
\caption{Constants of {\ZF}} \label{ZF-constants}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   117
\end{figure} 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   118
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   119
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   120
\section{The syntax of set theory}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   121
The language of set theory, as studied by logicians, has no constants.  The
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   122
traditional axioms merely assert the existence of empty sets, unions,
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   123
powersets, etc.; this would be intolerable for practical reasoning.  The
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   124
Isabelle theory declares constants for primitive sets.  It also extends
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   125
{\tt FOL} with additional syntax for finite sets, ordered pairs,
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   126
comprehension, general union/intersection, general sums/products, and
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   127
bounded quantifiers.  In most other respects, Isabelle implements precisely
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   128
Zermelo-Fraenkel set theory.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   129
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   130
Figure~\ref{ZF-constants} lists the constants and infixes of~\ZF, while
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   131
Figure~\ref{ZF-trans} presents the syntax translations.  Finally,
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   132
Figure~\ref{ZF-syntax} presents the full grammar for set theory, including
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   133
the constructs of \FOL.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   134
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   135
Set theory does not use polymorphism.  All terms in {\ZF} have type~{\it
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   136
i}, which is the type of individuals and lies in class {\it logic}.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   137
The type of first-order formulae,
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   138
remember, is~{\it o}.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   139
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   140
Infix operators include union and intersection ($A\union B$ and $A\inter
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   141
B$), and the subset and membership relations.  Note that $a$\verb|~:|$b$ is
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   142
translated to \verb|~(|$a$:$b$\verb|)|.  The union and intersection
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   143
operators ($\bigcup A$ and $\bigcap A$) form the union or intersection of a
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   144
set of sets; $\bigcup A$ means the same as $\bigcup@{x\in A}x$.  Of these
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   145
operators, only $\bigcup A$ is primitive.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   146
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   147
The constant \ttindexbold{Upair} constructs unordered pairs; thus {\tt
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   148
Upair($A$,$B$)} denotes the set~$\{A,B\}$ and {\tt Upair($A$,$A$)} denotes
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   149
the singleton~$\{A\}$.  As usual in {\ZF}, general union is used to define
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   150
binary union.  The Isabelle version goes on to define the constant
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   151
\ttindexbold{cons}:
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   152
\begin{eqnarray*}
111
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   153
   A\cup B              & \equiv &       \bigcup({\tt Upair}(A,B)) \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   154
   {\tt cons}(a,B)      & \equiv &        {\tt Upair}(a,a) \union B
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   155
\end{eqnarray*}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   156
The {\tt\{\ldots\}} notation abbreviates finite sets constructed in the
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   157
obvious manner using~{\tt cons} and~$\emptyset$ (the empty set):
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   158
\begin{eqnarray*}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   159
 \{a,b,c\} & \equiv & {\tt cons}(a,{\tt cons}(b,{\tt cons}(c,\emptyset)))
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   160
\end{eqnarray*}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   161
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   162
The constant \ttindexbold{Pair} constructs ordered pairs, as in {\tt
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   163
Pair($a$,$b$)}.  Ordered pairs may also be written within angle brackets,
111
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   164
as {\tt<$a$,$b$>}.  The $n$-tuple {\tt<$a@1$,\ldots,$a@{n-1}$,$a@n$>}
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   165
abbreviates the nest of pairs {\tt
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   166
  Pair($a@1$,\ldots,Pair($a@{n-1}$,$a@n$)\ldots)}. 
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   167
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   168
In {\ZF}, a function is a set of pairs.  A {\ZF} function~$f$ is simply an
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   169
individual as far as Isabelle is concerned: its Isabelle type is~$i$, not
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   170
say $i\To i$.  The infix operator~{\tt`} denotes the application of a
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   171
function set to its argument; we must write~$f{\tt`}x$, not~$f(x)$.  The
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   172
syntax for image is~$f{\tt``}A$ and that for inverse image is~$f{\tt-``}A$.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   173
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   174
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   175
\begin{figure} 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   176
\indexbold{*"-">}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   177
\indexbold{*"*}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   178
\begin{center} \tt\frenchspacing
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   179
\begin{tabular}{rrr} 
111
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   180
  \it external          & \it internal  & \it description \\ 
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   181
  $a$ \ttilde: $b$      & \ttilde($a$ : $b$)    & \rm negated membership\\
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   182
  \{$a@1$, $\ldots$, $a@n$\}  &  cons($a@1$,$\cdots$,cons($a@n$,0)) &
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   183
        \rm finite set \\
111
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   184
  <$a@1$, $\ldots$, $a@{n-1}$, $a@n$> & 
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   185
        Pair($a@1$,\ldots,Pair($a@{n-1}$,$a@n$)\ldots) &
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   186
        \rm ordered $n$-tuple \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   187
  \{$x$:$A . P[x]$\}    &  Collect($A$,$\lambda x.P[x]$) &
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   188
        \rm separation \\
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   189
  \{$y . x$:$A$, $Q[x,y]$\}  &  Replace($A$,$\lambda x\,y.Q[x,y]$) &
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   190
        \rm replacement \\
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   191
  \{$b[x] . x$:$A$\}  &  RepFun($A$,$\lambda x.b[x]$) &
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   192
        \rm functional replacement \\
111
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   193
  \idx{INT} $x$:$A . B[x]$      & Inter(\{$B[x] . x$:$A$\}) &
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   194
        \rm general intersection \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   195
  \idx{UN}  $x$:$A . B[x]$      & Union(\{$B[x] . x$:$A$\}) &
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   196
        \rm general union \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   197
  \idx{PROD} $x$:$A . B[x]$     & Pi($A$,$\lambda x.B[x]$) & 
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   198
        \rm general product \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   199
  \idx{SUM}  $x$:$A . B[x]$     & Sigma($A$,$\lambda x.B[x]$) & 
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   200
        \rm general sum \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   201
  $A$ -> $B$            & Pi($A$,$\lambda x.B$) & 
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   202
        \rm function space \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   203
  $A$ * $B$             & Sigma($A$,$\lambda x.B$) & 
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   204
        \rm binary product \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   205
  \idx{THE}  $x . P[x]$ & The($\lambda x.P[x]$) & 
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   206
        \rm definite description \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   207
  \idx{lam}  $x$:$A . b[x]$     & Lambda($A$,$\lambda x.b[x]$) & 
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   208
        \rm $\lambda$-abstraction\\[1ex]
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   209
  \idx{ALL} $x$:$A . P[x]$      & Ball($A$,$\lambda x.P[x]$) & 
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   210
        \rm bounded $\forall$ \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   211
  \idx{EX}  $x$:$A . P[x]$      & Bex($A$,$\lambda x.P[x]$) & 
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   212
        \rm bounded $\exists$
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   213
\end{tabular}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   214
\end{center}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   215
\caption{Translations for {\ZF}} \label{ZF-trans}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   216
\end{figure} 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   217
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   218
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   219
\begin{figure} 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   220
\dquotes
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   221
\[\begin{array}{rcl}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   222
    term & = & \hbox{expression of type~$i$} \\
111
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   223
         & | & "\{ " term\; ("," term)^* " \}" \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   224
         & | & "< " term ", " term " >" \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   225
         & | & "\{ " id ":" term " . " formula " \}" \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   226
         & | & "\{ " id " . " id ":" term "," formula " \}" \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   227
         & | & "\{ " term " . " id ":" term " \}" \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   228
         & | & term " `` " term \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   229
         & | & term " -`` " term \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   230
         & | & term " ` " term \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   231
         & | & term " * " term \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   232
         & | & term " Int " term \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   233
         & | & term " Un " term \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   234
         & | & term " - " term \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   235
         & | & term " -> " term \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   236
         & | & "THE~~"  id  " . " formula\\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   237
         & | & "lam~~"  id ":" term " . " term \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   238
         & | & "INT~~"  id ":" term " . " term \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   239
         & | & "UN~~~"  id ":" term " . " term \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   240
         & | & "PROD~"  id ":" term " . " term \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   241
         & | & "SUM~~"  id ":" term " . " term \\[2ex]
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   242
 formula & = & \hbox{expression of type~$o$} \\
111
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   243
         & | & term " : " term \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   244
         & | & term " <= " term \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   245
         & | & term " = " term \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   246
         & | & "\ttilde\ " formula \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   247
         & | & formula " \& " formula \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   248
         & | & formula " | " formula \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   249
         & | & formula " --> " formula \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   250
         & | & formula " <-> " formula \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   251
         & | & "ALL " id ":" term " . " formula \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   252
         & | & "EX~~" id ":" term " . " formula \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   253
         & | & "ALL~" id~id^* " . " formula \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   254
         & | & "EX~~" id~id^* " . " formula \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   255
         & | & "EX!~" id~id^* " . " formula
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   256
  \end{array}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   257
\]
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   258
\caption{Full grammar for {\ZF}} \label{ZF-syntax}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   259
\end{figure} 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   260
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   261
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   262
\section{Binding operators}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   263
The constant \ttindexbold{Collect} constructs sets by the principle of {\bf
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   264
  separation}.  The syntax for separation is \hbox{\tt\{$x$:$A$.$P[x]$\}},
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   265
where $P[x]$ is a formula that may contain free occurrences of~$x$.  It
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   266
abbreviates the set {\tt Collect($A$,$\lambda x.P$[x])}, which consists of
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   267
all $x\in A$ that satisfy~$P[x]$.  Note that {\tt Collect} is an
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   268
unfortunate choice of name: some set theories adopt a set-formation
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   269
principle, related to replacement, called collection.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   270
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   271
The constant \ttindexbold{Replace} constructs sets by the principle of {\bf
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   272
  replacement}.  The syntax for replacement is
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   273
\hbox{\tt\{$y$.$x$:$A$,$Q[x,y]$\}}.  It denotes the set {\tt
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   274
  Replace($A$,$\lambda x\,y.Q$[x,y])} consisting of all $y$ such that there
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   275
exists $x\in A$ satisfying~$Q[x,y]$.  The Replacement Axiom has the
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   276
condition that $Q$ must be single-valued over~$A$: for all~$x\in A$ there
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   277
exists at most one $y$ satisfying~$Q[x,y]$.  A single-valued binary
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   278
predicate is also called a {\bf class function}.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   279
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   280
The constant \ttindexbold{RepFun} expresses a special case of replacement,
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   281
where $Q[x,y]$ has the form $y=b[x]$.  Such a $Q$ is trivially
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   282
single-valued, since it is just the graph of the meta-level
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   283
function~$\lambda x.b[x]$.  The syntax is \hbox{\tt\{$b[x]$.$x$:$A$\}},
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   284
denoting set {\tt RepFun($A$,$\lambda x.b[x]$)} of all $b[x]$ for~$x\in A$.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   285
This is analogous to the \ML{} functional {\tt map}, since it applies a
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   286
function to every element of a set.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   287
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   288
\indexbold{*INT}\indexbold{*UN}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   289
General unions and intersections of families, namely $\bigcup@{x\in A}B[x]$ and
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   290
$\bigcap@{x\in A}B[x]$, are written \hbox{\tt UN $x$:$A$.$B[x]$} and
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   291
\hbox{\tt INT $x$:$A$.$B[x]$}.  Their meaning is expressed using {\tt
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   292
RepFun} as
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   293
\[ \bigcup(\{B[x]. x\in A\}) \qquad\hbox{and}\qquad 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   294
   \bigcap(\{B[x]. x\in A\}). 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   295
\]
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   296
General sums $\sum@{x\in A}B[x]$ and products $\prod@{x\in A}B[x]$ can be
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   297
constructed in set theory, where $B[x]$ is a family of sets over~$A$.  They
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   298
have as special cases $A\times B$ and $A\to B$, where $B$ is simply a set.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   299
This is similar to the situation in Constructive Type Theory (set theory
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   300
has ``dependent sets'') and calls for similar syntactic conventions.  The
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   301
constants~\ttindexbold{Sigma} and~\ttindexbold{Pi} construct general sums and
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   302
products.  Instead of {\tt Sigma($A$,$B$)} and {\tt Pi($A$,$B$)} we may write
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   303
\hbox{\tt SUM $x$:$A$.$B[x]$} and \hbox{\tt PROD $x$:$A$.$B[x]$}.  
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   304
\indexbold{*SUM}\indexbold{*PROD}%
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   305
The special cases as \hbox{\tt$A$*$B$} and \hbox{\tt$A$->$B$} abbreviate
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   306
general sums and products over a constant family.\footnote{Unlike normal
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   307
infix operators, {\tt*} and {\tt->} merely define abbreviations; there are
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   308
no constants~{\tt op~*} and~\hbox{\tt op~->}.} Isabelle accepts these
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   309
abbreviations in parsing and uses them whenever possible for printing.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   310
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   311
\indexbold{*THE} 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   312
As mentioned above, whenever the axioms assert the existence and uniqueness
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   313
of a set, Isabelle's set theory declares a constant for that set.  These
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   314
constants can express the {\bf definite description} operator~$\iota
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   315
x.P[x]$, which stands for the unique~$a$ satisfying~$P[a]$, if such exists.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   316
Since all terms in {\ZF} denote something, a description is always
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   317
meaningful, but we do not know its value unless $P[x]$ defines it uniquely.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   318
Using the constant~\ttindexbold{The}, we may write descriptions as {\tt
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   319
  The($\lambda x.P[x]$)} or use the syntax \hbox{\tt THE $x$.$P[x]$}.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   320
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   321
\indexbold{*lam}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   322
Function sets may be written in $\lambda$-notation; $\lambda x\in A.b[x]$
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   323
stands for the set of all pairs $\pair{x,b[x]}$ for $x\in A$.  In order for
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   324
this to be a set, the function's domain~$A$ must be given.  Using the
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   325
constant~\ttindexbold{Lambda}, we may express function sets as {\tt
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   326
Lambda($A$,$\lambda x.b[x]$)} or use the syntax \hbox{\tt lam $x$:$A$.$b[x]$}.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   327
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   328
Isabelle's set theory defines two {\bf bounded quantifiers}:
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   329
\begin{eqnarray*}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   330
   \forall x\in A.P[x] &\hbox{which abbreviates}& \forall x. x\in A\imp P[x] \\
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   331
   \exists x\in A.P[x] &\hbox{which abbreviates}& \exists x. x\in A\conj P[x]
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   332
\end{eqnarray*}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   333
The constants~\ttindexbold{Ball} and~\ttindexbold{Bex} are defined
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   334
accordingly.  Instead of {\tt Ball($A$,$P$)} and {\tt Bex($A$,$P$)} we may
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   335
write
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   336
\hbox{\tt ALL $x$:$A$.$P[x]$} and \hbox{\tt EX $x$:$A$.$P[x]$}.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   337
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   338
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   339
%%%% zf.thy
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   340
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   341
\begin{figure}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   342
\begin{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   343
\idx{Ball_def}           Ball(A,P) == ALL x. x:A --> P(x)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   344
\idx{Bex_def}            Bex(A,P)  == EX x. x:A & P(x)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   345
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   346
\idx{subset_def}         A <= B  == ALL x:A. x:B
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   347
\idx{extension}          A = B  <->  A <= B & B <= A
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   348
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   349
\idx{union_iff}          A : Union(C) <-> (EX B:C. A:B)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   350
\idx{power_set}          A : Pow(B) <-> A <= B
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   351
\idx{foundation}         A=0 | (EX x:A. ALL y:x. ~ y:A)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   352
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   353
\idx{replacement}        (ALL x:A. ALL y z. P(x,y) & P(x,z) --> y=z) ==>
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   354
                   b : PrimReplace(A,P) <-> (EX x:A. P(x,b))
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   355
\subcaption{The Zermelo-Fraenkel Axioms}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   356
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   357
\idx{Replace_def}  Replace(A,P) == 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   358
                   PrimReplace(A, %x y. (EX!z.P(x,z)) & P(x,y))
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   359
\idx{RepFun_def}   RepFun(A,f)  == \{y . x:A, y=f(x)\}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   360
\idx{the_def}      The(P)       == Union(\{y . x:\{0\}, P(y)\})
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   361
\idx{if_def}       if(P,a,b)    == THE z. P & z=a | ~P & z=b
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   362
\idx{Collect_def}  Collect(A,P) == \{y . x:A, x=y & P(x)\}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   363
\idx{Upair_def}    Upair(a,b)   == 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   364
                 \{y. x:Pow(Pow(0)), (x=0 & y=a) | (x=Pow(0) & y=b)\}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   365
\subcaption{Consequences of replacement}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   366
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   367
\idx{Inter_def}    Inter(A) == \{ x:Union(A) . ALL y:A. x:y\}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   368
\idx{Un_def}       A Un  B  == Union(Upair(A,B))
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   369
\idx{Int_def}      A Int B  == Inter(Upair(A,B))
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   370
\idx{Diff_def}     A - B    == \{ x:A . ~(x:B) \}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   371
\subcaption{Union, intersection, difference}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   372
\end{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   373
\caption{Rules and axioms of {\ZF}} \label{ZF-rules}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   374
\end{figure}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   375
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   376
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   377
\begin{figure}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   378
\begin{ttbox}
111
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   379
\idx{cons_def}     cons(a,A) == Upair(a,a) Un A
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   380
\idx{succ_def}     succ(i) == cons(i,i)
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   381
\idx{infinity}     0:Inf & (ALL y:Inf. succ(y): Inf)
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   382
\subcaption{Finite and infinite sets}
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   383
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   384
\idx{Pair_def}       <a,b>      == \{\{a,a\}, \{a,b\}\}
111
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   385
\idx{split_def}      split(c,p) == THE y. EX a b. p=<a,b> & y=c(a,b)
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   386
\idx{fst_def}        fst(A)     == split(%x y.x, p)
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   387
\idx{snd_def}        snd(A)     == split(%x y.y, p)
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   388
\idx{Sigma_def}      Sigma(A,B) == UN x:A. UN y:B(x). \{<x,y>\}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   389
\subcaption{Ordered pairs and Cartesian products}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   390
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   391
\idx{converse_def}   converse(r) == \{z. w:r, EX x y. w=<x,y> & z=<y,x>\}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   392
\idx{domain_def}     domain(r)   == \{x. w:r, EX y. w=<x,y>\}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   393
\idx{range_def}      range(r)    == domain(converse(r))
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   394
\idx{field_def}      field(r)    == domain(r) Un range(r)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   395
\idx{image_def}      r `` A      == \{y : range(r) . EX x:A. <x,y> : r\}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   396
\idx{vimage_def}     r -`` A     == converse(r)``A
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   397
\subcaption{Operations on relations}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   398
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   399
\idx{lam_def}    Lambda(A,b) == \{<x,b(x)> . x:A\}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   400
\idx{apply_def}  f`a         == THE y. <a,y> : f
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   401
\idx{Pi_def}     Pi(A,B) == \{f: Pow(Sigma(A,B)). ALL x:A. EX! y. <x,y>: f\}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   402
\idx{restrict_def}   restrict(f,A) == lam x:A.f`x
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   403
\subcaption{Functions and general product}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   404
\end{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   405
\caption{Further definitions of {\ZF}} \label{ZF-defs}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   406
\end{figure}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   407
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   408
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   409
%%%% zf.ML
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   410
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   411
\begin{figure}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   412
\begin{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   413
\idx{ballI}       [| !!x. x:A ==> P(x) |] ==> ALL x:A. P(x)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   414
\idx{bspec}       [| ALL x:A. P(x);  x: A |] ==> P(x)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   415
\idx{ballE}       [| ALL x:A. P(x);  P(x) ==> Q;  ~ x:A ==> Q |] ==> Q
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   416
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   417
\idx{ball_cong}   [| A=A';  !!x. x:A' ==> P(x) <-> P'(x) |] ==> 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   418
            (ALL x:A. P(x)) <-> (ALL x:A'. P'(x))
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   419
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   420
\idx{bexI}        [| P(x);  x: A |] ==> EX x:A. P(x)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   421
\idx{bexCI}       [| ALL x:A. ~P(x) ==> P(a);  a: A |] ==> EX x:A.P(x)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   422
\idx{bexE}        [| EX x:A. P(x);  !!x. [| x:A; P(x) |] ==> Q |] ==> Q
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   423
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   424
\idx{bex_cong}    [| A=A';  !!x. x:A' ==> P(x) <-> P'(x) |] ==> 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   425
            (EX x:A. P(x)) <-> (EX x:A'. P'(x))
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   426
\subcaption{Bounded quantifiers}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   427
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   428
\idx{subsetI}       (!!x.x:A ==> x:B) ==> A <= B
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   429
\idx{subsetD}       [| A <= B;  c:A |] ==> c:B
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   430
\idx{subsetCE}      [| A <= B;  ~(c:A) ==> P;  c:B ==> P |] ==> P
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   431
\idx{subset_refl}   A <= A
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   432
\idx{subset_trans}  [| A<=B;  B<=C |] ==> A<=C
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   433
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   434
\idx{equalityI}     [| A <= B;  B <= A |] ==> A = B
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   435
\idx{equalityD1}    A = B ==> A<=B
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   436
\idx{equalityD2}    A = B ==> B<=A
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   437
\idx{equalityE}     [| A = B;  [| A<=B; B<=A |] ==> P |]  ==>  P
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   438
\subcaption{Subsets and extensionality}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   439
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   440
\idx{emptyE}          a:0 ==> P
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   441
\idx{empty_subsetI}   0 <= A
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   442
\idx{equals0I}        [| !!y. y:A ==> False |] ==> A=0
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   443
\idx{equals0D}        [| A=0;  a:A |] ==> P
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   444
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   445
\idx{PowI}            A <= B ==> A : Pow(B)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   446
\idx{PowD}            A : Pow(B)  ==>  A<=B
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   447
\subcaption{The empty set; power sets}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   448
\end{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   449
\caption{Basic derived rules for {\ZF}} \label{ZF-lemmas1}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   450
\end{figure}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   451
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   452
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   453
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   454
\begin{figure}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   455
\begin{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   456
\idx{ReplaceI}      [| x: A;  P(x,b);  !!y. P(x,y) ==> y=b |] ==> 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   457
              b : \{y. x:A, P(x,y)\}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   458
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   459
\idx{ReplaceE}      [| b : \{y. x:A, P(x,y)\};  
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   460
                 !!x. [| x: A;  P(x,b);  ALL y. P(x,y)-->y=b |] ==> R 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   461
              |] ==> R
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   462
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   463
\idx{RepFunI}       [| a : A |] ==> f(a) : \{f(x). x:A\}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   464
\idx{RepFunE}       [| b : \{f(x). x:A\};  
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   465
                 !!x.[| x:A;  b=f(x) |] ==> P |] ==> P
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   466
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   467
\idx{separation}     a : \{x:A. P(x)\} <-> a:A & P(a)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   468
\idx{CollectI}       [| a:A;  P(a) |] ==> a : \{x:A. P(x)\}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   469
\idx{CollectE}       [| a : \{x:A. P(x)\};  [| a:A; P(a) |] ==> R |] ==> R
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   470
\idx{CollectD1}      a : \{x:A. P(x)\} ==> a:A
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   471
\idx{CollectD2}      a : \{x:A. P(x)\} ==> P(a)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   472
\end{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   473
\caption{Replacement and separation} \label{ZF-lemmas2}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   474
\end{figure}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   475
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   476
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   477
\begin{figure}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   478
\begin{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   479
\idx{UnionI}    [| B: C;  A: B |] ==> A: Union(C)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   480
\idx{UnionE}    [| A : Union(C);  !!B.[| A: B;  B: C |] ==> R |] ==> R
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   481
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   482
\idx{InterI}    [| !!x. x: C ==> A: x;  c:C |] ==> A : Inter(C)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   483
\idx{InterD}    [| A : Inter(C);  B : C |] ==> A : B
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   484
\idx{InterE}    [| A : Inter(C);  A:B ==> R;  ~ B:C ==> R |] ==> R
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   485
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   486
\idx{UN_I}      [| a: A;  b: B(a) |] ==> b: (UN x:A. B(x))
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   487
\idx{UN_E}      [| b : (UN x:A. B(x));  !!x.[| x: A;  b: B(x) |] ==> R 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   488
          |] ==> R
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   489
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   490
\idx{INT_I}     [| !!x. x: A ==> b: B(x);  a: A |] ==> b: (INT x:A. B(x))
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   491
\idx{INT_E}     [| b : (INT x:A. B(x));  a: A |] ==> b : B(a)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   492
\end{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   493
\caption{General Union and Intersection} \label{ZF-lemmas3}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   494
\end{figure}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   495
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   496
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   497
\section{The Zermelo-Fraenkel axioms}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   498
The axioms appear in Figure~\ref{ZF-rules}.  They resemble those
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   499
presented by Suppes~\cite{suppes72}.  Most of the theory consists of
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   500
definitions.  In particular, bounded quantifiers and the subset relation
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   501
appear in other axioms.  Object-level quantifiers and implications have
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   502
been replaced by meta-level ones wherever possible, to simplify use of the
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   503
axioms.  See the file \ttindexbold{ZF/zf.thy} for details.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   504
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   505
The traditional replacement axiom asserts
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   506
\[ y \in {\tt PrimReplace}(A,P) \bimp (\exists x\in A. P(x,y)) \]
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   507
subject to the condition that $P(x,y)$ is single-valued for all~$x\in A$.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   508
The Isabelle theory defines \ttindex{Replace} to apply
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   509
\ttindexbold{PrimReplace} to the single-valued part of~$P$, namely
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   510
\[ (\exists!z.P(x,z)) \conj P(x,y). \]
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   511
Thus $y\in {\tt Replace}(A,P)$ if and only if there is some~$x$ such that
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   512
$P(x,-)$ holds uniquely for~$y$.  Because the equivalence is unconditional,
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   513
{\tt Replace} is much easier to use than {\tt PrimReplace}; it defines the
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   514
same set, if $P(x,y)$ is single-valued.  The nice syntax for replacement
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   515
expands to {\tt Replace}.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   516
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   517
Other consequences of replacement include functional replacement
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   518
(\ttindexbold{RepFun}) and definite descriptions (\ttindexbold{The}).
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   519
Axioms for separation (\ttindexbold{Collect}) and unordered pairs
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   520
(\ttindexbold{Upair}) are traditionally assumed, but they actually follow
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   521
from replacement~\cite[pages 237--8]{suppes72}.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   522
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   523
The definitions of general intersection, etc., are straightforward.  Note
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   524
the definition of \ttindex{cons}, which underlies the finite set notation.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   525
The axiom of infinity gives us a set that contains~0 and is closed under
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   526
successor (\ttindexbold{succ}).  Although this set is not uniquely defined,
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   527
the theory names it (\ttindexbold{Inf}) in order to simplify the
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   528
construction of the natural numbers.
111
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   529
                                             
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   530
Further definitions appear in Figure~\ref{ZF-defs}.  Ordered pairs are
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   531
defined in the standard way, $\pair{a,b}\equiv\{\{a\},\{a,b\}\}$.  Recall
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   532
that \ttindexbold{Sigma}$(A,B)$ generalizes the Cartesian product of two
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   533
sets.  It is defined to be the union of all singleton sets
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   534
$\{\pair{x,y}\}$, for $x\in A$ and $y\in B(x)$.  This is a typical usage of
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   535
general union.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   536
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   537
The projections involve definite descriptions.  The \ttindex{split}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   538
operation is like the similar operation in Martin-L\"of Type Theory, and is
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   539
often easier to use than \ttindex{fst} and~\ttindex{snd}.  It is defined
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   540
using a description for convenience, but could equivalently be defined by
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   541
\begin{ttbox}
111
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   542
split(c,p) == c(fst(p),snd(p))
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   543
\end{ttbox}  
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   544
Operations on relations include converse, domain, range, and image.  The
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   545
set ${\tt Pi}(A,B)$ generalizes the space of functions between two sets.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   546
Note the simple definitions of $\lambda$-abstraction (using
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   547
\ttindex{RepFun}) and application (using a definite description).  The
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   548
function \ttindex{restrict}$(f,A)$ has the same values as~$f$, but only
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   549
over the domain~$A$.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   550
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   551
No axiom of choice is provided.  It is traditional to include this axiom
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   552
only where it is needed --- mainly in the theory of cardinal numbers, which
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   553
Isabelle does not formalize at present.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   554
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   555
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   556
\section{From basic lemmas to function spaces}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   557
Faced with so many definitions, it is essential to prove lemmas.  Even
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   558
trivial theorems like $A\inter B=B\inter A$ would be difficult to prove
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   559
from the definitions alone.  Isabelle's set theory derives many rules using
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   560
a natural deduction style.  Ideally, a natural deduction rule should
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   561
introduce or eliminate just one operator, but this is not always practical.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   562
For most operators, we may forget its definition and use its derived rules
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   563
instead.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   564
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   565
\subsection{Fundamental lemmas}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   566
Figure~\ref{ZF-lemmas1} presents the derived rules for the most basic
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   567
operators.  The rules for the bounded quantifiers resemble those for the
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   568
ordinary quantifiers, but note that \ttindex{BallE} uses a negated
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   569
assumption in the style of Isabelle's classical module.  The congruence rules
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   570
\ttindex{ball_cong} and \ttindex{bex_cong} are required by Isabelle's
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   571
simplifier, but have few other uses.  Congruence rules must be specially
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   572
derived for all binding operators, and henceforth will not be shown.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   573
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   574
Figure~\ref{ZF-lemmas1} also shows rules for the subset and equality
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   575
relations (proof by extensionality), and rules about the empty set and the
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   576
power set operator.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   577
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   578
Figure~\ref{ZF-lemmas2} presents rules for replacement and separation.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   579
The rules for \ttindex{Replace} and \ttindex{RepFun} are much simpler than
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   580
comparable rules for {\tt PrimReplace} would be.  The principle of
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   581
separation is proved explicitly, although most proofs should use the
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   582
natural deduction rules for \ttindex{Collect}.  The elimination rule
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   583
\ttindex{CollectE} is equivalent to the two destruction rules
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   584
\ttindex{CollectD1} and \ttindex{CollectD2}, but each rule is suited to
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   585
particular circumstances.  Although too many rules can be confusing, there
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   586
is no reason to aim for a minimal set of rules.  See the file
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   587
\ttindexbold{ZF/zf.ML} for a complete listing.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   588
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   589
Figure~\ref{ZF-lemmas3} presents rules for general union and intersection.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   590
The empty intersection should be undefined.  We cannot have
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   591
$\bigcap(\emptyset)=V$ because $V$, the universal class, is not a set.  All
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   592
expressions denote something in {\ZF} set theory; the definition of
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   593
intersection implies $\bigcap(\emptyset)=\emptyset$, but this value is
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   594
arbitrary.  The rule \ttindexbold{InterI} must have a premise to exclude
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   595
the empty intersection.  Some of the laws governing intersections require
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   596
similar premises.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   597
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   598
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   599
%%% upair.ML
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   600
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   601
\begin{figure}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   602
\begin{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   603
\idx{pairing}      a:Upair(b,c) <-> (a=b | a=c)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   604
\idx{UpairI1}      a : Upair(a,b)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   605
\idx{UpairI2}      b : Upair(a,b)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   606
\idx{UpairE}       [| a : Upair(b,c);  a = b ==> P;  a = c ==> P |] ==> P
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   607
\subcaption{Unordered pairs}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   608
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   609
\idx{UnI1}         c : A ==> c : A Un B
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   610
\idx{UnI2}         c : B ==> c : A Un B
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   611
\idx{UnCI}         (~c : B ==> c : A) ==> c : A Un B
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   612
\idx{UnE}          [| c : A Un B;  c:A ==> P;  c:B ==> P |] ==> P
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   613
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   614
\idx{IntI}         [| c : A;  c : B |] ==> c : A Int B
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   615
\idx{IntD1}        c : A Int B ==> c : A
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   616
\idx{IntD2}        c : A Int B ==> c : B
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   617
\idx{IntE}         [| c : A Int B;  [| c:A; c:B |] ==> P |] ==> P
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   618
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   619
\idx{DiffI}        [| c : A;  ~ c : B |] ==> c : A - B
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   620
\idx{DiffD1}       c : A - B ==> c : A
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   621
\idx{DiffD2}       [| c : A - B;  c : B |] ==> P
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   622
\idx{DiffE}        [| c : A - B;  [| c:A; ~ c:B |] ==> P |] ==> P
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   623
\subcaption{Union, intersection, difference}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   624
\end{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   625
\caption{Unordered pairs and their consequences} \label{ZF-upair1}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   626
\end{figure}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   627
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   628
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   629
\begin{figure}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   630
\begin{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   631
\idx{consI1}       a : cons(a,B)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   632
\idx{consI2}       a : B ==> a : cons(b,B)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   633
\idx{consCI}       (~ a:B ==> a=b) ==> a: cons(b,B)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   634
\idx{consE}        [| a : cons(b,A);  a=b ==> P;  a:A ==> P |] ==> P
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   635
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   636
\idx{singletonI}   a : \{a\}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   637
\idx{singletonE}   [| a : \{b\}; a=b ==> P |] ==> P
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   638
\subcaption{Finite and singleton sets}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   639
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   640
\idx{succI1}       i : succ(i)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   641
\idx{succI2}       i : j ==> i : succ(j)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   642
\idx{succCI}       (~ i:j ==> i=j) ==> i: succ(j)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   643
\idx{succE}        [| i : succ(j);  i=j ==> P;  i:j ==> P |] ==> P
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   644
\idx{succ_neq_0}   [| succ(n)=0 |] ==> P
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   645
\idx{succ_inject}  succ(m) = succ(n) ==> m=n
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   646
\subcaption{The successor function}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   647
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   648
\idx{the_equality}     [| P(a);  !!x. P(x) ==> x=a |] ==> (THE x. P(x)) = a
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   649
\idx{theI}             EX! x. P(x) ==> P(THE x. P(x))
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   650
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   651
\idx{if_P}             P ==> if(P,a,b) = a
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   652
\idx{if_not_P}        ~P ==> if(P,a,b) = b
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   653
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   654
\idx{mem_anti_sym}     [| a:b;  b:a |] ==> P
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   655
\idx{mem_anti_refl}    a:a ==> P
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   656
\subcaption{Descriptions; non-circularity}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   657
\end{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   658
\caption{Finite sets and their consequences} \label{ZF-upair2}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   659
\end{figure}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   660
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   661
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   662
\subsection{Unordered pairs and finite sets}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   663
Figure~\ref{ZF-upair1} presents the principle of unordered pairing, along
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   664
with its derived rules.  Binary union and intersection are defined in terms
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   665
of ordered pairs, and set difference is included for completeness.  The
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   666
rule \ttindexbold{UnCI} is useful for classical reasoning about unions,
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   667
like {\tt disjCI}\@; it supersedes \ttindexbold{UnI1} and
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   668
\ttindexbold{UnI2}, but these rules are often easier to work with.  For
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   669
intersection and difference we have both elimination and destruction rules.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   670
Again, there is no reason to provide a minimal rule set.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   671
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   672
Figure~\ref{ZF-upair2} is concerned with finite sets.  It presents rules
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   673
for~\ttindex{cons}, the finite set constructor, and rules for singleton
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   674
sets.  Because the successor function is defined in terms of~{\tt cons},
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   675
its derived rules appear here.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   676
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   677
Definite descriptions (\ttindex{THE}) are defined in terms of the singleton
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   678
set $\{0\}$, but their derived rules fortunately hide this.  The
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   679
rule~\ttindex{theI} can be difficult to apply, because $\Var{P}$ must be
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   680
instantiated correctly.  However, \ttindex{the_equality} does not have this
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   681
problem and the files contain many examples of its use.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   682
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   683
Finally, the impossibility of having both $a\in b$ and $b\in a$
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   684
(\ttindex{mem_anti_sym}) is proved by applying the axiom of foundation to
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   685
the set $\{a,b\}$.  The impossibility of $a\in a$ is a trivial consequence.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   686
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   687
See the file \ttindexbold{ZF/upair.ML} for full details.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   688
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   689
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   690
%%% subset.ML
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   691
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   692
\begin{figure}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   693
\begin{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   694
\idx{Union_upper}       B:A ==> B <= Union(A)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   695
\idx{Union_least}       [| !!x. x:A ==> x<=C |] ==> Union(A) <= C
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   696
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   697
\idx{Inter_lower}       B:A ==> Inter(A) <= B
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   698
\idx{Inter_greatest}    [| a:A;  !!x. x:A ==> C<=x |] ==> C <= Inter(A)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   699
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   700
\idx{Un_upper1}         A <= A Un B
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   701
\idx{Un_upper2}         B <= A Un B
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   702
\idx{Un_least}          [| A<=C;  B<=C |] ==> A Un B <= C
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   703
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   704
\idx{Int_lower1}        A Int B <= A
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   705
\idx{Int_lower2}        A Int B <= B
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   706
\idx{Int_greatest}      [| C<=A;  C<=B |] ==> C <= A Int B
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   707
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   708
\idx{Diff_subset}       A-B <= A
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   709
\idx{Diff_contains}     [| C<=A;  C Int B = 0 |] ==> C <= A-B
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   710
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   711
\idx{Collect_subset}    Collect(A,P) <= A
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   712
\end{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   713
\caption{Subset and lattice properties} \label{ZF-subset}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   714
\end{figure}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   715
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   716
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   717
\subsection{Subset and lattice properties}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   718
Figure~\ref{ZF-subset} shows that the subset relation is a complete
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   719
lattice.  Unions form least upper bounds; non-empty intersections form
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   720
greatest lower bounds.  A few other laws involving subsets are included.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   721
See the file \ttindexbold{ZF/subset.ML}.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   722
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   723
%%% pair.ML
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   724
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   725
\begin{figure}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   726
\begin{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   727
\idx{Pair_inject1}    <a,b> = <c,d> ==> a=c
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   728
\idx{Pair_inject2}    <a,b> = <c,d> ==> b=d
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   729
\idx{Pair_inject}     [| <a,b> = <c,d>;  [| a=c; b=d |] ==> P |] ==> P
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   730
\idx{Pair_neq_0}      <a,b>=0 ==> P
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   731
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   732
\idx{fst}       fst(<a,b>) = a
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   733
\idx{snd}       snd(<a,b>) = b
111
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   734
\idx{split}     split(%x y.c(x,y), <a,b>) = c(a,b)
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   735
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   736
\idx{SigmaI}    [| a:A;  b:B(a) |] ==> <a,b> : Sigma(A,B)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   737
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   738
\idx{SigmaE}    [| c: Sigma(A,B);  
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   739
             !!x y.[| x:A; y:B(x); c=<x,y> |] ==> P |] ==> P
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   740
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   741
\idx{SigmaE2}   [| <a,b> : Sigma(A,B);    
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   742
             [| a:A;  b:B(a) |] ==> P   |] ==> P
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   743
\end{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   744
\caption{Ordered pairs; projections; general sums} \label{ZF-pair}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   745
\end{figure}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   746
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   747
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   748
\subsection{Ordered pairs}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   749
Figure~\ref{ZF-pair} presents the rules governing ordered pairs,
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   750
projections and general sums.  File \ttindexbold{ZF/pair.ML} contains the
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   751
full (and tedious) proof that $\{\{a\},\{a,b\}\}$ functions as an ordered
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   752
pair.  This property is expressed as two destruction rules,
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   753
\ttindexbold{Pair_inject1} and \ttindexbold{Pair_inject2}, and equivalently
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   754
as the elimination rule \ttindexbold{Pair_inject}.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   755
114
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
   756
The rule \ttindexbold{Pair_neq_0} asserts $\pair{a,b}\neq\emptyset$.  This
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
   757
is a property of $\{\{a\},\{a,b\}\}$, and need not hold for other 
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
   758
encoding of ordered pairs.  The non-standard ordered pairs mentioned below
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
   759
satisfy $\pair{\emptyset;\emptyset}=\emptyset$.
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   760
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   761
The natural deduction rules \ttindexbold{SigmaI} and \ttindexbold{SigmaE}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   762
assert that \ttindex{Sigma}$(A,B)$ consists of all pairs of the form
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   763
$\pair{x,y}$, for $x\in A$ and $y\in B(x)$.  The rule \ttindexbold{SigmaE2}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   764
merely states that $\pair{a,b}\in {\tt Sigma}(A,B)$ implies $a\in A$ and
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   765
$b\in B(a)$.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   766
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   767
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   768
%%% domrange.ML
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   769
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   770
\begin{figure}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   771
\begin{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   772
\idx{domainI}        <a,b>: r ==> a : domain(r)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   773
\idx{domainE}        [| a : domain(r);  !!y. <a,y>: r ==> P |] ==> P
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   774
\idx{domain_subset}  domain(Sigma(A,B)) <= A
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   775
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   776
\idx{rangeI}         <a,b>: r ==> b : range(r)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   777
\idx{rangeE}         [| b : range(r);  !!x. <x,b>: r ==> P |] ==> P
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   778
\idx{range_subset}   range(A*B) <= B
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   779
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   780
\idx{fieldI1}        <a,b>: r ==> a : field(r)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   781
\idx{fieldI2}        <a,b>: r ==> b : field(r)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   782
\idx{fieldCI}        (~ <c,a>:r ==> <a,b>: r) ==> a : field(r)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   783
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   784
\idx{fieldE}         [| a : field(r);  
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   785
                  !!x. <a,x>: r ==> P;  
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   786
                  !!x. <x,a>: r ==> P      
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   787
               |] ==> P
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   788
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   789
\idx{field_subset}   field(A*A) <= A
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   790
\subcaption{Domain, range and field of a Relation}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   791
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   792
\idx{imageI}         [| <a,b>: r;  a:A |] ==> b : r``A
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   793
\idx{imageE}         [| b: r``A;  !!x.[| <x,b>: r;  x:A |] ==> P |] ==> P
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   794
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   795
\idx{vimageI}        [| <a,b>: r;  b:B |] ==> a : r-``B
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   796
\idx{vimageE}        [| a: r-``B;  !!x.[| <a,x>: r;  x:B |] ==> P |] ==> P
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   797
\subcaption{Image and inverse image}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   798
\end{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   799
\caption{Relations} \label{ZF-domrange}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   800
\end{figure}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   801
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   802
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   803
\subsection{Relations}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   804
Figure~\ref{ZF-domrange} presents rules involving relations, which are sets
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   805
of ordered pairs.  The converse of a relation~$r$ is the set of all pairs
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   806
$\pair{y,x}$ such that $\pair{x,y}\in r$; if $r$ is a function, then
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   807
{\ttindex{converse}$(r)$} is its inverse.  The rules for the domain
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   808
operation, \ttindex{domainI} and~\ttindex{domainE}, assert that
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   809
\ttindex{domain}$(r)$ consists of every element~$a$ such that $r$ contains
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   810
some pair of the form~$\pair{x,y}$.  The range operation is similar, and
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   811
the field of a relation is merely the union of its domain and range.  Note
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   812
that image and inverse image are generalizations of range and domain,
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   813
respectively.  See the file
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   814
\ttindexbold{ZF/domrange.ML} for derivations of the rules.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   815
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   816
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   817
%%% func.ML
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   818
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   819
\begin{figure}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   820
\begin{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   821
\idx{fun_is_rel}      f: Pi(A,B) ==> f <= Sigma(A,B)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   822
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   823
\idx{apply_equality}  [| <a,b>: f;  f: Pi(A,B) |] ==> f`a = b
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   824
\idx{apply_equality2} [| <a,b>: f;  <a,c>: f;  f: Pi(A,B) |] ==> b=c
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   825
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   826
\idx{apply_type}      [| f: Pi(A,B);  a:A |] ==> f`a : B(a)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   827
\idx{apply_Pair}      [| f: Pi(A,B);  a:A |] ==> <a,f`a>: f
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   828
\idx{apply_iff}       f: Pi(A,B) ==> <a,b>: f <-> a:A & f`a = b
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   829
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   830
\idx{fun_extension}   [| f : Pi(A,B);  g: Pi(A,D);
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   831
                   !!x. x:A ==> f`x = g`x     |] ==> f=g
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   832
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   833
\idx{domain_type}     [| <a,b> : f;  f: Pi(A,B) |] ==> a : A
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   834
\idx{range_type}      [| <a,b> : f;  f: Pi(A,B) |] ==> b : B(a)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   835
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   836
\idx{Pi_type}         [| f: A->C;  !!x. x:A ==> f`x: B(x) |] ==> f: Pi(A,B)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   837
\idx{domain_of_fun}   f: Pi(A,B) ==> domain(f)=A
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   838
\idx{range_of_fun}    f: Pi(A,B) ==> f: A->range(f)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   839
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   840
\idx{restrict}   a : A ==> restrict(f,A) ` a = f`a
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   841
\idx{restrict_type}   [| !!x. x:A ==> f`x: B(x) |] ==> 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   842
                restrict(f,A) : Pi(A,B)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   843
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   844
\idx{lamI}       a:A ==> <a,b(a)> : (lam x:A. b(x))
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   845
\idx{lamE}       [| p: (lam x:A. b(x));  !!x.[| x:A; p=<x,b(x)> |] ==> P 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   846
           |] ==>  P
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   847
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   848
\idx{lam_type}   [| !!x. x:A ==> b(x): B(x) |] ==> (lam x:A.b(x)) : Pi(A,B)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   849
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   850
\idx{beta}       a : A ==> (lam x:A.b(x)) ` a = b(a)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   851
\idx{eta}        f : Pi(A,B) ==> (lam x:A. f`x) = f
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   852
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   853
\idx{lam_theI}   (!!x. x:A ==> EX! y. Q(x,y)) ==> EX h. ALL x:A. Q(x, h`x)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   854
\end{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   855
\caption{Functions and $\lambda$-abstraction} \label{ZF-func1}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   856
\end{figure}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   857
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   858
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   859
\begin{figure}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   860
\begin{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   861
\idx{fun_empty}            0: 0->0
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   862
\idx{fun_single}           \{<a,b>\} : \{a\} -> \{b\}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   863
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   864
\idx{fun_disjoint_Un}      [| f: A->B;  g: C->D;  A Int C = 0  |] ==>  
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   865
                     (f Un g) : (A Un C) -> (B Un D)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   866
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   867
\idx{fun_disjoint_apply1}  [| a:A;  f: A->B;  g: C->D;  A Int C = 0 |] ==>  
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   868
                     (f Un g)`a = f`a
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   869
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   870
\idx{fun_disjoint_apply2}  [| c:C;  f: A->B;  g: C->D;  A Int C = 0 |] ==>  
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   871
                     (f Un g)`c = g`c
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   872
\end{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   873
\caption{Constructing functions from smaller sets} \label{ZF-func2}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   874
\end{figure}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   875
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   876
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   877
\subsection{Functions}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   878
Functions, represented by graphs, are notoriously difficult to reason
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   879
about.  The file \ttindexbold{ZF/func.ML} derives many rules, which overlap
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   880
more than they ought.  One day these rules will be tidied up; this section
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   881
presents only the more important ones.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   882
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   883
Figure~\ref{ZF-func1} presents the basic properties of \ttindex{Pi}$(A,B)$,
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   884
the generalized function space.  For example, if $f$ is a function and
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   885
$\pair{a,b}\in f$, then $f`a=b$ (\ttindex{apply_equality}).  Two functions
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   886
are equal provided they have equal domains and deliver equals results
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   887
(\ttindex{fun_extension}).
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   888
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   889
By \ttindex{Pi_type}, a function typing of the form $f\in A\to C$ can be
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   890
refined to the dependent typing $f\in\prod@{x\in A}B(x)$, given a suitable
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   891
family of sets $\{B(x)\}@{x\in A}$.  Conversely, by \ttindex{range_of_fun},
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   892
any dependent typing can be flattened to yield a function type of the form
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   893
$A\to C$; here, $C={\tt range}(f)$.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   894
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   895
Among the laws for $\lambda$-abstraction, \ttindex{lamI} and \ttindex{lamE}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   896
describe the graph of the generated function, while \ttindex{beta} and
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   897
\ttindex{eta} are the standard conversions.  We essentially have a
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   898
dependently-typed $\lambda$-calculus.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   899
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   900
Figure~\ref{ZF-func2} presents some rules that can be used to construct
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   901
functions explicitly.  We start with functions consisting of at most one
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   902
pair, and may form the union of two functions provided their domains are
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   903
disjoint.  
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   904
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   905
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   906
\begin{figure} 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   907
\begin{center}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   908
\begin{tabular}{rrr} 
111
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   909
  \it name      &\it meta-type  & \it description \\ 
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   910
  \idx{id}      & $i$           & identity function \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   911
  \idx{inj}     & $[i,i]\To i$  & injective function space\\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   912
  \idx{surj}    & $[i,i]\To i$  & surjective function space\\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   913
  \idx{bij}     & $[i,i]\To i$  & bijective function space
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   914
        \\[1ex]
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   915
  \idx{1}       & $i$           & $\{\emptyset\}$       \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   916
  \idx{bool}    & $i$           & the set $\{\emptyset,1\}$     \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   917
  \idx{cond}    & $[i,i,i]\To i$        & conditional for {\tt bool}
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   918
        \\[1ex]
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   919
  \idx{Inl}~~\idx{Inr}  & $i\To i$      & injections\\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   920
  \idx{case}    & $[i\To i,i\To i, i]\To i$      & conditional for $+$
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   921
        \\[1ex]
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   922
  \idx{nat}     & $i$           & set of natural numbers \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   923
  \idx{nat_case}& $[i,i\To i,i]\To i$   & conditional for $nat$\\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   924
  \idx{rec}     & $[i,i,[i,i]\To i]\To i$ & recursor for $nat$
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   925
        \\[1ex]
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   926
  \idx{list}    & $i\To i$      & lists over some set\\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   927
  \idx{list_case} & $[i, [i,i]\To i, i] \To i$  & conditional for $list(A)$ \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   928
  \idx{list_rec} & $[i, i, [i,i,i]\To i] \To i$ & recursor for $list(A)$ \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   929
  \idx{map}     & $[i\To i, i] \To i$   & mapping functional\\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   930
  \idx{length}  & $i\To i$              & length of a list\\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   931
  \idx{rev}     & $i\To i$              & reverse of a list\\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   932
  \idx{flat}    & $i\To i$              & flatting a list of lists\\
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   933
\end{tabular}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   934
\end{center}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   935
\subcaption{Constants}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   936
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   937
\begin{center}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   938
\indexbold{*"+}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   939
\index{#*@{\tt\#*}|bold}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   940
\index{*div|bold}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   941
\index{*mod|bold}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   942
\index{#+@{\tt\#+}|bold}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   943
\index{#-@{\tt\#-}|bold}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   944
\begin{tabular}{rrrr} 
111
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   945
  \idx{O}       & $[i,i]\To i$  &  Right 60     & composition ($\circ$) \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   946
  \tt +         & $[i,i]\To i$  &  Right 65     & disjoint union \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   947
  \tt \#*       & $[i,i]\To i$  &  Left 70      & multiplication \\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   948
  \tt div       & $[i,i]\To i$  &  Left 70      & division\\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   949
  \tt mod       & $[i,i]\To i$  &  Left 70      & modulus\\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   950
  \tt \#+       & $[i,i]\To i$  &  Left 65      & addition\\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   951
  \tt \#-       & $[i,i]\To i$  &  Left 65      & subtraction\\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
   952
  \tt \@        & $[i,i]\To i$  &  Right 60     & append for lists
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   953
\end{tabular}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   954
\end{center}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   955
\subcaption{Infixes}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   956
\caption{Further constants for {\ZF}} \label{ZF-further-constants}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   957
\end{figure} 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   958
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   959
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   960
\begin{figure}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   961
\begin{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   962
\idx{Int_absorb}         A Int A = A
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   963
\idx{Int_commute}        A Int B = B Int A
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   964
\idx{Int_assoc}          (A Int B) Int C  =  A Int (B Int C)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   965
\idx{Int_Un_distrib}     (A Un B) Int C  =  (A Int C) Un (B Int C)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   966
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   967
\idx{Un_absorb}          A Un A = A
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   968
\idx{Un_commute}         A Un B = B Un A
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   969
\idx{Un_assoc}           (A Un B) Un C  =  A Un (B Un C)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   970
\idx{Un_Int_distrib}     (A Int B) Un C  =  (A Un C) Int (B Un C)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   971
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   972
\idx{Diff_cancel}        A-A = 0
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   973
\idx{Diff_disjoint}      A Int (B-A) = 0
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   974
\idx{Diff_partition}     A<=B ==> A Un (B-A) = B
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   975
\idx{double_complement}  [| A<=B; B<= C |] ==> (B - (C-A)) = A
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   976
\idx{Diff_Un}            A - (B Un C) = (A-B) Int (A-C)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   977
\idx{Diff_Int}           A - (B Int C) = (A-B) Un (A-C)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   978
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   979
\idx{Union_Un_distrib}   Union(A Un B) = Union(A) Un Union(B)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   980
\idx{Inter_Un_distrib}   [| a:A;  b:B |] ==> 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   981
                   Inter(A Un B) = Inter(A) Int Inter(B)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   982
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   983
\idx{Int_Union_RepFun}   A Int Union(B) = (UN C:B. A Int C)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   984
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   985
\idx{Un_Inter_RepFun}    b:B ==> 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   986
                   A Un Inter(B) = (INT C:B. A Un C)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   987
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   988
\idx{SUM_Un_distrib1}    (SUM x:A Un B. C(x)) = 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   989
                   (SUM x:A. C(x)) Un (SUM x:B. C(x))
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   990
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   991
\idx{SUM_Un_distrib2}    (SUM x:C. A(x) Un B(x)) =
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   992
                   (SUM x:C. A(x))  Un  (SUM x:C. B(x))
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   993
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   994
\idx{SUM_Int_distrib1}   (SUM x:A Int B. C(x)) =
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   995
                   (SUM x:A. C(x)) Int (SUM x:B. C(x))
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   996
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   997
\idx{SUM_Int_distrib2}   (SUM x:C. A(x) Int B(x)) =
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   998
                   (SUM x:C. A(x)) Int (SUM x:C. B(x))
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   999
\end{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1000
\caption{Equalities} \label{zf-equalities}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1001
\end{figure}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1002
111
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1003
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1004
\begin{figure}
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1005
\begin{ttbox}
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1006
\idx{bnd_mono_def}   bnd_mono(D,h) == 
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1007
                 h(D)<=D & (ALL W X. W<=X --> X<=D --> h(W) <= h(X))
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1008
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1009
\idx{lfp_def}        lfp(D,h) == Inter({X: Pow(D). h(X) <= X})
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1010
\idx{gfp_def}        gfp(D,h) == Union({X: Pow(D). X <= h(X)})
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1011
\subcaption{Definitions}
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1012
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1013
\idx{lfp_lowerbound} [| h(A) <= A;  A<=D |] ==> lfp(D,h) <= A
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1014
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1015
\idx{lfp_subset}     lfp(D,h) <= D
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1016
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1017
\idx{lfp_greatest}   [| bnd_mono(D,h);  
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1018
                  !!X. [| h(X) <= X;  X<=D |] ==> A<=X 
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1019
               |] ==> A <= lfp(D,h)
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1020
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1021
\idx{lfp_Tarski}     bnd_mono(D,h) ==> lfp(D,h) = h(lfp(D,h))
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1022
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1023
\idx{induct}         [| a : lfp(D,h);  bnd_mono(D,h);
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1024
                  !!x. x : h(Collect(lfp(D,h),P)) ==> P(x)
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1025
               |] ==> P(a)
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1026
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1027
\idx{lfp_mono}       [| bnd_mono(D,h);  bnd_mono(E,i);
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1028
                  !!X. X<=D ==> h(X) <= i(X)  
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1029
               |] ==> lfp(D,h) <= lfp(E,i)
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1030
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1031
\idx{gfp_upperbound} [| A <= h(A);  A<=D |] ==> A <= gfp(D,h)
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1032
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1033
\idx{gfp_subset}     gfp(D,h) <= D
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1034
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1035
\idx{gfp_least}      [| bnd_mono(D,h);  
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1036
                  !!X. [| X <= h(X);  X<=D |] ==> X<=A
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1037
               |] ==> gfp(D,h) <= A
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1038
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1039
\idx{gfp_Tarski}     bnd_mono(D,h) ==> gfp(D,h) = h(gfp(D,h))
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1040
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1041
\idx{coinduct}       [| bnd_mono(D,h); a: X; X <= h(X Un gfp(D,h)); X <= D 
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1042
               |] ==> a : gfp(D,h)
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1043
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1044
\idx{gfp_mono}       [| bnd_mono(D,h);  D <= E;
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1045
                  !!X. X<=D ==> h(X) <= i(X)  
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1046
               |] ==> gfp(D,h) <= gfp(E,i)
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1047
\end{ttbox}
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1048
\caption{Least and greatest fixedpoints} \label{zf-fixedpt}
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1049
\end{figure}
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1050
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1051
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1052
\begin{figure}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1053
\begin{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1054
\idx{comp_def}  r O s     == \{xz : domain(s)*range(r) . 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1055
                        EX x y z. xz=<x,z> & <x,y>:s & <y,z>:r\}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1056
\idx{id_def}    id(A)     == (lam x:A. x)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1057
\idx{inj_def}   inj(A,B)  == \{ f: A->B. ALL w:A. ALL x:A. f`w=f`x --> w=x\}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1058
\idx{surj_def}  surj(A,B) == \{ f: A->B . ALL y:B. EX x:A. f`x=y\}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1059
\idx{bij_def}   bij(A,B)  == inj(A,B) Int surj(A,B)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1060
\subcaption{Definitions}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1061
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1062
\idx{left_inverse}     [| f: inj(A,B);  a: A |] ==> converse(f)`(f`a) = a
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1063
\idx{right_inverse}    [| f: inj(A,B);  b: range(f) |] ==> 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1064
                 f`(converse(f)`b) = b
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1065
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1066
\idx{inj_converse_inj} f: inj(A,B) ==> converse(f): inj(range(f), A)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1067
\idx{bij_converse_bij} f: bij(A,B) ==> converse(f): bij(B,A)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1068
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1069
\idx{comp_type}        [| s<=A*B;  r<=B*C |] ==> (r O s) <= A*C
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1070
\idx{comp_assoc}       (r O s) O t = r O (s O t)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1071
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1072
\idx{left_comp_id}     r<=A*B ==> id(B) O r = r
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1073
\idx{right_comp_id}    r<=A*B ==> r O id(A) = r
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1074
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1075
\idx{comp_func}        [| g:A->B; f:B->C |] ==> (f O g):A->C
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1076
\idx{comp_func_apply}  [| g:A->B; f:B->C; a:A |] ==> (f O g)`a = f`(g`a)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1077
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1078
\idx{comp_inj}         [| g:inj(A,B);  f:inj(B,C)  |] ==> (f O g):inj(A,C)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1079
\idx{comp_surj}        [| g:surj(A,B); f:surj(B,C) |] ==> (f O g):surj(A,C)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1080
\idx{comp_bij}         [| g:bij(A,B); f:bij(B,C) |] ==> (f O g):bij(A,C)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1081
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1082
\idx{left_comp_inverse}     f: inj(A,B) ==> converse(f) O f = id(A)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1083
\idx{right_comp_inverse}    f: surj(A,B) ==> f O converse(f) = id(B)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1084
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1085
\idx{bij_disjoint_Un}   
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1086
    [| f: bij(A,B);  g: bij(C,D);  A Int C = 0;  B Int D = 0 |] ==> 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1087
    (f Un g) : bij(A Un C, B Un D)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1088
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1089
\idx{restrict_bij}  [| f:inj(A,B);  C<=A |] ==> restrict(f,C): bij(C, f``C)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1090
\end{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1091
\caption{Permutations} \label{zf-perm}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1092
\end{figure}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1093
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1094
\begin{figure}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1095
\begin{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1096
\idx{one_def}        1    == succ(0)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1097
\idx{bool_def}       bool == {0,1}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1098
\idx{cond_def}       cond(b,c,d) == if(b=1,c,d)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1099
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1100
\idx{sum_def}        A+B == \{0\}*A Un \{1\}*B
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1101
\idx{Inl_def}        Inl(a) == <0,a>
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1102
\idx{Inr_def}        Inr(b) == <1,b>
111
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1103
\idx{case_def}       case(c,d,u) == split(%y z. cond(y, d(z), c(z)), u)
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1104
\subcaption{Definitions}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1105
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1106
\idx{bool_1I}        1 : bool
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1107
\idx{bool_0I}        0 : bool
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1108
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1109
\idx{boolE}          [| c: bool;  P(1);  P(0) |] ==> P(c)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1110
\idx{cond_1}         cond(1,c,d) = c
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1111
\idx{cond_0}         cond(0,c,d) = d
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1112
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1113
\idx{sum_InlI}       a : A ==> Inl(a) : A+B
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1114
\idx{sum_InrI}       b : B ==> Inr(b) : A+B
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1115
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1116
\idx{Inl_inject}     Inl(a)=Inl(b) ==> a=b
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1117
\idx{Inr_inject}     Inr(a)=Inr(b) ==> a=b
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1118
\idx{Inl_neq_Inr}    Inl(a)=Inr(b) ==> P
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1119
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1120
\idx{sumE2}   u: A+B ==> (EX x. x:A & u=Inl(x)) | (EX y. y:B & u=Inr(y))
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1121
111
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1122
\idx{case_Inl}       case(c,d,Inl(a)) = c(a)
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1123
\idx{case_Inr}       case(c,d,Inr(b)) = d(b)
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1124
\end{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1125
\caption{Booleans and disjoint unions} \label{zf-sum}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1126
\end{figure}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1127
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1128
\begin{figure}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1129
\begin{ttbox}
111
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1130
\idx{QPair_def}       <a;b> == a+b
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1131
\idx{qsplit_def}      qsplit(c,p)  == THE y. EX a b. p=<a;b> & y=c(a,b)
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1132
\idx{qfsplit_def}     qfsplit(R,z) == EX x y. z=<x;y> & R(x,y)
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1133
\idx{qconverse_def}   qconverse(r) == {z. w:r, EX x y. w=<x;y> & z=<y;x>}
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1134
\idx{QSigma_def}      QSigma(A,B)  ==  UN x:A. UN y:B(x). {<x;y>}
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1135
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1136
\idx{qsum_def}        A <+> B      == (\{0\} <*> A) Un (\{1\} <*> B)
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1137
\idx{QInl_def}        QInl(a)      == <0;a>
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1138
\idx{QInr_def}        QInr(b)      == <1;b>
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1139
\idx{qcase_def}       qcase(c,d)   == qsplit(%y z. cond(y, d(z), c(z)))
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1140
\end{ttbox}
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1141
\caption{Non-standard pairs, products and sums} \label{zf-qpair}
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1142
\end{figure}
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1143
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1144
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1145
\begin{figure}
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1146
\begin{ttbox}
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1147
\idx{nat_def}       nat == lfp(lam r: Pow(Inf). \{0\} Un \{succ(x). x:r\}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1148
111
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1149
\idx{nat_case_def}  nat_case(a,b,k) == 
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1150
              THE y. k=0 & y=a | (EX x. k=succ(x) & y=b(x))
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1151
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1152
\idx{rec_def}       rec(k,a,b) ==  
111
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1153
              transrec(k, %n f. nat_case(a, %m. b(m, f`m), n))
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1154
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1155
\idx{add_def}       m#+n == rec(m, n, %u v.succ(v))
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1156
\idx{diff_def}      m#-n == rec(n, m, %u v. rec(v, 0, %x y.x))
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1157
\idx{mult_def}      m#*n == rec(m, 0, %u v. n #+ v)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1158
\idx{mod_def}       m mod n == transrec(m, %j f. if(j:n, j, f`(j#-n)))
111
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1159
\idx{div_def}       m div n == transrec(m, %j f. if(j:n, 0, succ(f`(j#-n))))
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1160
\subcaption{Definitions}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1161
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1162
\idx{nat_0I}        0 : nat
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1163
\idx{nat_succI}     n : nat ==> succ(n) : nat
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1164
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1165
\idx{nat_induct}        
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1166
    [| n: nat;  P(0);  !!x. [| x: nat;  P(x) |] ==> P(succ(x)) 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1167
    |] ==> P(n)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1168
111
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1169
\idx{nat_case_0}    nat_case(a,b,0) = a
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1170
\idx{nat_case_succ} nat_case(a,b,succ(m)) = b(m)
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1171
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1172
\idx{rec_0}         rec(0,a,b) = a
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1173
\idx{rec_succ}      rec(succ(m),a,b) = b(m, rec(m,a,b))
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1174
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1175
\idx{mult_type}     [| m:nat;  n:nat |] ==> m #* n : nat
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1176
\idx{mult_0}        0 #* n = 0
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1177
\idx{mult_succ}     succ(m) #* n = n #+ (m #* n)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1178
\idx{mult_commute}  [| m:nat;  n:nat |] ==> m #* n = n #* m
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1179
\idx{add_mult_dist}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1180
    [| m:nat;  k:nat |] ==> (m #+ n) #* k = (m #* k) #+ (n #* k)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1181
\idx{mult_assoc}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1182
    [| m:nat;  n:nat;  k:nat |] ==> (m #* n) #* k = m #* (n #* k)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1183
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1184
\idx{mod_quo_equality}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1185
    [| 0:n;  m:nat;  n:nat |] ==> (m div n)#*n #+ m mod n = m
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1186
\end{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1187
\caption{The natural numbers} \label{zf-nat}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1188
\end{figure}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1189
111
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1190
\begin{figure}
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1191
\begin{ttbox}
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1192
\idx{Fin_0I}          0 : Fin(A)
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1193
\idx{Fin_consI}       [| a: A;  b: Fin(A) |] ==> cons(a,b) : Fin(A)
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1194
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1195
\idx{Fin_induct}
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1196
    [| b: Fin(A);
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1197
       P(0);
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1198
       !!x y. [| x: A;  y: Fin(A);  x~:y;  P(y) |] ==> P(cons(x,y))
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1199
    |] ==> P(b)
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1200
114
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1201
\idx{Fin_mono}        A<=B ==> Fin(A) <= Fin(B)
111
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1202
\idx{Fin_UnI}         [| b: Fin(A);  c: Fin(A) |] ==> b Un c : Fin(A)
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1203
\idx{Fin_UnionI}      C : Fin(Fin(A)) ==> Union(C) : Fin(A)
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1204
\idx{Fin_subset}      [| c<=b;  b: Fin(A) |] ==> c: Fin(A)
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1205
\end{ttbox}
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1206
\caption{The finite set operator} \label{zf-fin}
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1207
\end{figure}
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1208
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1209
\begin{figure}\underscoreon %%because @ is used here
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1210
\begin{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1211
\idx{list_rec_def}    list_rec(l,c,h) == 
111
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1212
                Vrec(l, %l g.list_case(c, %x xs. h(x, xs, g`xs), l))
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1213
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1214
\idx{map_def}         map(f,l)  == list_rec(l,  0,  %x xs r. <f(x), r>)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1215
\idx{length_def}      length(l) == list_rec(l,  0,  %x xs r. succ(r))
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1216
\idx{app_def}         xs@ys     == list_rec(xs, ys, %x xs r. <x,r>)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1217
\idx{rev_def}         rev(l)    == list_rec(l,  0,  %x xs r. r @ <x,0>)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1218
\idx{flat_def}        flat(ls)  == list_rec(ls, 0,  %l ls r. l @ r)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1219
\subcaption{Definitions}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1220
111
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1221
\idx{NilI}            Nil : list(A)
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1222
\idx{ConsI}           [| a: A;  l: list(A) |] ==> Cons(a,l) : list(A)
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1223
111
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1224
\idx{List.induct}
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1225
    [| l: list(A);
111
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1226
       P(Nil);
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1227
       !!x y. [| x: A;  y: list(A);  P(y) |] ==> P(Cons(x,y))
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1228
    |] ==> P(l)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1229
111
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1230
\idx{Cons_iff}        Cons(a,l)=Cons(a',l') <-> a=a' & l=l'
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1231
\idx{Nil_Cons_iff}    ~ Nil=Cons(a,l)
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1232
111
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1233
\idx{list_mono}       A<=B ==> list(A) <= list(B)
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1234
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1235
\idx{list_rec_Nil}    list_rec(Nil,c,h) = c
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1236
\idx{list_rec_Cons}   list_rec(Cons(a,l), c, h) = h(a, l, list_rec(l,c,h))
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1237
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1238
\idx{map_ident}       l: list(A) ==> map(%u.u, l) = l
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1239
\idx{map_compose}     l: list(A) ==> map(h, map(j,l)) = map(%u.h(j(u)), l)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1240
\idx{map_app_distrib} xs: list(A) ==> map(h, xs@ys) = map(h,xs) @ map(h,ys)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1241
\idx{map_type}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1242
    [| l: list(A);  !!x. x: A ==> h(x): B |] ==> map(h,l) : list(B)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1243
\idx{map_flat}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1244
    ls: list(list(A)) ==> map(h, flat(ls)) = flat(map(map(h),ls))
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1245
\end{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1246
\caption{Lists} \label{zf-list}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1247
\end{figure}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1248
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1249
\section{Further developments}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1250
The next group of developments is complex and extensive, and only
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1251
highlights can be covered here.  Figure~\ref{ZF-further-constants} lists
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1252
some of the further constants and infixes that are declared in the various
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1253
theory extensions.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1254
114
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1255
Figure~\ref{zf-equalities} presents commutative, associative, distributive,
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1256
and idempotency laws of union and intersection, along with other equations.
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1257
See file \ttindexbold{ZF/equalities.ML}.
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1258
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1259
Figure~\ref{zf-sum} defines $\{0,1\}$ as a set of booleans, with a
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1260
conditional operator.  It also defines the disjoint union of two sets, with
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1261
injections and a case analysis operator.  See files
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1262
\ttindexbold{ZF/bool.ML} and \ttindexbold{ZF/sum.ML}.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1263
111
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1264
Figure~\ref{zf-qpair} defines a notion of ordered pair that admits
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1265
non-well-founded tupling.  Such pairs are written {\tt<$a$;$b$>}.  It also
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1266
defines the eliminator \ttindexbold{qsplit}, the converse operator
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1267
\ttindexbold{qconverse}, and the summation operator \ttindexbold{QSigma}.
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1268
These are completely analogous to the corresponding versions for standard
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1269
ordered pairs.  The theory goes on to define a non-standard notion of
114
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1270
disjoint sum using non-standard pairs.  This will support co-inductive
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1271
definitions, for example of infinite lists.  See file \ttindexbold{qpair.thy}.
111
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1272
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1273
Monotonicity properties of most of the set-forming operations are proved.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1274
These are useful for applying the Knaster-Tarski Fixedpoint Theorem.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1275
See file \ttindexbold{ZF/mono.ML}.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1276
111
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1277
Figure~\ref{zf-fixedpt} presents the Knaster-Tarski Fixedpoint Theorem, proved
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1278
for the lattice of subsets of a set.  The theory defines least and greatest
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1279
fixedpoint operators with corresponding induction and co-induction rules.
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1280
Later definitions use these, such as the natural numbers and
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1281
the transitive closure operator.  The (co-)inductive definition
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1282
package also uses them.    See file \ttindexbold{ZF/fixedpt.ML}.
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1283
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1284
Figure~\ref{zf-perm} defines composition and injective, surjective and
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1285
bijective function spaces, with proofs of many of their properties.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1286
See file \ttindexbold{ZF/perm.ML}.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1287
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1288
Figure~\ref{zf-nat} presents the natural numbers, with induction and a
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1289
primitive recursion operator.  See file \ttindexbold{ZF/nat.ML}.  File
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1290
\ttindexbold{ZF/arith.ML} develops arithmetic on the natural numbers.  It
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1291
defines addition, multiplication, subtraction, division, and remainder,
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1292
proving the theorem $a \bmod b + (a/b)\times b = a$.  Division and
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1293
remainder are defined by repeated subtraction, which requires well-founded
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1294
rather than primitive recursion.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1295
111
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1296
The file \ttindexbold{ZF/univ.ML} defines a ``universe'' ${\tt univ}(A)$,
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1297
for constructing datatypes such as trees.  This set contains $A$ and the
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1298
natural numbers.  Vitally, it is closed under finite products: ${\tt
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1299
  univ}(A)\times{\tt univ}(A)\subseteq{\tt univ}(A)$.  This file also
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1300
defines set theory's cumulative hierarchy, traditionally written $V@\alpha$
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1301
where $\alpha$ is any ordinal.
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1302
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1303
The file \ttindexbold{ZF/quniv.ML} defines a ``universe'' ${\tt quniv}(A)$,
114
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1304
for constructing co-datatypes such as streams.  It is analogous to ${\tt
111
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1305
  univ}(A)$ but is closed under the non-standard product and sum.
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1306
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1307
Figure~\ref{zf-fin} presents the finite set operator; ${\tt Fin}(A)$ is the
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1308
set of all finite sets over~$A$.  The definition employs Isabelle's
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1309
inductive definition package, which proves the introduction rules
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1310
automatically.  The induction rule shown is stronger than the one proved by
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1311
the package.  See file \ttindexbold{ZF/fin.ML}.
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1312
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1313
Figure~\ref{zf-list} presents the set of lists over~$A$, ${\tt list}(A)$.
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1314
The definition employs Isabelle's datatype package, which defines the
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1315
introduction and induction rules automatically, as well as the constructors
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1316
and case operator (\verb|list_case|).  See file \ttindexbold{ZF/list.ML}.
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1317
The file \ttindexbold{ZF/listfn.thy} proceeds to define structural
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1318
recursion and the usual list functions.
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1319
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1320
The constructions of the natural numbers and lists make use of a suite of
111
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1321
operators for handling recursive function definitions.  The developments are
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1322
summarized below:
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1323
\begin{description}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1324
\item[\ttindexbold{ZF/trancl.ML}]
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1325
defines the transitive closure of a relation (as a least fixedpoint).
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1326
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1327
\item[\ttindexbold{ZF/wf.ML}]
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1328
proves the Well-Founded Recursion Theorem, using an elegant
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1329
approach of Tobias Nipkow.  This theorem permits general recursive
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1330
definitions within set theory.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1331
111
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1332
\item[\ttindexbold{ZF/ord.ML}] defines the notions of transitive set and
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1333
  ordinal number.  It derives transfinite induction.  A key definition is
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1334
  {\bf less than}: $i<j$ if and only if $i$ and $j$ are both ordinals and
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1335
  $i\in j$.  As a special case, it includes less than on the natural
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1336
  numbers.
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1337
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1338
\item[\ttindexbold{ZF/epsilon.ML}]
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1339
derives $\epsilon$-induction and $\epsilon$-recursion, which are
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1340
generalizations of transfinite induction.  It also defines
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1341
\ttindexbold{rank}$(x)$, which is the least ordinal $\alpha$ such that $x$
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1342
is constructed at stage $\alpha$ of the cumulative hierarchy (thus $x\in
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1343
V@{\alpha+1}$).
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1344
\end{description}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1345
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1346
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1347
\begin{figure}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1348
\begin{eqnarray*}
111
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1349
  a\in \emptyset        & \bimp &  \bot\\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1350
  a \in A \union B      & \bimp &  a\in A \disj a\in B\\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1351
  a \in A \inter B      & \bimp &  a\in A \conj a\in B\\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1352
  a \in A-B             & \bimp &  a\in A \conj \neg (a\in B)\\
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1353
  a \in {\tt cons}(b,B) & \bimp &  a=b \disj a\in B\\
111
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1354
  i \in {\tt succ}(j)   & \bimp &  i=j \disj i\in j\\
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1355
  \pair{a,b}\in {\tt Sigma}(A,B)
111
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1356
                        & \bimp &  a\in A \conj b\in B(a)\\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1357
  a \in {\tt Collect}(A,P)      & \bimp &  a\in A \conj P(a)\\
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1358
  (\forall x \in A. \top)       & \bimp &  \top
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1359
\end{eqnarray*}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1360
\caption{Rewrite rules for set theory} \label{ZF-simpdata}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1361
\end{figure}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1362
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1363
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1364
\section{Simplification rules}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1365
{\ZF} does not merely inherit simplification from \FOL, but instantiates
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1366
the rewriting package new.  File \ttindexbold{ZF/simpdata.ML} contains the
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1367
details; here is a summary of the key differences:
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1368
\begin{itemize}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1369
\item 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1370
\ttindexbold{mk_rew_rules} is given as a function that can
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1371
strip bounded universal quantifiers from a formula.  For example, $\forall
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1372
x\in A.f(x)=g(x)$ yields the conditional rewrite rule $x\in A \Imp
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1373
f(x)=g(x)$.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1374
\item
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1375
\ttindexbold{ZF_ss} contains congruence rules for all the operators of
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1376
{\ZF}, including the binding operators.  It contains all the conversion
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1377
rules, such as \ttindex{fst} and \ttindex{snd}, as well as the
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1378
rewrites shown in Figure~\ref{ZF-simpdata}.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1379
\item
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1380
\ttindexbold{FOL_ss} is redeclared with the same {\FOL} rules as the
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1381
previous version, so that it may still be used.  
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1382
\end{itemize}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1383
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1384
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1385
\section{The examples directory}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1386
This directory contains further developments in {\ZF} set theory.  Here is
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1387
an overview; see the files themselves for more details.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1388
\begin{description}
111
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1389
\item[\ttindexbold{ZF/ex/misc.ML}] contains miscellaneous examples such as
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1390
  Cantor's Theorem, the Schr\"oder-Bernstein Theorem.  and the
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1391
  ``Composition of homomorphisms'' challenge~\cite{boyer86}.
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1392
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1393
\item[\ttindexbold{ZF/ex/ramsey.ML}]
114
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1394
proves the finite exponent 2 version of Ramsey's Theorem, following Basin
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1395
and Kaufmann's presentation~\cite{basin91}.
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1396
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1397
\item[\ttindexbold{ZF/ex/equiv.ML}]
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1398
develops a ZF theory of equivalence classes, not using the Axiom of Choice.
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1399
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1400
\item[\ttindexbold{ZF/ex/integ.ML}]
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1401
develops a theory of the integers as equivalence classes of pairs of
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1402
natural numbers.
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1403
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1404
\item[\ttindexbold{ZF/ex/bin.ML}]
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1405
defines a datatype for two's complement binary integers.  File
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1406
\ttindexbold{ZF/ex/binfn.ML} then develops rewrite rules for binary
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1407
arithmetic.  For instance, $1359\times {-}2468 = {-}3354012$ takes under
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1408
14 seconds.
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1409
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1410
\item[\ttindexbold{ZF/ex/bt.ML}]
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1411
defines the recursive data structure ${\tt bt}(A)$, labelled binary trees.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1412
114
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1413
\item[\ttindexbold{ZF/ex/term.ML}] 
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1414
  and \ttindexbold{ZF/ex/termfn.ML} define a recursive data structure for
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1415
  terms and term lists.  These are simply finite branching trees.
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1416
111
1b3cddf41b2d Various updates for Isabelle-93
lcp
parents: 104
diff changeset
  1417
\item[\ttindexbold{ZF/ex/tf.ML}]
114
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1418
  and \ttindexbold{ZF/ex/tf_fn.ML} define primitives for solving mutually
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1419
  recursive equations over sets.  It constructs sets of trees and forests
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1420
  as an example, including induction and recursion rules that handle the
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1421
  mutual recursion.
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1422
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1423
\item[\ttindexbold{ZF/ex/prop.ML}]
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1424
  and \ttindexbold{ZF/ex/proplog.ML} proves soundness and completeness of
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1425
  propositional logic.  This illustrates datatype definitions, inductive
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1426
  definitions, structural induction and rule induction.
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1427
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1428
\item[\ttindexbold{ZF/ex/listn.ML}]
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1429
presents the inductive definition of the lists of $n$ elements~\cite{paulin92}.
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1430
114
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1431
\item[\ttindexbold{ZF/ex/acc.ML}]
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1432
presents the inductive definition of the accessible part of a
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1433
relation~\cite{paulin92}. 
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1434
114
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1435
\item[\ttindexbold{ZF/ex/comb.ML}]
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1436
  presents the datatype definition of combinators.  File
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1437
  \ttindexbold{ZF/ex/contract0.ML} defines contraction, while file
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1438
  \ttindexbold{ZF/ex/parcontract.ML} defines parallel contraction and
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1439
  proves the Church-Rosser Theorem.  This case study follows Camilleri and
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1440
  Melham~\cite{camilleri92}. 
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1441
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1442
\item[\ttindexbold{ZF/ex/llist.ML}]
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1443
  and \ttindexbold{ZF/ex/llist_eq.ML} develop lazy lists in ZF and a notion
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1444
  of co-induction for proving equations between them.
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1445
\end{description}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1446
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1447
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1448
\section{A proof about powersets}
114
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1449
To demonstrate high-level reasoning about subsets, let us prove the
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1450
equation ${{\tt Pow}(A)\cap {\tt Pow}(B)}= {\tt Pow}(A\cap B)$.  Compared
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1451
with first-order logic, set theory involves a maze of rules, and theorems
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1452
have many different proofs.  Attempting other proofs of the theorem might
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1453
be instructive.  This proof exploits the lattice properties of
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1454
intersection.  It also uses the monotonicity of the powerset operation,
96c627d2815e Misc updates
lcp
parents: 111
diff changeset
  1455
from {\tt ZF/mono.ML}:
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1456
\begin{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1457
\idx{Pow_mono}      A<=B ==> Pow(A) <= Pow(B)
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1458
\end{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1459
We enter the goal and make the first step, which breaks the equation into
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1460
two inclusions by extensionality:\index{equalityI}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1461
\begin{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1462
goal ZF.thy "Pow(A Int B) = Pow(A) Int Pow(B)";
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1463
{\out Level 0}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1464
{\out Pow(A Int B) = Pow(A) Int Pow(B)}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1465
{\out  1. Pow(A Int B) = Pow(A) Int Pow(B)}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1466
by (resolve_tac [equalityI] 1);
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1467
{\out Level 1}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1468
{\out Pow(A Int B) = Pow(A) Int Pow(B)}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1469
{\out  1. Pow(A Int B) <= Pow(A) Int Pow(B)}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1470
{\out  2. Pow(A) Int Pow(B) <= Pow(A Int B)}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1471
\end{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1472
Both inclusions could be tackled straightforwardly using {\tt subsetI}.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1473
A shorter proof results from noting that intersection forms the greatest
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1474
lower bound:\index{*Int_greatest}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1475
\begin{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1476
by (resolve_tac [Int_greatest] 1);
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1477
{\out Level 2}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1478
{\out Pow(A Int B) = Pow(A) Int Pow(B)}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1479
{\out  1. Pow(A Int B) <= Pow(A)}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1480
{\out  2. Pow(A Int B) <= Pow(B)}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1481
{\out  3. Pow(A) Int Pow(B) <= Pow(A Int B)}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1482
\end{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1483
Subgoal~1 follows by applying the monotonicity of {\tt Pow} to $A\inter
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1484
B\subseteq A$; subgoal~2 follows similarly:
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1485
\index{*Int_lower1}\index{*Int_lower2}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1486
\begin{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1487
by (resolve_tac [Int_lower1 RS Pow_mono] 1);
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1488
{\out Level 3}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1489
{\out Pow(A Int B) = Pow(A) Int Pow(B)}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1490
{\out  1. Pow(A Int B) <= Pow(B)}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1491
{\out  2. Pow(A) Int Pow(B) <= Pow(A Int B)}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1492
by (resolve_tac [Int_lower2 RS Pow_mono] 1);
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1493
{\out Level 4}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1494
{\out Pow(A Int B) = Pow(A) Int Pow(B)}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1495
{\out  1. Pow(A) Int Pow(B) <= Pow(A Int B)}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1496
\end{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1497
We are left with the opposite inclusion, which we tackle in the
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1498
straightforward way:\index{*subsetI}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1499
\begin{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1500
by (resolve_tac [subsetI] 1);
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1501
{\out Level 5}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1502
{\out Pow(A Int B) = Pow(A) Int Pow(B)}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1503
{\out  1. !!x. x : Pow(A) Int Pow(B) ==> x : Pow(A Int B)}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1504
\end{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1505
The subgoal is to show $x\in {\tt Pow}(A\cap B)$ assuming $x\in{\tt
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1506
Pow}(A)\cap {\tt Pow}(B)$.  Eliminating this assumption produces two
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1507
subgoals, since intersection is like conjunction.\index{*IntE}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1508
\begin{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1509
by (eresolve_tac [IntE] 1);
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1510
{\out Level 6}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1511
{\out Pow(A Int B) = Pow(A) Int Pow(B)}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1512
{\out  1. !!x. [| x : Pow(A); x : Pow(B) |] ==> x : Pow(A Int B)}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1513
\end{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1514
The next step replaces the {\tt Pow} by the subset
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1515
relation~($\subseteq$).\index{*PowI}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1516
\begin{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1517
by (resolve_tac [PowI] 1);
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1518
{\out Level 7}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1519
{\out Pow(A Int B) = Pow(A) Int Pow(B)}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1520
{\out  1. !!x. [| x : Pow(A); x : Pow(B) |] ==> x <= A Int B}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1521
\end{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1522
We perform the same replacement in the assumptions:\index{*PowD}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1523
\begin{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1524
by (REPEAT (dresolve_tac [PowD] 1));
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1525
{\out Level 8}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1526
{\out Pow(A Int B) = Pow(A) Int Pow(B)}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1527
{\out  1. !!x. [| x <= A; x <= B |] ==> x <= A Int B}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1528
\end{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1529
Here, $x$ is a lower bound of $A$ and~$B$, but $A\inter B$ is the greatest
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1530
lower bound:\index{*Int_greatest}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1531
\begin{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1532
by (resolve_tac [Int_greatest] 1);
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1533
{\out Level 9}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1534
{\out Pow(A Int B) = Pow(A) Int Pow(B)}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1535
{\out  1. !!x. [| x <= A; x <= B |] ==> x <= A}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1536
{\out  2. !!x. [| x <= A; x <= B |] ==> x <= B}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1537
by (REPEAT (assume_tac 1));
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1538
{\out Level 10}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1539
{\out Pow(A Int B) = Pow(A) Int Pow(B)}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1540
{\out No subgoals!}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1541
\end{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1542
We could have performed this proof in one step by applying
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1543
\ttindex{fast_tac} with the classical rule set \ttindex{ZF_cs}.  But we
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1544
must add \ttindex{equalityI} as an introduction rule, since extensionality
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1545
is not used by default:
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1546
\begin{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1547
choplev 0;
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1548
{\out Level 0}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1549
{\out Pow(A Int B) = Pow(A) Int Pow(B)}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
  1550
{\out  1. Pow(A Int B) = Pow(A) Int Pow(B)}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset