author | Cezary Kaliszyk <kaliszyk@in.tum.de> |
Tue, 16 Mar 2010 15:38:14 +0100 | |
changeset 1455 | 0fae5608cd1e |
parent 1430 | ccbcebef56f3 |
child 1477 | 4ac3485899e1 |
permissions | -rw-r--r-- |
1271 | 1 |
theory TySch |
2 |
imports "Nominal2_Atoms" "Nominal2_Eqvt" "Nominal2_Supp" "Abs" "Perm" "Fv" "Rsp" "../Attic/Prove" |
|
3 |
begin |
|
4 |
||
5 |
atom_decl name |
|
6 |
||
7 |
text {* type schemes *} |
|
8 |
datatype ty = |
|
9 |
Var "name" |
|
10 |
| Fun "ty" "ty" |
|
11 |
||
1277
6eacf60ce41d
Permutation and FV_Alpha interface change.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1271
diff
changeset
|
12 |
setup {* snd o define_raw_perms (Datatype.the_info @{theory} "TySch.ty") 1 *} |
1271 | 13 |
print_theorems |
14 |
||
15 |
datatype tyS = |
|
16 |
All "name set" "ty" |
|
17 |
||
1430
ccbcebef56f3
Trying to prove atom_image_fresh_swap
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1277
diff
changeset
|
18 |
lemma support_image: "supp (atom ` (s :: (('a :: at) set))) = supp s" |
ccbcebef56f3
Trying to prove atom_image_fresh_swap
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1277
diff
changeset
|
19 |
apply (simp add: supp_def) |
ccbcebef56f3
Trying to prove atom_image_fresh_swap
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1277
diff
changeset
|
20 |
apply (simp add: eqvts eqvts_raw) |
ccbcebef56f3
Trying to prove atom_image_fresh_swap
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1277
diff
changeset
|
21 |
(* apply (metis COMBC_def Collect_def Collect_mem_eq atom_name_def_raw finite finite_imageI obtain_at_base rangeI)*) |
ccbcebef56f3
Trying to prove atom_image_fresh_swap
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1277
diff
changeset
|
22 |
sorry |
ccbcebef56f3
Trying to prove atom_image_fresh_swap
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1277
diff
changeset
|
23 |
|
ccbcebef56f3
Trying to prove atom_image_fresh_swap
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1277
diff
changeset
|
24 |
lemma atom_image_swap_fresh: "\<lbrakk>a \<sharp> atom ` (fn :: ('a :: at) set); b \<sharp> atom ` fn\<rbrakk> \<Longrightarrow> (a \<rightleftharpoons> b) \<bullet> fn = fn" |
ccbcebef56f3
Trying to prove atom_image_fresh_swap
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1277
diff
changeset
|
25 |
apply (simp add: fresh_def) |
ccbcebef56f3
Trying to prove atom_image_fresh_swap
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1277
diff
changeset
|
26 |
apply (simp add: support_image) |
ccbcebef56f3
Trying to prove atom_image_fresh_swap
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1277
diff
changeset
|
27 |
apply (fold fresh_def) |
ccbcebef56f3
Trying to prove atom_image_fresh_swap
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1277
diff
changeset
|
28 |
apply (simp add: swap_fresh_fresh) |
ccbcebef56f3
Trying to prove atom_image_fresh_swap
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1277
diff
changeset
|
29 |
done |
ccbcebef56f3
Trying to prove atom_image_fresh_swap
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1277
diff
changeset
|
30 |
|
ccbcebef56f3
Trying to prove atom_image_fresh_swap
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1277
diff
changeset
|
31 |
lemma "\<lbrakk>a \<sharp> atom ` fun; a \<sharp> t; b \<sharp> atom ` fun; b \<sharp> t\<rbrakk> \<Longrightarrow> All ((a \<rightleftharpoons> b) \<bullet> fun) t = All fun t" |
ccbcebef56f3
Trying to prove atom_image_fresh_swap
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1277
diff
changeset
|
32 |
apply (simp add: atom_image_swap_fresh) |
ccbcebef56f3
Trying to prove atom_image_fresh_swap
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1277
diff
changeset
|
33 |
done |
ccbcebef56f3
Trying to prove atom_image_fresh_swap
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1277
diff
changeset
|
34 |
|
1277
6eacf60ce41d
Permutation and FV_Alpha interface change.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1271
diff
changeset
|
35 |
setup {* snd o define_raw_perms (Datatype.the_info @{theory} "TySch.tyS") 1 *} |
1271 | 36 |
print_theorems |
37 |
||
1277
6eacf60ce41d
Permutation and FV_Alpha interface change.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1271
diff
changeset
|
38 |
local_setup {* snd o define_fv_alpha (Datatype.the_info @{theory} "TySch.ty") |
6eacf60ce41d
Permutation and FV_Alpha interface change.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1271
diff
changeset
|
39 |
[[[[]], [[], []]]] *} |
1271 | 40 |
print_theorems |
41 |
||
42 |
(* |
|
43 |
Doesnot work yet since we do not refer to fv_ty |
|
1277
6eacf60ce41d
Permutation and FV_Alpha interface change.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1271
diff
changeset
|
44 |
local_setup {* define_raw_fv (Datatype.the_info @{theory} "TySch.tyS") [[[[], []]]] *} |
1271 | 45 |
print_theorems |
46 |
*) |
|
47 |
||
48 |
primrec |
|
49 |
fv_tyS |
|
50 |
where |
|
51 |
"fv_tyS (All xs T) = (fv_ty T - atom ` xs)" |
|
52 |
||
53 |
inductive |
|
54 |
alpha_tyS :: "tyS \<Rightarrow> tyS \<Rightarrow> bool" ("_ \<approx>tyS _" [100, 100] 100) |
|
55 |
where |
|
56 |
a1: "\<exists>pi. ((atom ` xs1, T1) \<approx>gen (op =) fv_ty pi (atom ` xs2, T2)) |
|
57 |
\<Longrightarrow> All xs1 T1 \<approx>tyS All xs2 T2" |
|
58 |
||
59 |
lemma |
|
60 |
shows "All {a, b} (Fun (Var a) (Var b)) \<approx>tyS All {b, a} (Fun (Var a) (Var b))" |
|
61 |
apply(rule a1) |
|
62 |
apply(simp add: alpha_gen) |
|
63 |
apply(rule_tac x="0::perm" in exI) |
|
64 |
apply(simp add: fresh_star_def) |
|
65 |
done |
|
66 |
||
67 |
lemma |
|
68 |
shows "All {a, b} (Fun (Var a) (Var b)) \<approx>tyS All {a, b} (Fun (Var b) (Var a))" |
|
69 |
apply(rule a1) |
|
70 |
apply(simp add: alpha_gen) |
|
71 |
apply(rule_tac x="(atom a \<rightleftharpoons> atom b)" in exI) |
|
72 |
apply(simp add: fresh_star_def) |
|
73 |
done |
|
74 |
||
75 |
lemma |
|
76 |
shows "All {a, b, c} (Fun (Var a) (Var b)) \<approx>tyS All {a, b} (Fun (Var a) (Var b))" |
|
77 |
apply(rule a1) |
|
78 |
apply(simp add: alpha_gen) |
|
79 |
apply(rule_tac x="0::perm" in exI) |
|
80 |
apply(simp add: fresh_star_def) |
|
81 |
done |
|
82 |
||
83 |
lemma |
|
84 |
assumes a: "a \<noteq> b" |
|
85 |
shows "\<not>(All {a, b} (Fun (Var a) (Var b)) \<approx>tyS All {c} (Fun (Var c) (Var c)))" |
|
86 |
using a |
|
87 |
apply(clarify) |
|
88 |
apply(erule alpha_tyS.cases) |
|
89 |
apply(simp add: alpha_gen) |
|
90 |
apply(erule conjE)+ |
|
91 |
apply(erule exE) |
|
92 |
apply(erule conjE)+ |
|
93 |
apply(clarify) |
|
94 |
apply(simp) |
|
95 |
apply(simp add: fresh_star_def) |
|
96 |
apply(auto) |
|
97 |
done |
|
98 |
||
99 |
||
100 |
end |