src/ZF/Perm.thy
author paulson
Tue, 02 Jul 2002 13:28:08 +0200
changeset 13269 3ba9be497c33
parent 13185 da61bfa0a391
child 13356 c9cfe1638bf2
permissions -rw-r--r--
Tidying and introduction of various new theorems
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1478
2b8c2a7547ab expanded tabs
clasohm
parents: 1401
diff changeset
     1
(*  Title:      ZF/perm
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     2
    ID:         $Id$
1478
2b8c2a7547ab expanded tabs
clasohm
parents: 1401
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
The theory underlying permutation groups
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     7
  -- Composition of relations, the identity relation
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     8
  -- Injections, surjections, bijections
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     9
  -- Lemmas for the Schroeder-Bernstein Theorem
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    10
*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    11
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    12
theory Perm = mono + func:
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    13
1806
12708740f58d Converted to use constdefs instead of defs
paulson
parents: 1478
diff changeset
    14
constdefs
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    15
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    16
  (*composition of relations and functions; NOT Suppes's relative product*)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    17
  comp     :: "[i,i]=>i"      (infixr "O" 60)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    18
    "r O s == {xz : domain(s)*range(r) . 
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    19
               EX x y z. xz=<x,z> & <x,y>:s & <y,z>:r}"
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    20
1806
12708740f58d Converted to use constdefs instead of defs
paulson
parents: 1478
diff changeset
    21
  (*the identity function for A*)
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    22
  id    :: "i=>i"
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    23
    "id(A) == (lam x:A. x)"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    24
1806
12708740f58d Converted to use constdefs instead of defs
paulson
parents: 1478
diff changeset
    25
  (*one-to-one functions from A to B*)
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    26
  inj   :: "[i,i]=>i"
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    27
    "inj(A,B) == { f: A->B. ALL w:A. ALL x:A. f`w=f`x --> w=x}"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    28
1806
12708740f58d Converted to use constdefs instead of defs
paulson
parents: 1478
diff changeset
    29
  (*onto functions from A to B*)
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    30
  surj  :: "[i,i]=>i"
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    31
    "surj(A,B) == { f: A->B . ALL y:B. EX x:A. f`x=y}"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    32
1806
12708740f58d Converted to use constdefs instead of defs
paulson
parents: 1478
diff changeset
    33
  (*one-to-one and onto functions*)
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    34
  bij   :: "[i,i]=>i"
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    35
    "bij(A,B) == inj(A,B) Int surj(A,B)"
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    36
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    37
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    38
(** Surjective function space **)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    39
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    40
lemma surj_is_fun: "f: surj(A,B) ==> f: A->B"
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    41
apply (unfold surj_def)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    42
apply (erule CollectD1)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    43
done
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    44
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    45
lemma fun_is_surj: "f : Pi(A,B) ==> f: surj(A,range(f))"
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    46
apply (unfold surj_def)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    47
apply (blast intro: apply_equality range_of_fun domain_type)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    48
done
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    49
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    50
lemma surj_range: "f: surj(A,B) ==> range(f)=B"
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    51
apply (unfold surj_def)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    52
apply (best intro: apply_Pair elim: range_type)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    53
done
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    54
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    55
(** A function with a right inverse is a surjection **)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    56
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    57
lemma f_imp_surjective: 
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    58
    "[| f: A->B;  !!y. y:B ==> d(y): A;  !!y. y:B ==> f`d(y) = y |]
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    59
     ==> f: surj(A,B)"
13180
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
    60
apply (simp add: surj_def, blast)
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    61
done
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    62
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    63
lemma lam_surjective: 
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    64
    "[| !!x. x:A ==> c(x): B;            
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    65
        !!y. y:B ==> d(y): A;            
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    66
        !!y. y:B ==> c(d(y)) = y         
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    67
     |] ==> (lam x:A. c(x)) : surj(A,B)"
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    68
apply (rule_tac d = "d" in f_imp_surjective) 
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    69
apply (simp_all add: lam_type)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    70
done
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    71
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    72
(*Cantor's theorem revisited*)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    73
lemma cantor_surj: "f ~: surj(A,Pow(A))"
13180
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
    74
apply (unfold surj_def, safe)
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    75
apply (cut_tac cantor)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    76
apply (best del: subsetI) 
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    77
done
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    78
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    79
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    80
(** Injective function space **)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    81
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    82
lemma inj_is_fun: "f: inj(A,B) ==> f: A->B"
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    83
apply (unfold inj_def)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    84
apply (erule CollectD1)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    85
done
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    86
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    87
(*Good for dealing with sets of pairs, but a bit ugly in use [used in AC]*)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    88
lemma inj_equality: 
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    89
    "[| <a,b>:f;  <c,b>:f;  f: inj(A,B) |] ==> a=c"
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    90
apply (unfold inj_def)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    91
apply (blast dest: Pair_mem_PiD)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    92
done
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    93
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    94
lemma inj_apply_equality: "[| f:inj(A,B);  a:A;  b:A;  f`a=f`b |] ==> a=b"
13180
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
    95
by (unfold inj_def, blast)
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    96
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    97
(** A function with a left inverse is an injection **)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    98
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
    99
lemma f_imp_injective: "[| f: A->B;  ALL x:A. d(f`x)=x |] ==> f: inj(A,B)"
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   100
apply (simp (no_asm_simp) add: inj_def)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   101
apply (blast intro: subst_context [THEN box_equals])
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   102
done
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   103
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   104
lemma lam_injective: 
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   105
    "[| !!x. x:A ==> c(x): B;            
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   106
        !!x. x:A ==> d(c(x)) = x |]
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   107
     ==> (lam x:A. c(x)) : inj(A,B)"
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   108
apply (rule_tac d = "d" in f_imp_injective)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   109
apply (simp_all add: lam_type)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   110
done
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   111
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   112
(** Bijections **)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   113
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   114
lemma bij_is_inj: "f: bij(A,B) ==> f: inj(A,B)"
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   115
apply (unfold bij_def)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   116
apply (erule IntD1)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   117
done
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   118
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   119
lemma bij_is_surj: "f: bij(A,B) ==> f: surj(A,B)"
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   120
apply (unfold bij_def)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   121
apply (erule IntD2)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   122
done
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   123
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   124
(* f: bij(A,B) ==> f: A->B *)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   125
lemmas bij_is_fun = bij_is_inj [THEN inj_is_fun, standard]
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   126
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   127
lemma lam_bijective: 
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   128
    "[| !!x. x:A ==> c(x): B;            
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   129
        !!y. y:B ==> d(y): A;            
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   130
        !!x. x:A ==> d(c(x)) = x;        
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   131
        !!y. y:B ==> c(d(y)) = y         
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   132
     |] ==> (lam x:A. c(x)) : bij(A,B)"
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   133
apply (unfold bij_def)
13180
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   134
apply (blast intro!: lam_injective lam_surjective)
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   135
done
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   136
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   137
lemma RepFun_bijective: "(ALL y : x. EX! y'. f(y') = f(y))   
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   138
      ==> (lam z:{f(y). y:x}. THE y. f(y) = z) : bij({f(y). y:x}, x)"
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   139
apply (rule_tac d = "f" in lam_bijective)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   140
apply (auto simp add: the_equality2)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   141
done
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   142
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   143
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   144
(** Identity function **)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   145
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   146
lemma idI [intro!]: "a:A ==> <a,a> : id(A)"
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   147
apply (unfold id_def)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   148
apply (erule lamI)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   149
done
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   150
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   151
lemma idE [elim!]: "[| p: id(A);  !!x.[| x:A; p=<x,x> |] ==> P |] ==>  P"
13180
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   152
by (simp add: id_def lam_def, blast)
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   153
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   154
lemma id_type: "id(A) : A->A"
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   155
apply (unfold id_def)
13180
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   156
apply (rule lam_type, assumption)
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   157
done
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   158
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   159
lemma id_conv [simp]: "x:A ==> id(A)`x = x"
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   160
apply (unfold id_def)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   161
apply (simp (no_asm_simp))
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   162
done
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   163
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   164
lemma id_mono: "A<=B ==> id(A) <= id(B)"
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   165
apply (unfold id_def)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   166
apply (erule lam_mono)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   167
done
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   168
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   169
lemma id_subset_inj: "A<=B ==> id(A): inj(A,B)"
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   170
apply (simp add: inj_def id_def)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   171
apply (blast intro: lam_type) 
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   172
done
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   173
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   174
lemmas id_inj = subset_refl [THEN id_subset_inj, standard]
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   175
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   176
lemma id_surj: "id(A): surj(A,A)"
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   177
apply (unfold id_def surj_def)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   178
apply (simp (no_asm_simp))
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   179
done
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   180
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   181
lemma id_bij: "id(A): bij(A,A)"
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   182
apply (unfold bij_def)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   183
apply (blast intro: id_inj id_surj)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   184
done
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   185
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   186
lemma subset_iff_id: "A <= B <-> id(A) : A->B"
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   187
apply (unfold id_def)
13180
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   188
apply (force intro!: lam_type dest: apply_type)
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   189
done
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   190
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   191
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   192
(*** Converse of a function ***)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   193
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   194
lemma inj_converse_fun: "f: inj(A,B) ==> converse(f) : range(f)->A"
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   195
apply (unfold inj_def)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   196
apply (simp (no_asm_simp) add: Pi_iff function_def)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   197
apply (erule CollectE)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   198
apply (simp (no_asm_simp) add: apply_iff)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   199
apply (blast dest: fun_is_rel)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   200
done
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   201
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   202
(** Equations for converse(f) **)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   203
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   204
(*The premises are equivalent to saying that f is injective...*) 
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   205
lemma left_inverse_lemma:
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   206
     "[| f: A->B;  converse(f): C->A;  a: A |] ==> converse(f)`(f`a) = a"
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   207
by (blast intro: apply_Pair apply_equality converseI)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   208
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   209
lemma left_inverse [simp]: "[| f: inj(A,B);  a: A |] ==> converse(f)`(f`a) = a"
13180
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   210
by (blast intro: left_inverse_lemma inj_converse_fun inj_is_fun)
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   211
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   212
lemmas left_inverse_bij = bij_is_inj [THEN left_inverse, standard]
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   213
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   214
lemma right_inverse_lemma:
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   215
     "[| f: A->B;  converse(f): C->A;  b: C |] ==> f`(converse(f)`b) = b"
13180
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   216
apply (rule apply_Pair [THEN converseD [THEN apply_equality]], auto) 
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   217
done
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   218
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   219
(*Should the premises be f:surj(A,B), b:B for symmetry with left_inverse?
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   220
  No: they would not imply that converse(f) was a function! *)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   221
lemma right_inverse [simp]:
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   222
     "[| f: inj(A,B);  b: range(f) |] ==> f`(converse(f)`b) = b"
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   223
by (blast intro: right_inverse_lemma inj_converse_fun inj_is_fun)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   224
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   225
lemma right_inverse_bij: "[| f: bij(A,B);  b: B |] ==> f`(converse(f)`b) = b"
13180
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   226
by (force simp add: bij_def surj_range)
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   227
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   228
(** Converses of injections, surjections, bijections **)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   229
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   230
lemma inj_converse_inj: "f: inj(A,B) ==> converse(f): inj(range(f), A)"
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   231
apply (rule f_imp_injective)
13180
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   232
apply (erule inj_converse_fun, clarify) 
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   233
apply (rule right_inverse)
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   234
 apply assumption
13180
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   235
apply blast 
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   236
done
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   237
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   238
lemma inj_converse_surj: "f: inj(A,B) ==> converse(f): surj(range(f), A)"
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   239
by (blast intro: f_imp_surjective inj_converse_fun left_inverse inj_is_fun 
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   240
                 range_of_fun [THEN apply_type])
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   241
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   242
(*Adding this as an intro! rule seems to cause looping*)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   243
lemma bij_converse_bij [TC]: "f: bij(A,B) ==> converse(f): bij(B,A)"
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   244
apply (unfold bij_def)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   245
apply (fast elim: surj_range [THEN subst] inj_converse_inj inj_converse_surj)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   246
done
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   247
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   248
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   249
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   250
(** Composition of two relations **)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   251
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   252
(*The inductive definition package could derive these theorems for (r O s)*)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   253
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   254
lemma compI [intro]: "[| <a,b>:s; <b,c>:r |] ==> <a,c> : r O s"
13180
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   255
by (unfold comp_def, blast)
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   256
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   257
lemma compE [elim!]: 
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   258
    "[| xz : r O s;   
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   259
        !!x y z. [| xz=<x,z>;  <x,y>:s;  <y,z>:r |] ==> P |]
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   260
     ==> P"
13180
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   261
by (unfold comp_def, blast)
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   262
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   263
lemma compEpair: 
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   264
    "[| <a,c> : r O s;   
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   265
        !!y. [| <a,y>:s;  <y,c>:r |] ==> P |]
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   266
     ==> P"
13180
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   267
by (erule compE, simp)  
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   268
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   269
lemma converse_comp: "converse(R O S) = converse(S) O converse(R)"
13180
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   270
by blast
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   271
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   272
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   273
(** Domain and Range -- see Suppes, section 3.1 **)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   274
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   275
(*Boyer et al., Set Theory in First-Order Logic, JAR 2 (1986), 287-327*)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   276
lemma range_comp: "range(r O s) <= range(r)"
13180
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   277
by blast
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   278
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   279
lemma range_comp_eq: "domain(r) <= range(s) ==> range(r O s) = range(r)"
13180
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   280
by (rule range_comp [THEN equalityI], blast)
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   281
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   282
lemma domain_comp: "domain(r O s) <= domain(s)"
13180
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   283
by blast
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   284
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   285
lemma domain_comp_eq: "range(s) <= domain(r) ==> domain(r O s) = domain(s)"
13180
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   286
by (rule domain_comp [THEN equalityI], blast)
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   287
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   288
lemma image_comp: "(r O s)``A = r``(s``A)"
13180
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   289
by blast
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   290
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   291
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   292
(** Other results **)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   293
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   294
lemma comp_mono: "[| r'<=r; s'<=s |] ==> (r' O s') <= (r O s)"
13180
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   295
by blast
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   296
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   297
(*composition preserves relations*)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   298
lemma comp_rel: "[| s<=A*B;  r<=B*C |] ==> (r O s) <= A*C"
13180
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   299
by blast
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   300
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   301
(*associative law for composition*)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   302
lemma comp_assoc: "(r O s) O t = r O (s O t)"
13180
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   303
by blast
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   304
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   305
(*left identity of composition; provable inclusions are
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   306
        id(A) O r <= r       
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   307
  and   [| r<=A*B; B<=C |] ==> r <= id(C) O r *)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   308
lemma left_comp_id: "r<=A*B ==> id(B) O r = r"
13180
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   309
by blast
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   310
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   311
(*right identity of composition; provable inclusions are
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   312
        r O id(A) <= r
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   313
  and   [| r<=A*B; A<=C |] ==> r <= r O id(C) *)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   314
lemma right_comp_id: "r<=A*B ==> r O id(A) = r"
13180
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   315
by blast
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   316
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   317
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   318
(** Composition preserves functions, injections, and surjections **)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   319
13180
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   320
lemma comp_function: "[| function(g);  function(f) |] ==> function(f O g)"
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   321
by (unfold function_def, blast)
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   322
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   323
(*Don't think the premises can be weakened much*)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   324
lemma comp_fun: "[| g: A->B;  f: B->C |] ==> (f O g) : A->C"
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   325
apply (auto simp add: Pi_def comp_function Pow_iff comp_rel)
13180
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   326
apply (subst range_rel_subset [THEN domain_comp_eq], auto) 
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   327
done
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   328
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   329
(*Thanks to the new definition of "apply", the premise f: B->C is gone!*)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   330
lemma comp_fun_apply [simp]:
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   331
     "[| g: A->B;  a:A |] ==> (f O g)`a = f`(g`a)"
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   332
apply (frule apply_Pair, assumption) 
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   333
apply (simp add: apply_def image_comp)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   334
apply (blast dest: apply_equality) 
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   335
done
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   336
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   337
(*Simplifies compositions of lambda-abstractions*)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   338
lemma comp_lam: 
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   339
    "[| !!x. x:A ==> b(x): B |]
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   340
     ==> (lam y:B. c(y)) O (lam x:A. b(x)) = (lam x:A. c(b(x)))"
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   341
apply (subgoal_tac "(lam x:A. b(x)) : A -> B") 
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   342
 apply (rule fun_extension)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   343
   apply (blast intro: comp_fun lam_funtype)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   344
  apply (rule lam_funtype)
13180
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   345
 apply simp 
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   346
apply (simp add: lam_type) 
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   347
done
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   348
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   349
lemma comp_inj:
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   350
     "[| g: inj(A,B);  f: inj(B,C) |] ==> (f O g) : inj(A,C)"
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   351
apply (frule inj_is_fun [of g]) 
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   352
apply (frule inj_is_fun [of f]) 
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   353
apply (rule_tac d = "%y. converse (g) ` (converse (f) ` y)" in f_imp_injective)
13180
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   354
 apply (blast intro: comp_fun, simp)  
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   355
done
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   356
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   357
lemma comp_surj: 
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   358
    "[| g: surj(A,B);  f: surj(B,C) |] ==> (f O g) : surj(A,C)"
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   359
apply (unfold surj_def)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   360
apply (blast intro!: comp_fun comp_fun_apply)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   361
done
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   362
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   363
lemma comp_bij: 
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   364
    "[| g: bij(A,B);  f: bij(B,C) |] ==> (f O g) : bij(A,C)"
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   365
apply (unfold bij_def)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   366
apply (blast intro: comp_inj comp_surj)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   367
done
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   368
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   369
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   370
(** Dual properties of inj and surj -- useful for proofs from
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   371
    D Pastre.  Automatic theorem proving in set theory. 
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   372
    Artificial Intelligence, 10:1--27, 1978. **)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   373
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   374
lemma comp_mem_injD1: 
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   375
    "[| (f O g): inj(A,C);  g: A->B;  f: B->C |] ==> g: inj(A,B)"
13180
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   376
apply (unfold inj_def, force) 
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   377
done
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   378
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   379
lemma comp_mem_injD2: 
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   380
    "[| (f O g): inj(A,C);  g: surj(A,B);  f: B->C |] ==> f: inj(B,C)"
13180
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   381
apply (unfold inj_def surj_def, safe)
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   382
apply (rule_tac x1 = "x" in bspec [THEN bexE])
13269
3ba9be497c33 Tidying and introduction of various new theorems
paulson
parents: 13185
diff changeset
   383
apply (erule_tac [3] x1 = "w" in bspec [THEN bexE], assumption+, safe)
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   384
apply (rule_tac t = "op ` (g) " in subst_context)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   385
apply (erule asm_rl bspec [THEN bspec, THEN mp])+
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   386
apply (simp (no_asm_simp))
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   387
done
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   388
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   389
lemma comp_mem_surjD1: 
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   390
    "[| (f O g): surj(A,C);  g: A->B;  f: B->C |] ==> f: surj(B,C)"
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   391
apply (unfold surj_def)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   392
apply (blast intro!: comp_fun_apply [symmetric] apply_funtype)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   393
done
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   394
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   395
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   396
lemma comp_mem_surjD2: 
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   397
    "[| (f O g): surj(A,C);  g: A->B;  f: inj(B,C) |] ==> g: surj(A,B)"
13180
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   398
apply (unfold inj_def surj_def, safe)
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   399
apply (drule_tac x = "f`y" in bspec, auto)  
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   400
apply (blast intro: apply_funtype)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   401
done
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   402
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   403
(** inverses of composition **)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   404
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   405
(*left inverse of composition; one inclusion is
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   406
        f: A->B ==> id(A) <= converse(f) O f *)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   407
lemma left_comp_inverse: "f: inj(A,B) ==> converse(f) O f = id(A)"
13180
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   408
apply (unfold inj_def, clarify) 
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   409
apply (rule equalityI) 
13180
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   410
 apply (auto simp add: apply_iff, blast)  
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   411
done
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   412
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   413
(*right inverse of composition; one inclusion is
13180
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   414
                f: A->B ==> f O converse(f) <= id(B) *)
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   415
lemma right_comp_inverse: 
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   416
    "f: surj(A,B) ==> f O converse(f) = id(B)"
13180
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   417
apply (simp add: surj_def, clarify) 
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   418
apply (rule equalityI)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   419
apply (best elim: domain_type range_type dest: apply_equality2)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   420
apply (blast intro: apply_Pair)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   421
done
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   422
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   423
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   424
(** Proving that a function is a bijection **)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   425
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   426
lemma comp_eq_id_iff: 
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   427
    "[| f: A->B;  g: B->A |] ==> f O g = id(B) <-> (ALL y:B. f`(g`y)=y)"
13180
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   428
apply (unfold id_def, safe)
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   429
 apply (drule_tac t = "%h. h`y " in subst_context)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   430
 apply simp
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   431
apply (rule fun_extension)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   432
  apply (blast intro: comp_fun lam_type)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   433
 apply auto
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   434
done
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   435
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   436
lemma fg_imp_bijective: 
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   437
    "[| f: A->B;  g: B->A;  f O g = id(B);  g O f = id(A) |] ==> f : bij(A,B)"
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   438
apply (unfold bij_def)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   439
apply (simp add: comp_eq_id_iff)
13180
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   440
apply (blast intro: f_imp_injective f_imp_surjective apply_funtype)
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   441
done
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   442
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   443
lemma nilpotent_imp_bijective: "[| f: A->A;  f O f = id(A) |] ==> f : bij(A,A)"
13180
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   444
by (blast intro: fg_imp_bijective)
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   445
13180
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   446
lemma invertible_imp_bijective:
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   447
     "[| converse(f): B->A;  f: A->B |] ==> f : bij(A,B)"
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   448
by (simp add: fg_imp_bijective comp_eq_id_iff 
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   449
              left_inverse_lemma right_inverse_lemma)
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   450
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   451
(** Unions of functions -- cf similar theorems on func.ML **)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   452
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   453
(*Theorem by KG, proof by LCP*)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   454
lemma inj_disjoint_Un:
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   455
     "[| f: inj(A,B);  g: inj(C,D);  B Int D = 0 |]  
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   456
      ==> (lam a: A Un C. if a:A then f`a else g`a) : inj(A Un C, B Un D)"
13180
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   457
apply (rule_tac d = "%z. if z:B then converse (f) `z else converse (g) `z" 
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   458
       in lam_injective)
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   459
apply (auto simp add: inj_is_fun [THEN apply_type])
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   460
apply (blast intro: inj_is_fun [THEN apply_type])
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   461
done
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   462
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   463
lemma surj_disjoint_Un: 
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   464
    "[| f: surj(A,B);  g: surj(C,D);  A Int C = 0 |]   
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   465
     ==> (f Un g) : surj(A Un C, B Un D)"
13180
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   466
apply (simp add: surj_def fun_disjoint_Un) 
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   467
apply (blast dest!: domain_of_fun 
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   468
	     intro!: fun_disjoint_apply1 fun_disjoint_apply2)
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   469
done
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   470
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   471
(*A simple, high-level proof; the version for injections follows from it,
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   472
  using  f:inj(A,B) <-> f:bij(A,range(f))  *)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   473
lemma bij_disjoint_Un:
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   474
     "[| f: bij(A,B);  g: bij(C,D);  A Int C = 0;  B Int D = 0 |]  
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   475
      ==> (f Un g) : bij(A Un C, B Un D)"
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   476
apply (rule invertible_imp_bijective)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   477
apply (subst converse_Un)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   478
apply (auto intro: fun_disjoint_Un bij_is_fun bij_converse_bij)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   479
done
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   480
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   481
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   482
(** Restrictions as surjections and bijections *)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   483
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   484
lemma surj_image:
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   485
    "f: Pi(A,B) ==> f: surj(A, f``A)"
13180
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   486
apply (simp add: surj_def) 
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   487
apply (blast intro: apply_equality apply_Pair Pi_type) 
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   488
done
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   489
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   490
lemma restrict_image [simp]: "restrict(f,A) `` B = f `` (A Int B)"
13180
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   491
by (auto simp add: restrict_def)
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   492
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   493
lemma restrict_inj: 
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   494
    "[| f: inj(A,B);  C<=A |] ==> restrict(f,C): inj(C,B)"
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   495
apply (unfold inj_def)
13180
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   496
apply (safe elim!: restrict_type2, auto) 
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   497
done
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   498
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   499
lemma restrict_surj: "[| f: Pi(A,B);  C<=A |] ==> restrict(f,C): surj(C, f``C)"
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   500
apply (insert restrict_type2 [THEN surj_image])
13180
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   501
apply (simp add: restrict_image) 
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   502
done
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   503
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   504
lemma restrict_bij: 
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   505
    "[| f: inj(A,B);  C<=A |] ==> restrict(f,C): bij(C, f``C)"
13180
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   506
apply (simp add: inj_def bij_def)
a82610e49b2d tidied; stronger lemmas about functions
paulson
parents: 13176
diff changeset
   507
apply (blast intro: restrict_surj surj_is_fun)
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   508
done
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   509
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   510
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   511
(*** Lemmas for Ramsey's Theorem ***)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   512
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   513
lemma inj_weaken_type: "[| f: inj(A,B);  B<=D |] ==> f: inj(A,D)"
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   514
apply (unfold inj_def)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   515
apply (blast intro: fun_weaken_type)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   516
done
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   517
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   518
lemma inj_succ_restrict:
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   519
     "[| f: inj(succ(m), A) |] ==> restrict(f,m) : inj(m, A-{f`m})"
13269
3ba9be497c33 Tidying and introduction of various new theorems
paulson
parents: 13185
diff changeset
   520
apply (rule restrict_bij [THEN bij_is_inj, THEN inj_weaken_type], assumption, blast)
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   521
apply (unfold inj_def)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   522
apply (fast elim: range_type mem_irrefl dest: apply_equality)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   523
done
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   524
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   525
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   526
lemma inj_extend: 
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   527
    "[| f: inj(A,B);  a~:A;  b~:B |]  
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   528
     ==> cons(<a,b>,f) : inj(cons(a,A), cons(b,B))"
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   529
apply (unfold inj_def)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   530
apply (force intro: apply_type  simp add: fun_extend)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   531
done
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   532
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   533
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   534
ML
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   535
{*
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   536
val comp_def = thm "comp_def";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   537
val id_def = thm "id_def";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   538
val inj_def = thm "inj_def";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   539
val surj_def = thm "surj_def";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   540
val bij_def = thm "bij_def";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   541
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   542
val surj_is_fun = thm "surj_is_fun";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   543
val fun_is_surj = thm "fun_is_surj";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   544
val surj_range = thm "surj_range";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   545
val f_imp_surjective = thm "f_imp_surjective";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   546
val lam_surjective = thm "lam_surjective";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   547
val cantor_surj = thm "cantor_surj";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   548
val inj_is_fun = thm "inj_is_fun";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   549
val inj_equality = thm "inj_equality";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   550
val inj_apply_equality = thm "inj_apply_equality";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   551
val f_imp_injective = thm "f_imp_injective";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   552
val lam_injective = thm "lam_injective";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   553
val bij_is_inj = thm "bij_is_inj";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   554
val bij_is_surj = thm "bij_is_surj";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   555
val bij_is_fun = thm "bij_is_fun";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   556
val lam_bijective = thm "lam_bijective";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   557
val RepFun_bijective = thm "RepFun_bijective";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   558
val idI = thm "idI";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   559
val idE = thm "idE";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   560
val id_type = thm "id_type";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   561
val id_conv = thm "id_conv";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   562
val id_mono = thm "id_mono";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   563
val id_subset_inj = thm "id_subset_inj";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   564
val id_inj = thm "id_inj";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   565
val id_surj = thm "id_surj";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   566
val id_bij = thm "id_bij";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   567
val subset_iff_id = thm "subset_iff_id";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   568
val inj_converse_fun = thm "inj_converse_fun";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   569
val left_inverse = thm "left_inverse";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   570
val left_inverse_bij = thm "left_inverse_bij";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   571
val right_inverse = thm "right_inverse";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   572
val right_inverse_bij = thm "right_inverse_bij";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   573
val inj_converse_inj = thm "inj_converse_inj";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   574
val inj_converse_surj = thm "inj_converse_surj";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   575
val bij_converse_bij = thm "bij_converse_bij";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   576
val compI = thm "compI";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   577
val compE = thm "compE";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   578
val compEpair = thm "compEpair";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   579
val converse_comp = thm "converse_comp";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   580
val range_comp = thm "range_comp";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   581
val range_comp_eq = thm "range_comp_eq";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   582
val domain_comp = thm "domain_comp";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   583
val domain_comp_eq = thm "domain_comp_eq";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   584
val image_comp = thm "image_comp";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   585
val comp_mono = thm "comp_mono";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   586
val comp_rel = thm "comp_rel";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   587
val comp_assoc = thm "comp_assoc";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   588
val left_comp_id = thm "left_comp_id";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   589
val right_comp_id = thm "right_comp_id";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   590
val comp_function = thm "comp_function";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   591
val comp_fun = thm "comp_fun";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   592
val comp_fun_apply = thm "comp_fun_apply";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   593
val comp_lam = thm "comp_lam";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   594
val comp_inj = thm "comp_inj";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   595
val comp_surj = thm "comp_surj";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   596
val comp_bij = thm "comp_bij";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   597
val comp_mem_injD1 = thm "comp_mem_injD1";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   598
val comp_mem_injD2 = thm "comp_mem_injD2";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   599
val comp_mem_surjD1 = thm "comp_mem_surjD1";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   600
val comp_mem_surjD2 = thm "comp_mem_surjD2";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   601
val left_comp_inverse = thm "left_comp_inverse";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   602
val right_comp_inverse = thm "right_comp_inverse";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   603
val comp_eq_id_iff = thm "comp_eq_id_iff";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   604
val fg_imp_bijective = thm "fg_imp_bijective";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   605
val nilpotent_imp_bijective = thm "nilpotent_imp_bijective";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   606
val invertible_imp_bijective = thm "invertible_imp_bijective";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   607
val inj_disjoint_Un = thm "inj_disjoint_Un";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   608
val surj_disjoint_Un = thm "surj_disjoint_Un";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   609
val bij_disjoint_Un = thm "bij_disjoint_Un";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   610
val surj_image = thm "surj_image";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   611
val restrict_image = thm "restrict_image";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   612
val restrict_inj = thm "restrict_inj";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   613
val restrict_surj = thm "restrict_surj";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   614
val restrict_bij = thm "restrict_bij";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   615
val inj_weaken_type = thm "inj_weaken_type";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   616
val inj_succ_restrict = thm "inj_succ_restrict";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   617
val inj_extend = thm "inj_extend";
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 9570
diff changeset
   618
*}
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   619
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   620
end