--- a/src/HOL/Algebra/Bij.thy Tue Jun 01 11:25:01 2004 +0200
+++ b/src/HOL/Algebra/Bij.thy Tue Jun 01 11:25:26 2004 +0200
@@ -10,7 +10,7 @@
constdefs
Bij :: "'a set => ('a => 'a) set"
--{*Only extensional functions, since otherwise we get too many.*}
- "Bij S == extensional S \<inter> {f. f`S = S & inj_on f S}"
+ "Bij S == extensional S \<inter> {f. bij_betw f S S}"
BijGroup :: "'a set => ('a => 'a) monoid"
"BijGroup S ==
@@ -25,53 +25,23 @@
by (simp add: Bij_def)
lemma Bij_imp_funcset: "f \<in> Bij S ==> f \<in> S -> S"
- by (auto simp add: Bij_def Pi_def)
-
-lemma Bij_imp_apply: "f \<in> Bij S ==> f ` S = S"
- by (simp add: Bij_def)
-
-lemma Bij_imp_inj_on: "f \<in> Bij S ==> inj_on f S"
- by (simp add: Bij_def)
-
-lemma BijI: "[| f \<in> extensional(S); f`S = S; inj_on f S |] ==> f \<in> Bij S"
- by (simp add: Bij_def)
+ by (auto simp add: Bij_def bij_betw_imp_funcset)
subsection {*Bijections Form a Group *}
lemma restrict_Inv_Bij: "f \<in> Bij S ==> (%x:S. (Inv S f) x) \<in> Bij S"
-apply (simp add: Bij_def)
-apply (intro conjI)
-txt{*Proving @{term "restrict (Inv S f) S ` S = S"}*}
- apply (rule equalityI)
- apply (force simp add: Inv_mem) --{*first inclusion*}
- apply (rule subsetI) --{*second inclusion*}
- apply (rule_tac x = "f x" in image_eqI)
- apply (force intro: simp add: Inv_f_f, blast)
-txt{*Remaining goal: @{term "inj_on (restrict (Inv S f) S) S"}*}
-apply (rule inj_onI)
-apply (auto elim: Inv_injective)
-done
+ by (simp add: Bij_def bij_betw_Inv)
lemma id_Bij: "(\<lambda>x\<in>S. x) \<in> Bij S "
-apply (rule BijI)
-apply (auto simp add: inj_on_def)
-done
+ by (auto simp add: Bij_def bij_betw_def inj_on_def)
lemma compose_Bij: "[| x \<in> Bij S; y \<in> Bij S|] ==> compose S x y \<in> Bij S"
-apply (rule BijI)
- apply (simp add: compose_extensional)
- apply (blast del: equalityI
- intro: surj_compose dest: Bij_imp_apply Bij_imp_inj_on)
-apply (blast intro: inj_on_compose dest: Bij_imp_apply Bij_imp_inj_on)
-done
+ by (auto simp add: Bij_def bij_betw_compose)
lemma Bij_compose_restrict_eq:
"f \<in> Bij S ==> compose S (restrict (Inv S f) S) f = (\<lambda>x\<in>S. x)"
-apply (rule compose_Inv_id)
- apply (simp add: Bij_imp_inj_on)
-apply (simp add: Bij_imp_apply)
-done
+ by (simp add: Bij_def compose_Inv_id)
theorem group_BijGroup: "group (BijGroup S)"
apply (simp add: BijGroup_def)
@@ -87,16 +57,16 @@
subsection{*Automorphisms Form a Group*}
-lemma Bij_Inv_mem: "[| f \<in> Bij S; x : S |] ==> Inv S f x : S"
-by (simp add: Bij_def Inv_mem)
+lemma Bij_Inv_mem: "[| f \<in> Bij S; x \<in> S |] ==> Inv S f x \<in> S"
+by (simp add: Bij_def bij_betw_def Inv_mem)
lemma Bij_Inv_lemma:
assumes eq: "!!x y. [|x \<in> S; y \<in> S|] ==> h(g x y) = g (h x) (h y)"
shows "[| h \<in> Bij S; g \<in> S \<rightarrow> S \<rightarrow> S; x \<in> S; y \<in> S |]
==> Inv S h (g x y) = g (Inv S h x) (Inv S h y)"
-apply (simp add: Bij_def)
-apply (subgoal_tac "EX x':S. EX y':S. x = h x' & y = h y'", clarify)
- apply (simp add: eq [symmetric] Inv_f_f funcset_mem [THEN funcset_mem], blast)
+apply (simp add: Bij_def bij_betw_def)
+apply (subgoal_tac "\<exists>x'\<in>S. \<exists>y'\<in>S. x = h x' & y = h y'", clarify)
+ apply (simp add: eq [symmetric] Inv_f_f funcset_mem [THEN funcset_mem], blast )
done
constdefs
@@ -130,7 +100,7 @@
apply (rule group.subgroupI)
apply (rule group_BijGroup)
apply (force simp add: auto_def BijGroup_def)
- apply (blast intro: dest: id_in_auto)
+ apply (blast dest: id_in_auto)
apply (simp del: restrict_apply
add: inv_BijGroup auto_def restrict_Inv_Bij restrict_Inv_hom)
apply (auto simp add: BijGroup_def auto_def Bij_imp_funcset group.hom_compose
--- a/src/HOL/Library/FuncSet.thy Tue Jun 01 11:25:01 2004 +0200
+++ b/src/HOL/Library/FuncSet.thy Tue Jun 01 11:25:26 2004 +0200
@@ -100,10 +100,6 @@
lemma surj_compose: "[| f ` A = B; g ` B = C |] ==> compose A g f ` A = C"
by (auto simp add: image_def compose_eq)
-lemma inj_on_compose:
- "[| f ` A = B; inj_on f A; inj_on g B |] ==> inj_on (compose A g f) A"
- by (auto simp add: inj_on_def compose_eq)
-
subsection{*Bounded Abstraction: @{term restrict}*}
@@ -121,7 +117,7 @@
"(!!x. x \<in> A ==> f x = g x) ==> (\<lambda>x\<in>A. f x) = (\<lambda>x\<in>A. g x)"
by (simp add: expand_fun_eq Pi_def Pi_def restrict_def)
-lemma inj_on_restrict_eq: "inj_on (restrict f A) A = inj_on f A"
+lemma inj_on_restrict_eq [simp]: "inj_on (restrict f A) A = inj_on f A"
by (simp add: inj_on_def restrict_def)
lemma Id_compose:
@@ -132,41 +128,8 @@
"[|g \<in> A -> B; g \<in> extensional A|] ==> compose A g (\<lambda>x\<in>A. x) = g"
by (auto simp add: expand_fun_eq compose_def extensional_def Pi_def)
-
-subsection{*Extensionality*}
-
-lemma extensional_arb: "[|f \<in> extensional A; x\<notin> A|] ==> f x = arbitrary"
- by (simp add: extensional_def)
-
-lemma restrict_extensional [simp]: "restrict f A \<in> extensional A"
- by (simp add: restrict_def extensional_def)
-
-lemma compose_extensional [simp]: "compose A f g \<in> extensional A"
- by (simp add: compose_def)
-
-lemma extensionalityI:
- "[| f \<in> extensional A; g \<in> extensional A;
- !!x. x\<in>A ==> f x = g x |] ==> f = g"
- by (force simp add: expand_fun_eq extensional_def)
-
-lemma Inv_funcset: "f ` A = B ==> (\<lambda>x\<in>B. Inv A f x) : B -> A"
- by (unfold Inv_def) (fast intro: restrict_in_funcset someI2)
-
-lemma compose_Inv_id:
- "[| inj_on f A; f ` A = B |]
- ==> compose A (\<lambda>y\<in>B. Inv A f y) f = (\<lambda>x\<in>A. x)"
- apply (simp add: compose_def)
- apply (rule restrict_ext, auto)
- apply (erule subst)
- apply (simp add: Inv_f_f)
- done
-
-lemma compose_id_Inv:
- "f ` A = B ==> compose B f (\<lambda>y\<in>B. Inv A f y) = (\<lambda>x\<in>B. x)"
- apply (simp add: compose_def)
- apply (rule restrict_ext)
- apply (simp add: f_Inv_f)
- done
+lemma image_restrict_eq [simp]: "(restrict f A) ` A = f ` A"
+ by (auto simp add: restrict_def)
subsection{*Bijections Between Sets*}
@@ -190,12 +153,55 @@
apply (simp add: image_def Inv_f_f)
done
+lemma inj_on_compose:
+ "[| bij_betw f A B; inj_on g B |] ==> inj_on (compose A g f) A"
+ by (auto simp add: bij_betw_def inj_on_def compose_eq)
+
lemma bij_betw_compose:
"[| bij_betw f A B; bij_betw g B C |] ==> bij_betw (compose A g f) A C"
apply (simp add: bij_betw_def compose_eq inj_on_compose)
apply (auto simp add: compose_def image_def)
done
+lemma bij_betw_restrict_eq [simp]:
+ "bij_betw (restrict f A) A B = bij_betw f A B"
+ by (simp add: bij_betw_def)
+
+
+subsection{*Extensionality*}
+
+lemma extensional_arb: "[|f \<in> extensional A; x\<notin> A|] ==> f x = arbitrary"
+ by (simp add: extensional_def)
+
+lemma restrict_extensional [simp]: "restrict f A \<in> extensional A"
+ by (simp add: restrict_def extensional_def)
+
+lemma compose_extensional [simp]: "compose A f g \<in> extensional A"
+ by (simp add: compose_def)
+
+lemma extensionalityI:
+ "[| f \<in> extensional A; g \<in> extensional A;
+ !!x. x\<in>A ==> f x = g x |] ==> f = g"
+ by (force simp add: expand_fun_eq extensional_def)
+
+lemma Inv_funcset: "f ` A = B ==> (\<lambda>x\<in>B. Inv A f x) : B -> A"
+ by (unfold Inv_def) (fast intro: restrict_in_funcset someI2)
+
+lemma compose_Inv_id:
+ "bij_betw f A B ==> compose A (\<lambda>y\<in>B. Inv A f y) f = (\<lambda>x\<in>A. x)"
+ apply (simp add: bij_betw_def compose_def)
+ apply (rule restrict_ext, auto)
+ apply (erule subst)
+ apply (simp add: Inv_f_f)
+ done
+
+lemma compose_id_Inv:
+ "f ` A = B ==> compose B f (\<lambda>y\<in>B. Inv A f y) = (\<lambda>x\<in>B. x)"
+ apply (simp add: compose_def)
+ apply (rule restrict_ext)
+ apply (simp add: f_Inv_f)
+ done
+
subsection{*Cardinality*}