Quot/Nominal/Abs.thy
author Cezary Kaliszyk <kaliszyk@in.tum.de>
Fri, 29 Jan 2010 19:42:07 +0100
changeset 994 333c24bd595d
parent 989 af02b193a19a
child 995 ee0619b5adff
permissions -rw-r--r--
More in the LF example in the new nominal way, all is clear until support.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
989
af02b193a19a the supp of a lambda can now be characterised, *provided* the notion of free variables coincides with support on lambda terms
Christian Urban <urbanc@in.tum.de>
parents: 988
diff changeset
     1
theory Abs
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     2
imports "Nominal2_Atoms" "Nominal2_Eqvt" "Nominal2_Supp" "../QuotMain" 
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     3
begin
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     4
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
     5
(* lemmas that should be in Nominal \<dots>\<dots>must be cleaned *)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
     6
lemma in_permute_iff:
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
     7
  shows "(p \<bullet> x) \<in> (p \<bullet> X) \<longleftrightarrow> x \<in> X"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
     8
apply(unfold mem_def permute_fun_def)[1]
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
     9
apply(simp add: permute_bool_def) 
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    10
done
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    11
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    12
lemma fresh_star_permute_iff:
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    13
  shows "(p \<bullet> a) \<sharp>* (p \<bullet> x) \<longleftrightarrow> a \<sharp>* x"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    14
apply(simp add: fresh_star_def)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    15
apply(auto)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    16
apply(drule_tac x="p \<bullet> xa" in bspec)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    17
apply(unfold mem_def permute_fun_def)[1] 
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    18
apply(simp add: eqvts)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    19
apply(simp add: fresh_permute_iff)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    20
apply(rule_tac ?p1="- p" in fresh_permute_iff[THEN iffD1])
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    21
apply(simp)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    22
apply(drule_tac x="- p \<bullet> xa" in bspec)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    23
apply(rule_tac ?p1="p" in in_permute_iff[THEN iffD1])
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    24
apply(simp)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    25
apply(simp)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    26
done
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    27
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    28
datatype 'a ABS_raw = Abs_raw "atom set" "'a::pt"
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    29
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    30
primrec
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    31
  Abs_raw_map
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    32
where
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    33
  "Abs_raw_map f (Abs_raw as x) = Abs_raw as (f x)"
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    34
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    35
fun
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    36
  Abs_raw_rel
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    37
where
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    38
  "Abs_raw_rel R (Abs_raw as x) (Abs_raw bs y) = R x y"
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    39
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    40
declare [[map "ABS_raw" = (Abs_raw_map, Abs_raw_rel)]]
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    41
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    42
instantiation ABS_raw :: (pt) pt
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    43
begin
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    44
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    45
primrec
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    46
  permute_ABS_raw
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    47
where
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    48
  "permute_ABS_raw p (Abs_raw as x) = Abs_raw (p \<bullet> as) (p \<bullet> x)"
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    49
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    50
instance
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    51
apply(default)
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    52
apply(case_tac [!] x)
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    53
apply(simp_all)
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    54
done
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    55
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    56
end  
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    57
988
a987b5acadc8 improved the proof slightly by defining alpha as a function and completely characterised the equality between two abstractions
Christian Urban <urbanc@in.tum.de>
parents: 986
diff changeset
    58
fun
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    59
  alpha_abs :: "('a::pt) ABS_raw \<Rightarrow> 'a ABS_raw \<Rightarrow> bool"
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    60
where
988
a987b5acadc8 improved the proof slightly by defining alpha as a function and completely characterised the equality between two abstractions
Christian Urban <urbanc@in.tum.de>
parents: 986
diff changeset
    61
  "alpha_abs (Abs_raw as x) (Abs_raw bs y) =
a987b5acadc8 improved the proof slightly by defining alpha as a function and completely characterised the equality between two abstractions
Christian Urban <urbanc@in.tum.de>
parents: 986
diff changeset
    62
    (\<exists>pi. (supp x) - as = (supp y) - bs \<and>  ((supp x) - as) \<sharp>* pi \<and> pi \<bullet> x = y)" 
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    63
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    64
lemma alpha_reflp:
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    65
  shows "alpha_abs ab ab"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    66
apply(induct ab)
988
a987b5acadc8 improved the proof slightly by defining alpha as a function and completely characterised the equality between two abstractions
Christian Urban <urbanc@in.tum.de>
parents: 986
diff changeset
    67
apply(simp)
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    68
apply(rule_tac x="0" in exI)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    69
apply(simp add: fresh_star_def fresh_zero_perm)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    70
done
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    71
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    72
lemma alpha_symp:
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    73
  assumes a: "alpha_abs ab1 ab2"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    74
  shows "alpha_abs ab2 ab1"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    75
using a
988
a987b5acadc8 improved the proof slightly by defining alpha as a function and completely characterised the equality between two abstractions
Christian Urban <urbanc@in.tum.de>
parents: 986
diff changeset
    76
apply(induct rule: alpha_abs.induct)
a987b5acadc8 improved the proof slightly by defining alpha as a function and completely characterised the equality between two abstractions
Christian Urban <urbanc@in.tum.de>
parents: 986
diff changeset
    77
apply(simp)
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    78
apply(clarify)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    79
apply(rule_tac x="- pi" in exI)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    80
apply(auto)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    81
apply(auto simp add: fresh_star_def)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    82
apply(simp add: fresh_def supp_minus_perm)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    83
done
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    84
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    85
lemma alpha_transp:
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    86
  assumes a1: "alpha_abs ab1 ab2"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    87
  and     a2: "alpha_abs ab2 ab3"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    88
  shows "alpha_abs ab1 ab3"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    89
using a1 a2
988
a987b5acadc8 improved the proof slightly by defining alpha as a function and completely characterised the equality between two abstractions
Christian Urban <urbanc@in.tum.de>
parents: 986
diff changeset
    90
apply(induct rule: alpha_abs.induct)
a987b5acadc8 improved the proof slightly by defining alpha as a function and completely characterised the equality between two abstractions
Christian Urban <urbanc@in.tum.de>
parents: 986
diff changeset
    91
apply(induct rule: alpha_abs.induct)
a987b5acadc8 improved the proof slightly by defining alpha as a function and completely characterised the equality between two abstractions
Christian Urban <urbanc@in.tum.de>
parents: 986
diff changeset
    92
apply(simp)
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    93
apply(clarify)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    94
apply(rule_tac x="pia + pi" in exI)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    95
apply(simp)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    96
apply(auto simp add: fresh_star_def)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    97
using supp_plus_perm
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    98
apply(simp add: fresh_def)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    99
apply(blast)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   100
done
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   101
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   102
lemma alpha_eqvt:
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   103
  assumes a: "alpha_abs ab1 ab2"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   104
  shows "alpha_abs (p \<bullet> ab1) (p \<bullet> ab2)"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   105
using a
988
a987b5acadc8 improved the proof slightly by defining alpha as a function and completely characterised the equality between two abstractions
Christian Urban <urbanc@in.tum.de>
parents: 986
diff changeset
   106
apply(induct ab1 ab2 rule: alpha_abs.induct)
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   107
apply(simp)
988
a987b5acadc8 improved the proof slightly by defining alpha as a function and completely characterised the equality between two abstractions
Christian Urban <urbanc@in.tum.de>
parents: 986
diff changeset
   108
apply(clarify)
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   109
apply(rule conjI)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   110
apply(simp add: supp_eqvt[symmetric])
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   111
apply(simp add: Diff_eqvt[symmetric])
988
a987b5acadc8 improved the proof slightly by defining alpha as a function and completely characterised the equality between two abstractions
Christian Urban <urbanc@in.tum.de>
parents: 986
diff changeset
   112
apply(rule_tac x="p \<bullet> pi" in exI)
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   113
apply(rule conjI)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   114
apply(simp add: supp_eqvt[symmetric])
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   115
apply(simp add: Diff_eqvt[symmetric])
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   116
apply(simp only: fresh_star_permute_iff)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   117
apply(simp add: permute_eqvt[symmetric])
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   118
done
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   119
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   120
lemma test1:
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   121
  assumes a1: "a \<notin> (supp x) - bs"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   122
  and     a2: "b \<notin> (supp x) - bs"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   123
  shows "alpha_abs (Abs_raw bs x) (Abs_raw ((a \<rightleftharpoons> b) \<bullet> bs) ((a \<rightleftharpoons> b) \<bullet> x))"
988
a987b5acadc8 improved the proof slightly by defining alpha as a function and completely characterised the equality between two abstractions
Christian Urban <urbanc@in.tum.de>
parents: 986
diff changeset
   124
unfolding alpha_abs.simps
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   125
apply(rule_tac x="(a \<rightleftharpoons> b)" in exI)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   126
apply(rule_tac conjI)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   127
apply(simp add: supp_eqvt[symmetric])
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   128
apply(simp add: Diff_eqvt[symmetric])
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   129
using a1 a2
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   130
apply(simp add: swap_set_fresh)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   131
apply(rule conjI)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   132
prefer 2
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   133
apply(simp)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   134
apply(simp add: fresh_star_def)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   135
apply(simp add: fresh_def)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   136
apply(subgoal_tac "supp (a \<rightleftharpoons> b) \<subseteq> {a, b}")
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   137
using a1 a2
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   138
apply -
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   139
apply(blast)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   140
apply(simp add: supp_swap)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   141
done
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   142
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   143
fun
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   144
  s_test
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   145
where
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   146
  "s_test (Abs_raw bs x) = (supp x) - bs"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   147
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   148
lemma s_test_lemma:
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   149
  assumes a: "alpha_abs x y" 
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   150
  shows "s_test x = s_test y"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   151
using a
988
a987b5acadc8 improved the proof slightly by defining alpha as a function and completely characterised the equality between two abstractions
Christian Urban <urbanc@in.tum.de>
parents: 986
diff changeset
   152
apply(induct rule: alpha_abs.induct)
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   153
apply(simp)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   154
done
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   155
  
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   156
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   157
quotient_type 'a ABS = "('a::pt) ABS_raw" / "alpha_abs::('a::pt) ABS_raw \<Rightarrow> 'a ABS_raw \<Rightarrow> bool"
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   158
  apply(rule equivpI)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   159
  unfolding reflp_def symp_def transp_def
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   160
  apply(auto intro: alpha_reflp alpha_symp alpha_transp)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   161
  done
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   162
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   163
quotient_definition
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   164
   "Abs::atom set \<Rightarrow> ('a::pt) \<Rightarrow> 'a ABS"
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   165
as
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   166
   "Abs_raw"
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   167
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   168
lemma [quot_respect]:
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   169
  shows "((op =) ===> (op =) ===> alpha_abs) Abs_raw Abs_raw"
988
a987b5acadc8 improved the proof slightly by defining alpha as a function and completely characterised the equality between two abstractions
Christian Urban <urbanc@in.tum.de>
parents: 986
diff changeset
   170
apply(auto simp del: alpha_abs.simps)
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   171
apply(rule alpha_reflp)
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   172
done
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   173
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   174
lemma [quot_respect]:
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   175
  shows "((op =) ===> alpha_abs ===> alpha_abs) permute permute"
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   176
apply(auto)
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   177
apply(simp add: alpha_eqvt)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   178
done
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   179
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   180
lemma [quot_respect]:
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   181
  shows "(alpha_abs ===> (op =)) s_test s_test"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   182
apply(simp add: s_test_lemma)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   183
done
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   184
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   185
lemma ABS_induct:
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   186
  "\<lbrakk>\<And>as (x::'a::pt). P (Abs as x)\<rbrakk> \<Longrightarrow> P t"
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   187
apply(lifting ABS_raw.induct)
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   188
done
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   189
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   190
instantiation ABS :: (pt) pt
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   191
begin
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   192
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   193
quotient_definition
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   194
  "permute_ABS::perm \<Rightarrow> ('a::pt ABS) \<Rightarrow> 'a ABS"
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   195
as
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   196
  "permute::perm \<Rightarrow> ('a::pt ABS_raw) \<Rightarrow> 'a ABS_raw"
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   197
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   198
lemma permute_ABS [simp]:
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   199
  fixes x::"'b::pt"  (* ??? has to be 'b \<dots> 'a doe not work *)
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   200
  shows "(p \<bullet> (Abs as x)) = Abs (p \<bullet> as) (p \<bullet> x)"
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   201
apply(lifting permute_ABS_raw.simps(1))
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   202
done
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   203
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   204
instance
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   205
  apply(default)
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   206
  apply(induct_tac [!] x rule: ABS_induct)
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   207
  apply(simp_all)
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   208
  done
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   209
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   210
end
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   211
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   212
lemma test1_lifted:
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   213
  assumes a1: "a \<notin> (supp x) - bs"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   214
  and     a2: "b \<notin> (supp x) - bs"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   215
  shows "(Abs bs x) = (Abs ((a \<rightleftharpoons> b) \<bullet> bs) ((a \<rightleftharpoons> b) \<bullet> x))"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   216
using a1 a2
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   217
apply(lifting test1)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   218
done
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   219
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   220
lemma Abs_supports:
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   221
  shows "((supp x) - as) supports (Abs as x) "
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   222
unfolding supports_def
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   223
apply(clarify)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   224
apply(simp (no_asm))
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   225
apply(subst test1_lifted[symmetric])
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   226
apply(simp_all)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   227
done
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   228
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   229
quotient_definition
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   230
  "s_test_lifted :: ('a::pt) ABS \<Rightarrow> atom \<Rightarrow> bool"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   231
as
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   232
  "s_test::('a::pt) ABS_raw \<Rightarrow> atom \<Rightarrow> bool"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   233
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   234
lemma s_test_lifted_simp:
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   235
  shows "s_test_lifted (Abs bs x) = (supp x) - bs"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   236
apply(lifting s_test.simps(1))
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   237
done
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   238
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   239
lemma s_test_lifted_eqvt:
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   240
  shows "(p \<bullet> (s_test_lifted ab)) = s_test_lifted (p \<bullet> ab)"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   241
apply(induct ab rule: ABS_induct)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   242
apply(simp add: s_test_lifted_simp supp_eqvt Diff_eqvt)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   243
done
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   244
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   245
lemma fresh_f_empty_supp:
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   246
  assumes a: "\<forall>p. p \<bullet> f = f"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   247
  shows "a \<sharp> x \<Longrightarrow> a \<sharp> (f x)"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   248
apply(simp add: fresh_def)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   249
apply(simp add: supp_def)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   250
apply(simp add: permute_fun_app_eq)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   251
apply(simp add: a)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   252
apply(rule finite_subset)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   253
prefer 2
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   254
apply(assumption)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   255
apply(auto)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   256
done
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   257
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   258
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   259
lemma s_test_fresh_lemma:
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   260
  shows "(a \<sharp> Abs bs x) \<Longrightarrow> (a \<sharp> s_test_lifted (Abs bs x))"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   261
apply(rule fresh_f_empty_supp)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   262
apply(rule allI)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   263
apply(subst permute_fun_def)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   264
apply(simp add: s_test_lifted_eqvt)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   265
apply(simp)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   266
done
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   267
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   268
lemma supp_finite_set:
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   269
  fixes S::"atom set"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   270
  assumes "finite S"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   271
  shows "supp S = S"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   272
  apply(rule finite_supp_unique)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   273
  apply(simp add: supports_def)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   274
  apply(auto simp add: permute_set_eq swap_atom)[1]
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   275
  apply(metis)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   276
  apply(rule assms)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   277
  apply(auto simp add: permute_set_eq swap_atom)[1]
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   278
done
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   279
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   280
lemma s_test_subset:
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   281
  fixes x::"'a::fs"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   282
  shows "((supp x) - as) \<subseteq> (supp (Abs as x))"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   283
apply(rule subsetI)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   284
apply(rule contrapos_pp)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   285
apply(assumption)
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   286
unfolding fresh_def[symmetric]
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   287
apply(drule_tac s_test_fresh_lemma)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   288
apply(simp only: s_test_lifted_simp)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   289
apply(simp add: fresh_def)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   290
apply(subgoal_tac "finite (supp x - as)")
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   291
apply(simp add: supp_finite_set)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   292
apply(simp add: finite_supp)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   293
done
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   294
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   295
lemma supp_Abs:
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   296
  fixes x::"'a::fs"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   297
  shows "supp (Abs as x) = (supp x) - as"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   298
apply(rule subset_antisym)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   299
apply(rule supp_is_subset)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   300
apply(rule Abs_supports)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   301
apply(simp add: finite_supp)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   302
apply(rule s_test_subset)
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   303
done
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   304
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   305
instance ABS :: (fs) fs
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   306
apply(default)
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   307
apply(induct_tac x rule: ABS_induct)
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   308
apply(simp add: supp_Abs)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   309
apply(simp add: finite_supp)
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   310
done
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   311
988
a987b5acadc8 improved the proof slightly by defining alpha as a function and completely characterised the equality between two abstractions
Christian Urban <urbanc@in.tum.de>
parents: 986
diff changeset
   312
lemma fresh_abs:
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   313
  fixes x::"'a::fs"
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   314
  shows "a \<sharp> Abs bs x = (a \<in> bs \<or> (a \<notin> bs \<and> a \<sharp> x))"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   315
apply(simp add: fresh_def)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   316
apply(simp add: supp_Abs)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   317
apply(auto)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   318
done
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   319
988
a987b5acadc8 improved the proof slightly by defining alpha as a function and completely characterised the equality between two abstractions
Christian Urban <urbanc@in.tum.de>
parents: 986
diff changeset
   320
lemma abs_eq:
a987b5acadc8 improved the proof slightly by defining alpha as a function and completely characterised the equality between two abstractions
Christian Urban <urbanc@in.tum.de>
parents: 986
diff changeset
   321
  shows "(Abs as x) = (Abs bs y) \<longleftrightarrow> (\<exists>pi. supp x - as = supp y - bs \<and> (supp x - as) \<sharp>* pi \<and> pi \<bullet> x = y)"
a987b5acadc8 improved the proof slightly by defining alpha as a function and completely characterised the equality between two abstractions
Christian Urban <urbanc@in.tum.de>
parents: 986
diff changeset
   322
apply(lifting alpha_abs.simps(1))
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   323
done
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   324
989
af02b193a19a the supp of a lambda can now be characterised, *provided* the notion of free variables coincides with support on lambda terms
Christian Urban <urbanc@in.tum.de>
parents: 988
diff changeset
   325
end
988
a987b5acadc8 improved the proof slightly by defining alpha as a function and completely characterised the equality between two abstractions
Christian Urban <urbanc@in.tum.de>
parents: 986
diff changeset
   326