author | wenzelm |
Tue, 07 Nov 2006 11:46:50 +0100 | |
changeset 21208 | 62ccdaf9369a |
parent 16417 | 9bc16273c2d4 |
child 24893 | b8ef7afe3a6b |
permissions | -rw-r--r-- |
1478 | 1 |
(* Title: ZF/Coind/Map.thy |
915 | 2 |
ID: $Id$ |
1478 | 3 |
Author: Jacob Frost, Cambridge University Computer Laboratory |
915 | 4 |
Copyright 1995 University of Cambridge |
12595 | 5 |
|
6 |
||
7 |
Some sample proofs of inclusions for the final coalgebra "U" (by lcp) |
|
8 |
||
915 | 9 |
*) |
10 |
||
16417 | 11 |
theory Map imports Main begin |
915 | 12 |
|
11318 | 13 |
constdefs |
12595 | 14 |
TMap :: "[i,i] => i" |
15 |
"TMap(A,B) == {m \<in> Pow(A*Union(B)).\<forall>a \<in> A. m``{a} \<in> B}" |
|
11318 | 16 |
|
12595 | 17 |
PMap :: "[i,i] => i" |
11318 | 18 |
"PMap(A,B) == TMap(A,cons(0,B))" |
915 | 19 |
|
12595 | 20 |
(* Note: 0 \<in> B ==> TMap(A,B) = PMap(A,B) *) |
915 | 21 |
|
1401 | 22 |
map_emp :: i |
11318 | 23 |
"map_emp == 0" |
24 |
||
12595 | 25 |
map_owr :: "[i,i,i]=>i" |
14171
0cab06e3bbd0
Extended the notion of letter and digit, such that now one may use greek,
skalberg
parents:
13339
diff
changeset
|
26 |
"map_owr(m,a,b) == \<Sigma> x \<in> {a} Un domain(m). if x=a then b else m``{x}" |
12595 | 27 |
|
28 |
map_app :: "[i,i]=>i" |
|
11318 | 29 |
"map_app(m,a) == m``{a}" |
915 | 30 |
|
12595 | 31 |
lemma "{0,1} \<subseteq> {1} Un TMap(I, {0,1})" |
32 |
by (unfold TMap_def, blast) |
|
33 |
||
34 |
lemma "{0} Un TMap(I,1) \<subseteq> {1} Un TMap(I, {0} Un TMap(I,1))" |
|
35 |
by (unfold TMap_def, blast) |
|
36 |
||
37 |
lemma "{0,1} Un TMap(I,2) \<subseteq> {1} Un TMap(I, {0,1} Un TMap(I,2))" |
|
38 |
by (unfold TMap_def, blast) |
|
39 |
||
40 |
(*A bit too slow. |
|
41 |
lemma "{0,1} Un TMap(I,TMap(I,2)) Un TMap(I,2) \<subseteq> |
|
42 |
{1} Un TMap(I, {0,1} Un TMap(I,TMap(I,2)) Un TMap(I,2))" |
|
43 |
by (unfold TMap_def, blast) |
|
44 |
*) |
|
45 |
||
46 |
(* ############################################################ *) |
|
47 |
(* Lemmas *) |
|
48 |
(* ############################################################ *) |
|
49 |
||
50 |
lemma qbeta_if: "Sigma(A,B)``{a} = (if a \<in> A then B(a) else 0)" |
|
51 |
by auto |
|
52 |
||
53 |
lemma qbeta: "a \<in> A ==> Sigma(A,B)``{a} = B(a)" |
|
54 |
by fast |
|
55 |
||
56 |
lemma qbeta_emp: "a\<notin>A ==> Sigma(A,B)``{a} = 0" |
|
57 |
by fast |
|
58 |
||
59 |
lemma image_Sigma1: "a \<notin> A ==> Sigma(A,B)``{a}=0" |
|
60 |
by fast |
|
61 |
||
62 |
||
63 |
(* ############################################################ *) |
|
64 |
(* Inclusion in Quine Universes *) |
|
65 |
(* ############################################################ *) |
|
66 |
||
67 |
(* Lemmas *) |
|
68 |
||
69 |
lemma MapQU_lemma: |
|
70 |
"A \<subseteq> univ(X) ==> Pow(A * Union(quniv(X))) \<subseteq> quniv(X)" |
|
71 |
apply (unfold quniv_def) |
|
72 |
apply (rule Pow_mono) |
|
73 |
apply (rule subset_trans [OF Sigma_mono product_univ]) |
|
74 |
apply (erule subset_trans) |
|
75 |
apply (rule arg_subset_eclose [THEN univ_mono]) |
|
76 |
apply (simp add: Union_Pow_eq) |
|
77 |
done |
|
78 |
||
79 |
(* Theorems *) |
|
80 |
||
81 |
lemma mapQU: |
|
82 |
"[| m \<in> PMap(A,quniv(B)); !!x. x \<in> A ==> x \<in> univ(B) |] ==> m \<in> quniv(B)" |
|
83 |
apply (unfold PMap_def TMap_def) |
|
84 |
apply (blast intro!: MapQU_lemma [THEN subsetD]) |
|
85 |
done |
|
86 |
||
87 |
(* ############################################################ *) |
|
88 |
(* Monotonicity *) |
|
89 |
(* ############################################################ *) |
|
90 |
||
91 |
lemma PMap_mono: "B \<subseteq> C ==> PMap(A,B)<=PMap(A,C)" |
|
92 |
by (unfold PMap_def TMap_def, blast) |
|
93 |
||
94 |
||
95 |
(* ############################################################ *) |
|
96 |
(* Introduction Rules *) |
|
97 |
(* ############################################################ *) |
|
98 |
||
99 |
(** map_emp **) |
|
100 |
||
101 |
lemma pmap_empI: "map_emp \<in> PMap(A,B)" |
|
102 |
by (unfold map_emp_def PMap_def TMap_def, auto) |
|
103 |
||
104 |
(** map_owr **) |
|
105 |
||
106 |
lemma pmap_owrI: |
|
107 |
"[| m \<in> PMap(A,B); a \<in> A; b \<in> B |] ==> map_owr(m,a,b):PMap(A,B)" |
|
13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
12595
diff
changeset
|
108 |
apply (unfold map_owr_def PMap_def TMap_def, safe) |
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
12595
diff
changeset
|
109 |
apply (simp_all add: if_iff, auto) |
12595 | 110 |
(*Remaining subgoal*) |
111 |
apply (rule excluded_middle [THEN disjE]) |
|
112 |
apply (erule image_Sigma1) |
|
113 |
apply (drule_tac psi = "?uu \<notin> B" in asm_rl) |
|
114 |
apply (auto simp add: qbeta) |
|
115 |
done |
|
116 |
||
117 |
(** map_app **) |
|
118 |
||
119 |
lemma tmap_app_notempty: |
|
120 |
"[| m \<in> TMap(A,B); a \<in> domain(m) |] ==> map_app(m,a) \<noteq>0" |
|
121 |
by (unfold TMap_def map_app_def, blast) |
|
122 |
||
123 |
lemma tmap_appI: |
|
124 |
"[| m \<in> TMap(A,B); a \<in> domain(m) |] ==> map_app(m,a):B" |
|
125 |
by (unfold TMap_def map_app_def domain_def, blast) |
|
126 |
||
127 |
lemma pmap_appI: |
|
128 |
"[| m \<in> PMap(A,B); a \<in> domain(m) |] ==> map_app(m,a):B" |
|
129 |
apply (unfold PMap_def) |
|
130 |
apply (frule tmap_app_notempty, assumption) |
|
13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
12595
diff
changeset
|
131 |
apply (drule tmap_appI, auto) |
12595 | 132 |
done |
133 |
||
134 |
(** domain **) |
|
135 |
||
136 |
lemma tmap_domainD: |
|
137 |
"[| m \<in> TMap(A,B); a \<in> domain(m) |] ==> a \<in> A" |
|
138 |
by (unfold TMap_def, blast) |
|
139 |
||
140 |
lemma pmap_domainD: |
|
141 |
"[| m \<in> PMap(A,B); a \<in> domain(m) |] ==> a \<in> A" |
|
142 |
by (unfold PMap_def TMap_def, blast) |
|
143 |
||
144 |
||
145 |
(* ############################################################ *) |
|
146 |
(* Equalities *) |
|
147 |
(* ############################################################ *) |
|
148 |
||
149 |
(** Domain **) |
|
150 |
||
151 |
(* Lemmas *) |
|
152 |
||
153 |
lemma domain_UN: "domain(\<Union>x \<in> A. B(x)) = (\<Union>x \<in> A. domain(B(x)))" |
|
154 |
by fast |
|
155 |
||
156 |
||
157 |
lemma domain_Sigma: "domain(Sigma(A,B)) = {x \<in> A. \<exists>y. y \<in> B(x)}" |
|
158 |
by blast |
|
159 |
||
160 |
(* Theorems *) |
|
161 |
||
162 |
lemma map_domain_emp: "domain(map_emp) = 0" |
|
163 |
by (unfold map_emp_def, blast) |
|
164 |
||
165 |
lemma map_domain_owr: |
|
166 |
"b \<noteq> 0 ==> domain(map_owr(f,a,b)) = {a} Un domain(f)" |
|
167 |
apply (unfold map_owr_def) |
|
168 |
apply (auto simp add: domain_Sigma) |
|
169 |
done |
|
170 |
||
171 |
(** Application **) |
|
172 |
||
173 |
lemma map_app_owr: |
|
174 |
"map_app(map_owr(f,a,b),c) = (if c=a then b else map_app(f,c))" |
|
175 |
by (simp add: qbeta_if map_app_def map_owr_def, blast) |
|
176 |
||
177 |
lemma map_app_owr1: "map_app(map_owr(f,a,b),a) = b" |
|
178 |
by (simp add: map_app_owr) |
|
179 |
||
180 |
lemma map_app_owr2: "c \<noteq> a ==> map_app(map_owr(f,a,b),c)= map_app(f,c)" |
|
181 |
by (simp add: map_app_owr) |
|
182 |
||
915 | 183 |
end |