src/HOL/Library/FuncSet.thy
author paulson
Fri, 27 Sep 2002 10:36:21 +0200
changeset 13593 e39f0751e4bf
parent 13586 0f339348df0e
child 13595 7e6cdcd113a2
permissions -rw-r--r--
Tidied. New Pi-theorem.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13586
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
     1
(*  Title:      HOL/Library/FuncSet.thy
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
     2
    ID:         $Id$
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
     3
    Author:     Florian Kammueller and Lawrence C Paulson
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
     4
*)
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
     5
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
     6
header {*
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
     7
  \title{Pi and Function Sets}
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
     8
  \author{Florian Kammueller and Lawrence C Paulson}
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
     9
*}
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    10
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    11
theory FuncSet = Main:
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    12
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    13
constdefs
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    14
  Pi      :: "['a set, 'a => 'b set] => ('a => 'b) set"
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    15
    "Pi A B == {f. \<forall>x. x \<in> A --> f(x) \<in> B(x)}"
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    16
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    17
  extensional :: "'a set => ('a => 'b) set"
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    18
    "extensional A == {f. \<forall>x. x~:A --> f(x) = arbitrary}"
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    19
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    20
  restrict :: "['a => 'b, 'a set] => ('a => 'b)"
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    21
    "restrict f A == (%x. if x \<in> A then f x else arbitrary)"
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    22
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    23
syntax
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    24
  "@Pi"  :: "[pttrn, 'a set, 'b set] => ('a => 'b) set"  ("(3PI _:_./ _)" 10)
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    25
  funcset :: "['a set, 'b set] => ('a => 'b) set"      (infixr "->" 60)
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    26
  "@lam" :: "[pttrn, 'a set, 'a => 'b] => ('a=>'b)"  ("(3%_:_./ _)" [0,0,3] 3)
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    27
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    28
syntax (xsymbols)
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    29
  "@Pi" :: "[pttrn, 'a set, 'b set] => ('a => 'b) set"  ("(3\<Pi> _\<in>_./ _)"   10)
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    30
  funcset :: "['a set, 'b set] => ('a => 'b) set"  (infixr "\<rightarrow>" 60) 
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    31
  "@lam" :: "[pttrn, 'a set, 'a => 'b] => ('a=>'b)"  ("(3\<lambda>_\<in>_./ _)" [0,0,3] 3)
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    32
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    33
translations
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    34
  "PI x:A. B" => "Pi A (%x. B)"
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    35
  "A -> B"    => "Pi A (_K B)"
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    36
  "%x:A. f"  == "restrict (%x. f) A"
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    37
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    38
constdefs
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    39
  compose :: "['a set, 'b => 'c, 'a => 'b] => ('a => 'c)"
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    40
  "compose A g f == \<lambda>x\<in>A. g (f x)"
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    41
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    42
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    43
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    44
subsection{*Basic Properties of @{term Pi}*}
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    45
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    46
lemma Pi_I: "(!!x. x \<in> A ==> f x \<in> B x) ==> f \<in> Pi A B"
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    47
by (simp add: Pi_def)
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    48
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    49
lemma funcsetI: "(!!x. x \<in> A ==> f x \<in> B) ==> f \<in> A -> B"
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    50
by (simp add: Pi_def)
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    51
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    52
lemma Pi_mem: "[|f: Pi A B; x \<in> A|] ==> f x \<in> B x"
13593
e39f0751e4bf Tidied. New Pi-theorem.
paulson
parents: 13586
diff changeset
    53
by (simp add: Pi_def)
13586
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    54
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    55
lemma funcset_mem: "[|f \<in> A -> B; x \<in> A|] ==> f x \<in> B"
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    56
by (simp add: Pi_def)
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    57
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    58
lemma Pi_eq_empty: "((PI x: A. B x) = {}) = (\<exists>x\<in>A. B(x) = {})"
13593
e39f0751e4bf Tidied. New Pi-theorem.
paulson
parents: 13586
diff changeset
    59
apply (simp add: Pi_def, auto)
13586
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    60
txt{*Converse direction requires Axiom of Choice to exhibit a function
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    61
picking an element from each non-empty @{term "B x"}*}
13593
e39f0751e4bf Tidied. New Pi-theorem.
paulson
parents: 13586
diff changeset
    62
apply (drule_tac x = "%u. SOME y. y \<in> B u" in spec, auto)
e39f0751e4bf Tidied. New Pi-theorem.
paulson
parents: 13586
diff changeset
    63
apply (cut_tac P= "%y. y \<in> B x" in some_eq_ex, auto) 
13586
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    64
done
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    65
13593
e39f0751e4bf Tidied. New Pi-theorem.
paulson
parents: 13586
diff changeset
    66
lemma Pi_empty [simp]: "Pi {} B = UNIV"
e39f0751e4bf Tidied. New Pi-theorem.
paulson
parents: 13586
diff changeset
    67
by (simp add: Pi_def)
e39f0751e4bf Tidied. New Pi-theorem.
paulson
parents: 13586
diff changeset
    68
e39f0751e4bf Tidied. New Pi-theorem.
paulson
parents: 13586
diff changeset
    69
lemma Pi_UNIV [simp]: "A -> UNIV = UNIV"
e39f0751e4bf Tidied. New Pi-theorem.
paulson
parents: 13586
diff changeset
    70
by (simp add: Pi_def)
13586
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    71
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    72
text{*Covariance of Pi-sets in their second argument*}
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    73
lemma Pi_mono: "(!!x. x \<in> A ==> B x <= C x) ==> Pi A B <= Pi A C"
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    74
by (simp add: Pi_def, blast)
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    75
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    76
text{*Contravariance of Pi-sets in their first argument*}
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    77
lemma Pi_anti_mono: "A' <= A ==> Pi A B <= Pi A' B"
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    78
by (simp add: Pi_def, blast)
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    79
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    80
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    81
subsection{*Composition With a Restricted Domain: @{term compose}*}
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    82
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    83
lemma funcset_compose: 
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    84
     "[| f \<in> A -> B; g \<in> B -> C |]==> compose A g f \<in> A -> C"
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    85
by (simp add: Pi_def compose_def restrict_def)
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    86
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    87
lemma compose_assoc:
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    88
     "[| f \<in> A -> B; g \<in> B -> C; h \<in> C -> D |] 
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    89
      ==> compose A h (compose A g f) = compose A (compose B h g) f"
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    90
by (simp add: expand_fun_eq Pi_def compose_def restrict_def) 
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    91
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    92
lemma compose_eq: "x \<in> A ==> compose A g f x = g(f(x))"
13593
e39f0751e4bf Tidied. New Pi-theorem.
paulson
parents: 13586
diff changeset
    93
by (simp add: compose_def restrict_def)
13586
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    94
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    95
lemma surj_compose: "[| f ` A = B; g ` B = C |] ==> compose A g f ` A = C"
13593
e39f0751e4bf Tidied. New Pi-theorem.
paulson
parents: 13586
diff changeset
    96
by (auto simp add: image_def compose_eq)
13586
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    97
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    98
lemma inj_on_compose:
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
    99
     "[| f ` A = B; inj_on f A; inj_on g B |] ==> inj_on (compose A g f) A"
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   100
by (auto simp add: inj_on_def compose_eq)
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   101
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   102
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   103
subsection{*Bounded Abstraction: @{term restrict}*}
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   104
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   105
lemma restrict_in_funcset: "(!!x. x \<in> A ==> f x \<in> B) ==> (\<lambda>x\<in>A. f x) \<in> A -> B"
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   106
by (simp add: Pi_def restrict_def)
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   107
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   108
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   109
lemma restrictI: "(!!x. x \<in> A ==> f x \<in> B x) ==> (\<lambda>x\<in>A. f x) \<in> Pi A B"
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   110
by (simp add: Pi_def restrict_def)
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   111
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   112
lemma restrict_apply [simp]:
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   113
     "(\<lambda>y\<in>A. f y) x = (if x \<in> A then f x else arbitrary)"
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   114
by (simp add: restrict_def)
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   115
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   116
lemma restrict_ext: 
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   117
    "(!!x. x \<in> A ==> f x = g x) ==> (\<lambda>x\<in>A. f x) = (\<lambda>x\<in>A. g x)"
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   118
by (simp add: expand_fun_eq Pi_def Pi_def restrict_def)
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   119
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   120
lemma inj_on_restrict_eq: "inj_on (restrict f A) A = inj_on f A"
13593
e39f0751e4bf Tidied. New Pi-theorem.
paulson
parents: 13586
diff changeset
   121
by (simp add: inj_on_def restrict_def)
13586
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   122
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   123
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   124
lemma Id_compose:
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   125
     "[|f \<in> A -> B;  f \<in> extensional A|] ==> compose A (\<lambda>y\<in>B. y) f = f"
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   126
by (auto simp add: expand_fun_eq compose_def extensional_def Pi_def)
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   127
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   128
lemma compose_Id:
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   129
     "[|g \<in> A -> B;  g \<in> extensional A|] ==> compose A g (\<lambda>x\<in>A. x) = g"
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   130
by (auto simp add: expand_fun_eq compose_def extensional_def Pi_def)
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   131
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   132
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   133
subsection{*Extensionality*}
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   134
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   135
lemma extensional_arb: "[|f \<in> extensional A; x\<notin> A|] ==> f x = arbitrary"
13593
e39f0751e4bf Tidied. New Pi-theorem.
paulson
parents: 13586
diff changeset
   136
by (simp add: extensional_def)
13586
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   137
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   138
lemma restrict_extensional [simp]: "restrict f A \<in> extensional A"
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   139
by (simp add: restrict_def extensional_def)
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   140
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   141
lemma compose_extensional [simp]: "compose A f g \<in> extensional A"
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   142
by (simp add: compose_def)
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   143
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   144
lemma extensionalityI:
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   145
     "[| f \<in> extensional A; g \<in> extensional A; 
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   146
         !!x. x\<in>A ==> f x = g x |] ==> f = g"
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   147
by (force simp add: expand_fun_eq extensional_def)
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   148
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   149
lemma Inv_funcset: "f ` A = B ==> (\<lambda>x\<in>B. Inv A f x) : B -> A"
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   150
apply (unfold Inv_def)
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   151
apply (fast intro: restrict_in_funcset someI2)
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   152
done
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   153
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   154
lemma compose_Inv_id:
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   155
     "[| inj_on f A;  f ` A = B |]  
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   156
      ==> compose A (\<lambda>y\<in>B. Inv A f y) f = (\<lambda>x\<in>A. x)"
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   157
apply (simp add: compose_def)
13593
e39f0751e4bf Tidied. New Pi-theorem.
paulson
parents: 13586
diff changeset
   158
apply (rule restrict_ext, auto)
13586
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   159
apply (erule subst)
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   160
apply (simp add: Inv_f_f)
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   161
done
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   162
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   163
lemma compose_id_Inv:
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   164
     "f ` A = B ==> compose B f (\<lambda>y\<in>B. Inv A f y) = (\<lambda>x\<in>B. x)"
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   165
apply (simp add: compose_def)
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   166
apply (rule restrict_ext)
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   167
apply (simp add: f_Inv_f)
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   168
done
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   169
0f339348df0e new theory for Pi-sets, restrict, etc.
paulson
parents:
diff changeset
   170
end