src/ZF/domrange.ML
author wenzelm
Thu, 15 Nov 2001 18:20:13 +0100
changeset 12207 4dff931b852f
parent 9211 6236c5285bd8
permissions -rw-r--r--
added Induct/Binary_Trees.thy, Induct/Tree_Forest (converted from former ex/TF.ML ex/TF.thy ex/Term.ML ex/Term.thy);
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 795
diff changeset
     1
(*  Title:      ZF/domrange
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     2
    ID:         $Id$
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 795
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     4
    Copyright   1991  University of Cambridge
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     5
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     6
Converse, domain, range of a relation or function
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     7
*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     8
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     9
(*** converse ***)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    10
9211
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
    11
Goalw [converse_def] "<a,b>: converse(r) <-> <b,a>:r";
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
    12
by (Blast_tac 1) ;
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
    13
qed "converse_iff";
687
91bc4b9eee1d ZF/domrange/converse_iff: new
lcp
parents: 674
diff changeset
    14
9211
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
    15
Goalw [converse_def] "<a,b>:r ==> <b,a>:converse(r)";
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
    16
by (Blast_tac 1) ;
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
    17
qed "converseI";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    18
9211
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
    19
Goalw [converse_def] "<a,b> : converse(r) ==> <b,a> : r";
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
    20
by (Blast_tac 1) ;
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
    21
qed "converseD";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    22
9211
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
    23
val [major,minor]= Goalw [converse_def] 
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    24
    "[| yx : converse(r);  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    25
\       !!x y. [| yx=<y,x>;  <x,y>:r |] ==> P \
9211
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
    26
\    |] ==> P";
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
    27
by (rtac (major RS ReplaceE) 1);
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
    28
by (REPEAT (eresolve_tac [exE, conjE, minor] 1));
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
    29
by (hyp_subst_tac 1);
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
    30
by (assume_tac 1) ;
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
    31
qed "converseE";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    32
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2033
diff changeset
    33
Addsimps [converse_iff];
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2033
diff changeset
    34
AddSIs [converseI];
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2033
diff changeset
    35
AddSEs [converseD,converseE];
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    36
9180
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
    37
Goal "r<=Sigma(A,B) ==> converse(converse(r)) = r";
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
    38
by (Blast_tac 1) ;
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
    39
qed "converse_converse";
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
    40
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
    41
Goal "r<=A*B ==> converse(r)<=B*A";
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
    42
by (Blast_tac 1) ;
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
    43
qed "converse_type";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    44
9180
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
    45
Goal "converse(A*B) = B*A";
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
    46
by (Blast_tac 1) ;
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
    47
qed "converse_prod";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    48
9180
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
    49
Goal "converse(0) = 0";
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
    50
by (Blast_tac 1) ;
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
    51
qed "converse_empty";
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2033
diff changeset
    52
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2033
diff changeset
    53
Addsimps [converse_prod, converse_empty];
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    54
9211
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
    55
Goal "A <= Sigma(X,Y) ==> converse(A) <= converse(B) <-> A <= B";
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
    56
by (Blast_tac 1) ;
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
    57
qed "converse_subset_iff";
5202
084ceb3844f5 A few new lemmas by Mark Staples
paulson
parents: 4091
diff changeset
    58
084ceb3844f5 A few new lemmas by Mark Staples
paulson
parents: 4091
diff changeset
    59
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    60
(*** domain ***)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    61
9211
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
    62
Goalw [domain_def] "a: domain(r) <-> (EX y. <a,y>: r)";
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
    63
by (Blast_tac 1) ;
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
    64
qed "domain_iff";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    65
9180
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
    66
Goal "<a,b>: r ==> a: domain(r)";
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
    67
by (etac (exI RS (domain_iff RS iffD2)) 1) ;
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
    68
qed "domainI";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    69
9180
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
    70
val prems= Goal
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
    71
    "[| a : domain(r);  !!y. <a,y>: r ==> P |] ==> P";
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
    72
by (rtac (domain_iff RS iffD1 RS exE) 1);
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
    73
by (REPEAT (ares_tac prems 1)) ;
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
    74
qed "domainE";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    75
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2033
diff changeset
    76
AddIs  [domainI];
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2033
diff changeset
    77
AddSEs [domainE];
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    78
9180
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
    79
Goal "domain(Sigma(A,B)) <= A";
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
    80
by (Blast_tac 1) ;
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
    81
qed "domain_subset";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    82
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    83
(*** range ***)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    84
9211
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
    85
Goalw [range_def]  "<a,b>: r ==> b : range(r)";
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
    86
by (etac (converseI RS domainI) 1) ;
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
    87
qed "rangeI";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    88
9211
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
    89
val major::prems= Goalw [range_def] 
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
    90
    "[| b : range(r);  !!x. <x,b>: r ==> P |] ==> P";
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
    91
by (rtac (major RS domainE) 1);
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
    92
by (resolve_tac prems 1);
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
    93
by (etac converseD 1) ;
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
    94
qed "rangeE";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    95
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2033
diff changeset
    96
AddIs  [rangeI];
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2033
diff changeset
    97
AddSEs [rangeE];
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2033
diff changeset
    98
9211
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
    99
Goalw [range_def]  "range(A*B) <= B";
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
   100
by (stac converse_prod 1);
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
   101
by (rtac domain_subset 1) ;
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
   102
qed "range_subset";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   103
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   104
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   105
(*** field ***)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   106
9211
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
   107
Goalw [field_def]  "<a,b>: r ==> a : field(r)";
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
   108
by (Blast_tac 1) ;
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
   109
qed "fieldI1";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   110
9211
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
   111
Goalw [field_def]  "<a,b>: r ==> b : field(r)";
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
   112
by (Blast_tac 1) ;
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
   113
qed "fieldI2";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   114
9211
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
   115
val [prem]= Goalw [field_def] 
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
   116
    "(~ <c,a>:r ==> <a,b>: r) ==> a : field(r)";
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
   117
by (blast_tac (claset() addIs [prem]) 1) ;
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
   118
qed "fieldCI";
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
   119
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
   120
val major::prems= Goalw [field_def] 
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   121
     "[| a : field(r);  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   122
\        !!x. <a,x>: r ==> P;  \
9211
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
   123
\        !!x. <x,a>: r ==> P        |] ==> P";
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
   124
by (rtac (major RS UnE) 1);
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
   125
by (REPEAT (eresolve_tac (prems@[domainE,rangeE]) 1)) ;
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
   126
qed "fieldE";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   127
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2033
diff changeset
   128
AddIs  [fieldCI];
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2033
diff changeset
   129
AddSEs [fieldE];
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   130
9180
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
   131
Goal "field(A*B) <= A Un B";
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
   132
by (Blast_tac 1) ;
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
   133
qed "field_subset";
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2033
diff changeset
   134
9211
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
   135
Goalw [field_def] "domain(r) <= field(r)";
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
   136
by (rtac Un_upper1 1) ;
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
   137
qed "domain_subset_field";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   138
9211
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
   139
Goalw [field_def] "range(r) <= field(r)";
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
   140
by (rtac Un_upper2 1) ;
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
   141
qed "range_subset_field";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   142
9180
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
   143
Goal "r <= Sigma(A,B) ==> r <= domain(r)*range(r)";
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
   144
by (Blast_tac 1) ;
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
   145
qed "domain_times_range";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   146
9180
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
   147
Goal "r <= Sigma(A,B) ==> r <= field(r)*field(r)";
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
   148
by (Blast_tac 1) ;
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
   149
qed "field_times_field";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   150
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   151
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   152
(*** Image of a set under a function/relation ***)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   153
9180
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
   154
Goalw [image_def] "b : r``A <-> (EX x:A. <x,b>:r)";
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
   155
by (Blast_tac 1);
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
   156
qed "image_iff";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   157
9180
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
   158
Goal "b : r``{a} <-> <a,b>:r";
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
   159
by (rtac (image_iff RS iff_trans) 1);
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
   160
by (Blast_tac 1) ;
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
   161
qed "image_singleton_iff";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   162
9211
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
   163
Goalw [image_def] "[| <a,b>: r;  a:A |] ==> b : r``A";
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
   164
by (Blast_tac 1) ;
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
   165
qed "imageI";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   166
9211
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
   167
val major::prems= Goalw [image_def] 
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
   168
    "[| b: r``A;  !!x.[| <x,b>: r;  x:A |] ==> P |] ==> P";
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
   169
by (rtac (major RS CollectE) 1);
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
   170
by (REPEAT (etac bexE 1 ORELSE ares_tac prems 1)) ;
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
   171
qed "imageE";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   172
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2033
diff changeset
   173
AddIs  [imageI];
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2033
diff changeset
   174
AddSEs [imageE];
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2033
diff changeset
   175
9180
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
   176
Goal "r <= A*B ==> r``C <= B";
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
   177
by (Blast_tac 1) ;
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
   178
qed "image_subset";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   179
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   180
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   181
(*** Inverse image of a set under a function/relation ***)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   182
9211
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
   183
Goalw [vimage_def,image_def,converse_def] 
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
   184
    "a : r-``B <-> (EX y:B. <a,y>:r)";
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
   185
by (Blast_tac 1) ;
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
   186
qed "vimage_iff";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   187
9180
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
   188
Goal "a : r-``{b} <-> <a,b>:r";
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
   189
by (rtac (vimage_iff RS iff_trans) 1);
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
   190
by (Blast_tac 1) ;
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
   191
qed "vimage_singleton_iff";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   192
9211
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
   193
Goalw [vimage_def] "[| <a,b>: r;  b:B |] ==> a : r-``B";
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
   194
by (Blast_tac 1) ;
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
   195
qed "vimageI";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   196
9211
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
   197
val major::prems= Goalw [vimage_def] 
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
   198
    "[| a: r-``B;  !!x.[| <a,x>: r;  x:B |] ==> P |] ==> P";
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
   199
by (rtac (major RS imageE) 1);
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
   200
by (REPEAT (etac converseD 1 ORELSE ares_tac prems 1)) ;
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
   201
qed "vimageE";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   202
9211
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
   203
Goalw [vimage_def] "r <= A*B ==> r-``C <= A";
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
   204
by (etac (converse_type RS image_subset) 1) ;
6236c5285bd8 removal of batch-style proofs
paulson
parents: 9180
diff changeset
   205
qed "vimage_subset";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   206
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   207
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   208
(** Theorem-proving for ZF set theory **)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   209
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2033
diff changeset
   210
AddIs  [vimageI];
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2033
diff changeset
   211
AddSEs [vimageE];
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2033
diff changeset
   212
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 2877
diff changeset
   213
val ZF_cs = claset() delrules [equalityI];
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   214
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   215
(** The Union of a set of relations is a relation -- Lemma for fun_Union **)
5325
f7a5e06adea1 Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents: 5202
diff changeset
   216
Goal "(ALL x:S. EX A B. x <= A*B) ==>  \
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   217
\                 Union(S) <= domain(Union(S)) * range(Union(S))";
2877
6476784dba1c Converted to call blast_tac.
paulson
parents: 2493
diff changeset
   218
by (Blast_tac 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 687
diff changeset
   219
qed "rel_Union";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   220
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   221
(** The Union of 2 relations is a relation (Lemma for fun_Un)  **)
9180
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
   222
Goal "[| r <= A*B;  s <= C*D |] ==> (r Un s) <= (A Un C) * (B Un D)";
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
   223
by (Blast_tac 1) ;
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
   224
qed "rel_Un";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   225
5325
f7a5e06adea1 Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents: 5202
diff changeset
   226
Goal "[| <a,c> : r; c~=b |] ==> domain(r-{<a,b>}) = domain(r)";
2877
6476784dba1c Converted to call blast_tac.
paulson
parents: 2493
diff changeset
   227
by (Blast_tac 1);
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2033
diff changeset
   228
qed "domain_Diff_eq";
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2033
diff changeset
   229
5325
f7a5e06adea1 Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents: 5202
diff changeset
   230
Goal "[| <c,b> : r; c~=a |] ==> range(r-{<a,b>}) = range(r)";
2877
6476784dba1c Converted to call blast_tac.
paulson
parents: 2493
diff changeset
   231
by (Blast_tac 1);
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2033
diff changeset
   232
qed "range_Diff_eq";
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2033
diff changeset
   233