Pearl/Paper.thy
changeset 1776 0c958e385691
parent 1774 c34347ec7ab3
child 1779 4c2e424cb858
equal deleted inserted replaced
1775:86122d793f32 1776:0c958e385691
    66   atoms and sorts are used in the original formulation of the nominal logic work.
    66   atoms and sorts are used in the original formulation of the nominal logic work.
    67   Therefore it was decided in earlier versions of Nominal Isabelle to use a
    67   Therefore it was decided in earlier versions of Nominal Isabelle to use a
    68   separate type for each sort of atoms and let the type system enforce the
    68   separate type for each sort of atoms and let the type system enforce the
    69   sort-respecting property of permutations. Inspired by the work on nominal
    69   sort-respecting property of permutations. Inspired by the work on nominal
    70   unification \cite{UrbanPittsGabbay04}, it seemed best at the time to also
    70   unification \cite{UrbanPittsGabbay04}, it seemed best at the time to also
    71   implement permutations concretely as list of pairs of atoms. Thus Nominal
    71   implement permutations concretely as lists of pairs of atoms. Thus Nominal
    72   Isabelle used the two-place permutation operation with the generic type
    72   Isabelle used the two-place permutation operation with the generic type
    73 
    73 
    74   @{text [display,indent=10] "_ \<bullet> _  ::  (\<alpha> \<times> \<alpha>) list \<Rightarrow> \<beta> \<Rightarrow> \<beta>"}
    74   @{text [display,indent=10] "_ \<bullet> _  ::  (\<alpha> \<times> \<alpha>) list \<Rightarrow> \<beta> \<Rightarrow> \<beta>"}
    75 
    75 
    76   \noindent 
    76   \noindent 
    79   the permutation operation is defined over the length of lists as follows
    79   the permutation operation is defined over the length of lists as follows
    80 
    80 
    81   \begin{isabelle}\ \ \ \ \ \ \ \ \ \ %%%
    81   \begin{isabelle}\ \ \ \ \ \ \ \ \ \ %%%
    82   \begin{tabular}{@ {}r@ {\hspace{2mm}}c@ {\hspace{2mm}}l}
    82   \begin{tabular}{@ {}r@ {\hspace{2mm}}c@ {\hspace{2mm}}l}
    83   @{text "[] \<bullet> c"} & @{text "="} & @{text c}\\
    83   @{text "[] \<bullet> c"} & @{text "="} & @{text c}\\
       
    84   \end{tabular}\hspace{12mm}
       
    85   \begin{tabular}{@ {}r@ {\hspace{2mm}}c@ {\hspace{2mm}}l}
    84   @{text "(a b)::\<pi> \<bullet> c"} & @{text "="} & 
    86   @{text "(a b)::\<pi> \<bullet> c"} & @{text "="} & 
    85      $\begin{cases} @{text a} & \textrm{if}~@{text "\<pi> \<bullet> c = b"}\\ 
    87      $\begin{cases} @{text a} & \textrm{if}~@{text "\<pi> \<bullet> c = b"}\\ 
    86                     @{text b} & \textrm{if}~@{text "\<pi> \<bullet> c = a"}\\
    88                     @{text b} & \textrm{if}~@{text "\<pi> \<bullet> c = a"}\\
    87                     @{text "\<pi> \<bullet> c"} & \textrm{otherwise}\end{cases}$
    89                     @{text "\<pi> \<bullet> c"} & \textrm{otherwise}\end{cases}$
    88   \end{tabular}\hfill\numbered{atomperm}
    90   \end{tabular}\hfill\numbered{atomperm}
   130 
   132 
   131   The major problem with Isabelle/HOL's type classes, however, is that they
   133   The major problem with Isabelle/HOL's type classes, however, is that they
   132   support operations with only a single type parameter and the permutation
   134   support operations with only a single type parameter and the permutation
   133   operations @{text "_ \<bullet> _"} used above in the permutation properties
   135   operations @{text "_ \<bullet> _"} used above in the permutation properties
   134   contain two! To work around this obstacle, Nominal Isabelle 
   136   contain two! To work around this obstacle, Nominal Isabelle 
   135   required from the user to
   137   required the user to
   136   declare up-front the collection of \emph{all} atom types, say @{text
   138   declare up-front the collection of \emph{all} atom types, say @{text
   137   "\<alpha>\<^isub>1,\<dots>,\<alpha>\<^isub>n"}. From this collection it used custom ML-code to
   139   "\<alpha>\<^isub>1,\<dots>,\<alpha>\<^isub>n"}. From this collection it used custom ML-code to
   138   generate @{text n} type classes corresponding to the permutation properties,
   140   generate @{text n} type classes corresponding to the permutation properties,
   139   whereby in these type classes the permutation operation is restricted to
   141   whereby in these type classes the permutation operation is restricted to
   140 
   142 
   142 
   144 
   143   \noindent
   145   \noindent
   144   This operation has only a single type parameter @{text "\<beta>"} (the @{text "\<alpha>\<^isub>i"} are the
   146   This operation has only a single type parameter @{text "\<beta>"} (the @{text "\<alpha>\<^isub>i"} are the
   145   atom types given by the user). 
   147   atom types given by the user). 
   146 
   148 
   147   While the representation of permutations-as-list solved the
   149   While the representation of permutations-as-lists solved the
   148   ``sort-respecting'' requirement and the declaration of all atom types
   150   ``sort-respecting'' requirement and the declaration of all atom types
   149   up-front solved the problem with Isabelle/HOL's type classes, this setup
   151   up-front solved the problem with Isabelle/HOL's type classes, this setup
   150   caused several problems for formalising the nominal logic work: First,
   152   caused several problems for formalising the nominal logic work: First,
   151   Nominal Isabelle had to generate @{text "n\<^sup>2"} definitions for the
   153   Nominal Isabelle had to generate @{text "n\<^sup>2"} definitions for the
   152   permutation operation over @{text "n"} types of atoms.  Second, whenever we
   154   permutation operation over @{text "n"} types of atoms.  Second, whenever we
   212   with the large amounts of custom ML-code for generating multiple variants
   214   with the large amounts of custom ML-code for generating multiple variants
   213   for some basic definitions. The result is that we can implement a pleasingly
   215   for some basic definitions. The result is that we can implement a pleasingly
   214   simple formalisation of the nominal logic work.\smallskip
   216   simple formalisation of the nominal logic work.\smallskip
   215 
   217 
   216   \noindent
   218   \noindent
   217   {\bf Contributions of the paper:} We use a single atom type for representing
   219   {\bf Contributions of the paper:} Our use of a single atom type for representing
   218   atoms of different sorts and use functions for representing
   220   atoms of different sorts and of functions for representing
   219   permutations. This drastically reduces the number of type classes to just
   221   permutations drastically reduces the number of type classes to just
   220   two (permutation types and finitely supported types), which we need in order
   222   two (permutation types and finitely supported types) that we need in order
   221   reason abstractly about properties from the nominal logic work. The novel
   223   reason abstractly about properties from the nominal logic work. The novel
   222   technical contribution of this paper is a mechanism for dealing with
   224   technical contribution of this paper is a mechanism for dealing with
   223   ``Church-style'' lambda-terms \cite{Church40} and HOL-based languages
   225   ``Church-style'' lambda-terms \cite{Church40} and HOL-based languages
   224   \cite{PittsHOL4} where variables and variable binding depend on type
   226   \cite{PittsHOL4} where variables and variable binding depend on type
   225   annotations.
   227   annotations.
   240 
   242 
   241 text {*
   243 text {*
   242   \noindent
   244   \noindent
   243   whereby the string argument specifies the sort of the atom.  (We use type
   245   whereby the string argument specifies the sort of the atom.  (We use type
   244   \emph{string} merely for convenience; any countably infinite type would work
   246   \emph{string} merely for convenience; any countably infinite type would work
   245   as well.)  We have an auxiliary function @{text sort} that is defined as @{thm
   247   as well.)  A similar design choice was made by Gunter et al \cite{GunterOsbornPopescu09} 
       
   248   for their variables. 
       
   249   We have an auxiliary function @{text sort} that is defined as @{thm
   246   sort_of.simps[no_vars]}, and we clearly have for every finite set @{text X} of
   250   sort_of.simps[no_vars]}, and we clearly have for every finite set @{text X} of
   247   atoms and every sort @{text s} the property:
   251   atoms and every sort @{text s} the property:
   248   
   252   
   249   \begin{proposition}\label{choosefresh}
   253   \begin{proposition}\label{choosefresh}
   250   @{text "If finite X then there exists an atom a such that
   254   @{text "If finite X then there exists an atom a such that
   273   written  \mbox{@{text "_ \<circ> _"}}, and function inversion, given by Isabelle/HOL's 
   277   written  \mbox{@{text "_ \<circ> _"}}, and function inversion, given by Isabelle/HOL's 
   274   inverse operator and written \mbox{@{text "inv _"}}, preserve the properties 
   278   inverse operator and written \mbox{@{text "inv _"}}, preserve the properties 
   275   @{text "i"}-@{text "iii"}. 
   279   @{text "i"}-@{text "iii"}. 
   276 
   280 
   277   However, a moment of thought is needed about how to construct non-trivial
   281   However, a moment of thought is needed about how to construct non-trivial
   278   permutations? In the nominal logic work it turned out to be most convenient
   282   permutations. In the nominal logic work it turned out to be most convenient
   279   to work with swappings, written @{text "(a b)"}.  In our setting the
   283   to work with swappings, written @{text "(a b)"}.  In our setting the
   280   type of swappings must be
   284   type of swappings must be
   281 
   285 
   282   @{text [display,indent=10] "(_ _) :: atom \<Rightarrow> atom \<Rightarrow> perm"}
   286   @{text [display,indent=10] "(_ _) :: atom \<Rightarrow> atom \<Rightarrow> perm"}
   283 
   287 
   433   \noindent
   437   \noindent
   434   and then establish:
   438   and then establish:
   435 
   439 
   436   \begin{theorem}
   440   \begin{theorem}
   437   If @{text \<beta>}, @{text "\<beta>\<^isub>1"} and @{text "\<beta>\<^isub>2"} are permutation types, 
   441   If @{text \<beta>}, @{text "\<beta>\<^isub>1"} and @{text "\<beta>\<^isub>2"} are permutation types, 
   438   then so are: @{text "atom"}, @{text "\<beta>\<^isub>1 \<Rightarrow> \<beta>\<^isub>2"}, 
   442   then so are @{text "atom"}, @{text "\<beta>\<^isub>1 \<Rightarrow> \<beta>\<^isub>2"}, 
   439   @{text perm}, @{term "\<beta> set"}, @{term "\<beta> list"}, @{term "\<beta>\<^isub>1 \<times> \<beta>\<^isub>2"},
   443   @{text perm}, @{term "\<beta> set"}, @{term "\<beta> list"}, @{term "\<beta>\<^isub>1 \<times> \<beta>\<^isub>2"},
   440   @{text bool} and @{text "nat"}.
   444   @{text bool} and @{text "nat"}.
   441   \end{theorem}
   445   \end{theorem}
   442 
   446 
   443   \begin{proof}
   447   \begin{proof}
   448   \begin{isabelle}\ \ \ \ \ \ \ \ \ \ %%%
   452   \begin{isabelle}\ \ \ \ \ \ \ \ \ \ %%%
   449   \begin{tabular}[b]{@ {}rcl}
   453   \begin{tabular}[b]{@ {}rcl}
   450   @{text "0 \<bullet> \<pi>'"} & @{text "\<equiv>"} & @{text "0 + \<pi>' - 0 = \<pi>'"}\\
   454   @{text "0 \<bullet> \<pi>'"} & @{text "\<equiv>"} & @{text "0 + \<pi>' - 0 = \<pi>'"}\\
   451   @{text "(\<pi>\<^isub>1 + \<pi>\<^isub>2) \<bullet> \<pi>'"} & @{text "\<equiv>"} & @{text "(\<pi>\<^isub>1 + \<pi>\<^isub>2) + \<pi>' - (\<pi>\<^isub>1 + \<pi>\<^isub>2)"}\\
   455   @{text "(\<pi>\<^isub>1 + \<pi>\<^isub>2) \<bullet> \<pi>'"} & @{text "\<equiv>"} & @{text "(\<pi>\<^isub>1 + \<pi>\<^isub>2) + \<pi>' - (\<pi>\<^isub>1 + \<pi>\<^isub>2)"}\\
   452   & @{text "="} & @{text "(\<pi>\<^isub>1 + \<pi>\<^isub>2) + \<pi>' - \<pi>\<^isub>2 - \<pi>\<^isub>1"}\\
   456   & @{text "="} & @{text "(\<pi>\<^isub>1 + \<pi>\<^isub>2) + \<pi>' - \<pi>\<^isub>2 - \<pi>\<^isub>1"}\\
   453   & @{text "="} & @{text "\<pi>\<^isub>1 + (\<pi>\<^isub>2 + \<pi>' - \<pi>\<^isub>2) - \<pi>\<^isub>1"}\\
   457   & @{text "="} & @{text "\<pi>\<^isub>1 + (\<pi>\<^isub>2 + \<pi>' - \<pi>\<^isub>2) - \<pi>\<^isub>1"} @{text "\<equiv>"} @{text "\<pi>\<^isub>1 \<bullet> \<pi>\<^isub>2 \<bullet> \<pi>'"} 
   454   & @{text "\<equiv>"} & @{text "\<pi>\<^isub>1 \<bullet> \<pi>\<^isub>2 \<bullet> \<pi>'"} 
       
   455   \end{tabular}\hfill\qed
   458   \end{tabular}\hfill\qed
   456   \end{isabelle}
   459   \end{isabelle}
   457   \end{proof}
   460   \end{proof}
   458 
   461 
   459   \noindent
   462   \noindent
   622   \end{lemma}
   625   \end{lemma}
   623 
   626 
   624   \begin{proof}
   627   \begin{proof}
   625   \begin{isabelle}
   628   \begin{isabelle}
   626   \begin{tabular}[t]{c@ {\hspace{2mm}}l@ {\hspace{5mm}}l}
   629   \begin{tabular}[t]{c@ {\hspace{2mm}}l@ {\hspace{5mm}}l}
   627   & @{thm (lhs) fresh_permute_iff[where p="\<pi>",no_vars]}
   630   & \multicolumn{2}{@ {}l}{@{thm (lhs) fresh_permute_iff[where p="\<pi>",no_vars]} @{text "\<equiv>"}
   628   & \\
   631     @{term "finite {b. (\<pi> \<bullet> a \<rightleftharpoons> b) \<bullet> \<pi> \<bullet> x \<noteq> \<pi> \<bullet> x}"}}\\
   629   @{text "\<Leftrightarrow>"}
       
   630   & @{term "finite {b. (\<pi> \<bullet> a \<rightleftharpoons> b) \<bullet> \<pi> \<bullet> x \<noteq> \<pi> \<bullet> x}"}
       
   631   & by definition\\
       
   632   @{text "\<Leftrightarrow>"}
   632   @{text "\<Leftrightarrow>"}
   633   & @{term "finite {b. (\<pi> \<bullet> a \<rightleftharpoons> \<pi> \<bullet> b) \<bullet> \<pi> \<bullet> x \<noteq> \<pi> \<bullet> x}"} 
   633   & @{term "finite {b. (\<pi> \<bullet> a \<rightleftharpoons> \<pi> \<bullet> b) \<bullet> \<pi> \<bullet> x \<noteq> \<pi> \<bullet> x}"} 
   634   & since @{text "\<pi> \<bullet> _"} is bijective\\ 
   634   & since @{text "\<pi> \<bullet> _"} is bijective\\ 
   635   @{text "\<Leftrightarrow>"}
   635   @{text "\<Leftrightarrow>"}
   636   & @{term "finite {b. \<pi> \<bullet> (a \<rightleftharpoons> b) \<bullet> x \<noteq> \<pi> \<bullet> x}"}
   636   & @{term "finite {b. \<pi> \<bullet> (a \<rightleftharpoons> b) \<bullet> x \<noteq> \<pi> \<bullet> x}"}
   637   & by \eqref{permutecompose} and \eqref{swapeqvt}\\
   637   & by \eqref{permutecompose} and \eqref{swapeqvt}\\
   638   @{text "\<Leftrightarrow>"}
   638   @{text "\<Leftrightarrow>"}
   639   & @{term "finite {b. (a \<rightleftharpoons> b) \<bullet> x \<noteq> x}"}
   639   & @{term "finite {b. (a \<rightleftharpoons> b) \<bullet> x \<noteq> x}"} @{text "\<equiv>"}
       
   640     @{thm (rhs) fresh_permute_iff[where p="\<pi>",no_vars]}
   640   & by \eqref{permuteequ}\\
   641   & by \eqref{permuteequ}\\
   641   @{text "\<Leftrightarrow>"}
       
   642   & @{thm (rhs) fresh_permute_iff[where p="\<pi>",no_vars]}
       
   643   & by definition\\
       
   644   \end{tabular}
   642   \end{tabular}
   645   \end{isabelle}\hfill\qed
   643   \end{isabelle}\hfill\qed
   646   \end{proof}
   644   \end{proof}
   647 
   645 
   648   \noindent
   646   \noindent
   698   i)    & @{thm[mode=IfThen] supp_is_subset[no_vars]}\\
   696   i)    & @{thm[mode=IfThen] supp_is_subset[no_vars]}\\
   699   ii)   & @{thm[mode=IfThen] supp_supports[no_vars]}\\
   697   ii)   & @{thm[mode=IfThen] supp_supports[no_vars]}\\
   700   iii)  & @{thm (concl) supp_is_least_supports[no_vars]}
   698   iii)  & @{thm (concl) supp_is_least_supports[no_vars]}
   701          provided @{thm (prem 1) supp_is_least_supports[no_vars]},
   699          provided @{thm (prem 1) supp_is_least_supports[no_vars]},
   702          @{thm (prem 2) supp_is_least_supports[no_vars]}
   700          @{thm (prem 2) supp_is_least_supports[no_vars]}
   703          and @{text "S"} is the least such set, that means formally:\\[2mm]
   701          and @{text "S"} is the least such set, that means formally,
   704 
   702          for all @{text "S'"}, if @{term "finite S'"} and 
   705         & \multicolumn{1}{c}{for all @{text "S'"}, if @{term "finite S'"} and 
   703          @{term "S' supports x"} then @{text "S \<subseteq> S'"}.
   706            @{term "S' supports x"} then @{text "S \<subseteq> S'"}.}
       
   707   \end{tabular}
   704   \end{tabular}
   708   \end{isabelle} 
   705   \end{isabelle} 
   709   \end{lemma}
   706   \end{lemma}
   710 
   707 
   711   \begin{proof}
   708   \begin{proof}
   725   nominal logic work. However for establishing the support of atoms and 
   722   nominal logic work. However for establishing the support of atoms and 
   726   permutations we found  the following ``optimised'' variant of @{text "iii)"} 
   723   permutations we found  the following ``optimised'' variant of @{text "iii)"} 
   727   more useful:
   724   more useful:
   728 
   725 
   729   \begin{lemma}\label{optimised} Let @{text x} be of permutation type.
   726   \begin{lemma}\label{optimised} Let @{text x} be of permutation type.
   730   Then @{thm (concl) finite_supp_unique[no_vars]}
   727   We have that @{thm (concl) finite_supp_unique[no_vars]}
   731   provided @{thm (prem 1) finite_supp_unique[no_vars]},
   728   provided @{thm (prem 1) finite_supp_unique[no_vars]},
   732   @{thm (prem 2) finite_supp_unique[no_vars]}, and for
   729   @{thm (prem 2) finite_supp_unique[no_vars]}, and for
   733   all @{text "a \<in> S"} and all @{text "b \<notin> S"}, with @{text a}
   730   all @{text "a \<in> S"} and all @{text "b \<notin> S"}, with @{text a}
   734   and @{text b} having the same sort, then @{term "(a \<rightleftharpoons> b) \<bullet> x \<noteq> x"}
   731   and @{text b} having the same sort, then \mbox{@{term "(a \<rightleftharpoons> b) \<bullet> x \<noteq> x"}}
   735   \end{lemma}
   732   \end{lemma}
   736 
   733 
   737   \begin{proof}
   734   \begin{proof}
   738   By Lemma \ref{supports}@{text ".iii)"} we have to show that for every finite
   735   By Lemma \ref{supports}@{text ".iii)"} we have to show that for every finite
   739   set @{text S'} that supports @{text x}, \mbox{@{text "S \<subseteq> S'"}} holds. We will
   736   set @{text S'} that supports @{text x}, \mbox{@{text "S \<subseteq> S'"}} holds. We will
   793   \end{isabelle}
   790   \end{isabelle}
   794 
   791 
   795   \noindent
   792   \noindent
   796   holds by a simple calculation using the group properties of permutations.
   793   holds by a simple calculation using the group properties of permutations.
   797   The proof-obligation can then be discharged by analysing the inequality
   794   The proof-obligation can then be discharged by analysing the inequality
   798   between the permutations @{term "(p \<bullet> a \<rightleftharpoons> b)"} and @{term "(a \<rightleftharpoons> b)"}.
   795   between the permutations @{term "(\<pi> \<bullet> a \<rightleftharpoons> b)"} and @{term "(a \<rightleftharpoons> b)"}.
   799 
   796 
   800   The main point about support is that whenever an object @{text x} has finite
   797   The main point about support is that whenever an object @{text x} has finite
   801   support, then Proposition~\ref{choosefresh} allows us to choose for @{text x} a 
   798   support, then Proposition~\ref{choosefresh} allows us to choose for @{text x} a 
   802   fresh atom with arbitrary sort. This is an important operation in Nominal
   799   fresh atom with arbitrary sort. This is an important operation in Nominal
   803   Isabelle in situations where, for example, a bound variable needs to be
   800   Isabelle in situations where, for example, a bound variable needs to be
   834   \begin{isabelle}\ \ \ \ \ \ \ \ \ \ %%%
   831   \begin{isabelle}\ \ \ \ \ \ \ \ \ \ %%%
   835   \begin{tabular}[b]{@ {}rcl@ {\hspace{5mm}}l}
   832   \begin{tabular}[b]{@ {}rcl@ {\hspace{5mm}}l}
   836   @{text "nat_of a"} & @{text "="} & @{text "(a \<rightleftharpoons> c) \<bullet> (nat_of a)"} & by def.~of permutations on nats\\
   833   @{text "nat_of a"} & @{text "="} & @{text "(a \<rightleftharpoons> c) \<bullet> (nat_of a)"} & by def.~of permutations on nats\\
   837   & @{text "="} & @{term "((a \<rightleftharpoons> c) \<bullet> nat_of) ((a \<rightleftharpoons> c) \<bullet> a)"} & by \eqref{permutefunapp}\\
   834   & @{text "="} & @{term "((a \<rightleftharpoons> c) \<bullet> nat_of) ((a \<rightleftharpoons> c) \<bullet> a)"} & by \eqref{permutefunapp}\\
   838   & @{text "="} & @{term "nat_of c"} & by assumptions on @{text c}\\
   835   & @{text "="} & @{term "nat_of c"} & by assumptions on @{text c}\\
   839   \end{tabular}\hfill\qed
   836   \end{tabular}
   840   \end{isabelle}
   837   \end{isabelle}
   841   
   838   
   842 
   839 
   843   \noindent
   840   \noindent
   844   But this means we have that @{term "nat_of a = nat_of c"} and @{term "sort_of a = sort_of c"}.
   841   But this means we have that @{term "nat_of a = nat_of c"} and @{term "sort_of a = sort_of c"}.
   845   This implies that atoms @{term a} and @{term c} must be equal, which clashes with our
   842   This implies that atoms @{term a} and @{term c} must be equal, which clashes with our
   846   assumption @{term "c \<noteq> a"} about how we chose @{text c}. Similar examples for 
   843   assumption @{term "c \<noteq> a"} about how we chose @{text c}. 
   847   constructions that have infinite support are given in~\cite{Cheney06}.
   844   Cheney \cite{Cheney06} gives similar examples for constructions that have infinite support.
   848 *}
   845 *}
   849 
   846 
   850 section {* Concrete Atom Types *}
   847 section {* Concrete Atom Types *}
   851 
   848 
   852 text {*
   849 text {*
   916   generic atom type, which we will write @{text "|_|"}.  For each class
   913   generic atom type, which we will write @{text "|_|"}.  For each class
   917   instance, this function must be injective and equivariant, and its outputs
   914   instance, this function must be injective and equivariant, and its outputs
   918   must all have the same sort.
   915   must all have the same sort.
   919 
   916 
   920   \begin{isabelle}\ \ \ \ \ \ \ \ \ \ %%%
   917   \begin{isabelle}\ \ \ \ \ \ \ \ \ \ %%%
   921   \begin{tabular}{@ {}r@ {\hspace{4mm}}p{10cm}}
   918   i)   \hspace{1mm}if @{thm (lhs) atom_eq_iff [no_vars]} then @{thm (rhs) atom_eq_iff [no_vars]}\hspace{4mm}
   922   i) & if @{thm (lhs) atom_eq_iff [no_vars]} then @{thm (rhs) atom_eq_iff [no_vars]}\\
   919   ii)  \hspace{1mm}@{thm atom_eqvt[where p="\<pi>", no_vars]}\hspace{4mm}
   923   ii) & @{thm atom_eqvt[where p="\<pi>", no_vars]}\\
   920   iii) \hspace{1mm}@{thm sort_of_atom_eq [no_vars]}
   924   iii) & @{thm sort_of_atom_eq [no_vars]}
   921   \hfill\numbered{atomprops}
   925   \end{tabular}\hfill\numbered{atomprops}
       
   926   \end{isabelle}
   922   \end{isabelle}
   927 
   923 
   928   \noindent
   924   \noindent
   929   With the definition @{thm atom_name_def [THEN eq_reflection, no_vars]} we can
   925   With the definition @{thm atom_name_def [THEN eq_reflection, no_vars]} we can
   930   show that @{typ name} satisfies all the above requirements of a concrete atom
   926   show that @{typ name} satisfies all the above requirements of a concrete atom
  1091   \end{isabelle}
  1087   \end{isabelle}
  1092 
  1088 
  1093   \noindent
  1089   \noindent
  1094   which can easily be shown to be injective.  
  1090   which can easily be shown to be injective.  
  1095   
  1091   
  1096   Having settled on what the the sorts should be for ``Church-like'' atoms, we have to
  1092   Having settled on what the sorts should be for ``Church-like'' atoms, we have to
  1097   give a subtype definition for concrete atoms. Previously we identified a subtype consisting 
  1093   give a subtype definition for concrete atoms. Previously we identified a subtype consisting 
  1098   of atoms of only one specified sort. This must be generalised to all sorts the
  1094   of atoms of only one specified sort. This must be generalised to all sorts the
  1099   function @{text "sort_ty"} might produce, i.e.~the
  1095   function @{text "sort_ty"} might produce, i.e.~the
  1100   range of @{text "sort_ty"}. Therefore we define
  1096   range of @{text "sort_ty"}. Therefore we define
  1101 
  1097 
  1154   \end{isabelle}
  1150   \end{isabelle}
  1155   
  1151   
  1156   \noindent
  1152   \noindent
  1157   where the argument, or arguments, are datatypes for which we can automatically
  1153   where the argument, or arguments, are datatypes for which we can automatically
  1158   define an injective function like @{text "sort_ty"} (see \eqref{sortty}).
  1154   define an injective function like @{text "sort_ty"} (see \eqref{sortty}).
  1159   Our hope is that with this approach the authors of \cite{PaulsonBenzmueller} 
  1155   Our hope is that with this approach Benzmueller and Paulson the authors of 
  1160   can make headway with formalising their results about simple type theory.  
  1156   \cite{PaulsonBenzmueller} can make headway with formalising their results 
       
  1157   about simple type theory.  
  1161   Because of its limitations, they did not attempt this with the old version 
  1158   Because of its limitations, they did not attempt this with the old version 
  1162   of Nominal Isabelle. We also hope we can make progress with formalisations of
  1159   of Nominal Isabelle. We also hope we can make progress with formalisations of
  1163   HOL-based languages.
  1160   HOL-based languages.
  1164 *}
  1161 *}
  1165 
  1162 
  1183   @{text \<pi>}, then we only have to state @{term "\<forall>\<pi>. P (\<pi> \<bullet> t)"}. The reason is
  1180   @{text \<pi>}, then we only have to state @{term "\<forall>\<pi>. P (\<pi> \<bullet> t)"}. The reason is
  1184   that permutations can now consist of multiple swapping each of which can
  1181   that permutations can now consist of multiple swapping each of which can
  1185   swap different kinds of atoms. This simplifies considerably the reasoning
  1182   swap different kinds of atoms. This simplifies considerably the reasoning
  1186   involved in building Nominal Isabelle.
  1183   involved in building Nominal Isabelle.
  1187 
  1184 
  1188   Second, we represented permutation as functions so that the associated
  1185   Second, we represented permutations as functions so that the associated
  1189   permutation operation has only a single type parameter. From this we derive
  1186   permutation operation has only a single type parameter. This is very convenient
  1190   most benefits because the abstract reasoning about permutations fits cleanly
  1187   because the abstract reasoning about permutations fits cleanly
  1191   with Isabelle/HOL's type classes. No custom ML-code is required to work
  1188   with Isabelle/HOL's type classes. No custom ML-code is required to work
  1192   around rough edges. Moreover, by establishing that our permutations-as-functions
  1189   around rough edges. Moreover, by establishing that our permutations-as-functions
  1193   representation satisfy the group properties, we were able to use extensively 
  1190   representation satisfy the group properties, we were able to use extensively 
  1194   Isabelle/HOL's reasoning infrastructure for groups. This often reduced proofs 
  1191   Isabelle/HOL's reasoning infrastructure for groups. This often reduced proofs 
  1195   to simple calculations over @{text "+"}, @{text "-"} and @{text "0"}.
  1192   to simple calculations over @{text "+"}, @{text "-"} and @{text "0"}.
  1220   {http://isabelle.in.tum.de/nominal/download}.\medskip
  1217   {http://isabelle.in.tum.de/nominal/download}.\medskip
  1221 
  1218 
  1222   \noindent
  1219   \noindent
  1223   {\bf Acknowledgements:} We are very grateful to Jesper Bengtson, Stefan 
  1220   {\bf Acknowledgements:} We are very grateful to Jesper Bengtson, Stefan 
  1224   Berghofer and Cezary Kaliszyk for their comments on earlier versions 
  1221   Berghofer and Cezary Kaliszyk for their comments on earlier versions 
  1225   of this paper.
  1222   of this paper. We are also grateful to the anonymous referee who helped us to
  1226   
  1223   put the work into the right context.  
  1227 *}
  1224 *}
  1228 
  1225 
  1229 
  1226 
  1230 (*<*)
  1227 (*<*)
  1231 end
  1228 end