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
|
1806
|
2 |
imports "../Nominal-General/Nominal2_Supp"
|
2302
|
3 |
"../Nominal-General/Nominal2_Atoms"
|
|
4 |
"../Nominal-General/Nominal2_Eqvt"
|
1806
|
5 |
FSet
|
1534
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
6 |
begin
|
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
7 |
|
2302
|
8 |
lemma "p \<bullet> {} = {}"
|
|
9 |
apply(perm_simp)
|
|
10 |
by simp
|
|
11 |
|
1534
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
12 |
lemma permute_rsp_fset[quot_respect]:
|
1682
|
13 |
"(op = ===> list_eq ===> list_eq) permute permute"
|
1534
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
14 |
apply (simp add: eqvts[symmetric])
|
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
15 |
apply clarify
|
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
16 |
apply (subst permute_minus_cancel(1)[symmetric, of "xb"])
|
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
17 |
apply (subst mem_eqvt[symmetric])
|
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
18 |
apply (subst (2) permute_minus_cancel(1)[symmetric, of "xb"])
|
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
19 |
apply (subst mem_eqvt[symmetric])
|
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
20 |
apply (erule_tac x="- x \<bullet> xb" in allE)
|
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
21 |
apply simp
|
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
22 |
done
|
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
23 |
|
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>
diff
changeset
|
24 |
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
|
25 |
begin
|
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
26 |
|
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
27 |
quotient_definition
|
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
28 |
"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
|
29 |
is
|
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
30 |
"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
|
31 |
|
1815
|
32 |
instance
|
|
33 |
proof
|
1782
|
34 |
fix x :: "'a fset" and p q :: "perm"
|
|
35 |
show "0 \<bullet> x = x"
|
|
36 |
by (lifting permute_zero [where 'a="'a list"])
|
|
37 |
show "(p + q) \<bullet> x = p \<bullet> q \<bullet> x"
|
|
38 |
by (lifting permute_plus [where 'a="'a list"])
|
|
39 |
qed
|
1534
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
40 |
|
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
41 |
end
|
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
42 |
|
2302
|
43 |
lemma "p \<bullet> {} = {}"
|
|
44 |
apply(perm_simp)
|
|
45 |
by simp
|
|
46 |
|
|
47 |
lemma permute_fset[simp]:
|
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>
diff
changeset
|
48 |
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>
diff
changeset
|
49 |
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>
diff
changeset
|
50 |
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
|
51 |
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
|
52 |
|
2302
|
53 |
lemma "p \<bullet> {} = {}"
|
|
54 |
apply(perm_simp)
|
|
55 |
by simp
|
|
56 |
|
|
57 |
ML {* @{term "{}"} ; @{term "{||}"} *}
|
|
58 |
|
|
59 |
declare permute_fset[eqvt]
|
|
60 |
|
|
61 |
lemma "p \<bullet> {} = {}"
|
|
62 |
apply(perm_simp)
|
|
63 |
by simp
|
|
64 |
|
|
65 |
|
1815
|
66 |
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>
diff
changeset
|
67 |
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
|
68 |
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
|
69 |
|
2340
|
70 |
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>
diff
changeset
|
71 |
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
|
72 |
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
|
73 |
|
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>
diff
changeset
|
74 |
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>
diff
changeset
|
75 |
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>
diff
changeset
|
76 |
by (induct S) (simp_all)
|
1542
|
77 |
|
1534
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
78 |
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>
diff
changeset
|
79 |
shows "supp (fset_to_set S) = supp S"
|
2340
|
80 |
unfolding supp_def
|
|
81 |
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
|
82 |
|
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>
diff
changeset
|
83 |
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>
diff
changeset
|
84 |
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>
diff
changeset
|
85 |
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>
diff
changeset
|
86 |
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>
diff
changeset
|
87 |
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>
diff
changeset
|
88 |
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>
diff
changeset
|
89 |
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>
diff
changeset
|
90 |
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>
diff
changeset
|
91 |
|
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>
diff
changeset
|
92 |
lemma 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>
diff
changeset
|
93 |
shows "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>
diff
changeset
|
94 |
unfolding supp_def
|
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>
diff
changeset
|
95 |
by 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>
diff
changeset
|
96 |
|
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>
diff
changeset
|
97 |
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>
diff
changeset
|
98 |
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>
diff
changeset
|
99 |
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>
diff
changeset
|
100 |
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>
diff
changeset
|
101 |
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>
diff
changeset
|
102 |
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>
diff
changeset
|
103 |
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>
diff
changeset
|
104 |
|
1534
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
105 |
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>
diff
changeset
|
106 |
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
|
107 |
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
|
108 |
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
|
109 |
done
|
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
110 |
|
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
111 |
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>
diff
changeset
|
112 |
shows "supp (fmap atom S) = supp S"
|
1818
|
113 |
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>
diff
changeset
|
114 |
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>
diff
changeset
|
115 |
apply(simp add: atom_fmap_cong)
|
1568
|
116 |
done
|
|
117 |
|
|
118 |
lemma supp_at_fset:
|
1973
|
119 |
fixes S::"('a::at_base) fset"
|
|
120 |
shows "supp S = fset_to_set (fmap atom S)"
|
|
121 |
apply (induct S)
|
1568
|
122 |
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>
diff
changeset
|
123 |
apply (simp add: supp_finsert)
|
1542
|
124 |
apply (simp add: supp_at_base)
|
|
125 |
done
|
1534
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
126 |
|
2178
|
127 |
lemma fresh_star_atom:
|
|
128 |
"fset_to_set s \<sharp>* (a :: _ :: at_base) \<Longrightarrow> atom a \<sharp> fset_to_set s"
|
|
129 |
apply (induct s)
|
|
130 |
apply (simp add: fresh_set_empty)
|
|
131 |
apply simp
|
|
132 |
apply (unfold fresh_def)
|
|
133 |
apply (simp add: supp_atom_insert)
|
|
134 |
apply (rule conjI)
|
|
135 |
apply (unfold fresh_star_def)
|
|
136 |
apply simp
|
|
137 |
apply (unfold fresh_def)
|
|
138 |
apply (simp add: supp_at_base supp_atom)
|
|
139 |
apply clarify
|
|
140 |
apply auto
|
|
141 |
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>
diff
changeset
|
142 |
|
2302
|
143 |
lemma "p \<bullet> {} = {}"
|
|
144 |
apply(perm_simp)
|
|
145 |
by simp
|
|
146 |
|
1534
984ea1299cd7
The nominal infrastructure for fset. 'fs' missing, but not needed so far.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
147 |
end
|