author | Christian Urban <urbanc@in.tum.de> |
Wed, 29 Sep 2010 16:49:13 -0400 | |
changeset 2503 | cc5d23547341 |
parent 2471 | 894599a50af3 |
child 2524 | 693562f03eee |
permissions | -rw-r--r-- |
1534
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
1 |
theory Nominal2_FSet |
2467
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2 |
imports "../Nominal-General/Nominal2_Base" |
2302 | 3 |
"../Nominal-General/Nominal2_Eqvt" |
1806 | 4 |
FSet |
1534
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
5 |
begin |
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
6 |
|
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
7 |
lemma permute_rsp_fset[quot_respect]: |
2447 | 8 |
shows "(op = ===> list_eq ===> list_eq) permute permute" |
9 |
apply(simp) |
|
10 |
apply(clarify) |
|
2468 | 11 |
apply(rule_tac p="-x" in permute_boolE) |
12 |
apply(perm_simp add: permute_minus_cancel) |
|
2447 | 13 |
apply(simp) |
1534
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
14 |
done |
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
15 |
|
2004
b96e8cf86891
generalised the fs-instance lemma (not just fsets of atoms are finitely supported, but also fsets of finitely supported elements)
Christian Urban <urbanc@in.tum.de>
parents:
1973
diff
changeset
|
16 |
instantiation fset :: (pt) pt |
1534
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
17 |
begin |
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
18 |
|
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
19 |
quotient_definition |
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
20 |
"permute_fset :: perm \<Rightarrow> 'a fset \<Rightarrow> 'a fset" |
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
21 |
is |
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
22 |
"permute :: perm \<Rightarrow> 'a list \<Rightarrow> 'a list" |
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
23 |
|
1815
4135198bbb8a
moved equivariance of map into Nominal2_Eqvt file
Christian Urban <urbanc@in.tum.de>
parents:
1806
diff
changeset
|
24 |
instance |
4135198bbb8a
moved equivariance of map into Nominal2_Eqvt file
Christian Urban <urbanc@in.tum.de>
parents:
1806
diff
changeset
|
25 |
proof |
1782 | 26 |
fix x :: "'a fset" and p q :: "perm" |
27 |
show "0 \<bullet> x = x" |
|
28 |
by (lifting permute_zero [where 'a="'a list"]) |
|
29 |
show "(p + q) \<bullet> x = p \<bullet> q \<bullet> x" |
|
30 |
by (lifting permute_plus [where 'a="'a list"]) |
|
31 |
qed |
|
1534
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
32 |
|
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
33 |
end |
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
34 |
|
2466
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2447
diff
changeset
|
35 |
lemma permute_fset[simp, eqvt]: |
2004
b96e8cf86891
generalised the fs-instance lemma (not just fsets of atoms are finitely supported, but also fsets of finitely supported elements)
Christian Urban <urbanc@in.tum.de>
parents:
1973
diff
changeset
|
36 |
fixes S::"('a::pt) fset" |
b96e8cf86891
generalised the fs-instance lemma (not just fsets of atoms are finitely supported, but also fsets of finitely supported elements)
Christian Urban <urbanc@in.tum.de>
parents:
1973
diff
changeset
|
37 |
shows "(p \<bullet> {||}) = ({||} ::('a::pt) fset)" |
b96e8cf86891
generalised the fs-instance lemma (not just fsets of atoms are finitely supported, but also fsets of finitely supported elements)
Christian Urban <urbanc@in.tum.de>
parents:
1973
diff
changeset
|
38 |
and "p \<bullet> finsert x S = finsert (p \<bullet> x) (p \<bullet> S)" |
1534
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
39 |
by (lifting permute_list.simps) |
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
40 |
|
1815
4135198bbb8a
moved equivariance of map into Nominal2_Eqvt file
Christian Urban <urbanc@in.tum.de>
parents:
1806
diff
changeset
|
41 |
lemma fmap_eqvt[eqvt]: |
2004
b96e8cf86891
generalised the fs-instance lemma (not just fsets of atoms are finitely supported, but also fsets of finitely supported elements)
Christian Urban <urbanc@in.tum.de>
parents:
1973
diff
changeset
|
42 |
shows "p \<bullet> (fmap f S) = fmap (p \<bullet> f) (p \<bullet> S)" |
1534
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
43 |
by (lifting map_eqvt) |
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
44 |
|
2340
b1549d391ea7
removed an "eqvt"-warning
Christian Urban <urbanc@in.tum.de>
parents:
2302
diff
changeset
|
45 |
lemma fset_to_set_eqvt [eqvt]: |
2004
b96e8cf86891
generalised the fs-instance lemma (not just fsets of atoms are finitely supported, but also fsets of finitely supported elements)
Christian Urban <urbanc@in.tum.de>
parents:
1973
diff
changeset
|
46 |
shows "p \<bullet> (fset_to_set S) = fset_to_set (p \<bullet> S)" |
1534
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
47 |
by (lifting set_eqvt) |
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
48 |
|
2004
b96e8cf86891
generalised the fs-instance lemma (not just fsets of atoms are finitely supported, but also fsets of finitely supported elements)
Christian Urban <urbanc@in.tum.de>
parents:
1973
diff
changeset
|
49 |
lemma fin_fset_to_set[simp]: |
b96e8cf86891
generalised the fs-instance lemma (not just fsets of atoms are finitely supported, but also fsets of finitely supported elements)
Christian Urban <urbanc@in.tum.de>
parents:
1973
diff
changeset
|
50 |
shows "finite (fset_to_set S)" |
b96e8cf86891
generalised the fs-instance lemma (not just fsets of atoms are finitely supported, but also fsets of finitely supported elements)
Christian Urban <urbanc@in.tum.de>
parents:
1973
diff
changeset
|
51 |
by (induct S) (simp_all) |
1542
63e327e95abd
Showed the instance: fset::(at) fs
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1534
diff
changeset
|
52 |
|
1534
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
53 |
lemma supp_fset_to_set: |
2004
b96e8cf86891
generalised the fs-instance lemma (not just fsets of atoms are finitely supported, but also fsets of finitely supported elements)
Christian Urban <urbanc@in.tum.de>
parents:
1973
diff
changeset
|
54 |
shows "supp (fset_to_set S) = supp S" |
2340
b1549d391ea7
removed an "eqvt"-warning
Christian Urban <urbanc@in.tum.de>
parents:
2302
diff
changeset
|
55 |
unfolding supp_def |
b1549d391ea7
removed an "eqvt"-warning
Christian Urban <urbanc@in.tum.de>
parents:
2302
diff
changeset
|
56 |
by (perm_simp) (simp add: fset_cong) |
1534
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
57 |
|
2447 | 58 |
lemma supp_fempty: |
59 |
shows "supp {||} = {}" |
|
60 |
unfolding supp_def |
|
61 |
by simp |
|
62 |
||
2004
b96e8cf86891
generalised the fs-instance lemma (not just fsets of atoms are finitely supported, but also fsets of finitely supported elements)
Christian Urban <urbanc@in.tum.de>
parents:
1973
diff
changeset
|
63 |
lemma supp_finsert: |
b96e8cf86891
generalised the fs-instance lemma (not just fsets of atoms are finitely supported, but also fsets of finitely supported elements)
Christian Urban <urbanc@in.tum.de>
parents:
1973
diff
changeset
|
64 |
fixes x::"'a::fs" |
b96e8cf86891
generalised the fs-instance lemma (not just fsets of atoms are finitely supported, but also fsets of finitely supported elements)
Christian Urban <urbanc@in.tum.de>
parents:
1973
diff
changeset
|
65 |
shows "supp (finsert x S) = supp x \<union> supp S" |
b96e8cf86891
generalised the fs-instance lemma (not just fsets of atoms are finitely supported, but also fsets of finitely supported elements)
Christian Urban <urbanc@in.tum.de>
parents:
1973
diff
changeset
|
66 |
apply(subst supp_fset_to_set[symmetric]) |
b96e8cf86891
generalised the fs-instance lemma (not just fsets of atoms are finitely supported, but also fsets of finitely supported elements)
Christian Urban <urbanc@in.tum.de>
parents:
1973
diff
changeset
|
67 |
apply(simp add: supp_fset_to_set) |
b96e8cf86891
generalised the fs-instance lemma (not just fsets of atoms are finitely supported, but also fsets of finitely supported elements)
Christian Urban <urbanc@in.tum.de>
parents:
1973
diff
changeset
|
68 |
apply(simp add: supp_of_fin_insert) |
b96e8cf86891
generalised the fs-instance lemma (not just fsets of atoms are finitely supported, but also fsets of finitely supported elements)
Christian Urban <urbanc@in.tum.de>
parents:
1973
diff
changeset
|
69 |
apply(simp add: supp_fset_to_set) |
b96e8cf86891
generalised the fs-instance lemma (not just fsets of atoms are finitely supported, but also fsets of finitely supported elements)
Christian Urban <urbanc@in.tum.de>
parents:
1973
diff
changeset
|
70 |
done |
b96e8cf86891
generalised the fs-instance lemma (not just fsets of atoms are finitely supported, but also fsets of finitely supported elements)
Christian Urban <urbanc@in.tum.de>
parents:
1973
diff
changeset
|
71 |
|
b96e8cf86891
generalised the fs-instance lemma (not just fsets of atoms are finitely supported, but also fsets of finitely supported elements)
Christian Urban <urbanc@in.tum.de>
parents:
1973
diff
changeset
|
72 |
|
b96e8cf86891
generalised the fs-instance lemma (not just fsets of atoms are finitely supported, but also fsets of finitely supported elements)
Christian Urban <urbanc@in.tum.de>
parents:
1973
diff
changeset
|
73 |
instance fset :: (fs) fs |
b96e8cf86891
generalised the fs-instance lemma (not just fsets of atoms are finitely supported, but also fsets of finitely supported elements)
Christian Urban <urbanc@in.tum.de>
parents:
1973
diff
changeset
|
74 |
apply (default) |
b96e8cf86891
generalised the fs-instance lemma (not just fsets of atoms are finitely supported, but also fsets of finitely supported elements)
Christian Urban <urbanc@in.tum.de>
parents:
1973
diff
changeset
|
75 |
apply (induct_tac x rule: fset_induct) |
b96e8cf86891
generalised the fs-instance lemma (not just fsets of atoms are finitely supported, but also fsets of finitely supported elements)
Christian Urban <urbanc@in.tum.de>
parents:
1973
diff
changeset
|
76 |
apply (simp add: supp_fempty) |
b96e8cf86891
generalised the fs-instance lemma (not just fsets of atoms are finitely supported, but also fsets of finitely supported elements)
Christian Urban <urbanc@in.tum.de>
parents:
1973
diff
changeset
|
77 |
apply (simp add: supp_finsert) |
b96e8cf86891
generalised the fs-instance lemma (not just fsets of atoms are finitely supported, but also fsets of finitely supported elements)
Christian Urban <urbanc@in.tum.de>
parents:
1973
diff
changeset
|
78 |
apply (simp add: finite_supp) |
b96e8cf86891
generalised the fs-instance lemma (not just fsets of atoms are finitely supported, but also fsets of finitely supported elements)
Christian Urban <urbanc@in.tum.de>
parents:
1973
diff
changeset
|
79 |
done |
b96e8cf86891
generalised the fs-instance lemma (not just fsets of atoms are finitely supported, but also fsets of finitely supported elements)
Christian Urban <urbanc@in.tum.de>
parents:
1973
diff
changeset
|
80 |
|
1534
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
81 |
lemma atom_fmap_cong: |
2004
b96e8cf86891
generalised the fs-instance lemma (not just fsets of atoms are finitely supported, but also fsets of finitely supported elements)
Christian Urban <urbanc@in.tum.de>
parents:
1973
diff
changeset
|
82 |
shows "fmap atom x = fmap atom y \<longleftrightarrow> x = y" |
1534
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
83 |
apply(rule inj_fmap_eq_iff) |
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
84 |
apply(simp add: inj_on_def) |
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
85 |
done |
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
86 |
|
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
87 |
lemma supp_fmap_atom: |
2004
b96e8cf86891
generalised the fs-instance lemma (not just fsets of atoms are finitely supported, but also fsets of finitely supported elements)
Christian Urban <urbanc@in.tum.de>
parents:
1973
diff
changeset
|
88 |
shows "supp (fmap atom S) = supp S" |
1818
37480540c1af
made everything to compile
Christian Urban <urbanc@in.tum.de>
parents:
1815
diff
changeset
|
89 |
unfolding supp_def |
2004
b96e8cf86891
generalised the fs-instance lemma (not just fsets of atoms are finitely supported, but also fsets of finitely supported elements)
Christian Urban <urbanc@in.tum.de>
parents:
1973
diff
changeset
|
90 |
apply(perm_simp) |
b96e8cf86891
generalised the fs-instance lemma (not just fsets of atoms are finitely supported, but also fsets of finitely supported elements)
Christian Urban <urbanc@in.tum.de>
parents:
1973
diff
changeset
|
91 |
apply(simp add: atom_fmap_cong) |
1568
2311a9fc4624
Strong induction for Type Schemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1542
diff
changeset
|
92 |
done |
2311a9fc4624
Strong induction for Type Schemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1542
diff
changeset
|
93 |
|
2311a9fc4624
Strong induction for Type Schemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1542
diff
changeset
|
94 |
lemma supp_at_fset: |
1973
fc5ce7f22b74
use the more general type-class at_base
Christian Urban <urbanc@in.tum.de>
parents:
1933
diff
changeset
|
95 |
fixes S::"('a::at_base) fset" |
fc5ce7f22b74
use the more general type-class at_base
Christian Urban <urbanc@in.tum.de>
parents:
1933
diff
changeset
|
96 |
shows "supp S = fset_to_set (fmap atom S)" |
fc5ce7f22b74
use the more general type-class at_base
Christian Urban <urbanc@in.tum.de>
parents:
1933
diff
changeset
|
97 |
apply (induct S) |
1568
2311a9fc4624
Strong induction for Type Schemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1542
diff
changeset
|
98 |
apply (simp add: supp_fempty) |
2004
b96e8cf86891
generalised the fs-instance lemma (not just fsets of atoms are finitely supported, but also fsets of finitely supported elements)
Christian Urban <urbanc@in.tum.de>
parents:
1973
diff
changeset
|
99 |
apply (simp add: supp_finsert) |
1542
63e327e95abd
Showed the instance: fset::(at) fs
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1534
diff
changeset
|
100 |
apply (simp add: supp_at_base) |
63e327e95abd
Showed the instance: fset::(at) fs
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1534
diff
changeset
|
101 |
done |
1534
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
102 |
|
2178
e559513143e9
reversing the direction of fresh_star
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2004
diff
changeset
|
103 |
lemma fresh_star_atom: |
2447 | 104 |
fixes a::"'a::at_base" |
105 |
shows "fset_to_set S \<sharp>* a \<Longrightarrow> atom a \<sharp> fset_to_set S" |
|
106 |
apply (induct S) |
|
2178
e559513143e9
reversing the direction of fresh_star
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2004
diff
changeset
|
107 |
apply (simp add: fresh_set_empty) |
e559513143e9
reversing the direction of fresh_star
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2004
diff
changeset
|
108 |
apply simp |
e559513143e9
reversing the direction of fresh_star
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2004
diff
changeset
|
109 |
apply (unfold fresh_def) |
2466
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2447
diff
changeset
|
110 |
apply (simp add: supp_of_fin_insert) |
2178
e559513143e9
reversing the direction of fresh_star
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2004
diff
changeset
|
111 |
apply (rule conjI) |
e559513143e9
reversing the direction of fresh_star
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2004
diff
changeset
|
112 |
apply (unfold fresh_star_def) |
e559513143e9
reversing the direction of fresh_star
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2004
diff
changeset
|
113 |
apply simp |
e559513143e9
reversing the direction of fresh_star
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2004
diff
changeset
|
114 |
apply (unfold fresh_def) |
e559513143e9
reversing the direction of fresh_star
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2004
diff
changeset
|
115 |
apply (simp add: supp_at_base supp_atom) |
e559513143e9
reversing the direction of fresh_star
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2004
diff
changeset
|
116 |
apply clarify |
e559513143e9
reversing the direction of fresh_star
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2004
diff
changeset
|
117 |
apply auto |
e559513143e9
reversing the direction of fresh_star
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2004
diff
changeset
|
118 |
done |
2004
b96e8cf86891
generalised the fs-instance lemma (not just fsets of atoms are finitely supported, but also fsets of finitely supported elements)
Christian Urban <urbanc@in.tum.de>
parents:
1973
diff
changeset
|
119 |
|
1534
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
120 |
end |