Nominal/Abs.thy
author Cezary Kaliszyk <kaliszyk@in.tum.de>
Fri, 26 Mar 2010 22:22:41 +0100
changeset 1664 aa999d263b10
parent 1657 d7dc35222afc
child 1665 d00dd828f7af
permissions -rw-r--r--
Modified abs_gen_sym and abs_gen_trans so it becomes usable in the proofs.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1440
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     1
theory Abs
1557
fee2389789ad moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents: 1544
diff changeset
     2
imports "Nominal2_Atoms" 
fee2389789ad moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents: 1544
diff changeset
     3
        "Nominal2_Eqvt" 
fee2389789ad moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents: 1544
diff changeset
     4
        "Nominal2_Supp" 
fee2389789ad moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents: 1544
diff changeset
     5
        "Nominal2_FSet"
fee2389789ad moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents: 1544
diff changeset
     6
        "../Quotient" 
fee2389789ad moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents: 1544
diff changeset
     7
        "../Quotient_Product" 
1440
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     8
begin
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     9
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    10
fun
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    11
  alpha_gen 
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    12
where
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    13
  alpha_gen[simp del]:
1465
4de35639fef0 added another supp-proof for the non-recursive case
Christian Urban <urbanc@in.tum.de>
parents: 1460
diff changeset
    14
  "alpha_gen (bs, x) R f pi (cs, y) \<longleftrightarrow> 
4de35639fef0 added another supp-proof for the non-recursive case
Christian Urban <urbanc@in.tum.de>
parents: 1460
diff changeset
    15
     f x - bs = f y - cs \<and> 
4de35639fef0 added another supp-proof for the non-recursive case
Christian Urban <urbanc@in.tum.de>
parents: 1460
diff changeset
    16
     (f x - bs) \<sharp>* pi \<and> 
4de35639fef0 added another supp-proof for the non-recursive case
Christian Urban <urbanc@in.tum.de>
parents: 1460
diff changeset
    17
     R (pi \<bullet> x) y \<and>
4de35639fef0 added another supp-proof for the non-recursive case
Christian Urban <urbanc@in.tum.de>
parents: 1460
diff changeset
    18
     pi \<bullet> bs = cs"
1440
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    19
1557
fee2389789ad moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents: 1544
diff changeset
    20
fun
fee2389789ad moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents: 1544
diff changeset
    21
  alpha_res
fee2389789ad moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents: 1544
diff changeset
    22
where
fee2389789ad moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents: 1544
diff changeset
    23
  alpha_res[simp del]:
fee2389789ad moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents: 1544
diff changeset
    24
  "alpha_res (bs, x) R f pi (cs, y) \<longleftrightarrow> 
fee2389789ad moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents: 1544
diff changeset
    25
     f x - bs = f y - cs \<and> 
fee2389789ad moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents: 1544
diff changeset
    26
     (f x - bs) \<sharp>* pi \<and> 
fee2389789ad moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents: 1544
diff changeset
    27
     R (pi \<bullet> x) y"
1440
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    28
1557
fee2389789ad moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents: 1544
diff changeset
    29
fun
fee2389789ad moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents: 1544
diff changeset
    30
  alpha_lst
fee2389789ad moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents: 1544
diff changeset
    31
where
fee2389789ad moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents: 1544
diff changeset
    32
  alpha_lst[simp del]:
fee2389789ad moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents: 1544
diff changeset
    33
  "alpha_lst (bs, x) R f pi (cs, y) \<longleftrightarrow> 
fee2389789ad moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents: 1544
diff changeset
    34
     f x - set bs = f y - set cs \<and> 
fee2389789ad moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents: 1544
diff changeset
    35
     (f x - set bs) \<sharp>* pi \<and> 
fee2389789ad moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents: 1544
diff changeset
    36
     R (pi \<bullet> x) y \<and>
fee2389789ad moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents: 1544
diff changeset
    37
     pi \<bullet> bs = cs"
fee2389789ad moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents: 1544
diff changeset
    38
fee2389789ad moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents: 1544
diff changeset
    39
lemmas alphas = alpha_gen.simps alpha_res.simps alpha_lst.simps
fee2389789ad moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents: 1544
diff changeset
    40
fee2389789ad moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents: 1544
diff changeset
    41
notation
fee2389789ad moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents: 1544
diff changeset
    42
  alpha_gen ("_ \<approx>gen _ _ _ _" [100, 100, 100, 100, 100] 100) and
fee2389789ad moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents: 1544
diff changeset
    43
  alpha_res ("_ \<approx>res _ _ _ _" [100, 100, 100, 100, 100] 100) and
fee2389789ad moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents: 1544
diff changeset
    44
  alpha_lst ("_ \<approx>lst _ _ _ _" [100, 100, 100, 100, 100] 100) 
fee2389789ad moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents: 1544
diff changeset
    45
fee2389789ad moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents: 1544
diff changeset
    46
(* monos *)
fee2389789ad moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents: 1544
diff changeset
    47
lemma [mono]: 
fee2389789ad moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents: 1544
diff changeset
    48
  shows "R1 \<le> R2 \<Longrightarrow> alpha_gen bs R1 \<le> alpha_gen bs R2"
fee2389789ad moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents: 1544
diff changeset
    49
  and   "R1 \<le> R2 \<Longrightarrow> alpha_res bs R1 \<le> alpha_res bs R2"
fee2389789ad moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents: 1544
diff changeset
    50
  and   "R1 \<le> R2 \<Longrightarrow> alpha_lst cs R1 \<le> alpha_lst cs R2"
fee2389789ad moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents: 1544
diff changeset
    51
  by (case_tac [!] bs, case_tac [!] cs) 
fee2389789ad moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents: 1544
diff changeset
    52
     (auto simp add: le_fun_def le_bool_def alphas)
1440
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    53
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    54
fun
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    55
  alpha_abs 
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    56
where
1558
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
    57
  "alpha_abs (bs, x) (cs, y) \<longleftrightarrow> (\<exists>p. (bs, x) \<approx>gen (op=) supp p (cs, y))"
1440
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    58
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
    59
fun
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
    60
  alpha_abs_lst
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
    61
where
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
    62
  "alpha_abs_lst (bs, x) (cs, y) \<longleftrightarrow> (\<exists>p. (bs, x) \<approx>lst (op=) supp p (cs, y))"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
    63
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
    64
fun
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
    65
  alpha_abs_res
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
    66
where
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
    67
  "alpha_abs_res (bs, x) (cs, y) \<longleftrightarrow> (\<exists>p. (bs, x) \<approx>res (op=) supp p (cs, y))"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
    68
1440
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    69
notation
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
    70
  alpha_abs ("_ \<approx>abs _") and
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
    71
  alpha_abs_lst ("_ \<approx>abs'_lst _") and
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
    72
  alpha_abs_res ("_ \<approx>abs'_res _")
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
    73
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
    74
lemmas alphas_abs = alpha_abs.simps alpha_abs_res.simps alpha_abs_lst.simps
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
    75
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
    76
lemma alphas_abs_refl:
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
    77
  shows "(bs, x) \<approx>abs (bs, x)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
    78
  and   "(bs, x) \<approx>abs_res (bs, x)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
    79
  and   "(cs, x) \<approx>abs_lst (cs, x)" 
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
    80
  unfolding alphas_abs
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
    81
  unfolding alphas
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
    82
  unfolding fresh_star_def
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
    83
  by (rule_tac [!] x="0" in exI)
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
    84
     (simp_all add: fresh_zero_perm)
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
    85
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
    86
lemma alphas_abs_sym:
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
    87
  shows "(bs, x) \<approx>abs (cs, y) \<Longrightarrow> (cs, y) \<approx>abs (bs, x)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
    88
  and   "(bs, x) \<approx>abs_res (cs, y) \<Longrightarrow> (cs, y) \<approx>abs_res (bs, x)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
    89
  and   "(ds, x) \<approx>abs_lst (es, y) \<Longrightarrow> (es, y) \<approx>abs_lst (ds, x)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
    90
  unfolding alphas_abs
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
    91
  unfolding alphas
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
    92
  unfolding fresh_star_def
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
    93
  by (erule_tac [!] exE, rule_tac [!] x="-p" in exI)
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
    94
     (auto simp add: fresh_minus_perm)
1440
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    95
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
    96
lemma alphas_abs_trans:
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
    97
  shows "\<lbrakk>(bs, x) \<approx>abs (cs, y); (cs, y) \<approx>abs (ds, z)\<rbrakk> \<Longrightarrow> (bs, x) \<approx>abs (ds, z)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
    98
  and   "\<lbrakk>(bs, x) \<approx>abs_res (cs, y); (cs, y) \<approx>abs_res (ds, z)\<rbrakk> \<Longrightarrow> (bs, x) \<approx>abs_res (ds, z)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
    99
  and   "\<lbrakk>(es, x) \<approx>abs_lst (gs, y); (gs, y) \<approx>abs_lst (hs, z)\<rbrakk> \<Longrightarrow> (es, x) \<approx>abs_lst (hs, z)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   100
  unfolding alphas_abs
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   101
  unfolding alphas
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   102
  unfolding fresh_star_def
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   103
  apply(erule_tac [!] exE, erule_tac [!] exE)
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   104
  apply(rule_tac [!] x="pa + p" in exI)
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   105
  by (simp_all add: fresh_plus_perm)
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   106
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   107
lemma alphas_abs_eqvt:
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   108
  shows "(bs, x) \<approx>abs (cs, y) \<Longrightarrow> (p \<bullet> bs, p \<bullet> x) \<approx>abs (p \<bullet> cs, p \<bullet> y)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   109
  and   "(bs, x) \<approx>abs_res (cs, y) \<Longrightarrow> (p \<bullet> bs, p \<bullet> x) \<approx>abs_res (p \<bullet> cs, p \<bullet> y)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   110
  and   "(ds, x) \<approx>abs_lst (es, y) \<Longrightarrow> (p \<bullet> ds, p \<bullet> x) \<approx>abs_lst (p \<bullet> es, p \<bullet> y)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   111
  unfolding alphas_abs
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   112
  unfolding alphas
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   113
  unfolding set_eqvt[symmetric]
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   114
  unfolding supp_eqvt[symmetric]
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   115
  unfolding Diff_eqvt[symmetric]
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   116
  apply(erule_tac [!] exE)
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   117
  apply(rule_tac [!] x="p \<bullet> pa" in exI)
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   118
  by (auto simp add: fresh_star_permute_iff permute_eqvt[symmetric])
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   119
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   120
lemma alphas_abs_swap1:
1440
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   121
  assumes a1: "a \<notin> (supp x) - bs"
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   122
  and     a2: "b \<notin> (supp x) - bs"
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   123
  shows "(bs, x) \<approx>abs ((a \<rightleftharpoons> b) \<bullet> bs, (a \<rightleftharpoons> b) \<bullet> x)"
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   124
  and   "(bs, x) \<approx>abs_res ((a \<rightleftharpoons> b) \<bullet> bs, (a \<rightleftharpoons> b) \<bullet> x)"
1440
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   125
  using a1 a2
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   126
  unfolding alphas_abs
1558
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   127
  unfolding alphas
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   128
  unfolding supp_eqvt[symmetric] Diff_eqvt[symmetric] 
1558
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   129
  unfolding fresh_star_def fresh_def
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   130
  unfolding swap_set_not_in[OF a1 a2] 
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   131
  by (rule_tac [!] x="(a \<rightleftharpoons> b)" in exI)
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   132
     (auto simp add: supp_perm swap_atom)
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   133
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   134
lemma alphas_abs_swap2:
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   135
  assumes a1: "a \<notin> (supp x) - (set bs)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   136
  and     a2: "b \<notin> (supp x) - (set bs)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   137
  shows "(bs, x) \<approx>abs_lst ((a \<rightleftharpoons> b) \<bullet> bs, (a \<rightleftharpoons> b) \<bullet> x)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   138
  using a1 a2
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   139
  unfolding alphas_abs
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   140
  unfolding alphas
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   141
  unfolding supp_eqvt[symmetric] Diff_eqvt[symmetric] set_eqvt[symmetric]
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   142
  unfolding fresh_star_def fresh_def
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   143
  unfolding swap_set_not_in[OF a1 a2] 
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   144
  by (rule_tac [!] x="(a \<rightleftharpoons> b)" in exI)
1558
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   145
     (auto simp add: supp_perm swap_atom)
1440
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   146
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   147
fun
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   148
  aux_set 
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   149
where
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   150
  "aux_set (bs, x) = (supp x) - bs"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   151
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   152
fun
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   153
  aux_list
1460
0fd03936dedb merge and proof of support for non-recursive case
Christian Urban <urbanc@in.tum.de>
parents: 1451
diff changeset
   154
where
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   155
  "aux_list (cs, x) = (supp x) - (set cs)"
1440
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   156
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   157
lemma aux_abs_lemma:
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   158
  assumes a: "(bs, x) \<approx>abs (cs, y)" 
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   159
  shows "aux_set (bs, x) = aux_set (cs, y)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   160
  using a
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   161
  by (induct rule: alpha_abs.induct)
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   162
     (simp add: alphas_abs alphas)
1558
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   163
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   164
lemma aux_abs_res_lemma:
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   165
  assumes a: "(bs, x) \<approx>abs_res (cs, y)" 
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   166
  shows "aux_set (bs, x) = aux_set (cs, y)"
1440
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   167
  using a
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   168
  by (induct rule: alpha_abs_res.induct)
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   169
     (simp add: alphas_abs alphas)
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   170
 
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   171
lemma aux_abs_list_lemma:
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   172
  assumes a: "(bs, x) \<approx>abs_lst (cs, y)" 
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   173
  shows "aux_list (bs, x) = aux_list (cs, y)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   174
  using a
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   175
  by (induct rule: alpha_abs_lst.induct)
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   176
     (simp add: alphas_abs alphas)
1558
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   177
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   178
quotient_type 
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   179
    'a abs_gen = "(atom set \<times> 'a::pt)" / "alpha_abs"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   180
and 'b abs_res = "(atom set \<times> 'b::pt)" / "alpha_abs_res"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   181
and 'c abs_lst = "(atom list \<times> 'c::pt)" / "alpha_abs_lst"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   182
  apply(rule_tac [!] equivpI)
1440
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   183
  unfolding reflp_def symp_def transp_def
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   184
  by (auto intro: alphas_abs_sym alphas_abs_refl alphas_abs_trans simp only:)
1440
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   185
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   186
quotient_definition
1558
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   187
  "Abs::atom set \<Rightarrow> ('a::pt) \<Rightarrow> 'a abs_gen"
1440
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   188
is
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   189
  "Pair::atom set \<Rightarrow> ('a::pt) \<Rightarrow> (atom set \<times> 'a)"
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   190
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   191
quotient_definition
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   192
  "Abs_res::atom set \<Rightarrow> ('a::pt) \<Rightarrow> 'a abs_res"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   193
is
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   194
  "Pair::atom set \<Rightarrow> ('a::pt) \<Rightarrow> (atom set \<times> 'a)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   195
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   196
quotient_definition
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   197
  "Abs_lst::atom list \<Rightarrow> ('a::pt) \<Rightarrow> 'a abs_lst"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   198
is
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   199
  "Pair::atom list \<Rightarrow> ('a::pt) \<Rightarrow> (atom list \<times> 'a)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   200
1440
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   201
lemma [quot_respect]:
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   202
  shows "(op= ===> op= ===> alpha_abs) Pair Pair"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   203
  and   "(op= ===> op= ===> alpha_abs_res) Pair Pair"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   204
  and   "(op= ===> op= ===> alpha_abs_lst) Pair Pair"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   205
  unfolding fun_rel_def
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   206
  by (auto intro: alphas_abs_refl simp only:)
1440
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   207
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   208
lemma [quot_respect]:
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   209
  shows "(op= ===> alpha_abs ===> alpha_abs) permute permute"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   210
  and   "(op= ===> alpha_abs_res ===> alpha_abs_res) permute permute"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   211
  and   "(op= ===> alpha_abs_lst ===> alpha_abs_lst) permute permute"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   212
  unfolding fun_rel_def
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   213
  by (auto intro: alphas_abs_eqvt simp only: Pair_eqvt)
1440
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   214
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   215
lemma [quot_respect]:
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   216
  shows "(alpha_abs ===> op=) aux_set aux_set"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   217
  and   "(alpha_abs_res ===> op=) aux_set aux_set"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   218
  and   "(alpha_abs_lst ===> op=) aux_list aux_list"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   219
  unfolding fun_rel_def
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   220
  apply(rule_tac [!] allI)
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   221
  apply(rule_tac [!] allI)
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   222
  apply(case_tac [!] x, case_tac [!] y)
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   223
  apply(rule_tac [!] impI)
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   224
  by (simp_all only: aux_abs_lemma aux_abs_res_lemma aux_abs_list_lemma)
1440
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   225
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   226
lemma abs_inducts:
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   227
  shows "(\<And>as (x::'a::pt). P1 (Abs as x)) \<Longrightarrow> P1 x1"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   228
  and   "(\<And>as (x::'a::pt). P2 (Abs_res as x)) \<Longrightarrow> P2 x2"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   229
  and   "(\<And>as (x::'a::pt). P3 (Abs_lst as x)) \<Longrightarrow> P3 x3"
1440
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   230
  apply(lifting prod.induct[where 'a="atom set" and 'b="'a"])
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   231
  apply(lifting prod.induct[where 'a="atom set" and 'b="'a"])
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   232
  apply(lifting prod.induct[where 'a="atom list" and 'b="'a"])
1440
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   233
  done
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   234
1558
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   235
instantiation abs_gen :: (pt) pt
1440
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   236
begin
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   237
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   238
quotient_definition
1558
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   239
  "permute_abs_gen::perm \<Rightarrow> ('a::pt abs_gen) \<Rightarrow> 'a abs_gen"
1440
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   240
is
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   241
  "permute:: perm \<Rightarrow> (atom set \<times> 'a::pt) \<Rightarrow> (atom set \<times> 'a::pt)"
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   242
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   243
lemma permute_Abs[simp]:
1558
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   244
  fixes x::"'a::pt"  
1440
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   245
  shows "(p \<bullet> (Abs as x)) = Abs (p \<bullet> as) (p \<bullet> x)"
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   246
  by (lifting permute_prod.simps[where 'a="atom set" and 'b="'a"])
1440
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   247
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   248
instance
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   249
  apply(default)
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   250
  apply(induct_tac [!] x rule: abs_inducts(1))
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   251
  apply(simp_all)
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   252
  done
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   253
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   254
end
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   255
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   256
instantiation abs_res :: (pt) pt
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   257
begin
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   258
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   259
quotient_definition
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   260
  "permute_abs_res::perm \<Rightarrow> ('a::pt abs_res) \<Rightarrow> 'a abs_res"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   261
is
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   262
  "permute:: perm \<Rightarrow> (atom set \<times> 'a::pt) \<Rightarrow> (atom set \<times> 'a::pt)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   263
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   264
lemma permute_Abs_res[simp]:
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   265
  fixes x::"'a::pt"  
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   266
  shows "(p \<bullet> (Abs_res as x)) = Abs_res (p \<bullet> as) (p \<bullet> x)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   267
  by (lifting permute_prod.simps[where 'a="atom set" and 'b="'a"])
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   268
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   269
instance
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   270
  apply(default)
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   271
  apply(induct_tac [!] x rule: abs_inducts(2))
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   272
  apply(simp_all)
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   273
  done
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   274
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   275
end
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   276
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   277
instantiation abs_lst :: (pt) pt
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   278
begin
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   279
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   280
quotient_definition
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   281
  "permute_abs_lst::perm \<Rightarrow> ('a::pt abs_lst) \<Rightarrow> 'a abs_lst"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   282
is
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   283
  "permute:: perm \<Rightarrow> (atom list \<times> 'a::pt) \<Rightarrow> (atom list \<times> 'a::pt)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   284
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   285
lemma permute_Abs_lst[simp]:
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   286
  fixes x::"'a::pt"  
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   287
  shows "(p \<bullet> (Abs_lst as x)) = Abs_lst (p \<bullet> as) (p \<bullet> x)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   288
  by (lifting permute_prod.simps[where 'a="atom list" and 'b="'a"])
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   289
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   290
instance
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   291
  apply(default)
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   292
  apply(induct_tac [!] x rule: abs_inducts(3))
1440
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   293
  apply(simp_all)
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   294
  done
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   295
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   296
end
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   297
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   298
lemmas permute_abs = permute_Abs permute_Abs_res permute_Abs_lst
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   299
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   300
1440
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   301
quotient_definition
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   302
  "supp_gen :: ('a::pt) abs_gen \<Rightarrow> atom set"
1440
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   303
is
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   304
  "aux_set"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   305
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   306
quotient_definition
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   307
  "supp_res :: ('a::pt) abs_res \<Rightarrow> atom set"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   308
is
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   309
  "aux_set"
1440
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   310
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   311
quotient_definition
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   312
  "supp_lst :: ('a::pt) abs_lst \<Rightarrow> atom set"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   313
is
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   314
  "aux_list"
1440
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   315
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   316
lemma aux_supps:
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   317
  shows "supp_gen (Abs bs x) = (supp x) - bs"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   318
  and   "supp_res (Abs_res bs x) = (supp x) - bs"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   319
  and   "supp_lst (Abs_lst cs x) = (supp x) - (set cs)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   320
  apply(lifting aux_set.simps)
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   321
  apply(lifting aux_set.simps)
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   322
  apply(lifting aux_list.simps)
1440
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   323
  done
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   324
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   325
lemma aux_supp_eqvt[eqvt]:
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   326
  shows "(p \<bullet> supp_gen x) = supp_gen (p \<bullet> x)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   327
  and   "(p \<bullet> supp_res y) = supp_res (p \<bullet> y)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   328
  and   "(p \<bullet> supp_lst z) = supp_lst (p \<bullet> z)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   329
  apply(induct_tac x rule: abs_inducts(1))
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   330
  apply(simp add: aux_supps supp_eqvt Diff_eqvt)
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   331
  apply(induct_tac y rule: abs_inducts(2))
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   332
  apply(simp add: aux_supps supp_eqvt Diff_eqvt)
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   333
  apply(induct_tac z rule: abs_inducts(3))
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   334
  apply(simp add: aux_supps supp_eqvt Diff_eqvt set_eqvt)
1440
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   335
  done
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   336
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   337
lemma aux_fresh:
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   338
  shows "a \<sharp> Abs bs x \<Longrightarrow> a \<sharp> supp_gen (Abs bs x)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   339
  and   "a \<sharp> Abs_res bs x \<Longrightarrow> a \<sharp> supp_res (Abs_res bs x)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   340
  and   "a \<sharp> Abs_lst cs x \<Longrightarrow> a \<sharp> supp_lst (Abs_lst cs x)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   341
  apply(rule_tac [!] fresh_fun_eqvt_app)
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   342
  apply(simp_all add: eqvts_raw)
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   343
  done
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   344
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   345
lemma abs_swap1:
1440
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   346
  assumes a1: "a \<notin> (supp x) - bs"
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   347
  and     a2: "b \<notin> (supp x) - bs"
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   348
  shows "Abs bs x = Abs ((a \<rightleftharpoons> b) \<bullet> bs) ((a \<rightleftharpoons> b) \<bullet> x)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   349
  and   "Abs_res bs x = Abs_res ((a \<rightleftharpoons> b) \<bullet> bs) ((a \<rightleftharpoons> b) \<bullet> x)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   350
  using a1 a2 
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   351
  apply(lifting alphas_abs_swap1(1))
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   352
  apply(lifting alphas_abs_swap1(2))
1440
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   353
  done
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   354
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   355
lemma abs_swap2:
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   356
  assumes a1: "a \<notin> (supp x) - (set bs)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   357
  and     a2: "b \<notin> (supp x) - (set bs)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   358
  shows "Abs_lst bs x = Abs_lst ((a \<rightleftharpoons> b) \<bullet> bs) ((a \<rightleftharpoons> b) \<bullet> x)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   359
  using a1 a2 by (lifting alphas_abs_swap2)
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   360
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   361
lemma abs_supports:
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   362
  shows "((supp x) - as) supports (Abs as x)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   363
  and   "((supp x) - as) supports (Abs_res as x)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   364
  and   "((supp x) - (set bs)) supports (Abs_lst bs x)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   365
  unfolding supports_def
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   366
  unfolding permute_abs
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   367
  by (simp_all add: abs_swap1[symmetric] abs_swap2[symmetric])
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   368
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   369
lemma supp_abs_subset1:
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   370
  assumes a: "finite (supp x)"
1440
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   371
  shows "(supp x) - as \<subseteq> supp (Abs as x)"
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   372
  and   "(supp x) - as \<subseteq> supp (Abs_res as x)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   373
  and   "(supp x) - (set bs) \<subseteq> supp (Abs_lst bs x)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   374
  unfolding supp_conv_fresh
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   375
  apply(auto dest!: aux_fresh simp add: aux_supps)
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   376
  apply(simp_all add: fresh_def supp_finite_atom_set a)
1440
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   377
  done
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   378
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   379
lemma supp_abs_subset2:
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   380
  assumes a: "finite (supp x)"
1440
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   381
  shows "supp (Abs as x) \<subseteq> (supp x) - as"
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   382
  and   "supp (Abs_res as x) \<subseteq> (supp x) - as"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   383
  and   "supp (Abs_lst bs x) \<subseteq> (supp x) - (set bs)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   384
  apply(rule_tac [!] supp_is_subset)
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   385
  apply(simp_all add: abs_supports a)
1478
1ea4ca823266 added proof of supp/fv for type schemes
Christian Urban <urbanc@in.tum.de>
parents: 1470
diff changeset
   386
  done
1ea4ca823266 added proof of supp/fv for type schemes
Christian Urban <urbanc@in.tum.de>
parents: 1470
diff changeset
   387
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   388
lemma abs_finite_supp:
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   389
  assumes a: "finite (supp x)"
1478
1ea4ca823266 added proof of supp/fv for type schemes
Christian Urban <urbanc@in.tum.de>
parents: 1470
diff changeset
   390
  shows "supp (Abs as x) = (supp x) - as"
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   391
  and   "supp (Abs_res as x) = (supp x) - as"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   392
  and   "supp (Abs_lst bs x) = (supp x) - (set bs)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   393
  apply(rule_tac [!] subset_antisym)
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   394
  apply(simp_all add: supp_abs_subset1[OF a] supp_abs_subset2[OF a])
1440
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   395
  done
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   396
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   397
lemma supp_abs:
1440
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   398
  fixes x::"'a::fs"
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   399
  shows "supp (Abs as x) = (supp x) - as"
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   400
  and   "supp (Abs_res as x) = (supp x) - as"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   401
  and   "supp (Abs_lst bs x) = (supp x) - (set bs)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   402
  apply(rule_tac [!] abs_finite_supp)
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   403
  apply(simp_all add: finite_supp)
1440
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   404
  done
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   405
1558
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   406
instance abs_gen :: (fs) fs
1440
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   407
  apply(default)
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   408
  apply(induct_tac x rule: abs_inducts(1))
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   409
  apply(simp add: supp_abs finite_supp)
1440
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   410
  done
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   411
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   412
instance abs_res :: (fs) fs
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   413
  apply(default)
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   414
  apply(induct_tac x rule: abs_inducts(2))
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   415
  apply(simp add: supp_abs finite_supp)
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   416
  done
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   417
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   418
instance abs_lst :: (fs) fs
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   419
  apply(default)
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   420
  apply(induct_tac x rule: abs_inducts(3))
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   421
  apply(simp add: supp_abs finite_supp)
1440
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   422
  done
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   423
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   424
lemma abs_fresh_iff:
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   425
  fixes x::"'a::fs"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   426
  shows "a \<sharp> Abs bs x \<longleftrightarrow> a \<in> bs \<or> (a \<notin> bs \<and> a \<sharp> x)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   427
  and   "a \<sharp> Abs_res bs x \<longleftrightarrow> a \<in> bs \<or> (a \<notin> bs \<and> a \<sharp> x)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   428
  and   "a \<sharp> Abs_lst cs x \<longleftrightarrow> a \<in> (set cs) \<or> (a \<notin> (set cs) \<and> a \<sharp> x)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   429
  unfolding fresh_def
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   430
  unfolding supp_abs
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   431
  by auto
1460
0fd03936dedb merge and proof of support for non-recursive case
Christian Urban <urbanc@in.tum.de>
parents: 1451
diff changeset
   432
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   433
lemma abs_eq_iff:
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   434
  shows "Abs bs x = Abs cs y \<longleftrightarrow> (bs, x) \<approx>abs (cs, y)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   435
  and   "Abs_res bs x = Abs_res cs y \<longleftrightarrow> (bs, x) \<approx>abs_res (cs, y)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   436
  and   "Abs_lst ds x = Abs_lst hs y \<longleftrightarrow> (ds, x) \<approx>abs_lst (hs, y)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   437
  apply(simp_all)
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   438
  apply(lifting alphas_abs)
1465
4de35639fef0 added another supp-proof for the non-recursive case
Christian Urban <urbanc@in.tum.de>
parents: 1460
diff changeset
   439
  done
4de35639fef0 added another supp-proof for the non-recursive case
Christian Urban <urbanc@in.tum.de>
parents: 1460
diff changeset
   440
1440
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   441
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   442
section {* BELOW is stuff that may or may not be needed *}
1440
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   443
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   444
(* support of concrete atom sets *)
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   445
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   446
lemma supp_atom_image:
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   447
  fixes as::"'a::at_base set"
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   448
  shows "supp (atom ` as) = supp as"
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   449
apply(simp add: supp_def)
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   450
apply(simp add: image_eqvt)
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   451
apply(simp add: atom_eqvt_raw)
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   452
apply(simp add: atom_image_cong)
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   453
done
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   454
1460
0fd03936dedb merge and proof of support for non-recursive case
Christian Urban <urbanc@in.tum.de>
parents: 1451
diff changeset
   455
lemma swap_atom_image_fresh: "\<lbrakk>a \<sharp> atom ` (fn :: ('a :: at_base set)); b \<sharp> atom ` fn\<rbrakk> \<Longrightarrow> (a \<rightleftharpoons> b) \<bullet> fn = fn"
0fd03936dedb merge and proof of support for non-recursive case
Christian Urban <urbanc@in.tum.de>
parents: 1451
diff changeset
   456
  apply (simp add: fresh_def)
0fd03936dedb merge and proof of support for non-recursive case
Christian Urban <urbanc@in.tum.de>
parents: 1451
diff changeset
   457
  apply (simp add: supp_atom_image)
0fd03936dedb merge and proof of support for non-recursive case
Christian Urban <urbanc@in.tum.de>
parents: 1451
diff changeset
   458
  apply (fold fresh_def)
0fd03936dedb merge and proof of support for non-recursive case
Christian Urban <urbanc@in.tum.de>
parents: 1451
diff changeset
   459
  apply (simp add: swap_fresh_fresh)
1440
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   460
  done
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   461
1467
77b86f1fc936 Lifting theorems with compound fv and compound alpha.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1460
diff changeset
   462
(* TODO: The following lemmas can be moved somewhere... *)
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   463
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   464
lemma Abs_eq_iff:
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   465
  shows "Abs bs x = Abs cs y \<longleftrightarrow> (\<exists>p. (bs, x) \<approx>gen (op =) supp p (cs, y))"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   466
  by (lifting alpha_abs.simps(1))
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   467
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   468
1467
77b86f1fc936 Lifting theorems with compound fv and compound alpha.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1460
diff changeset
   469
lemma split_rsp2[quot_respect]: "((R1 ===> R2 ===> prod_rel R1 R2 ===> op =) ===>
77b86f1fc936 Lifting theorems with compound fv and compound alpha.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1460
diff changeset
   470
  prod_rel R1 R2 ===> prod_rel R1 R2 ===> op =) split split"
77b86f1fc936 Lifting theorems with compound fv and compound alpha.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1460
diff changeset
   471
  by auto
77b86f1fc936 Lifting theorems with compound fv and compound alpha.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1460
diff changeset
   472
77b86f1fc936 Lifting theorems with compound fv and compound alpha.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1460
diff changeset
   473
lemma split_prs2[quot_preserve]:
77b86f1fc936 Lifting theorems with compound fv and compound alpha.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1460
diff changeset
   474
  assumes q1: "Quotient R1 Abs1 Rep1"
77b86f1fc936 Lifting theorems with compound fv and compound alpha.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1460
diff changeset
   475
  and q2: "Quotient R2 Abs2 Rep2"
77b86f1fc936 Lifting theorems with compound fv and compound alpha.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1460
diff changeset
   476
  shows "((Abs1 ---> Abs2 ---> prod_fun Abs1 Abs2 ---> id) ---> prod_fun Rep1 Rep2 ---> prod_fun Rep1 Rep2 ---> id) split = split"
77b86f1fc936 Lifting theorems with compound fv and compound alpha.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1460
diff changeset
   477
  by (simp add: expand_fun_eq Quotient_abs_rep[OF q1] Quotient_abs_rep[OF q2])
77b86f1fc936 Lifting theorems with compound fv and compound alpha.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1460
diff changeset
   478
77b86f1fc936 Lifting theorems with compound fv and compound alpha.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1460
diff changeset
   479
lemma alpha_gen2:
77b86f1fc936 Lifting theorems with compound fv and compound alpha.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1460
diff changeset
   480
  "(bs, x1, x2) \<approx>gen (\<lambda>(x1, y1) (x2, y2). R1 x1 x2 \<and> R2 y1 y2) (\<lambda>(a, b). f1 a \<union> f2 b) pi (cs, y1, y2) =
1470
3127c75275a6 Fix for the change of alpha_gen.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1469
diff changeset
   481
  (f1 x1 \<union> f2 x2 - bs = f1 y1 \<union> f2 y2 - cs \<and> (f1 x1 \<union> f2 x2 - bs) \<sharp>* pi \<and> R1 (pi \<bullet> x1) y1 \<and> R2 (pi \<bullet> x2) y2
3127c75275a6 Fix for the change of alpha_gen.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1469
diff changeset
   482
  \<and> pi \<bullet> bs = cs)"
1467
77b86f1fc936 Lifting theorems with compound fv and compound alpha.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1460
diff changeset
   483
by (simp add: alpha_gen)
77b86f1fc936 Lifting theorems with compound fv and compound alpha.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1460
diff changeset
   484
1544
c6849a634582 Keep only one copy of infinite_Un.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1543
diff changeset
   485
1558
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   486
lemma alpha_gen_compose_sym:
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   487
  fixes pi
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   488
  assumes b: "(aa, t) \<approx>gen (\<lambda>x1 x2. R x1 x2 \<and> R x2 x1) f pi (ab, s)"
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   489
  and a: "\<And>pi t s. (R t s \<Longrightarrow> R (pi \<bullet> t) (pi \<bullet> s))"
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   490
  shows "(ab, s) \<approx>gen R f (- pi) (aa, t)"
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   491
  using b apply -
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   492
  apply(simp add: alpha_gen)
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   493
  apply(erule conjE)+
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   494
  apply(rule conjI)
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   495
  apply(simp add: fresh_star_def fresh_minus_perm)
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   496
  apply(subgoal_tac "R (- pi \<bullet> s) ((- pi) \<bullet> (pi \<bullet> t))")
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   497
  apply simp
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   498
  apply(clarify)
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   499
  apply(simp)
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   500
  apply(rule a)
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   501
  apply assumption
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   502
  done
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   503
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   504
lemma alpha_gen_compose_sym2:
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   505
  assumes a: "(aa, t1, t2) \<approx>gen (\<lambda>(x11, x12) (x21, x22).
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   506
  (R1 x11 x21 \<and> R1 x21 x11) \<and> R2 x12 x22 \<and> R2 x22 x12) (\<lambda>(b, a). fb b \<union> fa a) pi (ab, s1, s2)"
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   507
  and r1: "\<And>pi t s. R1 t s \<Longrightarrow> R1 (pi \<bullet> t) (pi \<bullet> s)"
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   508
  and r2: "\<And>pi t s. R2 t s \<Longrightarrow> R2 (pi \<bullet> t) (pi \<bullet> s)"
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   509
  shows "(ab, s1, s2) \<approx>gen (\<lambda>(a, b) (d, c). R1 a d \<and> R2 b c) (\<lambda>(b, a). fb b \<union> fa a) (- pi) (aa, t1, t2)"
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   510
  using a
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   511
  apply(simp add: alpha_gen)
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   512
  apply clarify
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   513
  apply (rule conjI)
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   514
  apply(simp add: fresh_star_def fresh_minus_perm)
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   515
  apply (rule conjI)
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   516
  apply (rotate_tac 3)
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   517
  apply (drule_tac pi="- pi" in r1)
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   518
  apply simp
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   519
  apply (rule conjI)
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   520
  apply (rotate_tac -1)
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   521
  apply (drule_tac pi="- pi" in r2)
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   522
  apply simp_all
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   523
  done
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   524
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   525
lemma alpha_gen_compose_trans:
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   526
  fixes pi pia
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   527
  assumes b: "(aa, t) \<approx>gen (\<lambda>x1 x2. R x1 x2 \<and> (\<forall>x. R x2 x \<longrightarrow> R x1 x)) f pi (ab, ta)"
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   528
  and c: "(ab, ta) \<approx>gen R f pia (ac, sa)"
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   529
  and a: "\<And>pi t s. (R t s \<Longrightarrow> R (pi \<bullet> t) (pi \<bullet> s))"
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   530
  shows "(aa, t) \<approx>gen R f (pia + pi) (ac, sa)"
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   531
  using b c apply -
1581
6b1eea8dcdc0 equivp_cheat can be removed for all one-permutation examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1563
diff changeset
   532
  apply(simp add: alpha_gen)
1558
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   533
  apply(erule conjE)+
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   534
  apply(simp add: fresh_star_plus)
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   535
  apply(drule_tac x="- pia \<bullet> sa" in spec)
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   536
  apply(drule mp)
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   537
  apply(rotate_tac 5)
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   538
  apply(drule_tac pi="- pia" in a)
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   539
  apply(simp)
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   540
  apply(rotate_tac 7)
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   541
  apply(drule_tac pi="pia" in a)
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   542
  apply(simp)
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   543
  done
a5ba76208983 started cleaning up and introduced 3 versions of ~~gen
Christian Urban <urbanc@in.tum.de>
parents: 1557
diff changeset
   544
1581
6b1eea8dcdc0 equivp_cheat can be removed for all one-permutation examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1563
diff changeset
   545
lemma alpha_gen_compose_trans2:
6b1eea8dcdc0 equivp_cheat can be removed for all one-permutation examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1563
diff changeset
   546
  fixes pi pia
6b1eea8dcdc0 equivp_cheat can be removed for all one-permutation examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1563
diff changeset
   547
  assumes b: "(aa, (t1, t2)) \<approx>gen
6b1eea8dcdc0 equivp_cheat can be removed for all one-permutation examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1563
diff changeset
   548
    (\<lambda>(b, a) (d, c). R1 b d \<and> (\<forall>z. R1 d z \<longrightarrow> R1 b z) \<and> R2 a c \<and> (\<forall>z. R2 c z \<longrightarrow> R2 a z))
6b1eea8dcdc0 equivp_cheat can be removed for all one-permutation examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1563
diff changeset
   549
    (\<lambda>(b, a). fv_a b \<union> fv_b a) pi (ab, (ta1, ta2))"
6b1eea8dcdc0 equivp_cheat can be removed for all one-permutation examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1563
diff changeset
   550
  and c: "(ab, (ta1, ta2)) \<approx>gen (\<lambda>(b, a) (d, c). R1 b d \<and> R2 a c) (\<lambda>(b, a). fv_a b \<union> fv_b a)
6b1eea8dcdc0 equivp_cheat can be removed for all one-permutation examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1563
diff changeset
   551
    pia (ac, (sa1, sa2))"
6b1eea8dcdc0 equivp_cheat can be removed for all one-permutation examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1563
diff changeset
   552
  and r1: "\<And>pi t s. R1 t s \<Longrightarrow> R1 (pi \<bullet> t) (pi \<bullet> s)"
6b1eea8dcdc0 equivp_cheat can be removed for all one-permutation examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1563
diff changeset
   553
  and r2: "\<And>pi t s. R2 t s \<Longrightarrow> R2 (pi \<bullet> t) (pi \<bullet> s)"
6b1eea8dcdc0 equivp_cheat can be removed for all one-permutation examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1563
diff changeset
   554
  shows "(aa, (t1, t2)) \<approx>gen (\<lambda>(b, a) (d, c). R1 b d \<and> R2 a c) (\<lambda>(b, a). fv_a b \<union> fv_b a)
6b1eea8dcdc0 equivp_cheat can be removed for all one-permutation examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1563
diff changeset
   555
    (pia + pi) (ac, (sa1, sa2))"
6b1eea8dcdc0 equivp_cheat can be removed for all one-permutation examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1563
diff changeset
   556
  using b c apply -
6b1eea8dcdc0 equivp_cheat can be removed for all one-permutation examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1563
diff changeset
   557
  apply(simp add: alpha_gen2)
6b1eea8dcdc0 equivp_cheat can be removed for all one-permutation examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1563
diff changeset
   558
  apply(simp add: alpha_gen)
6b1eea8dcdc0 equivp_cheat can be removed for all one-permutation examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1563
diff changeset
   559
  apply(erule conjE)+
6b1eea8dcdc0 equivp_cheat can be removed for all one-permutation examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1563
diff changeset
   560
  apply(simp add: fresh_star_plus)
6b1eea8dcdc0 equivp_cheat can be removed for all one-permutation examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1563
diff changeset
   561
  apply(drule_tac x="- pia \<bullet> sa1" in spec)
6b1eea8dcdc0 equivp_cheat can be removed for all one-permutation examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1563
diff changeset
   562
  apply(drule mp)
6b1eea8dcdc0 equivp_cheat can be removed for all one-permutation examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1563
diff changeset
   563
  apply(rotate_tac 5)
6b1eea8dcdc0 equivp_cheat can be removed for all one-permutation examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1563
diff changeset
   564
  apply(drule_tac pi="- pia" in r1)
6b1eea8dcdc0 equivp_cheat can be removed for all one-permutation examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1563
diff changeset
   565
  apply(simp)
6b1eea8dcdc0 equivp_cheat can be removed for all one-permutation examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1563
diff changeset
   566
  apply(rotate_tac -1)
6b1eea8dcdc0 equivp_cheat can be removed for all one-permutation examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1563
diff changeset
   567
  apply(drule_tac pi="pia" in r1)
6b1eea8dcdc0 equivp_cheat can be removed for all one-permutation examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1563
diff changeset
   568
  apply(simp)
6b1eea8dcdc0 equivp_cheat can be removed for all one-permutation examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1563
diff changeset
   569
  apply(drule_tac x="- pia \<bullet> sa2" in spec)
6b1eea8dcdc0 equivp_cheat can be removed for all one-permutation examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1563
diff changeset
   570
  apply(drule mp)
6b1eea8dcdc0 equivp_cheat can be removed for all one-permutation examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1563
diff changeset
   571
  apply(rotate_tac 6)
6b1eea8dcdc0 equivp_cheat can be removed for all one-permutation examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1563
diff changeset
   572
  apply(drule_tac pi="- pia" in r2)
6b1eea8dcdc0 equivp_cheat can be removed for all one-permutation examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1563
diff changeset
   573
  apply(simp)
6b1eea8dcdc0 equivp_cheat can be removed for all one-permutation examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1563
diff changeset
   574
  apply(rotate_tac -1)
6b1eea8dcdc0 equivp_cheat can be removed for all one-permutation examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1563
diff changeset
   575
  apply(drule_tac pi="pia" in r2)
6b1eea8dcdc0 equivp_cheat can be removed for all one-permutation examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1563
diff changeset
   576
  apply(simp)
6b1eea8dcdc0 equivp_cheat can be removed for all one-permutation examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1563
diff changeset
   577
  done
6b1eea8dcdc0 equivp_cheat can be removed for all one-permutation examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1563
diff changeset
   578
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   579
lemma alpha_gen_refl:
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   580
  assumes a: "R x x"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   581
  shows "(bs, x) \<approx>gen R f 0 (bs, x)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   582
  and   "(bs, x) \<approx>res R f 0 (bs, x)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   583
  and   "(cs, x) \<approx>lst R f 0 (cs, x)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   584
  using a 
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   585
  unfolding alphas
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   586
  unfolding fresh_star_def
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   587
  by (simp_all add: fresh_zero_perm)
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   588
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   589
lemma alpha_gen_sym:
1664
aa999d263b10 Modified abs_gen_sym and abs_gen_trans so it becomes usable in the proofs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1657
diff changeset
   590
  assumes a: "R (p \<bullet> x) y \<Longrightarrow> R y (p \<bullet> x)"
aa999d263b10 Modified abs_gen_sym and abs_gen_trans so it becomes usable in the proofs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1657
diff changeset
   591
  and     b: "\<And>x y p. R x y \<Longrightarrow> R (p \<bullet> x) (p \<bullet> y)"
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   592
  shows "(bs, x) \<approx>gen R f p (cs, y) \<Longrightarrow> (cs, y) \<approx>gen R f (- p) (bs, x)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   593
  and   "(bs, x) \<approx>res R f p (cs, y) \<Longrightarrow> (cs, y) \<approx>res R f (- p) (bs, x)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   594
  and   "(ds, x) \<approx>lst R f p (es, y) \<Longrightarrow> (es, y) \<approx>lst R f (- p) (ds, x)"
1664
aa999d263b10 Modified abs_gen_sym and abs_gen_trans so it becomes usable in the proofs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1657
diff changeset
   595
  unfolding alphas fresh_star_def
aa999d263b10 Modified abs_gen_sym and abs_gen_trans so it becomes usable in the proofs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1657
diff changeset
   596
  apply (erule_tac [1] conjE)+
aa999d263b10 Modified abs_gen_sym and abs_gen_trans so it becomes usable in the proofs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1657
diff changeset
   597
  apply (erule_tac [2] conjE)+
aa999d263b10 Modified abs_gen_sym and abs_gen_trans so it becomes usable in the proofs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1657
diff changeset
   598
  apply (erule_tac [3] conjE)+
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   599
  using a
1664
aa999d263b10 Modified abs_gen_sym and abs_gen_trans so it becomes usable in the proofs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1657
diff changeset
   600
  apply (simp_all add: fresh_minus_perm)
aa999d263b10 Modified abs_gen_sym and abs_gen_trans so it becomes usable in the proofs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1657
diff changeset
   601
  apply (rotate_tac [!] -1)
aa999d263b10 Modified abs_gen_sym and abs_gen_trans so it becomes usable in the proofs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1657
diff changeset
   602
  apply (drule_tac [!] p="-p" in b)
aa999d263b10 Modified abs_gen_sym and abs_gen_trans so it becomes usable in the proofs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1657
diff changeset
   603
  apply (simp_all)
aa999d263b10 Modified abs_gen_sym and abs_gen_trans so it becomes usable in the proofs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1657
diff changeset
   604
  apply (metis permute_minus_cancel(2))
aa999d263b10 Modified abs_gen_sym and abs_gen_trans so it becomes usable in the proofs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1657
diff changeset
   605
  apply (metis permute_minus_cancel(2))
aa999d263b10 Modified abs_gen_sym and abs_gen_trans so it becomes usable in the proofs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1657
diff changeset
   606
  done
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   607
lemma alpha_gen_trans:
1664
aa999d263b10 Modified abs_gen_sym and abs_gen_trans so it becomes usable in the proofs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1657
diff changeset
   608
  assumes a: "(\<forall>c. R y c \<longrightarrow> R (p \<bullet> x) c)"
aa999d263b10 Modified abs_gen_sym and abs_gen_trans so it becomes usable in the proofs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1657
diff changeset
   609
  and b: "R (p \<bullet> x) y"
aa999d263b10 Modified abs_gen_sym and abs_gen_trans so it becomes usable in the proofs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1657
diff changeset
   610
  and c: "R (q \<bullet> y) z"
aa999d263b10 Modified abs_gen_sym and abs_gen_trans so it becomes usable in the proofs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1657
diff changeset
   611
  and d: "\<And>x y p. R x y \<Longrightarrow> R (p \<bullet> x) (p \<bullet> y)"
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   612
  shows "\<lbrakk>(bs, x) \<approx>gen R f p (cs, y); (cs, y) \<approx>gen R f q (ds, z)\<rbrakk> \<Longrightarrow> (bs, x) \<approx>gen R f (q + p) (ds, z)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   613
  and   "\<lbrakk>(bs, x) \<approx>res R f p (cs, y); (cs, y) \<approx>res R f q (ds, z)\<rbrakk> \<Longrightarrow> (bs, x) \<approx>res R f (q + p) (ds, z)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   614
  and   "\<lbrakk>(es, x) \<approx>lst R f p (gs, y); (gs, y) \<approx>lst R f q (hs, z)\<rbrakk> \<Longrightarrow> (es, x) \<approx>lst R f (q + p) (hs, z)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   615
  unfolding alphas
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   616
  unfolding fresh_star_def
1664
aa999d263b10 Modified abs_gen_sym and abs_gen_trans so it becomes usable in the proofs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1657
diff changeset
   617
  apply (simp_all add: fresh_plus_perm)
aa999d263b10 Modified abs_gen_sym and abs_gen_trans so it becomes usable in the proofs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1657
diff changeset
   618
  apply (metis a c d permute_minus_cancel(2))+
aa999d263b10 Modified abs_gen_sym and abs_gen_trans so it becomes usable in the proofs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1657
diff changeset
   619
  done
1657
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   620
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   621
lemma alpha_gen_eqvt:
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   622
  assumes a: "R (q \<bullet> x) y \<Longrightarrow> R (p \<bullet> (q \<bullet> x)) (p \<bullet> y)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   623
  and     b: "p \<bullet> (f x) = f (p \<bullet> x)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   624
  and     c: "p \<bullet> (f y) = f (p \<bullet> y)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   625
  shows "(bs, x) \<approx>gen R f q (cs, y) \<Longrightarrow> (p \<bullet> bs, p \<bullet> x) \<approx>gen R f (p \<bullet> q) (p \<bullet> cs, p \<bullet> y)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   626
  and   "(bs, x) \<approx>res R f q (cs, y) \<Longrightarrow> (p \<bullet> bs, p \<bullet> x) \<approx>res R f (p \<bullet> q) (p \<bullet> cs, p \<bullet> y)"
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   627
  and   "(ds, x) \<approx>lst R f q (es, y) \<Longrightarrow> (p \<bullet> ds, p \<bullet> x) \<approx>lst R f (p \<bullet> q) (p \<bullet> es, p \<bullet> y)" 
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   628
  unfolding alphas
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   629
  unfolding set_eqvt[symmetric]
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   630
  unfolding b[symmetric] c[symmetric]
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   631
  unfolding Diff_eqvt[symmetric]
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   632
  unfolding permute_eqvt[symmetric]
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   633
  using a
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   634
  by (auto simp add: fresh_star_permute_iff)
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   635
Christian Urban <urbanc@in.tum.de>
parents: 1588
diff changeset
   636
1440
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   637
end
ffd5540ac2e9 added preliminary test version....but Test works now
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   638