# HG changeset patch # User paulson # Date 1086081926 -7200 # Node ID 8d710bece29f50c505ebcc243236e7f75912578f # Parent fffab59e0050156271507db40302e1a26f6d32f5 more on bij_betw diff -r fffab59e0050 -r 8d710bece29f src/HOL/Algebra/Bij.thy --- 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 \ {f. f`S = S & inj_on f S}" + "Bij S == extensional S \ {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 \ Bij S ==> f \ S -> S" - by (auto simp add: Bij_def Pi_def) - -lemma Bij_imp_apply: "f \ Bij S ==> f ` S = S" - by (simp add: Bij_def) - -lemma Bij_imp_inj_on: "f \ Bij S ==> inj_on f S" - by (simp add: Bij_def) - -lemma BijI: "[| f \ extensional(S); f`S = S; inj_on f S |] ==> f \ 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 \ Bij S ==> (%x:S. (Inv S f) x) \ 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: "(\x\S. x) \ 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 \ Bij S; y \ Bij S|] ==> compose S x y \ 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 \ Bij S ==> compose S (restrict (Inv S f) S) f = (\x\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 \ Bij S; x : S |] ==> Inv S f x : S" -by (simp add: Bij_def Inv_mem) +lemma Bij_Inv_mem: "[| f \ Bij S; x \ S |] ==> Inv S f x \ S" +by (simp add: Bij_def bij_betw_def Inv_mem) lemma Bij_Inv_lemma: assumes eq: "!!x y. [|x \ S; y \ S|] ==> h(g x y) = g (h x) (h y)" shows "[| h \ Bij S; g \ S \ S \ S; x \ S; y \ 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 "\x'\S. \y'\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 diff -r fffab59e0050 -r 8d710bece29f src/HOL/Library/FuncSet.thy --- 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 \ A ==> f x = g x) ==> (\x\A. f x) = (\x\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 \ A -> B; g \ extensional A|] ==> compose A g (\x\A. x) = g" by (auto simp add: expand_fun_eq compose_def extensional_def Pi_def) - -subsection{*Extensionality*} - -lemma extensional_arb: "[|f \ extensional A; x\ A|] ==> f x = arbitrary" - by (simp add: extensional_def) - -lemma restrict_extensional [simp]: "restrict f A \ extensional A" - by (simp add: restrict_def extensional_def) - -lemma compose_extensional [simp]: "compose A f g \ extensional A" - by (simp add: compose_def) - -lemma extensionalityI: - "[| f \ extensional A; g \ extensional A; - !!x. x\A ==> f x = g x |] ==> f = g" - by (force simp add: expand_fun_eq extensional_def) - -lemma Inv_funcset: "f ` A = B ==> (\x\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 (\y\B. Inv A f y) f = (\x\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 (\y\B. Inv A f y) = (\x\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 \ extensional A; x\ A|] ==> f x = arbitrary" + by (simp add: extensional_def) + +lemma restrict_extensional [simp]: "restrict f A \ extensional A" + by (simp add: restrict_def extensional_def) + +lemma compose_extensional [simp]: "compose A f g \ extensional A" + by (simp add: compose_def) + +lemma extensionalityI: + "[| f \ extensional A; g \ extensional A; + !!x. x\A ==> f x = g x |] ==> f = g" + by (force simp add: expand_fun_eq extensional_def) + +lemma Inv_funcset: "f ` A = B ==> (\x\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 (\y\B. Inv A f y) f = (\x\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 (\y\B. Inv A f y) = (\x\B. x)" + apply (simp add: compose_def) + apply (rule restrict_ext) + apply (simp add: f_Inv_f) + done + subsection{*Cardinality*}