tuned FuncSet
authornipkow
Mon Jun 22 20:59:12 2009 +0200 (2009-06-22)
changeset 31754b5260f5272a4
parent 31747 8361d7a517b4
child 31755 78529fc872b1
tuned FuncSet
src/HOL/Algebra/Bij.thy
src/HOL/Algebra/Group.thy
src/HOL/Algebra/Sylow.thy
src/HOL/Library/FuncSet.thy
src/HOL/MetisExamples/Abstraction.thy
src/HOL/ex/Tarski.thy
     1.1 --- a/src/HOL/Algebra/Bij.thy	Mon Jun 22 08:17:52 2009 +0200
     1.2 +++ b/src/HOL/Algebra/Bij.thy	Mon Jun 22 20:59:12 2009 +0200
     1.3 @@ -50,7 +50,7 @@
     1.4      apply (simp add: compose_Bij)
     1.5     apply (simp add: id_Bij)
     1.6    apply (simp add: compose_Bij)
     1.7 -  apply (blast intro: compose_assoc [symmetric] Bij_imp_funcset)
     1.8 +  apply (blast intro: compose_assoc [symmetric] dest: Bij_imp_funcset)
     1.9   apply (simp add: id_Bij Bij_imp_funcset Bij_imp_extensional, simp)
    1.10  apply (blast intro: Bij_compose_restrict_eq restrict_Inv_Bij)
    1.11  done
     2.1 --- a/src/HOL/Algebra/Group.thy	Mon Jun 22 08:17:52 2009 +0200
     2.2 +++ b/src/HOL/Algebra/Group.thy	Mon Jun 22 20:59:12 2009 +0200
     2.3 @@ -542,10 +542,8 @@
     2.4        (\<forall>x \<in> carrier G. \<forall>y \<in> carrier G. h (x \<otimes>\<^bsub>G\<^esub> y) = h x \<otimes>\<^bsub>H\<^esub> h y)}"
     2.5  
     2.6  lemma (in group) hom_compose:
     2.7 -     "[|h \<in> hom G H; i \<in> hom H I|] ==> compose (carrier G) i h \<in> hom G I"
     2.8 -apply (auto simp add: hom_def funcset_compose) 
     2.9 -apply (simp add: compose_def Pi_def)
    2.10 -done
    2.11 +  "[|h \<in> hom G H; i \<in> hom H I|] ==> compose (carrier G) i h \<in> hom G I"
    2.12 +by (fastsimp simp add: hom_def compose_def)
    2.13  
    2.14  constdefs
    2.15    iso :: "_ => _ => ('a => 'b) set"  (infixr "\<cong>" 60)
    2.16 @@ -568,7 +566,7 @@
    2.17  
    2.18  lemma DirProd_commute_iso:
    2.19    shows "(\<lambda>(x,y). (y,x)) \<in> (G \<times>\<times> H) \<cong> (H \<times>\<times> G)"
    2.20 -by (auto simp add: iso_def hom_def inj_on_def bij_betw_def Pi_def)
    2.21 +by (auto simp add: iso_def hom_def inj_on_def bij_betw_def)
    2.22  
    2.23  lemma DirProd_assoc_iso:
    2.24    shows "(\<lambda>(x,y,z). (x,(y,z))) \<in> (G \<times>\<times> H \<times>\<times> I) \<cong> (G \<times>\<times> (H \<times>\<times> I))"
    2.25 @@ -592,7 +590,7 @@
    2.26    "x \<in> carrier G ==> h x \<in> carrier H"
    2.27  proof -
    2.28    assume "x \<in> carrier G"
    2.29 -  with homh [unfolded hom_def] show ?thesis by (auto simp add: Pi_def)
    2.30 +  with homh [unfolded hom_def] show ?thesis by auto
    2.31  qed
    2.32  
    2.33  lemma (in group_hom) one_closed [simp]:
     3.1 --- a/src/HOL/Algebra/Sylow.thy	Mon Jun 22 08:17:52 2009 +0200
     3.2 +++ b/src/HOL/Algebra/Sylow.thy	Mon Jun 22 20:59:12 2009 +0200
     3.3 @@ -371,4 +371,3 @@
     3.4  done
     3.5  
     3.6  end
     3.7 -
     4.1 --- a/src/HOL/Library/FuncSet.thy	Mon Jun 22 08:17:52 2009 +0200
     4.2 +++ b/src/HOL/Library/FuncSet.thy	Mon Jun 22 20:59:12 2009 +0200
     4.3 @@ -51,7 +51,7 @@
     4.4  
     4.5  subsection{*Basic Properties of @{term Pi}*}
     4.6  
     4.7 -lemma Pi_I: "(!!x. x \<in> A ==> f x \<in> B x) ==> f \<in> Pi A B"
     4.8 +lemma Pi_I[intro!]: "(!!x. x \<in> A ==> f x \<in> B x) ==> f \<in> Pi A B"
     4.9    by (simp add: Pi_def)
    4.10  
    4.11  lemma Pi_I'[simp]: "(!!x. x : A --> f x : B x) ==> f : Pi A B"
    4.12 @@ -63,13 +63,17 @@
    4.13  lemma Pi_mem: "[|f: Pi A B; x \<in> A|] ==> f x \<in> B x"
    4.14    by (simp add: Pi_def)
    4.15  
    4.16 +lemma ballE [elim]:
    4.17 +  "f : Pi A B ==> (f x : B x ==> Q) ==> (x ~: A ==> Q) ==> Q"
    4.18 +by(auto simp: Pi_def)
    4.19 +
    4.20  lemma funcset_mem: "[|f \<in> A -> B; x \<in> A|] ==> f x \<in> B"
    4.21    by (simp add: Pi_def)
    4.22  
    4.23  lemma funcset_image: "f \<in> A\<rightarrow>B ==> f ` A \<subseteq> B"
    4.24 -  by (auto simp add: Pi_def)
    4.25 +by auto
    4.26  
    4.27 -lemma Pi_eq_empty: "((PI x: A. B x) = {}) = (\<exists>x\<in>A. B(x) = {})"
    4.28 +lemma Pi_eq_empty[simp]: "((PI x: A. B x) = {}) = (\<exists>x\<in>A. B(x) = {})"
    4.29  apply (simp add: Pi_def, auto)
    4.30  txt{*Converse direction requires Axiom of Choice to exhibit a function
    4.31  picking an element from each non-empty @{term "B x"}*}
    4.32 @@ -78,36 +82,36 @@
    4.33  done
    4.34  
    4.35  lemma Pi_empty [simp]: "Pi {} B = UNIV"
    4.36 -  by (simp add: Pi_def)
    4.37 +by (simp add: Pi_def)
    4.38  
    4.39  lemma Pi_UNIV [simp]: "A -> UNIV = UNIV"
    4.40 -  by (simp add: Pi_def)
    4.41 +by (simp add: Pi_def)
    4.42  (*
    4.43  lemma funcset_id [simp]: "(%x. x): A -> A"
    4.44    by (simp add: Pi_def)
    4.45  *)
    4.46  text{*Covariance of Pi-sets in their second argument*}
    4.47  lemma Pi_mono: "(!!x. x \<in> A ==> B x <= C x) ==> Pi A B <= Pi A C"
    4.48 -  by (simp add: Pi_def, blast)
    4.49 +by auto
    4.50  
    4.51  text{*Contravariance of Pi-sets in their first argument*}
    4.52  lemma Pi_anti_mono: "A' <= A ==> Pi A B <= Pi A' B"
    4.53 -  by (simp add: Pi_def, blast)
    4.54 +by auto
    4.55  
    4.56  
    4.57  subsection{*Composition With a Restricted Domain: @{term compose}*}
    4.58  
    4.59  lemma funcset_compose:
    4.60 -    "[| f \<in> A -> B; g \<in> B -> C |]==> compose A g f \<in> A -> C"
    4.61 -  by (simp add: Pi_def compose_def restrict_def)
    4.62 +  "[| f \<in> A -> B; g \<in> B -> C |]==> compose A g f \<in> A -> C"
    4.63 +by (simp add: Pi_def compose_def restrict_def)
    4.64  
    4.65  lemma compose_assoc:
    4.66      "[| f \<in> A -> B; g \<in> B -> C; h \<in> C -> D |]
    4.67        ==> compose A h (compose A g f) = compose A (compose B h g) f"
    4.68 -  by (simp add: expand_fun_eq Pi_def compose_def restrict_def)
    4.69 +by (simp add: expand_fun_eq Pi_def compose_def restrict_def)
    4.70  
    4.71  lemma compose_eq: "x \<in> A ==> compose A g f x = g(f(x))"
    4.72 -  by (simp add: compose_def restrict_def)
    4.73 +by (simp add: compose_def restrict_def)
    4.74  
    4.75  lemma surj_compose: "[| f ` A = B; g ` B = C |] ==> compose A g f ` A = C"
    4.76    by (auto simp add: image_def compose_eq)
    4.77 @@ -118,7 +122,7 @@
    4.78  lemma restrict_in_funcset: "(!!x. x \<in> A ==> f x \<in> B) ==> (\<lambda>x\<in>A. f x) \<in> A -> B"
    4.79    by (simp add: Pi_def restrict_def)
    4.80  
    4.81 -lemma restrictI: "(!!x. x \<in> A ==> f x \<in> B x) ==> (\<lambda>x\<in>A. f x) \<in> Pi A B"
    4.82 +lemma restrictI[intro!]: "(!!x. x \<in> A ==> f x \<in> B x) ==> (\<lambda>x\<in>A. f x) \<in> Pi A B"
    4.83    by (simp add: Pi_def restrict_def)
    4.84  
    4.85  lemma restrict_apply [simp]:
    4.86 @@ -127,7 +131,7 @@
    4.87  
    4.88  lemma restrict_ext:
    4.89      "(!!x. x \<in> A ==> f x = g x) ==> (\<lambda>x\<in>A. f x) = (\<lambda>x\<in>A. g x)"
    4.90 -  by (simp add: expand_fun_eq Pi_def Pi_def restrict_def)
    4.91 +  by (simp add: expand_fun_eq Pi_def restrict_def)
    4.92  
    4.93  lemma inj_on_restrict_eq [simp]: "inj_on (restrict f A) A = inj_on f A"
    4.94    by (simp add: inj_on_def restrict_def)
    4.95 @@ -150,68 +154,66 @@
    4.96  the theorems belong here, or need at least @{term Hilbert_Choice}.*}
    4.97  
    4.98  lemma bij_betw_imp_funcset: "bij_betw f A B \<Longrightarrow> f \<in> A \<rightarrow> B"
    4.99 -  by (auto simp add: bij_betw_def inj_on_Inv Pi_def)
   4.100 +by (auto simp add: bij_betw_def inj_on_Inv)
   4.101  
   4.102  lemma inj_on_compose:
   4.103 -    "[| bij_betw f A B; inj_on g B |] ==> inj_on (compose A g f) A"
   4.104 -  by (auto simp add: bij_betw_def inj_on_def compose_eq)
   4.105 +  "[| bij_betw f A B; inj_on g B |] ==> inj_on (compose A g f) A"
   4.106 +by (auto simp add: bij_betw_def inj_on_def compose_eq)
   4.107  
   4.108  lemma bij_betw_compose:
   4.109 -    "[| bij_betw f A B; bij_betw g B C |] ==> bij_betw (compose A g f) A C"
   4.110 -  apply (simp add: bij_betw_def compose_eq inj_on_compose)
   4.111 -  apply (auto simp add: compose_def image_def)
   4.112 -  done
   4.113 +  "[| bij_betw f A B; bij_betw g B C |] ==> bij_betw (compose A g f) A C"
   4.114 +apply (simp add: bij_betw_def compose_eq inj_on_compose)
   4.115 +apply (auto simp add: compose_def image_def)
   4.116 +done
   4.117  
   4.118  lemma bij_betw_restrict_eq [simp]:
   4.119 -     "bij_betw (restrict f A) A B = bij_betw f A B"
   4.120 -  by (simp add: bij_betw_def)
   4.121 +  "bij_betw (restrict f A) A B = bij_betw f A B"
   4.122 +by (simp add: bij_betw_def)
   4.123  
   4.124  
   4.125  subsection{*Extensionality*}
   4.126  
   4.127  lemma extensional_arb: "[|f \<in> extensional A; x\<notin> A|] ==> f x = undefined"
   4.128 -  by (simp add: extensional_def)
   4.129 +by (simp add: extensional_def)
   4.130  
   4.131  lemma restrict_extensional [simp]: "restrict f A \<in> extensional A"
   4.132 -  by (simp add: restrict_def extensional_def)
   4.133 +by (simp add: restrict_def extensional_def)
   4.134  
   4.135  lemma compose_extensional [simp]: "compose A f g \<in> extensional A"
   4.136 -  by (simp add: compose_def)
   4.137 +by (simp add: compose_def)
   4.138  
   4.139  lemma extensionalityI:
   4.140 -    "[| f \<in> extensional A; g \<in> extensional A;
   4.141 +  "[| f \<in> extensional A; g \<in> extensional A;
   4.142        !!x. x\<in>A ==> f x = g x |] ==> f = g"
   4.143 -  by (force simp add: expand_fun_eq extensional_def)
   4.144 +by (force simp add: expand_fun_eq extensional_def)
   4.145  
   4.146  lemma Inv_funcset: "f ` A = B ==> (\<lambda>x\<in>B. Inv A f x) : B -> A"
   4.147 -  by (unfold Inv_def) (fast intro: restrict_in_funcset someI2)
   4.148 +by (unfold Inv_def) (fast intro: someI2)
   4.149  
   4.150  lemma compose_Inv_id:
   4.151 -    "bij_betw f A B ==> compose A (\<lambda>y\<in>B. Inv A f y) f = (\<lambda>x\<in>A. x)"
   4.152 -  apply (simp add: bij_betw_def compose_def)
   4.153 -  apply (rule restrict_ext, auto)
   4.154 -  apply (erule subst)
   4.155 -  apply (simp add: Inv_f_f)
   4.156 -  done
   4.157 +  "bij_betw f A B ==> compose A (\<lambda>y\<in>B. Inv A f y) f = (\<lambda>x\<in>A. x)"
   4.158 +apply (simp add: bij_betw_def compose_def)
   4.159 +apply (rule restrict_ext, auto)
   4.160 +apply (erule subst)
   4.161 +apply (simp add: Inv_f_f)
   4.162 +done
   4.163  
   4.164  lemma compose_id_Inv:
   4.165 -    "f ` A = B ==> compose B f (\<lambda>y\<in>B. Inv A f y) = (\<lambda>x\<in>B. x)"
   4.166 -  apply (simp add: compose_def)
   4.167 -  apply (rule restrict_ext)
   4.168 -  apply (simp add: f_Inv_f)
   4.169 -  done
   4.170 +  "f ` A = B ==> compose B f (\<lambda>y\<in>B. Inv A f y) = (\<lambda>x\<in>B. x)"
   4.171 +apply (simp add: compose_def)
   4.172 +apply (rule restrict_ext)
   4.173 +apply (simp add: f_Inv_f)
   4.174 +done
   4.175  
   4.176  
   4.177  subsection{*Cardinality*}
   4.178  
   4.179  lemma card_inj: "[|f \<in> A\<rightarrow>B; inj_on f A; finite B|] ==> card(A) \<le> card(B)"
   4.180 -  apply (rule card_inj_on_le)
   4.181 -    apply (auto simp add: Pi_def)
   4.182 -  done
   4.183 +by (rule card_inj_on_le) auto
   4.184  
   4.185  lemma card_bij:
   4.186 -     "[|f \<in> A\<rightarrow>B; inj_on f A;
   4.187 -        g \<in> B\<rightarrow>A; inj_on g B; finite A; finite B|] ==> card(A) = card(B)"
   4.188 -  by (blast intro: card_inj order_antisym)
   4.189 +  "[|f \<in> A\<rightarrow>B; inj_on f A;
   4.190 +     g \<in> B\<rightarrow>A; inj_on g B; finite A; finite B|] ==> card(A) = card(B)"
   4.191 +by (blast intro: card_inj order_antisym)
   4.192  
   4.193  end
     5.1 --- a/src/HOL/MetisExamples/Abstraction.thy	Mon Jun 22 08:17:52 2009 +0200
     5.2 +++ b/src/HOL/MetisExamples/Abstraction.thy	Mon Jun 22 20:59:12 2009 +0200
     5.3 @@ -201,7 +201,7 @@
     5.4     "(cl,f) \<in> CLF ==> 
     5.5      CLF \<subseteq> (SIGMA cl': CL. {f. f \<in> pset cl' \<rightarrow> pset cl'}) ==> 
     5.6      f \<in> pset cl \<rightarrow> pset cl"
     5.7 -by auto
     5.8 +by fast
     5.9  (*??no longer terminates, with combinators
    5.10  by (metis Collect_mem_eq SigmaD2 subsetD)
    5.11  *)
     6.1 --- a/src/HOL/ex/Tarski.thy	Mon Jun 22 08:17:52 2009 +0200
     6.2 +++ b/src/HOL/ex/Tarski.thy	Mon Jun 22 20:59:12 2009 +0200
     6.3 @@ -824,11 +824,6 @@
     6.4  apply (simp add: intY1_def interval_def  intY1_elem)
     6.5  done
     6.6  
     6.7 -lemma (in Tarski) intY1_func: "(%x: intY1. f x) \<in> intY1 -> intY1"
     6.8 -apply (rule restrictI)
     6.9 -apply (erule intY1_f_closed)
    6.10 -done
    6.11 -
    6.12  lemma (in Tarski) intY1_mono:
    6.13       "monotone (%x: intY1. f x) intY1 (induced intY1 r)"
    6.14  apply (auto simp add: monotone_def induced_def intY1_f_closed)
    6.15 @@ -853,7 +848,7 @@
    6.16  apply (rule CLF.glbH_is_fixp [OF CLF.intro, unfolded CLF_set_def, of "\<lparr>pset = intY1, order = induced intY1 r\<rparr>", simplified])
    6.17  apply auto
    6.18  apply (rule intY1_is_cl)
    6.19 -apply (rule intY1_func)
    6.20 +apply (erule intY1_f_closed)
    6.21  apply (rule intY1_mono)
    6.22  done
    6.23