798 abstractions involving raw types by bounded ones, and equalities |
798 abstractions involving raw types by bounded ones, and equalities |
799 involving raw types are replaced by appropriate aggregate |
799 involving raw types are replaced by appropriate aggregate |
800 equivalence relations. It is defined as follows: |
800 equivalence relations. It is defined as follows: |
801 |
801 |
802 \begin{center} |
802 \begin{center} |
803 \begin{tabular}{rcl} |
803 \begin{longtable}{rcl} |
804 \multicolumn{3}{@ {\hspace{-4mm}}l}{abstractions (with same types and different types):}\\ |
804 \multicolumn{3}{@ {}l}{abstractions:}\smallskip\\ |
805 @{text "REG (\<lambda>x : \<sigma>. t, \<lambda>x : \<sigma>. s)"} & $\dn$ & @{text "\<lambda>x : \<sigma>. REG (t, s)"}\\ |
805 @{text "REG (\<lambda>x\<^sup>\<sigma>. t, \<lambda>x\<^sup>\<tau>. s)"} & $\dn$ & |
806 @{text "REG (\<lambda>x : \<sigma>. t, \<lambda>x : \<tau>. s)"} & $\dn$ & @{text "\<lambda>x : \<sigma> \<in> Respects (REL (\<sigma>, \<tau>)). REG (t, s)"}\\ |
806 $\begin{cases} |
807 \multicolumn{3}{@ {\hspace{-4mm}}l}{quantification (over same types and different types):}\\ |
807 @{text "\<lambda>x\<^sup>\<sigma>. REG (t, s)"} \quad\mbox{provided @{text "\<sigma> = \<tau>"}}\\ |
808 @{text "REG (\<forall>x : \<sigma>. t, \<forall>x : \<sigma>. s)"} & $\dn$ & @{text "\<forall>x : \<sigma>. REG (t, s)"}\\ |
808 @{text "\<lambda>x\<^sup>\<sigma> \<in> Respects (REL (\<sigma>, \<tau>)). REG (t, s)"} |
809 @{text "REG (\<forall>x : \<sigma>. t, \<forall>x : \<tau>. s)"} & $\dn$ & @{text "\<forall>x : \<sigma> \<in> Respects (REL (\<sigma>, \<tau>)). REG (t, s)"}\\ |
809 \end{cases}$\smallskip\\ |
810 \multicolumn{3}{@ {\hspace{-4mm}}l}{equalities (with same types and different types):}\\ |
810 \multicolumn{3}{@ {}l}{universal quantifiers:}\\ |
811 @{text "REG ((op =) : \<sigma>, (op =) : \<sigma>)"} & $\dn$ & @{text "(op =) : \<sigma>"}\\ |
811 @{text "REG (\<forall>x\<^sup>\<sigma>. t, \<forall>x\<^sup>\<tau>. s)"} & $\dn$ & |
812 @{text "REG ((op =) : \<sigma>, (op =) : \<tau>)"} & $\dn$ & @{text "REL (\<sigma>, \<tau>) : \<sigma>"}\\ |
812 $\begin{cases} |
813 \multicolumn{3}{@ {\hspace{-4mm}}l}{applications, variables, constants:}\\ |
813 @{text "\<forall>x\<^sup>\<sigma>. REG (t, s)"} \quad\mbox{provided @{text "\<sigma> = \<tau>"}}\\ |
|
814 @{text "\<forall>x\<^sup>\<sigma> \<in> Respects (REL (\<sigma>, \<tau>)). REG (t, s)"} |
|
815 \end{cases}$\smallskip\\ |
|
816 \multicolumn{3}{@ {}l}{equality:}\smallskip\\ |
|
817 @{text "REG (=\<^bsup>\<sigma>\<Rightarrow>\<sigma>\<Rightarrow>bool\<^esup>, =\<^bsup>\<tau>\<Rightarrow>\<tau>\<Rightarrow>bool\<^esup>)"} & $\dn$ & |
|
818 $\begin{cases} |
|
819 @{text "="} \quad\mbox{provided @{text "\<sigma> = \<tau>"}}\\ |
|
820 @{text "REL (\<sigma>, \<tau>)"}\\ |
|
821 \end{cases}$\\ |
|
822 \multicolumn{3}{@ {}l}{applications, variables and constants:}\\ |
814 @{text "REG (t\<^isub>1 t\<^isub>2, s\<^isub>1 s\<^isub>2)"} & $\dn$ & @{text "REG (t\<^isub>1, s\<^isub>1) REG (t\<^isub>2, s\<^isub>2)"}\\ |
823 @{text "REG (t\<^isub>1 t\<^isub>2, s\<^isub>1 s\<^isub>2)"} & $\dn$ & @{text "REG (t\<^isub>1, s\<^isub>1) REG (t\<^isub>2, s\<^isub>2)"}\\ |
815 @{text "REG (v\<^isub>1, v\<^isub>2)"} & $\dn$ & @{text "v\<^isub>1"}\\ |
824 @{text "REG (x\<^isub>1, x\<^isub>2)"} & $\dn$ & @{text "x\<^isub>1"}\\ |
816 @{text "REG (c\<^isub>1, c\<^isub>2)"} & $\dn$ & @{text "c\<^isub>1"}\\ |
825 @{text "REG (c\<^isub>1, c\<^isub>2)"} & $\dn$ & @{text "c\<^isub>1"}\\[-5mm] |
817 \end{tabular} |
826 \end{longtable} |
818 \end{center} |
827 \end{center} |
819 |
828 % |
|
829 \noindent |
820 In the above definition we omitted the cases for existential quantifiers |
830 In the above definition we omitted the cases for existential quantifiers |
821 and unique existential quantifiers, as they are very similar to the cases |
831 and unique existential quantifiers, as they are very similar to the cases |
822 for the universal quantifier. |
832 for the universal quantifier. |
823 Next we define the function @{text INJ} which takes the statement of |
833 Next we define the function @{text INJ} which takes the statement of |
824 the regularized theorems and the statement of the lifted theorem both as |
834 the regularized theorems and the statement of the lifted theorem both as |
825 terms and returns the statement of the injected theorem: |
835 terms and returns the statement of the injected theorem: |
826 |
836 |
827 \begin{center} |
837 \begin{center} |
828 \begin{tabular}{rcl} |
838 \begin{tabular}{rcl} |
829 \multicolumn{3}{@ {\hspace{-4mm}}l}{abstractions (with same types and different types):}\\ |
839 \multicolumn{3}{@ {\hspace{-4mm}}l}{abstractions:}\\ |
830 @{text "INJ ((\<lambda>x. t) : \<sigma>, (\<lambda>x. s) : \<sigma>) "} & $\dn$ & @{text "\<lambda>x. INJ (t, s)"}\\ |
840 @{text "INJ (\<lambda>x. t :: \<sigma>, \<lambda>x. s :: \<tau>) "} & $\dn$ & |
831 @{text "INJ ((\<lambda>x. t) : \<sigma>, (\<lambda>x. s) : \<tau>) "} & $\dn$ & @{text "REP(\<sigma>,\<tau>) (ABS (\<sigma>,\<tau>) (\<lambda>x. (INJ (t, s))))"}\\ |
841 $\begin{cases} |
832 @{text "INJ ((\<lambda>x \<in> R. t) : \<sigma>, (\<lambda>x. s) : \<tau>) "} & $\dn$ & @{text "REP(\<sigma>,\<tau>) (ABS (\<sigma>,\<tau>) (\<lambda>x \<in> R. (INJ (t, s))))"}\\ |
842 @{text "\<lambda>x. INJ (t, s)"} \quad\mbox{provided @{text "\<sigma> = \<tau>"}}\\ |
833 \multicolumn{3}{@ {\hspace{-4mm}}l}{quantification (over same types and different types):}\\ |
843 @{text "REP (\<sigma>, \<tau>) (ABS (\<sigma>, \<tau>) (\<lambda>x. INJ (t, s)))"} |
834 @{text "INJ (\<forall> t, \<forall> s) "} & $\dn$ & @{text "\<forall> (INJ (t, s))"}\\ |
844 \end{cases}$\\ |
835 @{text "INJ (\<forall> t \<in> R, \<forall> s) "} & $\dn$ & @{text "\<forall> INJ (t, s) \<in> R"}\\ |
845 @{text "INJ (\<lambda>x \<in> R. t :: \<sigma>, \<lambda>x. s :: \<tau>) "} & $\dn$ |
836 \multicolumn{3}{@ {\hspace{-4mm}}l}{applications, variables, constants:}\\ |
846 & @{text "REP (\<sigma>, \<tau>) (ABS (\<sigma>, \<tau>) (\<lambda>x \<in> R. INJ (t, s)))"}\smallskip\\ |
|
847 \multicolumn{3}{@ {\hspace{-4mm}}l}{universal quantifiers:}\\ |
|
848 @{text "INJ (\<forall> t, \<forall> s) "} & $\dn$ & @{text "\<forall> INJ (t, s)"}\\ |
|
849 @{text "INJ (\<forall> t \<in> R, \<forall> s) "} & $\dn$ & @{text "\<forall> INJ (t, s) \<in> R"}\smallskip\\ |
|
850 \multicolumn{3}{@ {\hspace{-4mm}}l}{applications, variables and constants:}\smallskip\\ |
837 @{text "INJ (t\<^isub>1 t\<^isub>2, s\<^isub>1 s\<^isub>2) "} & $\dn$ & @{text " INJ (t\<^isub>1, s\<^isub>1) INJ (t\<^isub>2, s\<^isub>2)"}\\ |
851 @{text "INJ (t\<^isub>1 t\<^isub>2, s\<^isub>1 s\<^isub>2) "} & $\dn$ & @{text " INJ (t\<^isub>1, s\<^isub>1) INJ (t\<^isub>2, s\<^isub>2)"}\\ |
838 @{text "INJ (v\<^isub>1 : \<sigma>, v\<^isub>2 : \<sigma>) "} & $\dn$ & @{text "v\<^isub>1"}\\ |
852 @{text "INJ (x\<^isub>1\<^sup>\<sigma>, x\<^isub>2\<^sup>\<tau>) "} & $\dn$ & |
839 @{text "INJ (v\<^isub>1 : \<sigma>, v\<^isub>2 : \<tau>) "} & $\dn$ & @{text "REP(\<sigma>,\<tau>) (ABS (\<sigma>,\<tau>) (v\<^isub>1))"}\\ |
853 $\begin{cases} |
840 @{text "INJ (c\<^isub>1 : \<sigma>, c\<^isub>2 : \<sigma>) "} & $\dn$ & @{text "c\<^isub>1"}\\ |
854 @{text "x\<^isub>1"} \quad\mbox{provided @{text "\<sigma> = \<tau>"}}\\ |
841 @{text "INJ (c\<^isub>1 : \<sigma>, c\<^isub>2 : \<tau>) "} & $\dn$ & @{text "REP(\<sigma>,\<tau>) (ABS (\<sigma>,\<tau>) (c\<^isub>1))"}\\ |
855 @{text "REP (\<sigma>, \<tau>) (ABS (\<sigma>, \<tau>) x\<^isub>1)"}\\ |
|
856 \end{cases}$\\ |
|
857 @{text "INJ (c\<^isub>1\<^sup>\<sigma>, c\<^isub>2\<^sup>\<tau>) "} & $\dn$ & |
|
858 $\begin{cases} |
|
859 @{text "c\<^isub>1"} \quad\mbox{provided @{text "\<sigma> = \<tau>"}}\\ |
|
860 @{text "REP (\<sigma>, \<tau>) (ABS (\<sigma>, \<tau>) c\<^isub>1)"}\\ |
|
861 \end{cases}$\\ |
842 \end{tabular} |
862 \end{tabular} |
843 \end{center} |
863 \end{center} |
844 |
864 |
845 \noindent where the cases for existential quantifiers and unique existential |
865 \noindent where the cases for existential quantifiers and unique existential |
846 quantifiers have been omitted for clarity; are similar to universal quantifier. |
866 quantifiers have been omitted for clarity; are similar to universal quantifier. |
855 The injection and cleaning subgoals are always solved if the appropriate |
875 The injection and cleaning subgoals are always solved if the appropriate |
856 respectfulness and preservation theorems are given. It is not the case |
876 respectfulness and preservation theorems are given. It is not the case |
857 with regularization; sometimes a theorem given by the user does not |
877 with regularization; sometimes a theorem given by the user does not |
858 imply a regularized version and a stronger one needs to be proved. This |
878 imply a regularized version and a stronger one needs to be proved. This |
859 is outside of the scope of the quotient package, so such obligations are |
879 is outside of the scope of the quotient package, so such obligations are |
860 left to the user. Take a simple statement for integers @{term "0 \<noteq> 1"}. |
880 left to the user. Take a simple statement for integers @{text "0 \<noteq> 1"}. |
861 It does not follow from the fact that @{term "\<not> (0, 0) = (1, 0)"} because |
881 It does not follow from the fact that @{text "(0, 0) \<noteq> (1, 0)"} because |
862 of regularization. The raw theorem only shows that particular items in the |
882 of regularization. The raw theorem only shows that particular items in the |
863 equivalence classes are not equal. A more general statement saying that |
883 equivalence classes are not equal. A more general statement saying that |
864 the classes are not equal is necessary. |
884 the classes are not equal is necessary. |
865 |
885 |
866 In the proof of the regularization subgoal we always start with an implication. |
886 In the proof of the regularization subgoal we always start with an implication. |
1031 of an equivalence checking algorithm for LF \cite{UrbanCheneyBerghofer08}, |
1055 of an equivalence checking algorithm for LF \cite{UrbanCheneyBerghofer08}, |
1032 Typed Scheme~\cite{TobinHochstadtFelleisen08}, several calculi for |
1056 Typed Scheme~\cite{TobinHochstadtFelleisen08}, several calculi for |
1033 concurrency \cite{BengtsonParow09} and a strong normalisation result for |
1057 concurrency \cite{BengtsonParow09} and a strong normalisation result for |
1034 cut-elimination in classical logic \cite{UrbanZhu08}. |
1058 cut-elimination in classical logic \cite{UrbanZhu08}. |
1035 |
1059 |
1036 Oscar Slotosch~\cite{Slotosch97} implemented a mechanism that automatically |
1060 Slotosch~\cite{Slotosch97} implemented a mechanism that automatically |
1037 defines quotient types for Isabelle/HOL. It did not include theorem lifting. |
1061 defines quotient types for Isabelle/HOL. It did not include theorem lifting. |
1038 John Harrison's quotient package~\cite{harrison-thesis} is the first one to |
1062 Harrison's quotient package~\cite{harrison-thesis} is the first one to |
1039 lift theorems, however only first order. There is work on quotient types in |
1063 lift theorems, however only first order. There is work on quotient types in |
1040 non-HOL based systems and logical frameworks, namely theory interpretations |
1064 non-HOL based systems and logical frameworks, namely theory interpretations |
1041 in PVS~\cite{PVS:Interpretations}, new types in MetaPRL~\cite{Nogin02}, or |
1065 in PVS~\cite{PVS:Interpretations}, new types in MetaPRL~\cite{Nogin02}, or |
1042 the use of setoids in Coq, with some higher order issues~\cite{ChicliPS02}. |
1066 the use of setoids in Coq, with some higher order issues~\cite{ChicliPS02}. |
1043 Larry Paulson shows a construction of quotients that does not require the |
1067 Paulson shows a construction of quotients that does not require the |
1044 Hilbert Choice operator, again only first order~\cite{Paulson06}. |
1068 Hilbert Choice operator, again only first order~\cite{Paulson06}. |
1045 The closest to our package is the package for HOL4 by Peter Homeier~\cite{Homeier05}, |
1069 The closest to our package is the package for HOL4 by Homeier~\cite{Homeier05}, |
1046 which is the first one to support lifting of higher order theorems. |
1070 which is the first one to support lifting of higher order theorems. |
1047 |
1071 |
1048 |
1072 |
1049 Our quotient package for the first time explore the notion of |
1073 Our quotient package for the first time explore the notion of |
1050 composition of quotients, which allows lifting constants like @{term |
1074 composition of quotients, which allows lifting constants like @{term |
1061 type-classes and locales. This has the advantage over packages |
1085 type-classes and locales. This has the advantage over packages |
1062 requiring big lists as input for the user of being able to develop |
1086 requiring big lists as input for the user of being able to develop |
1063 a theory progressively. |
1087 a theory progressively. |
1064 |
1088 |
1065 We allow lifting only some occurrences of quotiented types, which |
1089 We allow lifting only some occurrences of quotiented types, which |
1066 is useful in Nominal. The package can be used automatically with |
1090 is useful in Nominal Isabelle. The package can be used automatically with |
1067 an attribute, manually with separate tactics for parts of the lifting |
1091 an attribute, manually with separate tactics for parts of the lifting |
1068 procedure, and programatically. Automated definitions of constants |
1092 procedure, and programatically. Automated definitions of constants |
1069 and respectfulness proof obligations are used in Nominal. Finally |
1093 and respectfulness proof obligations are used in Nominal. Finally |
1070 we streamlined and showed the detailed lifting procedure, which |
1094 we streamlined and showed the detailed lifting procedure, which |
1071 has not been presented before. |
1095 has not been presented before. |
1072 |
1096 |
1073 \medskip |
1097 \medskip |
1074 \noindent |
1098 \noindent |
1075 {\bf Acknowledgements:} We would like to thank Peter Homeier for the |
1099 {\bf Acknowledgements:} We would like to thank Peter Homeier for the |
1076 discussions about the HOL4 quotient package and explaining us its |
1100 discussions about his HOL4 quotient package and explaining to us |
1077 implementation details. |
1101 some its finer points in the implementation. |
1078 |
1102 |
1079 *} |
1103 *} |
1080 |
1104 |
1081 |
1105 |
1082 |
1106 |