Paper/Paper.thy
changeset 2363 9832641ed955
parent 2362 9d8ebeded16f
child 2364 2bf351f09317
equal deleted inserted replaced
2362:9d8ebeded16f 2363:9832641ed955
  1687   third \emph{only} holds because of our restriction
  1687   third \emph{only} holds because of our restriction
  1688   imposed on the form of the binding functions---namely \emph{not} returning 
  1688   imposed on the form of the binding functions---namely \emph{not} returning 
  1689   any bound atoms. In Ott, in contrast, the user may 
  1689   any bound atoms. In Ott, in contrast, the user may 
  1690   define @{text "bn"}$_{1..m}$ so that they return bound
  1690   define @{text "bn"}$_{1..m}$ so that they return bound
  1691   atoms and in this case the third implication is \emph{not} true. A 
  1691   atoms and in this case the third implication is \emph{not} true. A 
  1692   result is that the lifing of the corresponding binding functions to $\alpha$-equated
  1692   result is that the lifing of the corresponding binding functions in Ott to $\alpha$-equated
  1693   terms is impossible.
  1693   terms is impossible.
  1694 
  1694 
  1695   Having established respectfulness for the raw term-constructors, the 
  1695   Having established respectfulness for the raw term-constructors, the 
  1696   quotient package is able to automatically deduce \eqref{distinctalpha} from 
  1696   quotient package is able to automatically deduce \eqref{distinctalpha} from 
  1697   \eqref{distinctraw}. Having the facts \eqref{fnresp} at our disposal, we can 
  1697   \eqref{distinctraw}. Having the facts \eqref{fnresp} at our disposal, we can 
  1726 
  1726 
  1727   \noindent
  1727   \noindent
  1728   to our infrastructure. In a similar fashion we can lift the defining equations
  1728   to our infrastructure. In a similar fashion we can lift the defining equations
  1729   of the free-atom functions @{text "fn_ty\<AL>"}$_{1..n}$ and
  1729   of the free-atom functions @{text "fn_ty\<AL>"}$_{1..n}$ and
  1730   @{text "fa_bn\<AL>"}$_{1..m}$ as well as of the binding functions @{text
  1730   @{text "fa_bn\<AL>"}$_{1..m}$ as well as of the binding functions @{text
  1731   "bn\<AL>"}$_{1..m}$ and of the size functions @{text "size_ty\<AL>"}$_{1..n}$.
  1731   "bn\<AL>"}$_{1..m}$ and the size functions @{text "size_ty\<AL>"}$_{1..n}$.
  1732   The latter are defined automatically for the raw types @{text "ty"}$_{1..n}$
  1732   The latter are defined automatically for the raw types @{text "ty"}$_{1..n}$
  1733   by the datatype package of Isabelle/HOL.
  1733   by the datatype package of Isabelle/HOL.
  1734 
  1734 
  1735   Finally we can add to our infrastructure a structural induction principle 
  1735   Finally we can add to our infrastructure a structural induction principle 
  1736   for the types @{text "ty\<AL>"}$_{i..n}$ whose 
  1736   for the types @{text "ty\<AL>"}$_{i..n}$ whose 
  1770   in \eqref{weakinduct}.
  1770   in \eqref{weakinduct}.
  1771   Having these equivariant properties established, we can
  1771   Having these equivariant properties established, we can
  1772   show for every term-constructor @{text "C\<^sup>\<alpha>"} that 
  1772   show for every term-constructor @{text "C\<^sup>\<alpha>"} that 
  1773 
  1773 
  1774   \begin{center}
  1774   \begin{center}
  1775   @{text "(supp x\<^isub>1 \<union> \<dots> supp x\<^isub>r) supports (C\<^sup>\<alpha> x\<^isub>1 \<dots> x\<^isub>r)"}
  1775   @{text "(supp x\<^isub>1 \<union> \<dots> \<union> supp x\<^isub>r) supports (C\<^sup>\<alpha> x\<^isub>1 \<dots> x\<^isub>r)"}
  1776   \end{center}
  1776   \end{center}
  1777  
  1777  
  1778   \noindent
  1778   \noindent
  1779   holds. This together with Property~\ref{supportsprop} allows us to show
  1779   holds. This together with Property~\ref{supportsprop} allows us to prove
  1780   for every @{text x} of type @{text "ty\<AL>"}$_{1..n}$ is finitely supported, 
  1780   that every @{text x} of type @{text "ty\<AL>"}$_{1..n}$ is finitely supported, 
  1781   namely @{text "finite (supp x)"}. This can be again shown by induction 
  1781   namely @{text "finite (supp x)"}. This can be again shown by induction 
  1782   over @{text "ty\<AL>"}$_{1..n}$. Lastly, we can show that the support of 
  1782   over @{text "ty\<AL>"}$_{1..n}$. Lastly, we can show that the support of 
  1783   elements in  @{text "ty\<AL>"}$_{1..n}$ is the same as @{text "fa_ty\<AL>"}$_{1..n}$.
  1783   elements in  @{text "ty\<AL>"}$_{1..n}$ is the same as @{text "fa_ty\<AL>"}$_{1..n}$.
  1784   This important fact provides evidence that our notions of free-atoms and 
  1784   This fact is important in a nominal setting, but also provides evidence 
  1785   $\alpha$-equivalence are correct.
  1785   that our notions of free-atoms and $\alpha$-equivalence are correct.
  1786 
  1786 
  1787   \begin{lemma} 
  1787   \begin{lemma} 
  1788   For every @{text "x"} of type @{text "ty\<AL>"}$_{1..n}$, we have
  1788   For every @{text "x"} of type @{text "ty\<AL>"}$_{1..n}$, we have
  1789   @{text "supp x = fa_ty\<AL>\<^isub>i x"}.
  1789   @{text "supp x = fa_ty\<AL>\<^isub>i x"}.
  1790   \end{lemma}
  1790   \end{lemma}
  1795   term-constructors and then use the quasi-injectivity lemmas in order to complete the
  1795   term-constructors and then use the quasi-injectivity lemmas in order to complete the
  1796   proof. For the abstraction cases we use the facts derived in Theorem~\ref{suppabs}.
  1796   proof. For the abstraction cases we use the facts derived in Theorem~\ref{suppabs}.
  1797   \end{proof}
  1797   \end{proof}
  1798 
  1798 
  1799   \noindent
  1799   \noindent
  1800   To sum up, we can established automatically a reasoning infrastructure
  1800   To sum up this section, we can established automatically a reasoning infrastructure
  1801   for the types @{text "ty\<AL>"}$_{1..n}$ 
  1801   for the types @{text "ty\<AL>"}$_{1..n}$ 
  1802   by first lifting definitions from the raw level to the quotient level and
  1802   by first lifting definitions from the raw level to the quotient level and
  1803   then by establishing facts about these lifted definitions. All necessary proofs
  1803   then by establishing facts about these lifted definitions. All necessary proofs
  1804   are generated automatically by custom ML-code. This code can deal with 
  1804   are generated automatically by custom ML-code. This code can deal with 
  1805   specifications like the one shown in Figure~\ref{nominalcorehas} for Core-Haskell.  
  1805   specifications such as the one shown in Figure~\ref{nominalcorehas} for Core-Haskell.  
  1806 
  1806 
  1807   \begin{figure}[t!]
  1807   \begin{figure}[t!]
  1808   \begin{boxedminipage}{\linewidth}
  1808   \begin{boxedminipage}{\linewidth}
  1809   \small
  1809   \small
  1810   \begin{tabular}{l}
  1810   \begin{tabular}{l}
  1878 section {* Strong Induction Principles *}
  1878 section {* Strong Induction Principles *}
  1879 
  1879 
  1880 text {*
  1880 text {*
  1881   In the previous section we were able to provide induction principles that 
  1881   In the previous section we were able to provide induction principles that 
  1882   allow us to perform structural inductions over $\alpha$-equated terms. 
  1882   allow us to perform structural inductions over $\alpha$-equated terms. 
  1883   We call such induction principles \emph{weak}, because in case of a term-constructor @{text "C\<^sup>\<alpha> x\<^isub>1 \<dots> x\<^isub>r"},
  1883   We call such induction principles \emph{weak}, because in case of the 
       
  1884   term-constructor @{text "C\<^sup>\<alpha> x\<^isub>1 \<dots> x\<^isub>r"},
  1884   the induction hypothesis requires us to establish the implications \eqref{weakprem}.
  1885   the induction hypothesis requires us to establish the implications \eqref{weakprem}.
  1885   The problem with these implications is that in general they are not easy to establish.
  1886   The problem with these implications is that in general they are difficult to establish.
  1886   The reason is that we cannot make any assumption about the binders that might be in @{text "C\<^sup>\<alpha>"} 
  1887   The reason is that we cannot make any assumption about the binders that might be in @{text "C\<^sup>\<alpha>"} 
  1887   (for example we cannot assume the variable convention for them).
  1888   (for example we cannot assume the variable convention for them).
  1888 
  1889 
  1889   In \cite{UrbanTasson05} we introduced a method for automatically
  1890   In \cite{UrbanTasson05} we introduced a method for automatically
  1890   strengthening weak induction principles for terms containing single
  1891   strengthening weak induction principles for terms containing single
  1896   the general binders presented here. We will indeed be able to so, but for this we need an 
  1897   the general binders presented here. We will indeed be able to so, but for this we need an 
  1897   additional notion for permuting deep binders. 
  1898   additional notion for permuting deep binders. 
  1898 
  1899 
  1899   Given a binding function @{text "bn"} we define an auxiliary permutation 
  1900   Given a binding function @{text "bn"} we define an auxiliary permutation 
  1900   operation @{text "_ \<bullet>\<^bsub>bn\<^esub> _"} which permutes only bound arguments in a deep binder.
  1901   operation @{text "_ \<bullet>\<^bsub>bn\<^esub> _"} which permutes only bound arguments in a deep binder.
  1901   Assuming a clause of @{text bn} is defined as @{text "bn (C x\<^isub>1 \<dots> x\<^isub>n) = rhs"}, then
  1902   Assuming a clause of @{text bn} is given as 
  1902   we define @{text "p \<bullet>\<^bsub>bn\<^esub> (C x\<^isub>1 \<dots> x\<^isub>n) \<equiv> C y\<^isub>1 \<dots> y\<^isub>n"} with @{text "y\<^isub>i"} determined as follows:
  1903   %
       
  1904   \begin{center}
       
  1905   @{text "bn (C x\<^isub>1 \<dots> x\<^isub>r) = rhs"}, 
       
  1906   \end{center}
       
  1907 
       
  1908   \noindent 
       
  1909   then we define 
       
  1910   %
       
  1911   \begin{center}
       
  1912   @{text "p \<bullet>\<^bsub>bn\<^esub> (C x\<^isub>1 \<dots> x\<^isub>r) \<equiv> C y\<^isub>1 \<dots> y\<^isub>r"} 
       
  1913   \end{center}
       
  1914   
       
  1915   \noindent
       
  1916   with @{text "y\<^isub>i"} determined as follows:
  1903   %
  1917   %
  1904   \begin{center}
  1918   \begin{center}
  1905   \begin{tabular}{c@ {\hspace{2mm}}p{7cm}}
  1919   \begin{tabular}{c@ {\hspace{2mm}}p{7cm}}
  1906   $\bullet$ & @{text "y\<^isub>i \<equiv> x\<^isub>i"} provided @{text "x\<^isub>i"} does not occur in @{text "rhs"}\\
  1920   $\bullet$ & @{text "y\<^isub>i \<equiv> x\<^isub>i"} provided @{text "x\<^isub>i"} does not occur in @{text "rhs"}\\
  1907   $\bullet$ & @{text "y\<^isub>i \<equiv> p \<bullet>\<^bsub>bn'\<^esub> x\<^isub>i"} provided @{text "bn' x\<^isub>i"} is in @{text "rhs"}\\
  1921   $\bullet$ & @{text "y\<^isub>i \<equiv> p \<bullet>\<^bsub>bn'\<^esub> x\<^isub>i"} provided @{text "bn' x\<^isub>i"} is in @{text "rhs"}\\
  1913   Using again the quotient package  we can lift the @{text "_ \<bullet>\<^bsub>bn\<^esub> _"} function to 
  1927   Using again the quotient package  we can lift the @{text "_ \<bullet>\<^bsub>bn\<^esub> _"} function to 
  1914   $\alpha$-equated terms. We can then prove the following two facts
  1928   $\alpha$-equated terms. We can then prove the following two facts
  1915 
  1929 
  1916   \begin{lemma}\label{permutebn} 
  1930   \begin{lemma}\label{permutebn} 
  1917   Given a binding function @{text "bn\<^sup>\<alpha>"} then for all @{text p}
  1931   Given a binding function @{text "bn\<^sup>\<alpha>"} then for all @{text p}
  1918   {\it i)} @{text "p \<bullet> (bn\<^sup>\<alpha> x) = bn\<^sup>\<alpha> (p \<bullet>\<^bsub>bn\<^esub>\<^sup>\<alpha> x)"} and {\it ii)}
  1932   {\it (i)} @{text "p \<bullet> (bn\<^sup>\<alpha> x) = bn\<^sup>\<alpha> (p \<bullet>\<AL>\<^bsub>bn\<^esub> x)"} and {\it (ii)}
  1919     @{text "fa_bn\<^isup>\<alpha> x = fa_bn\<^isup>\<alpha> (p \<bullet>\<^bsub>bn\<^esub>\<^sup>\<alpha> x)"}.
  1933     @{text "fa_bn\<^isup>\<alpha> x = fa_bn\<^isup>\<alpha> (p \<bullet>\<AL>\<^bsub>bn\<^esub> x)"}.
  1920   \end{lemma}
  1934   \end{lemma}
  1921 
  1935 
  1922   \begin{proof} 
  1936   \begin{proof} 
  1923   By induction on @{text x}. The equations follow by simple unfolding 
  1937   By induction on @{text x}. The equations follow by simple unfolding 
  1924   of the definitions. 
  1938   of the definitions. 
  1931   effect on the free-atom function. The main point of this permutation
  1945   effect on the free-atom function. The main point of this permutation
  1932   function, however, is that if we have a permutation that is fresh 
  1946   function, however, is that if we have a permutation that is fresh 
  1933   for the support of an object @{text x}, then we can use this permutation 
  1947   for the support of an object @{text x}, then we can use this permutation 
  1934   to rename the binders in @{text x}, without ``changing'' @{text x}. In case of the 
  1948   to rename the binders in @{text x}, without ``changing'' @{text x}. In case of the 
  1935   @{text "Let"} term-constructor from the example shown 
  1949   @{text "Let"} term-constructor from the example shown 
  1936   \eqref{letpat} this means for a permutation @{text "r"}:
  1950   in \eqref{letpat} this means for a permutation @{text "r"}
  1937   %
  1951   %
  1938   \begin{equation}\label{renaming}
  1952   \begin{equation}\label{renaming}
  1939   \begin{array}{l}
  1953   \begin{array}{l}
  1940   \mbox{if @{term "supp (Abs_lst (bn p) t\<^isub>2)  \<sharp>* r"}}\\ 
  1954   \mbox{if @{term "supp (Abs_lst (bn p) t\<^isub>2)  \<sharp>* r"}}\\ 
  1941   \qquad\mbox{then @{text "Let p t\<^isub>1 t\<^isub>2 = Let (r \<bullet>\<^bsub>bnpat\<^esub> p) t\<^isub>1 (r \<bullet> t\<^isub>2)"}}
  1955   \qquad\mbox{then @{text "Let p t\<^isub>1 t\<^isub>2 = Let (r \<bullet>\<AL>\<^bsub>bn_pat\<^esub> p) t\<^isub>1 (r \<bullet> t\<^isub>2)"}}
  1942   \end{array}
  1956   \end{array}
  1943   \end{equation}
  1957   \end{equation}
  1944 
  1958 
  1945   \noindent
  1959   \noindent
  1946   This fact will be crucial when establishing the strong induction principles. 
  1960   This fact will be crucial when establishing the strong induction principles below.
  1947   In our running example about @{text "Let"}, they state that instead 
  1961 
       
  1962  
       
  1963   In our running example about @{text "Let"}, the strong induction
       
  1964   principle means that instead 
  1948   of establishing the implication 
  1965   of establishing the implication 
  1949   %
  1966   %
  1950   \begin{center}
  1967   \begin{center}
  1951   @{text "\<forall>p t\<^isub>1 t\<^isub>2. P\<^bsub>pat\<^esub> p \<and> P\<^bsub>trm\<^esub> t\<^isub>1 \<and> P\<^bsub>trm\<^esub> t\<^isub>2 \<Rightarrow> P\<^bsub>trm\<^esub> (Let p t\<^isub>1 t\<^isub>2)"}
  1968   @{text "\<forall>p t\<^isub>1 t\<^isub>2. P\<^bsub>pat\<^esub> p \<and> P\<^bsub>trm\<^esub> t\<^isub>1 \<and> P\<^bsub>trm\<^esub> t\<^isub>2 \<Rightarrow> P\<^bsub>trm\<^esub> (Let p t\<^isub>1 t\<^isub>2)"}
  1952   \end{center}
  1969   \end{center}
  1964   \end{equation}
  1981   \end{equation}
  1965 
  1982 
  1966   \noindent 
  1983   \noindent 
  1967   While this implication contains an additional argument, namely @{text c}, and 
  1984   While this implication contains an additional argument, namely @{text c}, and 
  1968   also additional universal quantifications, it is usually easier to establish.
  1985   also additional universal quantifications, it is usually easier to establish.
  1969   The reason is that we can make the freshness 
  1986   The reason is that we have the freshness 
  1970   assumption @{text "set (bn\<^sup>\<alpha> p) #\<^sup>* c"}, whereby @{text c} can be arbitrarily 
  1987   assumption @{text "set (bn\<^sup>\<alpha> p) #\<^sup>* c"}, whereby @{text c} can be arbitrarily 
  1971   chosen by the user as long as it has finite support.
  1988   chosen by the user as long as it has finite support.
  1972 
  1989 
  1973   Let us now show how we derive the strong induction principles from the
  1990   Let us now show how we derive the strong induction principles from the
  1974   weak ones. In case of the @{text "Let"}-example we derive by the weak 
  1991   weak ones. In case of the @{text "Let"}-example we derive by the weak 
  1975   induction the following two properties
  1992   induction the following two properties
  1976   %
  1993   %
  1977   \begin{equation}\label{hyps}
  1994   \begin{equation}\label{hyps}
  1978   @{text "\<forall>q c. P\<^bsub>trm\<^esub> c (q \<bullet> t)"} \hspace{4mm} 
  1995   @{text "\<forall>q c. P\<^bsub>trm\<^esub> c (q \<bullet> t)"} \hspace{4mm} 
  1979   @{text "\<forall>q\<^isub>1 q\<^isub>2 c. P\<^bsub>pat\<^esub> (q\<^isub>1 \<bullet>\<^bsub>bn\<^esub> (q\<^isub>2 \<bullet> p))"}
  1996   @{text "\<forall>q\<^isub>1 q\<^isub>2 c. P\<^bsub>pat\<^esub> (q\<^isub>1 \<bullet>\<AL>\<^bsub>bn\<^esub> (q\<^isub>2 \<bullet> p))"}
  1980   \end{equation} 
  1997   \end{equation} 
  1981 
  1998 
  1982   \noindent
  1999   \noindent
  1983   For the @{text Let} term-constructor  we therefore have to establish @{text "P\<^bsub>trm\<^esub> c (q \<bullet> Let p t\<^isub>1 t\<^isub>2)"} 
  2000   For the @{text Let} term-constructor  we therefore have to establish @{text "P\<^bsub>trm\<^esub> c (q \<bullet> Let p t\<^isub>1 t\<^isub>2)"} 
  1984   assuming \eqref{hyps} as induction hypotheses (the first for @{text t\<^isub>1} and @{text t\<^isub>2}). 
  2001   assuming \eqref{hyps} as induction hypotheses (the first for @{text t\<^isub>1} and @{text t\<^isub>2}). 
  1994   hold. The latter fact and \eqref{renaming} give us
  2011   hold. The latter fact and \eqref{renaming} give us
  1995   %
  2012   %
  1996   \begin{center}
  2013   \begin{center}
  1997   \begin{tabular}{l}
  2014   \begin{tabular}{l}
  1998   @{text "Let (q \<bullet> p) (q \<bullet> t\<^isub>1) (q \<bullet> t\<^isub>2) ="} \\
  2015   @{text "Let (q \<bullet> p) (q \<bullet> t\<^isub>1) (q \<bullet> t\<^isub>2) ="} \\
  1999   \hspace{15mm}@{text "Let (r \<bullet>\<^bsub>bn\<^esub> (q \<bullet> p)) (q \<bullet> t\<^isub>1) (r \<bullet> (q \<bullet> t\<^isub>2))"}
  2016   \hspace{15mm}@{text "Let (r \<bullet>\<AL>\<^bsub>bn\<^esub> (q \<bullet> p)) (q \<bullet> t\<^isub>1) (r \<bullet> (q \<bullet> t\<^isub>2))"}
  2000   \end{tabular}
  2017   \end{tabular}
  2001   \end{center}
  2018   \end{center}
  2002 
  2019 
  2003   \noindent
  2020   \noindent
  2004   So instead of proving @{text "P\<^bsub>trm\<^esub> c (q \<bullet> Let p t\<^isub>1 t\<^isub>2)"}, we can equally
  2021   So instead of proving @{text "P\<^bsub>trm\<^esub> c (q \<bullet> Let p t\<^isub>1 t\<^isub>2)"}, we can equally
  2005   establish @{text "P\<^bsub>trm\<^esub> c (Let (r \<bullet>\<^bsub>bn\<^esub> (q \<bullet> p)) (q \<bullet> t\<^isub>1) (r \<bullet> (q \<bullet> t\<^isub>2)))"}.
  2022   establish @{text "P\<^bsub>trm\<^esub> c (Let (r \<bullet>\<AL>\<^bsub>bn\<^esub> (q \<bullet> p)) (q \<bullet> t\<^isub>1) (r \<bullet> (q \<bullet> t\<^isub>2)))"}.
  2006   To do so, we will use the implication \eqref{strong} of the strong induction
  2023   To do so, we will use the implication \eqref{strong} of the strong induction
  2007   principle, which requires us to discharge
  2024   principle, which requires us to discharge
  2008   the following four proof obligations:
  2025   the following four proof obligations:
  2009   %
  2026   %
  2010   \begin{center}
  2027   \begin{center}
  2011   \begin{tabular}{rl}
  2028   \begin{tabular}{rl}
  2012   {\it i)} &   @{text "set (bn (r \<bullet>\<^bsub>bn\<^esub> (q \<bullet> p))) #\<^sup>* c"}\\
  2029   {\it (i)} &   @{text "set (bn (r \<bullet>\<AL>\<^bsub>bn\<^esub> (q \<bullet> p))) #\<^sup>* c"}\\
  2013   {\it ii)} &  @{text "\<forall>d. P\<^bsub>pat\<^esub> d (r \<bullet>\<^bsub>bn\<^esub> (q \<bullet> p))"}\\
  2030   {\it (ii)} &  @{text "\<forall>d. P\<^bsub>pat\<^esub> d (r \<bullet>\<AL>\<^bsub>bn\<^esub> (q \<bullet> p))"}\\
  2014   {\it iii)} & @{text "\<forall>d. P\<^bsub>trm\<^esub> d (q \<bullet> t\<^isub>1)"}\\
  2031   {\it (iii)} & @{text "\<forall>d. P\<^bsub>trm\<^esub> d (q \<bullet> t\<^isub>1)"}\\
  2015   {\it iv)} & @{text "\<forall>d. P\<^bsub>trm\<^esub> d (r \<bullet> (q \<bullet> t\<^isub>2))"}\\
  2032   {\it (iv)} & @{text "\<forall>d. P\<^bsub>trm\<^esub> d (r \<bullet> (q \<bullet> t\<^isub>2))"}\\
  2016   \end{tabular}
  2033   \end{tabular}
  2017   \end{center}
  2034   \end{center}
  2018 
  2035 
  2019   \noindent
  2036   \noindent
  2020   The first follows from \eqref{rprops} and Lemma~\ref{permutebn}.{\it i)}; the 
  2037   The first follows from \eqref{rprops} and Lemma~\ref{permutebn}.{\it (i)}; the 
  2021   others from the induction hypotheses in \eqref{hyps} (in the fourth case
  2038   others from the induction hypotheses in \eqref{hyps} (in the fourth case
  2022   we have to use the fact that @{term "(r \<bullet> (q \<bullet> t\<^isub>2)) = (r + q) \<bullet> t\<^isub>2"}).
  2039   we have to use the fact that @{term "(r \<bullet> (q \<bullet> t\<^isub>2)) = (r + q) \<bullet> t\<^isub>2"}).
  2023 
  2040 
  2024   Taking now the identity permutation @{text 0} for the permutations in \eqref{hyps},
  2041   Taking now the identity permutation @{text 0} for the permutations in \eqref{hyps},
  2025   we can establish our original goals, namely @{text "P\<^bsub>trm\<^esub> c t"} and \mbox{@{text "P\<^bsub>pat\<^esub> c p"}}.
  2042   we can establish our original goals, namely @{text "P\<^bsub>trm\<^esub> c t"} and \mbox{@{text "P\<^bsub>pat\<^esub> c p"}}.
  2026   This completes the proof showing that the strong induction principle derives from
  2043   This completes the proof showing that the weak induction principles imply 
  2027   the weak induction principle. For the moment we can derive the difficult cases of 
  2044   the strong induction principles. 
  2028   the strong induction principles only by hand, but they are very schematic 
       
  2029   so that with little effort we can even derive them for 
       
  2030   Core-Haskell given in Figure~\ref{nominalcorehas}. 
       
  2031 *}
  2045 *}
  2032 
  2046 
  2033 
  2047 
  2034 section {* Related Work *}
  2048 section {* Related Work *}
  2035 
  2049 
  2071   versions of Nominal Isabelle (one about Psi-calculi and one about algorithm W 
  2085   versions of Nominal Isabelle (one about Psi-calculi and one about algorithm W 
  2072   \cite{BengtsonParow09, UrbanNipkow09}).  Both
  2086   \cite{BengtsonParow09, UrbanNipkow09}).  Both
  2073   use the approach based on iterated single binders. Our experience with
  2087   use the approach based on iterated single binders. Our experience with
  2074   the latter formalisation has been disappointing. The major pain arose from
  2088   the latter formalisation has been disappointing. The major pain arose from
  2075   the need to ``unbind'' variables. This can be done in one step with our
  2089   the need to ``unbind'' variables. This can be done in one step with our
  2076   general binders, but needs a cumbersome
  2090   general binders described in this paper, but needs a cumbersome
  2077   iteration with single binders. The resulting formal reasoning turned out to
  2091   iteration with single binders. The resulting formal reasoning turned out to
  2078   be rather unpleasant. The hope is that the extension presented in this paper
  2092   be rather unpleasant. The hope is that the extension presented in this paper
  2079   is a substantial improvement.
  2093   is a substantial improvement.
  2080  
  2094  
  2081   The most closely related work to the one presented here is the Ott-tool
  2095   The most closely related work to the one presented here is the Ott-tool
  2095   its definition of $\alpha$-equivalence is unsuitable for our extension of
  2109   its definition of $\alpha$-equivalence is unsuitable for our extension of
  2096   Nominal Isabelle. First, it is far too complicated to be a basis for
  2110   Nominal Isabelle. First, it is far too complicated to be a basis for
  2097   automated proofs implemented on the ML-level of Isabelle/HOL. Second, it
  2111   automated proofs implemented on the ML-level of Isabelle/HOL. Second, it
  2098   covers cases of binders depending on other binders, which just do not make
  2112   covers cases of binders depending on other binders, which just do not make
  2099   sense for our $\alpha$-equated terms. Third, it allows empty types that have no
  2113   sense for our $\alpha$-equated terms. Third, it allows empty types that have no
  2100   meaning in a HOL-based theorem prover. We also had to generalise slightly their 
  2114   meaning in a HOL-based theorem prover. We also had to generalise slightly Ott's 
  2101   binding clauses. In Ott you specify binding clauses with a single body; we 
  2115   binding clauses. In Ott you specify binding clauses with a single body; we 
  2102   allow more than one. We have to do this, because this makes a difference 
  2116   allow more than one. We have to do this, because this makes a difference 
  2103   for our notion of $\alpha$-equivalence in case of \isacommand{bind\_set} and 
  2117   for our notion of $\alpha$-equivalence in case of \isacommand{bind\_set} and 
  2104   \isacommand{bind\_res}. For example
  2118   \isacommand{bind\_res}. Consider the examples
  2105 
  2119 
  2106   \begin{center}
  2120   \begin{center}
  2107   \begin{tabular}{@ {}l@ {\hspace{2mm}}l@ {}}
  2121   \begin{tabular}{@ {}l@ {\hspace{2mm}}l@ {}}
  2108   @{text "Foo\<^isub>1 xs::name fset t::trm s::trm"} &  
  2122   @{text "Foo\<^isub>1 xs::name fset t::trm s::trm"} &  
  2109       \isacommand{bind\_set} @{text "xs"} \isacommand{in} @{text "t s"}\\
  2123       \isacommand{bind\_set} @{text "xs"} \isacommand{in} @{text "t s"}\\
  2112       \isacommand{bind\_set} @{text "xs"} \isacommand{in} @{text "s"}\\
  2126       \isacommand{bind\_set} @{text "xs"} \isacommand{in} @{text "s"}\\
  2113   \end{tabular}
  2127   \end{tabular}
  2114   \end{center}
  2128   \end{center}
  2115 
  2129 
  2116   \noindent
  2130   \noindent
  2117   in the first term-constructor we have a single
  2131   In the first term-constructor we have a single
  2118   body that happens to be ``spread'' over two arguments; in the second term-constructor we have
  2132   body that happens to be ``spread'' over two arguments; in the second term-constructor we have
  2119   two independent bodies in which the same variables are bound. As a result we 
  2133   two independent bodies in which the same variables are bound. As a result we 
  2120   have
  2134   have
  2121 
  2135 
  2122   \begin{center}
  2136   \begin{center}
  2151   reasoning infrastructure is well beyond the purposes of his language. 
  2165   reasoning infrastructure is well beyond the purposes of his language. 
  2152   
  2166   
  2153   In a slightly different domain (programming with dependent types), the 
  2167   In a slightly different domain (programming with dependent types), the 
  2154   paper \cite{Altenkirch10} presents a calculus with a notion of 
  2168   paper \cite{Altenkirch10} presents a calculus with a notion of 
  2155   $\alpha$-equivalence related to our binding mode \isacommand{bind\_res}.
  2169   $\alpha$-equivalence related to our binding mode \isacommand{bind\_res}.
  2156   The corresponding definition is similar to the one by Pottier, except that it
  2170   The definition in \cite{Altenkirch10} is similar to the one by Pottier, except that it
  2157   has a more operational flavour and calculates a partial (renaming) map. 
  2171   has a more operational flavour and calculates a partial (renaming) map. 
  2158   In this way Altenkirch et al can deal with vacuous binders. However, to our
  2172   In this way, the definition can deal with vacuous binders. However, to our
  2159   best knowledge, no concrete mathematical result concerning their notion
  2173   best knowledge, no concrete mathematical result concerning this
  2160   of equality has been proved.    
  2174   definition of $\alpha$-equivalence has been proved.    
  2161 *}
  2175 *}
  2162 
  2176 
  2163 section {* Conclusion *}
  2177 section {* Conclusion *}
  2164 
  2178 
  2165 text {*
  2179 text {*
  2166   We have presented an extension of Nominal Isabelle for dealing with
  2180   We have presented an extension of Nominal Isabelle for dealing with
  2167   general binders, that is term-constructors having multiple bound 
  2181   general binders, that is term-constructors having multiple bound 
  2168   variables. For this extension we introduced novel definitions of 
  2182   variables. For this extension we introduced novel definitions of 
  2169   $\alpha$-equivalence and automated all necessary proofs in Isabelle/HOL.
  2183   $\alpha$-equivalence and automated all necessary proofs in Isabelle/HOL.
  2170   We have tried out the extension with terms from Core-Haskell and our code
  2184   To specify general binders we used the syntax from Ott, but modified 
  2171   will become part of the Isabelle distribution.\footnote{For the moment
  2185   it so that it makes sense in our context of $\alpha$-equated terms.
       
  2186   We have tried out the extension with terms from Core-Haskell, type-schemes 
       
  2187   and the lambda-calculus, and our code
       
  2188   will eventually become part of the next Isabelle distribution.\footnote{For the moment
  2172   it can be downloaded from the Mercurial repository linked at
  2189   it can be downloaded from the Mercurial repository linked at
  2173   \href{http://isabelle.in.tum.de/nominal/download}
  2190   \href{http://isabelle.in.tum.de/nominal/download}
  2174   {http://isabelle.in.tum.de/nominal/download}.}
  2191   {http://isabelle.in.tum.de/nominal/download}.}
  2175 
  2192 
  2176   We have left out a discussion about how functions can be defined over
  2193   We have left out a discussion about how functions can be defined over
  2179   hope to do better this time by using the function package that has recently
  2196   hope to do better this time by using the function package that has recently
  2180   been implemented in Isabelle/HOL and also by restricting function
  2197   been implemented in Isabelle/HOL and also by restricting function
  2181   definitions to equivariant functions (for such functions it is possible to
  2198   definitions to equivariant functions (for such functions it is possible to
  2182   provide more automation).
  2199   provide more automation).
  2183 
  2200 
  2184   There are some restrictions we imposed in this paper, that we would like to lift in
  2201   There are some restrictions we imposed in this paper that we would like to lift in
  2185   future work. One is the exclusion of nested datatype definitions. Nested
  2202   future work. One is the exclusion of nested datatype definitions. Nested
  2186   datatype definitions allow one to specify, for instance, the function kinds
  2203   datatype definitions allow one to specify, for instance, the function kinds
  2187   in Core-Haskell as @{text "TFun string (ty list)"} instead of the unfolded
  2204   in Core-Haskell as @{text "TFun string (ty list)"} instead of the unfolded
  2188   version @{text "TFun string ty_list"} (see Figure~\ref{nominalcorehas}). To
  2205   version @{text "TFun string ty_list"} (see Figure~\ref{nominalcorehas}). To
  2189   achieve this, we need a slightly more clever implementation than we have at the moment. 
  2206   achieve this, we need a slightly more clever implementation than we have at the moment. 
  2190 
  2207 
  2191   A more interesting line of investigation is whether we can go beyond the 
  2208   A more interesting line of investigation is whether we can go beyond the 
  2192   simple-minded form for binding functions that we adopted from Ott. At the moment, binding
  2209   simple-minded form of binding functions that we adopted from Ott. At the moment, binding
  2193   functions can only return the empty set, a singleton atom set or unions
  2210   functions can only return the empty set, a singleton atom set or unions
  2194   of atom sets (similarly for lists). It remains to be seen whether 
  2211   of atom sets (similarly for lists). It remains to be seen whether 
  2195   properties like
  2212   properties like
  2196   %
  2213   %
  2197   \begin{center}
  2214   \begin{center}