|
1 (* How to change the notation for \<lbrakk> \<rbrakk> meta-level implications? *) |
1 |
2 |
2 (*<*) |
3 (*<*) |
3 theory Paper |
4 theory Paper |
4 imports "Quotient" |
5 imports "Quotient" |
5 "LaTeXsugar" |
6 "LaTeXsugar" |
6 "../Nominal/FSet" |
7 "../Nominal/FSet" |
7 begin |
8 begin |
8 |
9 |
|
10 print_syntax |
|
11 |
9 notation (latex output) |
12 notation (latex output) |
10 rel_conj ("_ OOO _" [53, 53] 52) |
13 rel_conj ("_ OOO _" [53, 53] 52) |
11 and |
14 and |
12 fun_map ("_ ---> _" [51, 51] 50) |
15 "op -->" (infix "\<rightarrow>" 100) |
13 and |
16 and |
14 fun_rel ("_ ===> _" [51, 51] 50) |
17 "==>" (infix "\<Rightarrow>" 100) |
|
18 and |
|
19 fun_map (infix "\<longrightarrow>" 51) |
|
20 and |
|
21 fun_rel (infix "\<Longrightarrow>" 51) |
15 and |
22 and |
16 list_eq (infix "\<approx>" 50) (* Not sure if we want this notation...? *) |
23 list_eq (infix "\<approx>" 50) (* Not sure if we want this notation...? *) |
17 |
24 |
18 ML {* |
25 ML {* |
19 fun nth_conj n (_, r) = nth (HOLogic.dest_conj r) n; |
26 fun nth_conj n (_, r) = nth (HOLogic.dest_conj r) n; |
206 \begin{itemize} |
213 \begin{itemize} |
207 \item @{text "ABS(\<alpha>\<^isub>1, \<alpha>\<^isub>2)"} = @{text "id"} |
214 \item @{text "ABS(\<alpha>\<^isub>1, \<alpha>\<^isub>2)"} = @{text "id"} |
208 \item @{text "REP(\<alpha>\<^isub>1, \<alpha>\<^isub>2)"} = @{text "id"} |
215 \item @{text "REP(\<alpha>\<^isub>1, \<alpha>\<^isub>2)"} = @{text "id"} |
209 \item @{text "ABS(\<sigma>, \<sigma>)"} = @{text "id"} |
216 \item @{text "ABS(\<sigma>, \<sigma>)"} = @{text "id"} |
210 \item @{text "REP(\<sigma>, \<sigma>)"} = @{text "id"} |
217 \item @{text "REP(\<sigma>, \<sigma>)"} = @{text "id"} |
211 \item @{text "ABS(\<sigma>\<^isub>1\<rightarrow>\<sigma>\<^isub>2,\<tau>\<^isub>1\<rightarrow>\<tau>\<^isub>2)"} = @{text "REP(\<sigma>\<^isub>1,\<tau>\<^isub>1) ---> ABS(\<sigma>\<^isub>2,\<tau>\<^isub>2)"} |
218 \item @{text "ABS(\<sigma>\<^isub>1\<rightarrow>\<sigma>\<^isub>2,\<tau>\<^isub>1\<rightarrow>\<tau>\<^isub>2)"} = @{text "REP(\<sigma>\<^isub>1,\<tau>\<^isub>1) \<longrightarrow> ABS(\<sigma>\<^isub>2,\<tau>\<^isub>2)"} |
212 \item @{text "REP(\<sigma>\<^isub>1\<rightarrow>\<sigma>\<^isub>2,\<tau>\<^isub>1\<rightarrow>\<tau>\<^isub>2)"} = @{text "ABS(\<sigma>\<^isub>1,\<tau>\<^isub>1) ---> REP(\<sigma>\<^isub>2,\<tau>\<^isub>2)"} |
219 \item @{text "REP(\<sigma>\<^isub>1\<rightarrow>\<sigma>\<^isub>2,\<tau>\<^isub>1\<rightarrow>\<tau>\<^isub>2)"} = @{text "ABS(\<sigma>\<^isub>1,\<tau>\<^isub>1) \<longrightarrow> REP(\<sigma>\<^isub>2,\<tau>\<^isub>2)"} |
213 \item @{text "ABS((\<sigma>\<^isub>1,\<dots>,\<sigma>\<^isub>n))\<kappa>, (\<tau>\<^isub>1,\<dots>,\<tau>\<^isub>n))\<kappa>)"} = @{text "(map \<kappa>) (ABS(\<sigma>\<^isub>1,\<tau>\<^isub>1)) \<dots> (ABS(\<sigma>\<^isub>n,\<tau>\<^isub>n))"} |
220 \item @{text "ABS((\<sigma>\<^isub>1,\<dots>,\<sigma>\<^isub>n))\<kappa>, (\<tau>\<^isub>1,\<dots>,\<tau>\<^isub>n))\<kappa>)"} = @{text "(map \<kappa>) (ABS(\<sigma>\<^isub>1,\<tau>\<^isub>1)) \<dots> (ABS(\<sigma>\<^isub>n,\<tau>\<^isub>n))"} |
214 \item @{text "REP((\<sigma>\<^isub>1,\<dots>,\<sigma>\<^isub>n))\<kappa>, (\<tau>\<^isub>1,\<dots>,\<tau>\<^isub>n))\<kappa>)"} = @{text "(map \<kappa>) (REP(\<sigma>\<^isub>1,\<tau>\<^isub>1)) \<dots> (REP(\<sigma>\<^isub>n,\<tau>\<^isub>n))"} |
221 \item @{text "REP((\<sigma>\<^isub>1,\<dots>,\<sigma>\<^isub>n))\<kappa>, (\<tau>\<^isub>1,\<dots>,\<tau>\<^isub>n))\<kappa>)"} = @{text "(map \<kappa>) (REP(\<sigma>\<^isub>1,\<tau>\<^isub>1)) \<dots> (REP(\<sigma>\<^isub>n,\<tau>\<^isub>n))"} |
215 \item @{text "ABS((\<sigma>\<^isub>1,\<dots>,\<sigma>\<^isub>n))\<kappa>\<^isub>1, (\<tau>\<^isub>1,\<dots>,\<tau>\<^isub>m))\<kappa>\<^isub>2)"} = @{text "Abs_\<kappa>\<^isub>2 \<circ> (map \<kappa>\<^isub>1) (ABS(\<rho>\<^isub>1,\<nu>\<^isub>1) \<dots> (ABS(\<rho>\<^isub>p,\<nu>\<^isub>p)"} provided @{text "\<eta> \<kappa>\<^isub>2 = (\<alpha>\<^isub>1\<dots>\<alpha>\<^isub>p)\<kappa>\<^isub>1 \<and> \<exists>s. s(\<sigma>s\<kappa>\<^isub>1)=\<rho>s\<kappa>\<^isub>1 \<and> s(\<tau>s\<kappa>\<^isub>2)=\<nu>s\<kappa>\<^isub>2"} |
222 \item @{text "ABS((\<sigma>\<^isub>1,\<dots>,\<sigma>\<^isub>n))\<kappa>\<^isub>1, (\<tau>\<^isub>1,\<dots>,\<tau>\<^isub>m))\<kappa>\<^isub>2)"} = @{text "Abs_\<kappa>\<^isub>2 \<circ> (map \<kappa>\<^isub>1) (ABS(\<rho>\<^isub>1,\<nu>\<^isub>1) \<dots> (ABS(\<rho>\<^isub>p,\<nu>\<^isub>p)"} provided @{text "\<eta> \<kappa>\<^isub>2 = (\<alpha>\<^isub>1\<dots>\<alpha>\<^isub>p)\<kappa>\<^isub>1 \<and> \<exists>s. s(\<sigma>s\<kappa>\<^isub>1)=\<rho>s\<kappa>\<^isub>1 \<and> s(\<tau>s\<kappa>\<^isub>2)=\<nu>s\<kappa>\<^isub>2"} |
216 \item @{text "REP((\<sigma>\<^isub>1,\<dots>,\<sigma>\<^isub>n))\<kappa>\<^isub>1, (\<tau>\<^isub>1,\<dots>,\<tau>\<^isub>m))\<kappa>\<^isub>2)"} = @{text "(map \<kappa>\<^isub>1) (REP(\<rho>\<^isub>1,\<nu>\<^isub>1) \<dots> (REP(\<rho>\<^isub>p,\<nu>\<^isub>p) \<circ> Rep_\<kappa>\<^isub>2"} provided @{text "\<eta> \<kappa>\<^isub>2 = (\<alpha>\<^isub>1\<dots>\<alpha>\<^isub>p)\<kappa>\<^isub>1 \<and> \<exists>s. s(\<sigma>s\<kappa>\<^isub>1)=\<rho>s\<kappa>\<^isub>1 \<and> s(\<tau>s\<kappa>\<^isub>2)=\<nu>s\<kappa>\<^isub>2"} |
223 \item @{text "REP((\<sigma>\<^isub>1,\<dots>,\<sigma>\<^isub>n))\<kappa>\<^isub>1, (\<tau>\<^isub>1,\<dots>,\<tau>\<^isub>m))\<kappa>\<^isub>2)"} = @{text "(map \<kappa>\<^isub>1) (REP(\<rho>\<^isub>1,\<nu>\<^isub>1) \<dots> (REP(\<rho>\<^isub>p,\<nu>\<^isub>p) \<circ> Rep_\<kappa>\<^isub>2"} provided @{text "\<eta> \<kappa>\<^isub>2 = (\<alpha>\<^isub>1\<dots>\<alpha>\<^isub>p)\<kappa>\<^isub>1 \<and> \<exists>s. s(\<sigma>s\<kappa>\<^isub>1)=\<rho>s\<kappa>\<^isub>1 \<and> s(\<tau>s\<kappa>\<^isub>2)=\<nu>s\<kappa>\<^isub>2"} |
217 \end{itemize} |
224 \end{itemize} |
218 |
225 |
219 Apart from the last 2 points the definition is same as the one implemented in |
226 Apart from the last 2 points the definition is same as the one implemented in |
220 in Homeier's HOL package, below is the definition of @{term fconcat} |
227 in Homeier's HOL package. Adding composition in last two cases is necessary |
221 that shows the last points: |
228 for compositional quotients. We ilustrate the different behaviour of the |
|
229 definition by showing the derived definition of @{term fconcat}: |
222 |
230 |
223 @{thm fconcat_def[no_vars]} |
231 @{thm fconcat_def[no_vars]} |
224 |
232 |
225 The aggregate @{term Abs} function takes a finite set of finite sets |
233 The aggregate @{term Abs} function takes a finite set of finite sets |
226 and applies @{term "map rep_fset"} composed with @{term rep_fset} to |
234 and applies @{term "map rep_fset"} composed with @{term rep_fset} to |
416 For existential quantifiers and unique existential quantifiers it is |
424 For existential quantifiers and unique existential quantifiers it is |
417 defined similarily to the universal one. |
425 defined similarily to the universal one. |
418 |
426 |
419 *} |
427 *} |
420 |
428 |
421 subsection {* Proof of Regularization *} |
429 subsection {* Proof procedure *} |
422 |
430 |
423 text {* |
431 (* In the below the type-guiding 'QuotTrue' assumption is removed; since we |
424 Example of non-regularizable theorem ($0 = 1$). |
432 present in a paper a version with typed-variables it is not necessary *) |
|
433 |
|
434 text {* |
|
435 |
|
436 With the above definitions of @{text "REG"} and @{text "INJ"} we can show |
|
437 how the proof is performed. The first step is always the application of |
|
438 of the following lemma: |
|
439 |
|
440 @{term "[|A; A --> B; B = C; C = D|] ==> D"} |
|
441 |
|
442 With @{text A} instantiated to the original raw theorem, |
|
443 @{text B} instantiated to @{text "REG(A)"}, |
|
444 @{text C} instantiated to @{text "INJ(REG(A))"}, |
|
445 and @{text D} instantiated to the statement of the lifted theorem. |
|
446 The first assumption can be immediately discharged using the original |
|
447 theorem and the three left subgoals are exactly the subgoals of regularization, |
|
448 injection and cleaning. The three can be proved independently by the |
|
449 framework and in case there are non-solved subgoals they can be left |
|
450 to the user. |
|
451 |
|
452 The injection and cleaning subgoals are always solved if the appropriate |
|
453 respectfulness and preservation theorems are given. It is not the case |
|
454 with regularization; sometimes a theorem given by the user does not |
|
455 imply a regularized version and a stronger one needs to be proved. This |
|
456 is outside of the scope of the quotient package, so the user is then left |
|
457 with such obligations. As an example lets see the simplest possible |
|
458 non-liftable theorem for integers: When we want to prove @{term "0 \<noteq> 1"} |
|
459 on integers the fact that @{term "\<not> (0, 0) = (1, 0)"} is not enough. It |
|
460 only shows that particular items in the equivalence classes are not equal, |
|
461 a more general statement saying that the classes are not equal is necessary. |
|
462 *} |
|
463 |
|
464 subsection {* Proving Regularization *} |
|
465 |
|
466 text {* |
|
467 Isabelle provides |
|
468 |
425 |
469 |
426 |
470 |
427 Separtion of regularization from injection thanks to the following 2 lemmas: |
471 Separtion of regularization from injection thanks to the following 2 lemmas: |
428 \begin{lemma} |
472 \begin{lemma} |
429 If @{term R2} is an equivalence relation, then: |
473 If @{term R2} is an equivalence relation, then: |