Quot/Examples/SigmaEx.thy
author Cezary Kaliszyk <kaliszyk@in.tum.de>
Fri, 12 Feb 2010 16:04:10 +0100
changeset 1139 c4001cda9da3
parent 1128 17ca92ab4660
permissions -rw-r--r--
renamed 'as' to 'is' everywhere.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
905
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     1
theory SigmaEx
1128
17ca92ab4660 Main renaming + fixes for new Isabelle in IntEx2.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1074
diff changeset
     2
imports Nominal "../Quotient" "../Quotient_List" "../Quotient_Product"
905
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     3
begin
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     4
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     5
atom_decl name
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     6
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     7
datatype robj =
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     8
  rVar "name"
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     9
| rObj "(string \<times> rmethod) list"
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    10
| rInv "robj" "string"
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    11
| rUpd "robj" "string" "rmethod"
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    12
and rmethod =
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    13
  rSig "name" "robj"
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    14
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    15
inductive
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    16
    alpha_obj :: "robj \<Rightarrow> robj \<Rightarrow> bool" ("_ \<approx>o _" [100, 100] 100)
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    17
and alpha_method :: "rmethod \<Rightarrow> rmethod \<Rightarrow> bool" ("_ \<approx>m _" [100, 100] 100)
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    18
where
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    19
  a1: "a = b \<Longrightarrow> (rVar a) \<approx>o (rVar b)"
914
b8e43414c5aa Proper alpha equivalence for Sigma calculus.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 912
diff changeset
    20
| a2: "rObj [] \<approx>o rObj []"
b8e43414c5aa Proper alpha equivalence for Sigma calculus.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 912
diff changeset
    21
| a3: "rObj t1 \<approx>o rObj t2 \<Longrightarrow> m1 \<approx>m r2 \<Longrightarrow> rObj ((l1, m1) # t1) \<approx>o rObj ((l2, m2) # t2)"
b8e43414c5aa Proper alpha equivalence for Sigma calculus.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 912
diff changeset
    22
| a4: "x \<approx>o y \<Longrightarrow> rInv x l1 \<approx>o rInv y l2"
b8e43414c5aa Proper alpha equivalence for Sigma calculus.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 912
diff changeset
    23
| a5: "\<exists>pi::name prm. (rfv t - {a} = rfv s - {b} \<and> (rfv t - {a})\<sharp>* pi \<and> (pi \<bullet> t) \<approx>o s \<and> (pi \<bullet> a) = b)
b8e43414c5aa Proper alpha equivalence for Sigma calculus.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 912
diff changeset
    24
       \<Longrightarrow> rSig a t \<approx>m rSig b s"
905
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    25
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    26
lemma alpha_equivps:
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    27
  shows "equivp alpha_obj"
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    28
  and   "equivp alpha_method"
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    29
sorry
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    30
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    31
quotient_type
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    32
    obj = robj / alpha_obj
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    33
and method = rmethod / alpha_method
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    34
  by (auto intro: alpha_equivps)
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    35
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    36
quotient_definition
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    37
  "Var :: name \<Rightarrow> obj"
1139
c4001cda9da3 renamed 'as' to 'is' everywhere.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1128
diff changeset
    38
is
905
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    39
  "rVar"
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    40
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    41
quotient_definition
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    42
  "Obj :: (string \<times> method) list \<Rightarrow> obj"
1139
c4001cda9da3 renamed 'as' to 'is' everywhere.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1128
diff changeset
    43
is
905
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    44
  "rObj"
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    45
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    46
quotient_definition
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    47
  "Inv :: obj \<Rightarrow> string \<Rightarrow> obj"
1139
c4001cda9da3 renamed 'as' to 'is' everywhere.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1128
diff changeset
    48
is
905
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    49
  "rInv"
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    50
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    51
quotient_definition
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    52
  "Upd :: obj \<Rightarrow> string \<Rightarrow> method \<Rightarrow> obj"
1139
c4001cda9da3 renamed 'as' to 'is' everywhere.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1128
diff changeset
    53
is
905
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    54
  "rUpd"
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    55
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    56
quotient_definition
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    57
  "Sig :: name \<Rightarrow> obj \<Rightarrow> method"
1139
c4001cda9da3 renamed 'as' to 'is' everywhere.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1128
diff changeset
    58
is
905
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    59
  "rSig"
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    60
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    61
overloading
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    62
  perm_obj \<equiv> "perm :: 'x prm \<Rightarrow> obj \<Rightarrow> obj" (unchecked)
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    63
  perm_method   \<equiv> "perm :: 'x prm \<Rightarrow> method \<Rightarrow> method" (unchecked)
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    64
begin
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    65
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    66
quotient_definition
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    67
  "perm_obj :: 'x prm \<Rightarrow> obj \<Rightarrow> obj"
1139
c4001cda9da3 renamed 'as' to 'is' everywhere.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1128
diff changeset
    68
is
905
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    69
  "(perm::'x prm \<Rightarrow> robj \<Rightarrow> robj)"
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    70
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    71
quotient_definition
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    72
  "perm_method :: 'x prm \<Rightarrow> method \<Rightarrow> method"
1139
c4001cda9da3 renamed 'as' to 'is' everywhere.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1128
diff changeset
    73
is
905
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    74
  "(perm::'x prm \<Rightarrow> rmethod \<Rightarrow> rmethod)"
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    75
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    76
end
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    77
1074
7a42cc191111 Fixes for Bex1 removal.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 980
diff changeset
    78
7a42cc191111 Fixes for Bex1 removal.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 980
diff changeset
    79
905
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    80
lemma tolift:
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    81
"\<forall> fvar.
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    82
 \<forall> fobj\<in>Respects (op = ===> list_rel (prod_rel (op =) alpha_method) ===> op =).
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    83
 \<forall> fnvk\<in>Respects (op = ===> alpha_obj ===> op =).
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    84
 \<forall> fupd\<in>Respects (op = ===> op = ===> alpha_obj ===> op = ===> alpha_method ===> op =).
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    85
 \<forall> fcns\<in>Respects (op = ===> op = ===> prod_rel (op =) alpha_method ===> list_rel (prod_rel (op =) alpha_method) ===> op =).
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    86
 \<forall> fnil.
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    87
 \<forall> fpar\<in>Respects (op = ===> op = ===> alpha_method ===> op =).
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    88
 \<forall> fsgm\<in>Respects (op = ===> (op = ===> alpha_obj) ===> op =).
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    89
1074
7a42cc191111 Fixes for Bex1 removal.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 980
diff changeset
    90
 Ex1 (\<lambda>x.
7a42cc191111 Fixes for Bex1 removal.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 980
diff changeset
    91
(x \<in> (Respects (prod_rel (alpha_obj ===> op =)
905
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    92
     (prod_rel (list_rel (prod_rel (op =) alpha_method) ===> op =)
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    93
       (prod_rel ((prod_rel (op =) alpha_method) ===> op =)
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    94
         (alpha_method ===> op =)
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    95
       )
1074
7a42cc191111 Fixes for Bex1 removal.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 980
diff changeset
    96
     )))) \<and>
945
de9e5faf1f03 Hom Theorem with exists unique
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 944
diff changeset
    97
(\<lambda> (hom_o\<Colon>robj \<Rightarrow> 'a, hom_d\<Colon>(char list \<times> rmethod) list \<Rightarrow> 'b, hom_e\<Colon>char list \<times> rmethod \<Rightarrow> 'c, hom_m\<Colon>rmethod \<Rightarrow> 'd).
905
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    98
1074
7a42cc191111 Fixes for Bex1 removal.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 980
diff changeset
    99
((\<forall>x. hom_o (rVar x) = fvar x) \<and>
905
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   100
 (\<forall>d. hom_o (rObj d) = fobj (hom_d d) d) \<and>
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   101
 (\<forall>a l. hom_o (rInv a l) = fnvk (hom_o a) a l) \<and>
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   102
 (\<forall>a l m. hom_o (rUpd a l m) = fupd (hom_o a) (hom_m m) a l m) \<and>
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   103
 (\<forall>e d. hom_d (e # d) = fcns (hom_e e) (hom_d d) e d) \<and>
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   104
 (hom_d [] = fnil) \<and>
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   105
 (\<forall>l m. hom_e (l, m) = fpar (hom_m m) l m) \<and>
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   106
 (\<forall>x a. hom_m (rSig x a) = fsgm (\<lambda>y. hom_o ([(x, y)] \<bullet> a)) (\<lambda>y. [(x, y)] \<bullet> a))
1074
7a42cc191111 Fixes for Bex1 removal.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 980
diff changeset
   107
)) x) "
905
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   108
sorry
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   109
1074
7a42cc191111 Fixes for Bex1 removal.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 980
diff changeset
   110
lemma test_to: "Ex1 (\<lambda>x. (x \<in> (Respects alpha_obj)) \<and> P x)"
7a42cc191111 Fixes for Bex1 removal.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 980
diff changeset
   111
ML_prf {* prop_of (#goal (Isar.goal ())) *}
7a42cc191111 Fixes for Bex1 removal.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 980
diff changeset
   112
sorry
7a42cc191111 Fixes for Bex1 removal.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 980
diff changeset
   113
lemma test_tod: "Ex1 (P :: obj \<Rightarrow> bool)"
7a42cc191111 Fixes for Bex1 removal.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 980
diff changeset
   114
apply (lifting test_to)
7a42cc191111 Fixes for Bex1 removal.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 980
diff changeset
   115
done
7a42cc191111 Fixes for Bex1 removal.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 980
diff changeset
   116
7a42cc191111 Fixes for Bex1 removal.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 980
diff changeset
   117
7a42cc191111 Fixes for Bex1 removal.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 980
diff changeset
   118
7a42cc191111 Fixes for Bex1 removal.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 980
diff changeset
   119
7a42cc191111 Fixes for Bex1 removal.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 980
diff changeset
   120
(*syntax
905
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   121
  "_expttrn"        :: "pttrn => bool => bool"      ("(3\<exists>\<exists> _./ _)" [0, 10] 10)
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   122
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   123
translations
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   124
  "\<exists>\<exists> x. P"   == "Ex (%x. P)"
1074
7a42cc191111 Fixes for Bex1 removal.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 980
diff changeset
   125
*)
905
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   126
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   127
lemma rvar_rsp[quot_respect]: "(op = ===> alpha_obj) rVar rVar"
938
0ff855a6ffb7 Sigma cleaning works with split_prs (still manual proof).
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 918
diff changeset
   128
  by (simp add: a1)
905
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   129
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   130
lemma robj_rsp[quot_respect]: "(list_rel (prod_rel op = alpha_method) ===> alpha_obj) rObj rObj"
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   131
sorry
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   132
lemma rinv_rsp[quot_respect]: "(alpha_obj ===> op = ===> alpha_obj) rInv rInv"
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   133
sorry
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   134
lemma rupd_rsp[quot_respect]: "(alpha_obj ===> op = ===> alpha_method ===> alpha_obj) rUpd rUpd"
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   135
sorry
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   136
lemma rsig_rsp[quot_respect]: "(op = ===> alpha_obj ===> alpha_method) rSig rSig"
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   137
sorry
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   138
lemma operm_rsp[quot_respect]: "(op = ===> alpha_obj ===> alpha_obj) op \<bullet> op \<bullet>"
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   139
sorry
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   140
918
7be9b054f672 test with splits
Christian Urban <urbanc@in.tum.de>
parents: 914
diff changeset
   141
  
980
9d35c6145dd2 Renamed Bexeq to Bex1_rel
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 946
diff changeset
   142
lemma bex1_bex1reg: "(\<exists>!x\<in>Respects R. P x) \<longrightarrow> (Bex1_rel R (\<lambda>x. P x))"
1074
7a42cc191111 Fixes for Bex1 removal.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 980
diff changeset
   143
apply (simp add: Ex1_def Bex1_rel_def in_respects)
946
46cc6708c3b3 Bex1_Bexeq_regular.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 945
diff changeset
   144
apply clarify
46cc6708c3b3 Bex1_Bexeq_regular.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 945
diff changeset
   145
apply auto
46cc6708c3b3 Bex1_Bexeq_regular.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 945
diff changeset
   146
apply (rule bexI)
46cc6708c3b3 Bex1_Bexeq_regular.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 945
diff changeset
   147
apply assumption
46cc6708c3b3 Bex1_Bexeq_regular.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 945
diff changeset
   148
apply (simp add: in_respects)
46cc6708c3b3 Bex1_Bexeq_regular.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 945
diff changeset
   149
apply (simp add: in_respects)
46cc6708c3b3 Bex1_Bexeq_regular.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 945
diff changeset
   150
apply auto
46cc6708c3b3 Bex1_Bexeq_regular.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 945
diff changeset
   151
done
918
7be9b054f672 test with splits
Christian Urban <urbanc@in.tum.de>
parents: 914
diff changeset
   152
905
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   153
lemma liftd: "
945
de9e5faf1f03 Hom Theorem with exists unique
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 944
diff changeset
   154
Ex1 (\<lambda>(hom_o, hom_d, hom_e, hom_m).
de9e5faf1f03 Hom Theorem with exists unique
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 944
diff changeset
   155
905
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   156
 (\<forall>x. hom_o (Var x) = fvar x) \<and>
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   157
 (\<forall>d. hom_o (Obj d) = fobj (hom_d d) d) \<and>
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   158
 (\<forall>a l. hom_o (Inv a l) = fnvk (hom_o a) a l) \<and>
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   159
 (\<forall>a l m. hom_o (Upd a l m) = fupd (hom_o a) (hom_m m) a l m) \<and>
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   160
 (\<forall>e d. hom_d (e # d) = fcns (hom_e e) (hom_d d) e d) \<and>
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   161
 (hom_d [] = fnil) \<and>
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   162
 (\<forall>l m. hom_e (l, m) = fpar (hom_m m) l m) \<and>
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   163
 (\<forall>x a. hom_m (Sig x a) = fsgm (\<lambda>y. hom_o ([(x, y)] \<bullet> a)) (\<lambda>y. [(x, y)] \<bullet> a))
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   164
)"
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   165
apply (lifting tolift)
944
6267ad688ea8 2 cases for regularize with split, lemmas with split now lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 940
diff changeset
   166
done
905
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   167
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   168
lemma tolift':
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   169
"\<forall> fvar.
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   170
 \<forall> fobj\<in>Respects (op = ===> list_rel (prod_rel (op =) alpha_method) ===> op =).
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   171
 \<forall> fnvk\<in>Respects (op = ===> alpha_obj ===> op =).
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   172
 \<forall> fupd\<in>Respects (op = ===> op = ===> alpha_obj ===> op = ===> alpha_method ===> op =).
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   173
 \<forall> fcns\<in>Respects (op = ===> op = ===> prod_rel (op =) alpha_method ===> list_rel (prod_rel (op =) alpha_method) ===> op =).
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   174
 \<forall> fnil.
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   175
 \<forall> fpar\<in>Respects (op = ===> op = ===> alpha_method ===> op =).
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   176
 \<forall> fsgm\<in>Respects (op = ===> (op = ===> alpha_obj) ===> op =).
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   177
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   178
 \<exists> hom_o\<Colon>robj \<Rightarrow> 'a \<in> Respects (alpha_obj ===> op =).
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   179
 \<exists> hom_d\<Colon>(char list \<times> rmethod) list \<Rightarrow> 'b \<in> Respects (list_rel (prod_rel (op =) alpha_method) ===> op =).
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   180
 \<exists> hom_e\<Colon>char list \<times> rmethod \<Rightarrow> 'c \<in> Respects ((prod_rel (op =) alpha_method) ===> op =).
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   181
 \<exists> hom_m\<Colon>rmethod \<Rightarrow> 'd \<in> Respects (alpha_method ===> op =).
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   182
(
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   183
 (\<forall>x. hom_o (rVar x) = fvar x) \<and>
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   184
 (\<forall>d. hom_o (rObj d) = fobj (hom_d d) d) \<and>
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   185
 (\<forall>a l. hom_o (rInv a l) = fnvk (hom_o a) a l) \<and>
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   186
 (\<forall>a l m. hom_o (rUpd a l m) = fupd (hom_o a) (hom_m m) a l m) \<and>
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   187
 (\<forall>e d. hom_d (e # d) = fcns (hom_e e) (hom_d d) e d) \<and>
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   188
 (hom_d [] = fnil) \<and>
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   189
 (\<forall>l m. hom_e (l, m) = fpar (hom_m m) l m) \<and>
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   190
 (\<forall>x a. hom_m (rSig x a) = fsgm (\<lambda>y. hom_o ([(x, y)] \<bullet> a)) (\<lambda>y. [(x, y)] \<bullet> a))
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   191
)"
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   192
sorry
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   193
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   194
lemma liftd': "
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   195
\<exists>hom_o. \<exists>hom_d. \<exists>hom_e. \<exists>hom_m.
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   196
(
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   197
 (\<forall>x. hom_o (Var x) = fvar x) \<and>
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   198
 (\<forall>d. hom_o (Obj d) = fobj (hom_d d) d) \<and>
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   199
 (\<forall>a l. hom_o (Inv a l) = fnvk (hom_o a) a l) \<and>
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   200
 (\<forall>a l m. hom_o (Upd a l m) = fupd (hom_o a) (hom_m m) a l m) \<and>
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   201
 (\<forall>e d. hom_d (e # d) = fcns (hom_e e) (hom_d d) e d) \<and>
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   202
 (hom_d [] = fnil) \<and>
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   203
 (\<forall>l m. hom_e (l, m) = fpar (hom_m m) l m) \<and>
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   204
 (\<forall>x a. hom_m (Sig x a) = fsgm (\<lambda>y. hom_o ([(x, y)] \<bullet> a)) (\<lambda>y. [(x, y)] \<bullet> a))
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   205
)"
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   206
apply (lifting tolift')
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   207
done
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   208
912
aa960d16570f Lifted Peter's Sigma lemma with Ex1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 908
diff changeset
   209
lemma tolift'':
aa960d16570f Lifted Peter's Sigma lemma with Ex1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 908
diff changeset
   210
"\<forall> fvar.
aa960d16570f Lifted Peter's Sigma lemma with Ex1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 908
diff changeset
   211
 \<forall> fobj\<in>Respects (op = ===> list_rel (prod_rel (op =) alpha_method) ===> op =).
aa960d16570f Lifted Peter's Sigma lemma with Ex1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 908
diff changeset
   212
 \<forall> fnvk\<in>Respects (op = ===> alpha_obj ===> op =).
aa960d16570f Lifted Peter's Sigma lemma with Ex1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 908
diff changeset
   213
 \<forall> fupd\<in>Respects (op = ===> op = ===> alpha_obj ===> op = ===> alpha_method ===> op =).
aa960d16570f Lifted Peter's Sigma lemma with Ex1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 908
diff changeset
   214
 \<forall> fcns\<in>Respects (op = ===> op = ===> prod_rel (op =) alpha_method ===> list_rel (prod_rel (op =) alpha_method) ===> op =).
aa960d16570f Lifted Peter's Sigma lemma with Ex1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 908
diff changeset
   215
 \<forall> fnil.
aa960d16570f Lifted Peter's Sigma lemma with Ex1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 908
diff changeset
   216
 \<forall> fpar\<in>Respects (op = ===> op = ===> alpha_method ===> op =).
aa960d16570f Lifted Peter's Sigma lemma with Ex1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 908
diff changeset
   217
 \<forall> fsgm\<in>Respects (op = ===> (op = ===> alpha_obj) ===> op =).
aa960d16570f Lifted Peter's Sigma lemma with Ex1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 908
diff changeset
   218
980
9d35c6145dd2 Renamed Bexeq to Bex1_rel
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 946
diff changeset
   219
 Bex1_rel (alpha_obj ===> op =) (\<lambda>hom_o\<Colon>robj \<Rightarrow> 'a .
9d35c6145dd2 Renamed Bexeq to Bex1_rel
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 946
diff changeset
   220
 Bex1_rel (list_rel (prod_rel (op =) alpha_method) ===> op =) (\<lambda>hom_d\<Colon>(char list \<times> rmethod) list \<Rightarrow> 'b.
9d35c6145dd2 Renamed Bexeq to Bex1_rel
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 946
diff changeset
   221
 Bex1_rel ((prod_rel (op =) alpha_method) ===> op =) (\<lambda>hom_e\<Colon>char list \<times> rmethod \<Rightarrow> 'c.
9d35c6145dd2 Renamed Bexeq to Bex1_rel
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 946
diff changeset
   222
 Bex1_rel (alpha_method ===> op =) (\<lambda>hom_m\<Colon>rmethod \<Rightarrow> 'd.
912
aa960d16570f Lifted Peter's Sigma lemma with Ex1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 908
diff changeset
   223
(
aa960d16570f Lifted Peter's Sigma lemma with Ex1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 908
diff changeset
   224
 (\<forall>x. hom_o (rVar x) = fvar x) \<and>
aa960d16570f Lifted Peter's Sigma lemma with Ex1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 908
diff changeset
   225
 (\<forall>d. hom_o (rObj d) = fobj (hom_d d) d) \<and>
aa960d16570f Lifted Peter's Sigma lemma with Ex1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 908
diff changeset
   226
 (\<forall>a l. hom_o (rInv a l) = fnvk (hom_o a) a l) \<and>
aa960d16570f Lifted Peter's Sigma lemma with Ex1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 908
diff changeset
   227
 (\<forall>a l m. hom_o (rUpd a l m) = fupd (hom_o a) (hom_m m) a l m) \<and>
aa960d16570f Lifted Peter's Sigma lemma with Ex1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 908
diff changeset
   228
 (\<forall>e d. hom_d (e # d) = fcns (hom_e e) (hom_d d) e d) \<and>
aa960d16570f Lifted Peter's Sigma lemma with Ex1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 908
diff changeset
   229
 (hom_d [] = fnil) \<and>
aa960d16570f Lifted Peter's Sigma lemma with Ex1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 908
diff changeset
   230
 (\<forall>l m. hom_e (l, m) = fpar (hom_m m) l m) \<and>
aa960d16570f Lifted Peter's Sigma lemma with Ex1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 908
diff changeset
   231
 (\<forall>x a. hom_m (rSig x a) = fsgm (\<lambda>y. hom_o ([(x, y)] \<bullet> a)) (\<lambda>y. [(x, y)] \<bullet> a))
aa960d16570f Lifted Peter's Sigma lemma with Ex1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 908
diff changeset
   232
)
aa960d16570f Lifted Peter's Sigma lemma with Ex1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 908
diff changeset
   233
))))"
aa960d16570f Lifted Peter's Sigma lemma with Ex1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 908
diff changeset
   234
sorry
aa960d16570f Lifted Peter's Sigma lemma with Ex1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 908
diff changeset
   235
aa960d16570f Lifted Peter's Sigma lemma with Ex1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 908
diff changeset
   236
lemma liftd'': "
aa960d16570f Lifted Peter's Sigma lemma with Ex1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 908
diff changeset
   237
\<exists>!hom_o. \<exists>!hom_d. \<exists>!hom_e. \<exists>!hom_m.
aa960d16570f Lifted Peter's Sigma lemma with Ex1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 908
diff changeset
   238
(
aa960d16570f Lifted Peter's Sigma lemma with Ex1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 908
diff changeset
   239
 (\<forall>x. hom_o (Var x) = fvar x) \<and>
aa960d16570f Lifted Peter's Sigma lemma with Ex1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 908
diff changeset
   240
 (\<forall>d. hom_o (Obj d) = fobj (hom_d d) d) \<and>
aa960d16570f Lifted Peter's Sigma lemma with Ex1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 908
diff changeset
   241
 (\<forall>a l. hom_o (Inv a l) = fnvk (hom_o a) a l) \<and>
aa960d16570f Lifted Peter's Sigma lemma with Ex1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 908
diff changeset
   242
 (\<forall>a l m. hom_o (Upd a l m) = fupd (hom_o a) (hom_m m) a l m) \<and>
aa960d16570f Lifted Peter's Sigma lemma with Ex1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 908
diff changeset
   243
 (\<forall>e d. hom_d (e # d) = fcns (hom_e e) (hom_d d) e d) \<and>
aa960d16570f Lifted Peter's Sigma lemma with Ex1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 908
diff changeset
   244
 (hom_d [] = fnil) \<and>
aa960d16570f Lifted Peter's Sigma lemma with Ex1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 908
diff changeset
   245
 (\<forall>l m. hom_e (l, m) = fpar (hom_m m) l m) \<and>
aa960d16570f Lifted Peter's Sigma lemma with Ex1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 908
diff changeset
   246
 (\<forall>x a. hom_m (Sig x a) = fsgm (\<lambda>y. hom_o ([(x, y)] \<bullet> a)) (\<lambda>y. [(x, y)] \<bullet> a))
aa960d16570f Lifted Peter's Sigma lemma with Ex1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 908
diff changeset
   247
)"
aa960d16570f Lifted Peter's Sigma lemma with Ex1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 908
diff changeset
   248
apply (lifting tolift'')
aa960d16570f Lifted Peter's Sigma lemma with Ex1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 908
diff changeset
   249
done
aa960d16570f Lifted Peter's Sigma lemma with Ex1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 908
diff changeset
   250
aa960d16570f Lifted Peter's Sigma lemma with Ex1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 908
diff changeset
   251
905
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   252
end
51e5cc3793d2 Added the Sigma Calculus example
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   253