author | oheimb |
Wed, 12 Aug 1998 17:40:18 +0200 | |
changeset 5307 | 6a699d5cdef4 |
parent 5231 | 2a454140ae24 |
child 5316 | 7a8975451a89 |
permissions | -rw-r--r-- |
1465 | 1 |
(* Title: Relation.ML |
1128
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
2 |
ID: $Id$ |
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
1842
diff
changeset
|
3 |
Authors: Lawrence C Paulson, Cambridge University Computer Laboratory |
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
1842
diff
changeset
|
4 |
Copyright 1996 University of Cambridge |
1128
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
5 |
*) |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
6 |
|
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
7 |
open Relation; |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
8 |
|
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
9 |
(** Identity relation **) |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
10 |
|
5069 | 11 |
Goalw [id_def] "(a,a) : id"; |
2891 | 12 |
by (Blast_tac 1); |
1128
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
13 |
qed "idI"; |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
14 |
|
4673 | 15 |
val major::prems = goalw thy [id_def] |
1128
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
16 |
"[| p: id; !!x.[| p = (x,x) |] ==> P \ |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
17 |
\ |] ==> P"; |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
18 |
by (rtac (major RS CollectE) 1); |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
19 |
by (etac exE 1); |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
20 |
by (eresolve_tac prems 1); |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
21 |
qed "idE"; |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
22 |
|
5069 | 23 |
Goalw [id_def] "(a,b):id = (a=b)"; |
2891 | 24 |
by (Blast_tac 1); |
1128
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
25 |
qed "pair_in_id_conv"; |
1694 | 26 |
Addsimps [pair_in_id_conv]; |
1128
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
27 |
|
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
28 |
|
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
29 |
(** Composition of two relations **) |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
30 |
|
5069 | 31 |
Goalw [comp_def] |
5148
74919e8f221c
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5143
diff
changeset
|
32 |
"[| (a,b):s; (b,c):r |] ==> (a,c) : r O s"; |
2891 | 33 |
by (Blast_tac 1); |
1128
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
34 |
qed "compI"; |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
35 |
|
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
36 |
(*proof requires higher-level assumptions or a delaying of hyp_subst_tac*) |
4673 | 37 |
val prems = goalw thy [comp_def] |
1128
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
38 |
"[| xz : r O s; \ |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
39 |
\ !!x y z. [| xz = (x,z); (x,y):s; (y,z):r |] ==> P \ |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
40 |
\ |] ==> P"; |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
41 |
by (cut_facts_tac prems 1); |
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
1842
diff
changeset
|
42 |
by (REPEAT (eresolve_tac [CollectE, splitE, exE, conjE] 1 |
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
1842
diff
changeset
|
43 |
ORELSE ares_tac prems 1)); |
1128
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
44 |
qed "compE"; |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
45 |
|
4673 | 46 |
val prems = goal thy |
1128
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
47 |
"[| (a,c) : r O s; \ |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
48 |
\ !!y. [| (a,y):s; (y,c):r |] ==> P \ |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
49 |
\ |] ==> P"; |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
50 |
by (rtac compE 1); |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
51 |
by (REPEAT (ares_tac prems 1 ORELSE eresolve_tac [Pair_inject,ssubst] 1)); |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
52 |
qed "compEpair"; |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
53 |
|
1754
852093aeb0ab
Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents:
1694
diff
changeset
|
54 |
AddIs [compI, idI]; |
852093aeb0ab
Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents:
1694
diff
changeset
|
55 |
AddSEs [compE, idE]; |
852093aeb0ab
Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents:
1694
diff
changeset
|
56 |
|
5069 | 57 |
Goal "R O id = R"; |
4673 | 58 |
by (Fast_tac 1); |
59 |
qed "R_O_id"; |
|
60 |
||
5069 | 61 |
Goal "id O R = R"; |
4673 | 62 |
by (Fast_tac 1); |
63 |
qed "id_O_R"; |
|
64 |
||
65 |
Addsimps [R_O_id,id_O_R]; |
|
66 |
||
5069 | 67 |
Goal "(R O S) O T = R O (S O T)"; |
4830 | 68 |
by (Blast_tac 1); |
69 |
qed "O_assoc"; |
|
70 |
||
5143
b94cd208f073
Removal of leading "\!\!..." from most Goal commands
paulson
parents:
5069
diff
changeset
|
71 |
Goal "[| r'<=r; s'<=s |] ==> (r' O s') <= (r O s)"; |
2891 | 72 |
by (Blast_tac 1); |
1128
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
73 |
qed "comp_mono"; |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
74 |
|
5148
74919e8f221c
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5143
diff
changeset
|
75 |
Goal "[| s <= A Times B; r <= B Times C |] ==> (r O s) <= A Times C"; |
2891 | 76 |
by (Blast_tac 1); |
1128
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
77 |
qed "comp_subset_Sigma"; |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
78 |
|
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
79 |
(** Natural deduction for trans(r) **) |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
80 |
|
4673 | 81 |
val prems = goalw thy [trans_def] |
1128
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
82 |
"(!! x y z. [| (x,y):r; (y,z):r |] ==> (x,z):r) ==> trans(r)"; |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
83 |
by (REPEAT (ares_tac (prems@[allI,impI]) 1)); |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
84 |
qed "transI"; |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
85 |
|
5148
74919e8f221c
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5143
diff
changeset
|
86 |
Goalw [trans_def] "[| trans(r); (a,b):r; (b,c):r |] ==> (a,c):r"; |
2891 | 87 |
by (Blast_tac 1); |
1128
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
88 |
qed "transD"; |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
89 |
|
3439 | 90 |
(** Natural deduction for r^-1 **) |
1128
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
91 |
|
5143
b94cd208f073
Removal of leading "\!\!..." from most Goal commands
paulson
parents:
5069
diff
changeset
|
92 |
Goalw [converse_def] "((a,b): r^-1) = ((b,a):r)"; |
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
1842
diff
changeset
|
93 |
by (Simp_tac 1); |
4746 | 94 |
qed "converse_iff"; |
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
1842
diff
changeset
|
95 |
|
4746 | 96 |
AddIffs [converse_iff]; |
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
1842
diff
changeset
|
97 |
|
5143
b94cd208f073
Removal of leading "\!\!..." from most Goal commands
paulson
parents:
5069
diff
changeset
|
98 |
Goalw [converse_def] "(a,b):r ==> (b,a): r^-1"; |
1264
3eb91524b938
added local simpsets; removed IOA from 'make test'
clasohm
parents:
1128
diff
changeset
|
99 |
by (Simp_tac 1); |
4746 | 100 |
qed "converseI"; |
1128
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
101 |
|
5143
b94cd208f073
Removal of leading "\!\!..." from most Goal commands
paulson
parents:
5069
diff
changeset
|
102 |
Goalw [converse_def] "(a,b) : r^-1 ==> (b,a) : r"; |
2891 | 103 |
by (Blast_tac 1); |
4746 | 104 |
qed "converseD"; |
1128
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
105 |
|
4746 | 106 |
(*More general than converseD, as it "splits" the member of the relation*) |
107 |
qed_goalw "converseE" thy [converse_def] |
|
3439 | 108 |
"[| yx : r^-1; \ |
1128
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
109 |
\ !!x y. [| yx=(y,x); (x,y):r |] ==> P \ |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
110 |
\ |] ==> P" |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
111 |
(fn [major,minor]=> |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
112 |
[ (rtac (major RS CollectE) 1), |
1454
d0266c81a85e
Streamlined defs in Relation and added new intro/elim rules to do with
nipkow
parents:
1264
diff
changeset
|
113 |
(REPEAT (eresolve_tac [splitE, bexE,exE, conjE, minor] 1)), |
1128
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
114 |
(assume_tac 1) ]); |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
115 |
|
4746 | 116 |
AddSEs [converseE]; |
1128
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
117 |
|
5069 | 118 |
Goalw [converse_def] "(r^-1)^-1 = r"; |
2891 | 119 |
by (Blast_tac 1); |
4746 | 120 |
qed "converse_converse"; |
121 |
Addsimps [converse_converse]; |
|
3413
c1f63cc3a768
Finite.ML Finite.thy: Replaced `finite subset of' by mere `finite'.
nipkow
parents:
2891
diff
changeset
|
122 |
|
5069 | 123 |
Goal "(r O s)^-1 = s^-1 O r^-1"; |
4423 | 124 |
by (Blast_tac 1); |
4746 | 125 |
qed "converse_comp"; |
1605 | 126 |
|
5069 | 127 |
Goal "id^-1 = id"; |
4644 | 128 |
by (Blast_tac 1); |
4746 | 129 |
qed "converse_id"; |
130 |
Addsimps [converse_id]; |
|
4644 | 131 |
|
1128
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
132 |
(** Domain **) |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
133 |
|
4673 | 134 |
qed_goalw "Domain_iff" thy [Domain_def] |
1128
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
135 |
"a: Domain(r) = (EX y. (a,y): r)" |
2891 | 136 |
(fn _=> [ (Blast_tac 1) ]); |
1128
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
137 |
|
4673 | 138 |
qed_goal "DomainI" thy "!!a b r. (a,b): r ==> a: Domain(r)" |
1128
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
139 |
(fn _ => [ (etac (exI RS (Domain_iff RS iffD2)) 1) ]); |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
140 |
|
4673 | 141 |
qed_goal "DomainE" thy |
1128
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
142 |
"[| a : Domain(r); !!y. (a,y): r ==> P |] ==> P" |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
143 |
(fn prems=> |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
144 |
[ (rtac (Domain_iff RS iffD1 RS exE) 1), |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
145 |
(REPEAT (ares_tac prems 1)) ]); |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
146 |
|
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
1842
diff
changeset
|
147 |
AddIs [DomainI]; |
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
1842
diff
changeset
|
148 |
AddSEs [DomainE]; |
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
1842
diff
changeset
|
149 |
|
5069 | 150 |
Goal "Domain id = UNIV"; |
4644 | 151 |
by (Blast_tac 1); |
152 |
qed "Domain_id"; |
|
153 |
Addsimps [Domain_id]; |
|
154 |
||
1128
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
155 |
(** Range **) |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
156 |
|
4673 | 157 |
qed_goalw "RangeI" thy [Range_def] "!!a b r.(a,b): r ==> b : Range(r)" |
4746 | 158 |
(fn _ => [ (etac (converseI RS DomainI) 1) ]); |
1128
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
159 |
|
4673 | 160 |
qed_goalw "RangeE" thy [Range_def] |
1128
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
161 |
"[| b : Range(r); !!x. (x,b): r ==> P |] ==> P" |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
162 |
(fn major::prems=> |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
163 |
[ (rtac (major RS DomainE) 1), |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
164 |
(resolve_tac prems 1), |
4746 | 165 |
(etac converseD 1) ]); |
1128
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
166 |
|
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
1842
diff
changeset
|
167 |
AddIs [RangeI]; |
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
1842
diff
changeset
|
168 |
AddSEs [RangeE]; |
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
1842
diff
changeset
|
169 |
|
5069 | 170 |
Goal "Range id = UNIV"; |
4644 | 171 |
by (Blast_tac 1); |
172 |
qed "Range_id"; |
|
173 |
Addsimps [Range_id]; |
|
174 |
||
1128
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
175 |
(*** Image of a set under a relation ***) |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
176 |
|
4673 | 177 |
qed_goalw "Image_iff" thy [Image_def] |
1128
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
178 |
"b : r^^A = (? x:A. (x,b):r)" |
2891 | 179 |
(fn _ => [ Blast_tac 1 ]); |
1128
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
180 |
|
4673 | 181 |
qed_goalw "Image_singleton" thy [Image_def] |
182 |
"r^^{a} = {b. (a,b):r}" |
|
183 |
(fn _ => [ Blast_tac 1 ]); |
|
184 |
||
185 |
qed_goal "Image_singleton_iff" thy |
|
1128
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
186 |
"(b : r^^{a}) = ((a,b):r)" |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
187 |
(fn _ => [ rtac (Image_iff RS trans) 1, |
2891 | 188 |
Blast_tac 1 ]); |
1128
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
189 |
|
4673 | 190 |
AddIffs [Image_singleton_iff]; |
191 |
||
192 |
qed_goalw "ImageI" thy [Image_def] |
|
1128
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
193 |
"!!a b r. [| (a,b): r; a:A |] ==> b : r^^A" |
2891 | 194 |
(fn _ => [ (Blast_tac 1)]); |
1128
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
195 |
|
4673 | 196 |
qed_goalw "ImageE" thy [Image_def] |
1128
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
197 |
"[| b: r^^A; !!x.[| (x,b): r; x:A |] ==> P |] ==> P" |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
198 |
(fn major::prems=> |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
199 |
[ (rtac (major RS CollectE) 1), |
3718 | 200 |
(Clarify_tac 1), |
1128
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
201 |
(rtac (hd prems) 1), |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
202 |
(REPEAT (etac bexE 1 ORELSE ares_tac prems 1)) ]); |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
203 |
|
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
1842
diff
changeset
|
204 |
AddIs [ImageI]; |
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
1842
diff
changeset
|
205 |
AddSEs [ImageE]; |
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
1842
diff
changeset
|
206 |
|
4593 | 207 |
|
4673 | 208 |
qed_goal "Image_empty" thy |
4593 | 209 |
"R^^{} = {}" |
210 |
(fn _ => [ Blast_tac 1 ]); |
|
211 |
||
212 |
Addsimps [Image_empty]; |
|
213 |
||
5069 | 214 |
Goal "id ^^ A = A"; |
4601 | 215 |
by (Blast_tac 1); |
216 |
qed "Image_id"; |
|
217 |
||
218 |
Addsimps [Image_id]; |
|
219 |
||
4673 | 220 |
qed_goal "Image_Int_subset" thy |
4593 | 221 |
"R ^^ (A Int B) <= R ^^ A Int R ^^ B" |
222 |
(fn _ => [ Blast_tac 1 ]); |
|
223 |
||
4733
2c984ac036f5
New theorem Image_eq_UN; deleted the silly vimage_inverse_Image
paulson
parents:
4673
diff
changeset
|
224 |
qed_goal "Image_Un" thy "R ^^ (A Un B) = R ^^ A Un R ^^ B" |
4593 | 225 |
(fn _ => [ Blast_tac 1 ]); |
226 |
||
4733
2c984ac036f5
New theorem Image_eq_UN; deleted the silly vimage_inverse_Image
paulson
parents:
4673
diff
changeset
|
227 |
qed_goal "Image_subset" thy "!!A B r. r <= A Times B ==> r^^C <= B" |
1128
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
228 |
(fn _ => |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
229 |
[ (rtac subsetI 1), |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
230 |
(REPEAT (eresolve_tac [asm_rl, ImageE, subsetD RS SigmaD2] 1)) ]); |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
231 |
|
4733
2c984ac036f5
New theorem Image_eq_UN; deleted the silly vimage_inverse_Image
paulson
parents:
4673
diff
changeset
|
232 |
(*NOT suitable for rewriting*) |
5069 | 233 |
Goal "r^^B = (UN y: B. r^^{y})"; |
4673 | 234 |
by (Blast_tac 1); |
4733
2c984ac036f5
New theorem Image_eq_UN; deleted the silly vimage_inverse_Image
paulson
parents:
4673
diff
changeset
|
235 |
qed "Image_eq_UN"; |
4760
9cdbd5a1d25a
added introduction and elimination rules for Univalent
oheimb
parents:
4746
diff
changeset
|
236 |
|
9cdbd5a1d25a
added introduction and elimination rules for Univalent
oheimb
parents:
4746
diff
changeset
|
237 |
|
9cdbd5a1d25a
added introduction and elimination rules for Univalent
oheimb
parents:
4746
diff
changeset
|
238 |
section "Univalent"; |
9cdbd5a1d25a
added introduction and elimination rules for Univalent
oheimb
parents:
4746
diff
changeset
|
239 |
|
9cdbd5a1d25a
added introduction and elimination rules for Univalent
oheimb
parents:
4746
diff
changeset
|
240 |
qed_goalw "UnivalentI" Relation.thy [Univalent_def] |
9cdbd5a1d25a
added introduction and elimination rules for Univalent
oheimb
parents:
4746
diff
changeset
|
241 |
"!!r. !x y. (x,y):r --> (!z. (x,z):r --> y=z) ==> Univalent r" (K [atac 1]); |
9cdbd5a1d25a
added introduction and elimination rules for Univalent
oheimb
parents:
4746
diff
changeset
|
242 |
|
9cdbd5a1d25a
added introduction and elimination rules for Univalent
oheimb
parents:
4746
diff
changeset
|
243 |
qed_goalw "UnivalentD" Relation.thy [Univalent_def] |
9cdbd5a1d25a
added introduction and elimination rules for Univalent
oheimb
parents:
4746
diff
changeset
|
244 |
"!!r. [| Univalent r; (x,y):r; (x,z):r|] ==> y=z" (K [Auto_tac]); |
5231 | 245 |
|
246 |
||
247 |
(** Graphs of partial functions **) |
|
248 |
||
249 |
Goal "Domain{(x,y). y = f x & P x} = {x. P x}"; |
|
250 |
by (Blast_tac 1); |
|
251 |
qed "Domain_partial_func"; |
|
252 |
||
253 |
Goal "Range{(x,y). y = f x & P x} = f``{x. P x}"; |
|
254 |
by (Blast_tac 1); |
|
255 |
qed "Range_partial_func"; |
|
256 |