src/ZF/domrange.ML
author paulson
Wed, 28 Jun 2000 12:34:08 +0200
changeset 9180 3bda56c0d70d
parent 5325 f7a5e06adea1
child 9211 6236c5285bd8
permissions -rw-r--r--
tidying and unbatchifying
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
5325
f7a5e06adea1 Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents: 5202
diff changeset
    11
qed_goalw "converse_iff" thy [converse_def]
687
91bc4b9eee1d ZF/domrange/converse_iff: new
lcp
parents: 674
diff changeset
    12
    "<a,b>: converse(r) <-> <b,a>:r"
2877
6476784dba1c Converted to call blast_tac.
paulson
parents: 2493
diff changeset
    13
 (fn _ => [ (Blast_tac 1) ]);
687
91bc4b9eee1d ZF/domrange/converse_iff: new
lcp
parents: 674
diff changeset
    14
5325
f7a5e06adea1 Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents: 5202
diff changeset
    15
qed_goalw "converseI" thy [converse_def]
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    16
    "!!a b r. <a,b>:r ==> <b,a>:converse(r)"
2877
6476784dba1c Converted to call blast_tac.
paulson
parents: 2493
diff changeset
    17
 (fn _ => [ (Blast_tac 1) ]);
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    18
5325
f7a5e06adea1 Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents: 5202
diff changeset
    19
qed_goalw "converseD" thy [converse_def]
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    20
    "!!a b r. <a,b> : converse(r) ==> <b,a> : r"
2877
6476784dba1c Converted to call blast_tac.
paulson
parents: 2493
diff changeset
    21
 (fn _ => [ (Blast_tac 1) ]);
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    22
5325
f7a5e06adea1 Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents: 5202
diff changeset
    23
qed_goalw "converseE" thy [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 \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    26
\    |] ==> P"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    27
 (fn [major,minor]=>
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    28
  [ (rtac (major RS ReplaceE) 1),
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    29
    (REPEAT (eresolve_tac [exE, conjE, minor] 1)),
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    30
    (hyp_subst_tac 1),
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    31
    (assume_tac 1) ]);
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
5325
f7a5e06adea1 Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents: 5202
diff changeset
    55
val converse_subset_iff = prove_goal thy
5202
084ceb3844f5 A few new lemmas by Mark Staples
paulson
parents: 4091
diff changeset
    56
  "!!z. A <= Sigma(X,Y) ==> converse(A) <= converse(B) <-> A <= B"
084ceb3844f5 A few new lemmas by Mark Staples
paulson
parents: 4091
diff changeset
    57
 (fn _=> [ (Blast_tac 1) ]);
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
5325
f7a5e06adea1 Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents: 5202
diff changeset
    62
qed_goalw "domain_iff" thy [domain_def]
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    63
    "a: domain(r) <-> (EX y. <a,y>: r)"
2877
6476784dba1c Converted to call blast_tac.
paulson
parents: 2493
diff changeset
    64
 (fn _=> [ (Blast_tac 1) ]);
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
5325
f7a5e06adea1 Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents: 5202
diff changeset
    85
qed_goalw "rangeI" thy [range_def] "!!a b r.<a,b>: r ==> b : range(r)"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    86
 (fn _ => [ (etac (converseI RS domainI) 1) ]);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    87
5325
f7a5e06adea1 Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents: 5202
diff changeset
    88
qed_goalw "rangeE" thy [range_def]
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    89
    "[| b : range(r);  !!x. <x,b>: r ==> P |] ==> P"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    90
 (fn major::prems=>
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    91
  [ (rtac (major RS domainE) 1),
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    92
    (resolve_tac prems 1),
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    93
    (etac converseD 1) ]);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    94
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2033
diff changeset
    95
AddIs  [rangeI];
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2033
diff changeset
    96
AddSEs [rangeE];
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2033
diff changeset
    97
5325
f7a5e06adea1 Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents: 5202
diff changeset
    98
qed_goalw "range_subset" thy [range_def] "range(A*B) <= B"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    99
 (fn _ =>
2033
639de962ded4 Ran expandshort; used stac instead of ssubst
paulson
parents: 1461
diff changeset
   100
  [ (stac converse_prod 1),
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   101
    (rtac domain_subset 1) ]);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   102
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   103
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   104
(*** field ***)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   105
5325
f7a5e06adea1 Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents: 5202
diff changeset
   106
qed_goalw "fieldI1" thy [field_def] "!!r. <a,b>: r ==> a : field(r)"
2877
6476784dba1c Converted to call blast_tac.
paulson
parents: 2493
diff changeset
   107
 (fn _ => [ (Blast_tac 1) ]);
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   108
5325
f7a5e06adea1 Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents: 5202
diff changeset
   109
qed_goalw "fieldI2" thy [field_def] "!!r. <a,b>: r ==> b : field(r)"
2877
6476784dba1c Converted to call blast_tac.
paulson
parents: 2493
diff changeset
   110
 (fn _ => [ (Blast_tac 1) ]);
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   111
5325
f7a5e06adea1 Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents: 5202
diff changeset
   112
qed_goalw "fieldCI" thy [field_def]
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   113
    "(~ <c,a>:r ==> <a,b>: r) ==> a : field(r)"
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 2877
diff changeset
   114
 (fn [prem]=> [ (blast_tac (claset() addIs [prem]) 1) ]);
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   115
5325
f7a5e06adea1 Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents: 5202
diff changeset
   116
qed_goalw "fieldE" thy [field_def]
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   117
     "[| a : field(r);  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   118
\        !!x. <a,x>: r ==> P;  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   119
\        !!x. <x,a>: r ==> P        |] ==> P"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   120
 (fn major::prems=>
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   121
  [ (rtac (major RS UnE) 1),
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   122
    (REPEAT (eresolve_tac (prems@[domainE,rangeE]) 1)) ]);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   123
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2033
diff changeset
   124
AddIs  [fieldCI];
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2033
diff changeset
   125
AddSEs [fieldE];
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   126
9180
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
   127
Goal "field(A*B) <= A Un B";
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
   128
by (Blast_tac 1) ;
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
   129
qed "field_subset";
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2033
diff changeset
   130
5325
f7a5e06adea1 Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents: 5202
diff changeset
   131
qed_goalw "domain_subset_field" thy [field_def]
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   132
    "domain(r) <= field(r)"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   133
 (fn _ => [ (rtac Un_upper1 1) ]);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   134
5325
f7a5e06adea1 Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents: 5202
diff changeset
   135
qed_goalw "range_subset_field" thy [field_def]
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   136
    "range(r) <= field(r)"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   137
 (fn _ => [ (rtac Un_upper2 1) ]);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   138
9180
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
   139
Goal "r <= Sigma(A,B) ==> r <= domain(r)*range(r)";
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
   140
by (Blast_tac 1) ;
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
   141
qed "domain_times_range";
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 <= field(r)*field(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 "field_times_field";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   146
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   147
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   148
(*** Image of a set under a function/relation ***)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   149
9180
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
   150
Goalw [image_def] "b : r``A <-> (EX x:A. <x,b>:r)";
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
   151
by (Blast_tac 1);
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
   152
qed "image_iff";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   153
9180
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
   154
Goal "b : r``{a} <-> <a,b>:r";
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
   155
by (rtac (image_iff RS iff_trans) 1);
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
   156
by (Blast_tac 1) ;
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
   157
qed "image_singleton_iff";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   158
5325
f7a5e06adea1 Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents: 5202
diff changeset
   159
qed_goalw "imageI" thy [image_def]
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   160
    "!!a b r. [| <a,b>: r;  a:A |] ==> b : r``A"
2877
6476784dba1c Converted to call blast_tac.
paulson
parents: 2493
diff changeset
   161
 (fn _ => [ (Blast_tac 1) ]);
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   162
5325
f7a5e06adea1 Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents: 5202
diff changeset
   163
qed_goalw "imageE" thy [image_def]
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   164
    "[| b: r``A;  !!x.[| <x,b>: r;  x:A |] ==> P |] ==> P"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   165
 (fn major::prems=>
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   166
  [ (rtac (major RS CollectE) 1),
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   167
    (REPEAT (etac bexE 1 ORELSE ares_tac prems 1)) ]);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   168
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2033
diff changeset
   169
AddIs  [imageI];
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2033
diff changeset
   170
AddSEs [imageE];
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2033
diff changeset
   171
9180
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
   172
Goal "r <= A*B ==> r``C <= B";
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
   173
by (Blast_tac 1) ;
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
   174
qed "image_subset";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   175
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   176
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   177
(*** Inverse image of a set under a function/relation ***)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   178
5325
f7a5e06adea1 Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents: 5202
diff changeset
   179
qed_goalw "vimage_iff" thy [vimage_def,image_def,converse_def]
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   180
    "a : r-``B <-> (EX y:B. <a,y>:r)"
2877
6476784dba1c Converted to call blast_tac.
paulson
parents: 2493
diff changeset
   181
 (fn _ => [ (Blast_tac 1) ]);
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   182
9180
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
   183
Goal "a : r-``{b} <-> <a,b>:r";
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
   184
by (rtac (vimage_iff RS iff_trans) 1);
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
   185
by (Blast_tac 1) ;
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
   186
qed "vimage_singleton_iff";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   187
5325
f7a5e06adea1 Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents: 5202
diff changeset
   188
qed_goalw "vimageI" thy [vimage_def]
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   189
    "!!A B r. [| <a,b>: r;  b:B |] ==> a : r-``B"
2877
6476784dba1c Converted to call blast_tac.
paulson
parents: 2493
diff changeset
   190
 (fn _ => [ (Blast_tac 1) ]);
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   191
5325
f7a5e06adea1 Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents: 5202
diff changeset
   192
qed_goalw "vimageE" thy [vimage_def]
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   193
    "[| a: r-``B;  !!x.[| <a,x>: r;  x:B |] ==> P |] ==> P"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   194
 (fn major::prems=>
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   195
  [ (rtac (major RS imageE) 1),
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   196
    (REPEAT (etac converseD 1 ORELSE ares_tac prems 1)) ]);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   197
5325
f7a5e06adea1 Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents: 5202
diff changeset
   198
qed_goalw "vimage_subset" thy [vimage_def]
14
1c0926788772 ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents: 0
diff changeset
   199
    "!!A B r. r <= A*B ==> r-``C <= A"
1c0926788772 ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents: 0
diff changeset
   200
 (fn _ => [ (etac (converse_type RS image_subset) 1) ]);
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   201
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   202
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   203
(** Theorem-proving for ZF set theory **)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   204
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2033
diff changeset
   205
AddIs  [vimageI];
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2033
diff changeset
   206
AddSEs [vimageE];
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2033
diff changeset
   207
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 2877
diff changeset
   208
val ZF_cs = claset() delrules [equalityI];
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   209
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   210
(** 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
   211
Goal "(ALL x:S. EX A B. x <= A*B) ==>  \
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   212
\                 Union(S) <= domain(Union(S)) * range(Union(S))";
2877
6476784dba1c Converted to call blast_tac.
paulson
parents: 2493
diff changeset
   213
by (Blast_tac 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 687
diff changeset
   214
qed "rel_Union";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   215
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   216
(** The Union of 2 relations is a relation (Lemma for fun_Un)  **)
9180
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
   217
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
   218
by (Blast_tac 1) ;
3bda56c0d70d tidying and unbatchifying
paulson
parents: 5325
diff changeset
   219
qed "rel_Un";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   220
5325
f7a5e06adea1 Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents: 5202
diff changeset
   221
Goal "[| <a,c> : r; c~=b |] ==> domain(r-{<a,b>}) = domain(r)";
2877
6476784dba1c Converted to call blast_tac.
paulson
parents: 2493
diff changeset
   222
by (Blast_tac 1);
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2033
diff changeset
   223
qed "domain_Diff_eq";
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2033
diff changeset
   224
5325
f7a5e06adea1 Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents: 5202
diff changeset
   225
Goal "[| <c,b> : r; c~=a |] ==> range(r-{<a,b>}) = range(r)";
2877
6476784dba1c Converted to call blast_tac.
paulson
parents: 2493
diff changeset
   226
by (Blast_tac 1);
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2033
diff changeset
   227
qed "range_Diff_eq";
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2033
diff changeset
   228