src/HOL/Relation.thy
author nipkow
Thu Jul 11 09:17:01 2002 +0200 (2002-07-11)
changeset 13343 3b2b18c58d80
parent 12913 5ac498bffb6b
child 13550 5a176b8dda84
permissions -rw-r--r--
*** empty log message ***
wenzelm@10358
     1
(*  Title:      HOL/Relation.thy
nipkow@1128
     2
    ID:         $Id$
paulson@1983
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
paulson@1983
     4
    Copyright   1996  University of Cambridge
nipkow@1128
     5
*)
nipkow@1128
     6
berghofe@12905
     7
header {* Relations *}
berghofe@12905
     8
berghofe@12905
     9
theory Relation = Product_Type:
paulson@5978
    10
wenzelm@12913
    11
subsection {* Definitions *}
wenzelm@12913
    12
paulson@5978
    13
constdefs
wenzelm@10358
    14
  converse :: "('a * 'b) set => ('b * 'a) set"    ("(_^-1)" [1000] 999)
wenzelm@10358
    15
  "r^-1 == {(y, x). (x, y) : r}"
wenzelm@10358
    16
syntax (xsymbols)
berghofe@12905
    17
  converse :: "('a * 'b) set => ('b * 'a) set"    ("(_\<inverse>)" [1000] 999)
paulson@7912
    18
wenzelm@10358
    19
constdefs
nipkow@12487
    20
  rel_comp  :: "[('b * 'c) set, ('a * 'b) set] => ('a * 'c) set"  (infixr "O" 60)
wenzelm@12913
    21
  "r O s == {(x,z). EX y. (x, y) : s & (y, z) : r}"
wenzelm@12913
    22
wenzelm@12913
    23
  fun_rel_comp :: "['a => 'b, ('b * 'c) set] => ('a => 'c) set"
wenzelm@12913
    24
  "fun_rel_comp f R == {g. ALL x. (f x, g x) : R}"
paulson@5978
    25
oheimb@11136
    26
  Image :: "[('a * 'b) set, 'a set] => 'b set"                (infixl "``" 90)
wenzelm@12913
    27
  "r `` s == {y. EX x:s. (x,y):r}"
paulson@7912
    28
berghofe@12905
    29
  Id    :: "('a * 'a) set"  -- {* the identity relation *}
wenzelm@12913
    30
  "Id == {p. EX x. p = (x,x)}"
paulson@7912
    31
berghofe@12905
    32
  diag  :: "'a set => ('a * 'a) set"  -- {* diagonal: identity over a set *}
wenzelm@12913
    33
  "diag A == UN x:A. {(x,x)}"
wenzelm@12913
    34
oheimb@11136
    35
  Domain :: "('a * 'b) set => 'a set"
wenzelm@12913
    36
  "Domain r == {x. EX y. (x,y):r}"
paulson@5978
    37
oheimb@11136
    38
  Range  :: "('a * 'b) set => 'b set"
wenzelm@12913
    39
  "Range r == Domain(r^-1)"
paulson@5978
    40
oheimb@11136
    41
  Field :: "('a * 'a) set => 'a set"
wenzelm@12913
    42
  "Field r == Domain r Un Range r"
paulson@10786
    43
berghofe@12905
    44
  refl   :: "['a set, ('a * 'a) set] => bool"  -- {* reflexivity over a set *}
wenzelm@12913
    45
  "refl A r == r \<subseteq> A \<times> A & (ALL x: A. (x,x) : r)"
paulson@6806
    46
berghofe@12905
    47
  sym    :: "('a * 'a) set => bool"  -- {* symmetry predicate *}
wenzelm@12913
    48
  "sym r == ALL x y. (x,y): r --> (y,x): r"
paulson@6806
    49
berghofe@12905
    50
  antisym:: "('a * 'a) set => bool"  -- {* antisymmetry predicate *}
wenzelm@12913
    51
  "antisym r == ALL x y. (x,y):r --> (y,x):r --> x=y"
paulson@6806
    52
berghofe@12905
    53
  trans  :: "('a * 'a) set => bool"  -- {* transitivity predicate *}
wenzelm@12913
    54
  "trans r == (ALL x y z. (x,y):r --> (y,z):r --> (x,z):r)"
paulson@5978
    55
oheimb@11136
    56
  single_valued :: "('a * 'b) set => bool"
wenzelm@12913
    57
  "single_valued r == ALL x y. (x,y):r --> (ALL z. (x,z):r --> y=z)"
berghofe@7014
    58
oheimb@11136
    59
  inv_image :: "('b * 'b) set => ('a => 'b) => ('a * 'a) set"
wenzelm@12913
    60
  "inv_image r f == {(x, y). (f x, f y) : r}"
oheimb@11136
    61
paulson@6806
    62
syntax
berghofe@12905
    63
  reflexive :: "('a * 'a) set => bool"  -- {* reflexivity over a type *}
paulson@6806
    64
translations
paulson@6806
    65
  "reflexive" == "refl UNIV"
paulson@6806
    66
berghofe@12905
    67
wenzelm@12913
    68
subsection {* The identity relation *}
berghofe@12905
    69
berghofe@12905
    70
lemma IdI [intro]: "(a, a) : Id"
berghofe@12905
    71
  by (simp add: Id_def)
berghofe@12905
    72
berghofe@12905
    73
lemma IdE [elim!]: "p : Id ==> (!!x. p = (x, x) ==> P) ==> P"
berghofe@12905
    74
  by (unfold Id_def) (rules elim: CollectE)
berghofe@12905
    75
berghofe@12905
    76
lemma pair_in_Id_conv [iff]: "((a, b) : Id) = (a = b)"
berghofe@12905
    77
  by (unfold Id_def) blast
berghofe@12905
    78
berghofe@12905
    79
lemma reflexive_Id: "reflexive Id"
berghofe@12905
    80
  by (simp add: refl_def)
berghofe@12905
    81
berghofe@12905
    82
lemma antisym_Id: "antisym Id"
berghofe@12905
    83
  -- {* A strange result, since @{text Id} is also symmetric. *}
berghofe@12905
    84
  by (simp add: antisym_def)
berghofe@12905
    85
berghofe@12905
    86
lemma trans_Id: "trans Id"
berghofe@12905
    87
  by (simp add: trans_def)
berghofe@12905
    88
berghofe@12905
    89
wenzelm@12913
    90
subsection {* Diagonal: identity over a set *}
berghofe@12905
    91
berghofe@12905
    92
lemma diag_eqI: "a = b ==> a : A ==> (a, b) : diag A"
berghofe@12905
    93
  by (simp add: diag_def)
berghofe@12905
    94
berghofe@12905
    95
lemma diagI [intro!]: "a : A ==> (a, a) : diag A"
berghofe@12905
    96
  by (rule diag_eqI) (rule refl)
berghofe@12905
    97
berghofe@12905
    98
lemma diagE [elim!]:
berghofe@12905
    99
  "c : diag A ==> (!!x. x : A ==> c = (x, x) ==> P) ==> P"
wenzelm@12913
   100
  -- {* The general elimination rule. *}
berghofe@12905
   101
  by (unfold diag_def) (rules elim!: UN_E singletonE)
berghofe@12905
   102
berghofe@12905
   103
lemma diag_iff: "((x, y) : diag A) = (x = y & x : A)"
berghofe@12905
   104
  by blast
berghofe@12905
   105
wenzelm@12913
   106
lemma diag_subset_Times: "diag A \<subseteq> A \<times> A"
berghofe@12905
   107
  by blast
berghofe@12905
   108
berghofe@12905
   109
berghofe@12905
   110
subsection {* Composition of two relations *}
berghofe@12905
   111
wenzelm@12913
   112
lemma rel_compI [intro]:
berghofe@12905
   113
  "(a, b) : s ==> (b, c) : r ==> (a, c) : r O s"
berghofe@12905
   114
  by (unfold rel_comp_def) blast
berghofe@12905
   115
wenzelm@12913
   116
lemma rel_compE [elim!]: "xz : r O s ==>
berghofe@12905
   117
  (!!x y z. xz = (x, z) ==> (x, y) : s ==> (y, z) : r  ==> P) ==> P"
berghofe@12905
   118
  by (unfold rel_comp_def) (rules elim!: CollectE splitE exE conjE)
berghofe@12905
   119
berghofe@12905
   120
lemma rel_compEpair:
berghofe@12905
   121
  "(a, c) : r O s ==> (!!y. (a, y) : s ==> (y, c) : r ==> P) ==> P"
berghofe@12905
   122
  by (rules elim: rel_compE Pair_inject ssubst)
berghofe@12905
   123
berghofe@12905
   124
lemma R_O_Id [simp]: "R O Id = R"
berghofe@12905
   125
  by fast
berghofe@12905
   126
berghofe@12905
   127
lemma Id_O_R [simp]: "Id O R = R"
berghofe@12905
   128
  by fast
berghofe@12905
   129
berghofe@12905
   130
lemma O_assoc: "(R O S) O T = R O (S O T)"
berghofe@12905
   131
  by blast
berghofe@12905
   132
wenzelm@12913
   133
lemma trans_O_subset: "trans r ==> r O r \<subseteq> r"
berghofe@12905
   134
  by (unfold trans_def) blast
berghofe@12905
   135
wenzelm@12913
   136
lemma rel_comp_mono: "r' \<subseteq> r ==> s' \<subseteq> s ==> (r' O s') \<subseteq> (r O s)"
berghofe@12905
   137
  by blast
berghofe@12905
   138
berghofe@12905
   139
lemma rel_comp_subset_Sigma:
wenzelm@12913
   140
    "s \<subseteq> A \<times> B ==> r \<subseteq> B \<times> C ==> (r O s) \<subseteq> A \<times> C"
berghofe@12905
   141
  by blast
berghofe@12905
   142
wenzelm@12913
   143
wenzelm@12913
   144
subsection {* Composition of function and relation *}
wenzelm@12913
   145
wenzelm@12913
   146
lemma fun_rel_comp_mono: "A \<subseteq> B ==> fun_rel_comp f A \<subseteq> fun_rel_comp f B"
wenzelm@12913
   147
  by (unfold fun_rel_comp_def) fast
berghofe@12905
   148
wenzelm@12913
   149
lemma fun_rel_comp_unique:
wenzelm@12913
   150
  "ALL x. EX! y. (f x, y) : R ==> EX! g. g : fun_rel_comp f R"
wenzelm@12913
   151
  apply (unfold fun_rel_comp_def)
wenzelm@12913
   152
  apply (rule_tac a = "%x. THE y. (f x, y) : R" in ex1I)
wenzelm@12913
   153
  apply (fast dest!: theI')
wenzelm@12913
   154
  apply (fast intro: ext the1_equality [symmetric])
wenzelm@12913
   155
  done
wenzelm@12913
   156
wenzelm@12913
   157
wenzelm@12913
   158
subsection {* Reflexivity *}
wenzelm@12913
   159
wenzelm@12913
   160
lemma reflI: "r \<subseteq> A \<times> A ==> (!!x. x : A ==> (x, x) : r) ==> refl A r"
berghofe@12905
   161
  by (unfold refl_def) (rules intro!: ballI)
berghofe@12905
   162
berghofe@12905
   163
lemma reflD: "refl A r ==> a : A ==> (a, a) : r"
berghofe@12905
   164
  by (unfold refl_def) blast
berghofe@12905
   165
wenzelm@12913
   166
wenzelm@12913
   167
subsection {* Antisymmetry *}
berghofe@12905
   168
berghofe@12905
   169
lemma antisymI:
berghofe@12905
   170
  "(!!x y. (x, y) : r ==> (y, x) : r ==> x=y) ==> antisym r"
berghofe@12905
   171
  by (unfold antisym_def) rules
berghofe@12905
   172
berghofe@12905
   173
lemma antisymD: "antisym r ==> (a, b) : r ==> (b, a) : r ==> a = b"
berghofe@12905
   174
  by (unfold antisym_def) rules
berghofe@12905
   175
wenzelm@12913
   176
wenzelm@12913
   177
subsection {* Transitivity *}
berghofe@12905
   178
berghofe@12905
   179
lemma transI:
berghofe@12905
   180
  "(!!x y z. (x, y) : r ==> (y, z) : r ==> (x, z) : r) ==> trans r"
berghofe@12905
   181
  by (unfold trans_def) rules
berghofe@12905
   182
berghofe@12905
   183
lemma transD: "trans r ==> (a, b) : r ==> (b, c) : r ==> (a, c) : r"
berghofe@12905
   184
  by (unfold trans_def) rules
berghofe@12905
   185
berghofe@12905
   186
wenzelm@12913
   187
subsection {* Converse *}
wenzelm@12913
   188
wenzelm@12913
   189
lemma converse_iff [iff]: "((a,b): r^-1) = ((b,a) : r)"
berghofe@12905
   190
  by (simp add: converse_def)
berghofe@12905
   191
nipkow@13343
   192
lemma converseI[sym]: "(a, b) : r ==> (b, a) : r^-1"
berghofe@12905
   193
  by (simp add: converse_def)
berghofe@12905
   194
nipkow@13343
   195
lemma converseD[sym]: "(a,b) : r^-1 ==> (b, a) : r"
berghofe@12905
   196
  by (simp add: converse_def)
berghofe@12905
   197
berghofe@12905
   198
lemma converseE [elim!]:
berghofe@12905
   199
  "yx : r^-1 ==> (!!x y. yx = (y, x) ==> (x, y) : r ==> P) ==> P"
wenzelm@12913
   200
    -- {* More general than @{text converseD}, as it ``splits'' the member of the relation. *}
berghofe@12905
   201
  by (unfold converse_def) (rules elim!: CollectE splitE bexE)
berghofe@12905
   202
berghofe@12905
   203
lemma converse_converse [simp]: "(r^-1)^-1 = r"
berghofe@12905
   204
  by (unfold converse_def) blast
berghofe@12905
   205
berghofe@12905
   206
lemma converse_rel_comp: "(r O s)^-1 = s^-1 O r^-1"
berghofe@12905
   207
  by blast
berghofe@12905
   208
berghofe@12905
   209
lemma converse_Id [simp]: "Id^-1 = Id"
berghofe@12905
   210
  by blast
berghofe@12905
   211
wenzelm@12913
   212
lemma converse_diag [simp]: "(diag A)^-1 = diag A"
berghofe@12905
   213
  by blast
berghofe@12905
   214
berghofe@12905
   215
lemma refl_converse: "refl A r ==> refl A (converse r)"
berghofe@12905
   216
  by (unfold refl_def) blast
berghofe@12905
   217
berghofe@12905
   218
lemma antisym_converse: "antisym (converse r) = antisym r"
berghofe@12905
   219
  by (unfold antisym_def) blast
berghofe@12905
   220
berghofe@12905
   221
lemma trans_converse: "trans (converse r) = trans r"
berghofe@12905
   222
  by (unfold trans_def) blast
berghofe@12905
   223
wenzelm@12913
   224
berghofe@12905
   225
subsection {* Domain *}
berghofe@12905
   226
berghofe@12905
   227
lemma Domain_iff: "(a : Domain r) = (EX y. (a, y) : r)"
berghofe@12905
   228
  by (unfold Domain_def) blast
berghofe@12905
   229
berghofe@12905
   230
lemma DomainI [intro]: "(a, b) : r ==> a : Domain r"
berghofe@12905
   231
  by (rules intro!: iffD2 [OF Domain_iff])
berghofe@12905
   232
berghofe@12905
   233
lemma DomainE [elim!]:
berghofe@12905
   234
  "a : Domain r ==> (!!y. (a, y) : r ==> P) ==> P"
berghofe@12905
   235
  by (rules dest!: iffD1 [OF Domain_iff])
berghofe@12905
   236
berghofe@12905
   237
lemma Domain_empty [simp]: "Domain {} = {}"
berghofe@12905
   238
  by blast
berghofe@12905
   239
berghofe@12905
   240
lemma Domain_insert: "Domain (insert (a, b) r) = insert a (Domain r)"
berghofe@12905
   241
  by blast
berghofe@12905
   242
berghofe@12905
   243
lemma Domain_Id [simp]: "Domain Id = UNIV"
berghofe@12905
   244
  by blast
berghofe@12905
   245
berghofe@12905
   246
lemma Domain_diag [simp]: "Domain (diag A) = A"
berghofe@12905
   247
  by blast
berghofe@12905
   248
berghofe@12905
   249
lemma Domain_Un_eq: "Domain(A Un B) = Domain(A) Un Domain(B)"
berghofe@12905
   250
  by blast
berghofe@12905
   251
wenzelm@12913
   252
lemma Domain_Int_subset: "Domain(A Int B) \<subseteq> Domain(A) Int Domain(B)"
berghofe@12905
   253
  by blast
berghofe@12905
   254
wenzelm@12913
   255
lemma Domain_Diff_subset: "Domain(A) - Domain(B) \<subseteq> Domain(A - B)"
berghofe@12905
   256
  by blast
berghofe@12905
   257
berghofe@12905
   258
lemma Domain_Union: "Domain (Union S) = (UN A:S. Domain A)"
berghofe@12905
   259
  by blast
berghofe@12905
   260
wenzelm@12913
   261
lemma Domain_mono: "r \<subseteq> s ==> Domain r \<subseteq> Domain s"
berghofe@12905
   262
  by blast
berghofe@12905
   263
berghofe@12905
   264
berghofe@12905
   265
subsection {* Range *}
berghofe@12905
   266
berghofe@12905
   267
lemma Range_iff: "(a : Range r) = (EX y. (y, a) : r)"
berghofe@12905
   268
  by (simp add: Domain_def Range_def)
berghofe@12905
   269
berghofe@12905
   270
lemma RangeI [intro]: "(a, b) : r ==> b : Range r"
berghofe@12905
   271
  by (unfold Range_def) (rules intro!: converseI DomainI)
berghofe@12905
   272
berghofe@12905
   273
lemma RangeE [elim!]: "b : Range r ==> (!!x. (x, b) : r ==> P) ==> P"
berghofe@12905
   274
  by (unfold Range_def) (rules elim!: DomainE dest!: converseD)
berghofe@12905
   275
berghofe@12905
   276
lemma Range_empty [simp]: "Range {} = {}"
berghofe@12905
   277
  by blast
berghofe@12905
   278
berghofe@12905
   279
lemma Range_insert: "Range (insert (a, b) r) = insert b (Range r)"
berghofe@12905
   280
  by blast
berghofe@12905
   281
berghofe@12905
   282
lemma Range_Id [simp]: "Range Id = UNIV"
berghofe@12905
   283
  by blast
berghofe@12905
   284
berghofe@12905
   285
lemma Range_diag [simp]: "Range (diag A) = A"
berghofe@12905
   286
  by auto
berghofe@12905
   287
berghofe@12905
   288
lemma Range_Un_eq: "Range(A Un B) = Range(A) Un Range(B)"
berghofe@12905
   289
  by blast
berghofe@12905
   290
wenzelm@12913
   291
lemma Range_Int_subset: "Range(A Int B) \<subseteq> Range(A) Int Range(B)"
berghofe@12905
   292
  by blast
berghofe@12905
   293
wenzelm@12913
   294
lemma Range_Diff_subset: "Range(A) - Range(B) \<subseteq> Range(A - B)"
berghofe@12905
   295
  by blast
berghofe@12905
   296
berghofe@12905
   297
lemma Range_Union: "Range (Union S) = (UN A:S. Range A)"
berghofe@12905
   298
  by blast
berghofe@12905
   299
berghofe@12905
   300
berghofe@12905
   301
subsection {* Image of a set under a relation *}
berghofe@12905
   302
berghofe@12905
   303
ML {* overload_1st_set "Relation.Image" *}
berghofe@12905
   304
wenzelm@12913
   305
lemma Image_iff: "(b : r``A) = (EX x:A. (x, b) : r)"
berghofe@12905
   306
  by (simp add: Image_def)
berghofe@12905
   307
wenzelm@12913
   308
lemma Image_singleton: "r``{a} = {b. (a, b) : r}"
berghofe@12905
   309
  by (simp add: Image_def)
berghofe@12905
   310
wenzelm@12913
   311
lemma Image_singleton_iff [iff]: "(b : r``{a}) = ((a, b) : r)"
berghofe@12905
   312
  by (rule Image_iff [THEN trans]) simp
berghofe@12905
   313
wenzelm@12913
   314
lemma ImageI [intro]: "(a, b) : r ==> a : A ==> b : r``A"
berghofe@12905
   315
  by (unfold Image_def) blast
berghofe@12905
   316
berghofe@12905
   317
lemma ImageE [elim!]:
wenzelm@12913
   318
    "b : r `` A ==> (!!x. (x, b) : r ==> x : A ==> P) ==> P"
berghofe@12905
   319
  by (unfold Image_def) (rules elim!: CollectE bexE)
berghofe@12905
   320
berghofe@12905
   321
lemma rev_ImageI: "a : A ==> (a, b) : r ==> b : r `` A"
berghofe@12905
   322
  -- {* This version's more effective when we already have the required @{text a} *}
berghofe@12905
   323
  by blast
berghofe@12905
   324
berghofe@12905
   325
lemma Image_empty [simp]: "R``{} = {}"
berghofe@12905
   326
  by blast
berghofe@12905
   327
berghofe@12905
   328
lemma Image_Id [simp]: "Id `` A = A"
berghofe@12905
   329
  by blast
berghofe@12905
   330
berghofe@12905
   331
lemma Image_diag [simp]: "diag A `` B = A Int B"
berghofe@12905
   332
  by blast
berghofe@12905
   333
wenzelm@12913
   334
lemma Image_Int_subset: "R `` (A Int B) \<subseteq> R `` A Int R `` B"
berghofe@12905
   335
  by blast
berghofe@12905
   336
berghofe@12905
   337
lemma Image_Un: "R `` (A Un B) = R `` A Un R `` B"
berghofe@12905
   338
  by blast
berghofe@12905
   339
wenzelm@12913
   340
lemma Image_subset: "r \<subseteq> A \<times> B ==> r``C \<subseteq> B"
berghofe@12905
   341
  by (rules intro!: subsetI elim!: ImageE dest!: subsetD SigmaD2)
berghofe@12905
   342
berghofe@12905
   343
lemma Image_eq_UN: "r``B = (UN y: B. r``{y})"
berghofe@12905
   344
  -- {* NOT suitable for rewriting *}
berghofe@12905
   345
  by blast
berghofe@12905
   346
wenzelm@12913
   347
lemma Image_mono: "r' \<subseteq> r ==> A' \<subseteq> A ==> (r' `` A') \<subseteq> (r `` A)"
berghofe@12905
   348
  by blast
berghofe@12905
   349
berghofe@12905
   350
lemma Image_UN: "(r `` (UNION A B)) = (UN x:A.(r `` (B x)))"
berghofe@12905
   351
  by blast
berghofe@12905
   352
wenzelm@12913
   353
lemma Image_INT_subset: "(r `` (INTER A B)) \<subseteq> (INT x:A.(r `` (B x)))"
berghofe@12905
   354
  -- {* Converse inclusion fails *}
berghofe@12905
   355
  by blast
berghofe@12905
   356
wenzelm@12913
   357
lemma Image_subset_eq: "(r``A \<subseteq> B) = (A \<subseteq> - ((r^-1) `` (-B)))"
berghofe@12905
   358
  by blast
berghofe@12905
   359
berghofe@12905
   360
wenzelm@12913
   361
subsection {* Single valued relations *}
wenzelm@12913
   362
wenzelm@12913
   363
lemma single_valuedI:
berghofe@12905
   364
  "ALL x y. (x,y):r --> (ALL z. (x,z):r --> y=z) ==> single_valued r"
berghofe@12905
   365
  by (unfold single_valued_def)
berghofe@12905
   366
berghofe@12905
   367
lemma single_valuedD:
berghofe@12905
   368
  "single_valued r ==> (x, y) : r ==> (x, z) : r ==> y = z"
berghofe@12905
   369
  by (simp add: single_valued_def)
berghofe@12905
   370
berghofe@12905
   371
berghofe@12905
   372
subsection {* Graphs given by @{text Collect} *}
berghofe@12905
   373
berghofe@12905
   374
lemma Domain_Collect_split [simp]: "Domain{(x,y). P x y} = {x. EX y. P x y}"
berghofe@12905
   375
  by auto
berghofe@12905
   376
berghofe@12905
   377
lemma Range_Collect_split [simp]: "Range{(x,y). P x y} = {y. EX x. P x y}"
berghofe@12905
   378
  by auto
berghofe@12905
   379
berghofe@12905
   380
lemma Image_Collect_split [simp]: "{(x,y). P x y} `` A = {y. EX x:A. P x y}"
berghofe@12905
   381
  by auto
berghofe@12905
   382
berghofe@12905
   383
wenzelm@12913
   384
subsection {* Inverse image *}
berghofe@12905
   385
wenzelm@12913
   386
lemma trans_inv_image: "trans r ==> trans (inv_image r f)"
berghofe@12905
   387
  apply (unfold trans_def inv_image_def)
berghofe@12905
   388
  apply (simp (no_asm))
berghofe@12905
   389
  apply blast
berghofe@12905
   390
  done
berghofe@12905
   391
nipkow@1128
   392
end