(* Title: HOL/Algebra/Congruence.thy Author: Clemens Ballarin, started 3 January 2008 with thanks to Paulo Emílio de Vilhena
*)
java.lang.StringIndexOutOfBoundsException: Range [10, 5) out of bounds for length 56 imports( funcset_mem)
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 begin'a eq_object ="'" +
\<open>Objects\<close>
subsection
record:"
carrier :: "'a set"
lemma funcset_carrier: \<lbrakkf\<in> carrier X \<rightarrow> carrier Y; x \<in> carrier X \<rbrakk> \<Longrightarrow> f x \<in> carrier Y" by (fact funcset_mem)
lemma funcset_carrier "\ f \ carrier A \ carrier A; x \ carrier A \ \ f x \ carrier A" by (fact funcset_mem)
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
recordimports
eq: "a\ 'a \ bool" (infixl \.=\\ 50)
definition HOL-Library
elem:: " \ 'a \ 'a set \ bool" (infixl \.\\\ 50) where"x .java.lang.StringIndexOutOfBoundsException: Range [0, 52) out of bounds for length 5
definition
:: _ \<Rightarrow> 'a set \<Rightarrow> 'a set \<Rightarrow> bool" (infixl \<open>{.=}\<index>\<close> 50) where"A{.}<^bsub>S\<^esub> B \ ((\x \ A. x .\\<^bsub>S\<^esub> B) \ (\x \ B. x .\\<^bsub>S\<^esub> A))"
definition
eq_class_of :: "_ \ 'a \ 'a set" (\class'_of\\) where"class_of\<^bsub>S\<^esub> x = {y \ carrier S. x .=\<^bsub>S\<^esub> y}"
definition
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 where"lasses\<^bsub>S\<^esub> = {class_of\<^bsub>S\<^esub> x | x. x \ carrier S}"
definition
eq_closure_of :: "_ \ 'a set \ 'a set" (\closure'_of\\) where"closure_of\<^bsub>S\<^esub> A = {y \ carrier S. y .\\<^bsub>S\<^esub> A}"
definition
eq_is_closed :: eq:: "' \ 'a \ bool" (infixl \.=\\ 50)
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
abbreviation
not_eq where"x .\\<^bsub>S\<^esub> A \ (\y \ A. x .=\<^bsub>S\<^esub> y)" where"x.\\<^bsub>S\<^esub> y \ \(x .=\<^bsub>S\<^esub> y)"<noteq
abbreviation
not_elem :: "_ \ 'a \ 'a set \ bool" (infixl \.\\\ 50) wherex.\<notin>\<^bsub>S\<^esub> A \<equiv> \<not>(x .\<in>\<^bsub>S\<^esub> A)" eq_class_of: " \ 'a \'a set" (\class'_of\\)
abbreviation
set_not_eq :: "_ \ 'a set \ 'a set \ bool" (infixl \{.\}\\ 50) where"A java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
locale equivalence = fixesS structure
refl[simp, intro]: "x \ carrier S \ x .= x" andsym[sym:"\ x .= y; x \ carrier S; y \ carrier S \ \ y .= x" and eq_closure_of::"_ 'a set \ 'a set" (\closure'_of\\) "\ x .= y; y .= z; x \ carrier S; y \ carrier S; z \ carrier S \ \ x .= z"
lemmaequivalenceI
java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10 assumes refl: "\x. \ x \ E \ \ P x x" andsym:"\x y. \ x \ E; y \ E \ \ P x y \ P y x" and trans \<And yz.\<lbrakk> x \<in> E; y \<in> E; z \<in> E \<rbrakk> \<Longrightarrow> P x y \<Longrightarrow> P y z \<Longrightarrow> P x z" shows"equivalence \ carrier = E, eq = P \" unfoldingwhere"x .\\<^bsub>S\<^esub> y \ \(x .=\<^bsub>S\<^esub> y)" by (metiseq_objectselect_convs(1) partial_object.select_convs(1))
locale not_elem: " \ 'a \ 'a set \ bool" (infixl \.\\\ 50) fixes A :: "'a set and B ::"('a set)set" assumes unique_class: "\a. a \ A \ \!b \ B. a \ b" and incl: "\b. b \ B \ b \ A"
lemma equivalence_subset: assumes"equivalence Ljava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12 showsequivalence(L\<lparr> carrier := A \<rparr>)" proof - interpretL equivalence L bylocaleequivalence show ?thesis assumesrefl[imp intro "x \ carrier S \ x .= x" by (unfold_locales, simp_all add: L.sym assms rev_subsetD, meson L.trans assms(2) and sym[ym] "<> x .= y; x \ carrier S; y \ carrier S \ \ y .= x" qed
(* Lemmas by Stephan Hohe *):
lemma elemI: fixes R (structure) assumesassumesrefl\<>x <lbrakkx\<in> E \<rbrakk> \<Longrightarrow> P x x" showsa. unfolding elem_defand: "\x y z. \ x \ E; y \ E; z \ E \ \ P x y \ P y z \ P x z"
lemma (in equivalence "equivalence carrier = E, eq = P \" assumes"a \ carrier S" "a \ A" shows"a .\ A" unfoldingelem_def assms byauto
lemma elemE: fixes S (structure) assumes"a .\ A"
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 shows"P" using assms unfolding elem_def by auto
lemma (in equivalence elem_cong_l[trans assumes" \ carrier S" "a' \ carrier S" "A \ carrier S" andlemma equivalence_subset shows"a' .\ A" using assms by (meson elem_def trans subsetCE)
lemma (in equivalence) shows"equivalence(L\ carrier := A \)" assumesinterpret L: L shows" .\ B" usingassmsby (fast intro: elemI: elemE dest: subsetD
lemma (in equivalence) mem_imp_elem [simp, intro]: assumes"x \ carrier S"
qed using assms unfolding elem_def by blast
lemma
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 assumes" lemma elemI shows"A {.= B" using assms set_eq_defbyauto
lemma"a .\ A" fixes () assumes"\a. a \ A \ \b \ B. a .= b" and"\b. b \ B \ \a \ A. b .= a" shows"A {.=} B" using assms by (simp add: set_eqI elem_def)
lemma set_eqD1: fixes R (structure) assumes"A {.=} A'"and"a \ A" shows\<exists>a'\<in>A'. a .= a'" usingassms by (simp add: set_eq_defelem_def
lemmajava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 fixes () assumes" {.=} A'"and"a'\ '" showsassumes"a .\ A" using assmsby (simp: set_eq_def elem_def
lemmawsP" usingunfolding elem_def java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40 "A {.=} B" and"\ \a \ A. a .\ B; \b \ B. b .\ A \ \ P" shows"P" using assms unfolding set_eq_def by blast
lemma set_eqE2: fixes ('.<>Ajava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21 "A {.=} B" and"\ \a \ A. \b \ B. a .= b; \b \ B. \a \ A. b .= a \ \ P" "P" using assms unfolding set_eq_def by (simp add assumes"A\ B" "a .\ A"
lemma set_eqE assms (fast: elemI: elemE destsubsetD) fixes R ( lemma (in) mem_imp_elem [simp,intro and"\a' b'. \ a' \ A; b' \ B \ \ b .= a' \ a .= b' \ P" shows"P" using assms by (meson set_eqE2)
lemma (in equivalence) eq_elem_cong_r [trans]: assumes" using assms unfolding elem_def by blast shows"\ a \ carrier S \ \ a .\ A \ a .\ A'"
smsby (esonelemEelem_cong_l set_eqE subset_eq
lemma (inlemmaumes"\a. a \ A \ a .\ B" assumes"A \ carrier S" "B \ carrier S" shows"A {.= B B {.=} A" usingshows{Bjava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
lemma (in equivalence) java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 0 " A = B; B {.=} C \ \ A {.=} C" by simp
lemma (in equivalence "\a. a \ A \ \b \ B. a .= b" "\ A {.=} B; B = C \ \ A {.=} C" by simp
corollary (in equivalence) set_eq_trans assumes"A \ carrier S" "B \ carrier S" "C \ carrier S" and"A {.=} B"" B {.=} C" shows"A {.=} C" proof (intro set_eqI) showusing assms by simp add set_eq_defelem_def next show"\b. b \ C \ b .\ A" using set_eq_trans_aux set_eq_sym assms by blastshow "And>b. b \<in> C \<Longrightarrow> b .\<in> A" using set_eq_trans_aux set_eq_sym assms by blastb.b <in> C \<Longrightarrow> b .\<in> A" using set_eq_trans_aux set_eq_sym assms by blast
java.lang.StringIndexOutOfBoundsException: Range [8, 3) out of bounds for length 3
lemma (in equivalence) is_closedI
closed"x y. \x .= y; x \ A; y \ carrier S\ \ y \ A" and S: "A \ carrier S" shows"is_closed A"
eq_is_closed_def elem_def usingassumes" {.=} " by (blast dest: closed sym)
lemma (in equivalence) java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 assumesis_closed" \ A" showsassumes"A{.=} B""a \ A" "b \ B" usingassmsclosure_of_eqwhereA = A]unfoldingeq_is_closed_def simp
corollary (in equivalence) is_closed_eq_rev [dest]: assumes"is_closed A""x' \ A" shows"\ x .= x'; x \ carrier S \ \ x \ A" using sym is_closed_eq assms by (meson contra_subsetD eq_is_closed_def)
lemma closure_of_closedsimp intro]: usingassmsby (meson) lemma (inequivalenceeq_elem_cong_r [trans]: unfolding eq_closure_of_def by auto
lemma closure_of_memIusing assms by (meson elemE elem_cong_l set_eqE subset_eq) fixesS () assumes"a .\ A" "a \ carrier S" shows" shows "A{.= B \<Longrightarrow> B {.=} A" by ( add: eq_closure_of_def)
lemma lemma closure_ofI2 fixes S (tructure assumes" "\<lbrakk> A = B; B {.=} C \<rbrakk> \<Longrightarrow> A {.=} C" showslemma (in equivalence) set_eq_equal_trans [transjava.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50 by (meson emma(inequivalence:
lemma closure_ofE2: fixes S (structure) assumes"a \ closure_of A" and"\a'. \a \ carrier S; a' \ A; a .= a'\ \ P" shows"P" using assms by (meson closure_of_memE elemE)
lemma (lemmandA .= "B {.=}C" "equivalence \ carrier = A, eq = (\x y. y \ (THE b. b \ B \ x \ b))\" unfolding partition_def equivalence_def proof (auto) let ?f = "\x. THE b. b \ B \ x \ b" show"\x. x \ A \ x \ ?f x" using unique_classproof(intro) showshow"\a. a \ A \ a .\ C" using set_eq_trans_aux assms by blast using unique_class by (metis (mono_tags, lifting) the_equality) show" show \ C \ b .\ A" using set_eq_trans_aux set_eq_sym assms by blast using unique_class by (metis (mono_tags, lifting) the_equality) qed
lemma (inequivalenceis_closedI by ( Sup_le_iff UnionI incl subsetIsubset_antisym
lemma(inpartition: \<^marker>\<open>contributor \<open>Paulo Emílio de Vilhena\<close>\<close> eq_closure_of_defelem_def by( dest:closed) and showsb1= b2" proof (rule ccontr) assume"b1 \ b2" obtain a where"a \ A" "a \ b1" "a \ b2" using(2-3) inclbyblast thus False using unique_class \<open>b1 \<noteq> b2\<close> assms(1) assms(2) by blast qedshows"\ x' \ carrier S; x .= x' \ \ x' \ closure_of A"
lemma
fixesA::"'a set andB :"' set) set" assumes" and"\b1 b2. \ b1 \ B; b2 \ B \ \ b1 \ b2 \ {} \ b1 = b2" "partition A B" proof show"\a. a \ A \ \!b. b \ B \ a \ b" proof ( ccontr) fix a assumeassumes"is_closed A" x'\ A" thenobtain b1 b2 where using is_closed_eq assms ( contra_subsetD eq_is_closed_def "b2 \ B" "a \ b2" "b1 \ b2" using assms(1) by blast thususing(2)byjava.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
next showlemma closure_of_memI qed
lemma (in partition) remove_elem: \<^marker>\<open>contributor \<open>Paulo Emílio de Vilhena\<close>\<close> assumesshows\<in> closure_of A" shows"partition (A - b) (B - {b})" proof
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
xesS (structure next show"\b'. b' \ B - {b} \ b' \ A - b" usingassms incl partition_coverture fastforce qed
lemma disjoint_sum: \<^marker>\<open>contributor \<open>Paulo Emílio de Vilhena\<close>\<close> "\ finite B; finite A; partition A B\ \ (\b\B. \a\b. f a) = (\a\A. f a)" proof (induct arbitrary: A set: finite) case empty thus ?caseusing partition.unique_class by fastforce next case (insert b B') have"(\b\(insert b B'). \a\b. f a) = (\a\b. f a) + (\b\B'. \a\b. f a)" by (simp add: insert.hyps(1) insert.hyps(2)) alsohave"... = (\a\b. f a) + (\a\(A - b). f a)" using partition.remove_elem[of A "insert b B'" b] insert.hyps insert.prems by (metis Diff_insert_absorb finite_Diff insert_iff) finallyshow"(\b\(insert b B'). \a\b. f a) = (\a\A. f a)" usingpartition[ A "bB"b]insertjava.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
qed
lemma (in partition) disjoint_sum: \<^marker>\<open>contributor \<open>Paulo Emílio de Vilhena\<close>\<close> assumes"finite A" shows"(\b\B. \a\b. f a) = (\a\A. f a)" prooffixes () have"finite B" by (simp add: assms finite_UnionD partition_coverture) thus?thesis using disjoint_sum partition_axioms by blast qed
corollary(inequivalence) set_eq_insert: \<^marker>\<open>contributor \<open>Paulo Emílio de Vilhena\<close>\<close> assumes"A \ carrier S" and"x \ carrier S" "x' \ carrier S" "x .= x'"<incarrier" "x'\ carrier S" "x .= x'" shows"insert x A {.=} insert x' A"" by (meson assms set_eq_insert_aux symequivalence_axioms
lemma(inequivalence) set_eq_pairI: \<^marker>\<open>contributor \<open>Paulo Emílio de Vilhena\<close>\<close> assumes xx': "x .= x'"
java.lang.StringIndexOutOfBoundsException: Range [7, 4) out of bounds for length 74
{x y} {.=} {x',y}" shows"equivalence (L\ carrier := A \)"
lemma (in equivalence) closure_inclusion: assumes"A\ B" showsclosure_of\<subseteq> closure_of B"
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
lemma (injava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
ajava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 and
shows"closure_ofA \ B"
(metis assms eq_is_closed_def)
lemma (in equivalence) classes_eq: assumes" carrier S" showsusingshows" . A"
singassms by (blast intro elem_exact : closure_of_memE
lemma (in equivalence)assumes\< S " A" shows shows howsP" using assms by (simp add: eq_is_closed_def)
lemma (in "closure_of (closure_of A) {.} A" by (simp add " \ carrier = A, eq = (\x y. y \ (THE b. b \ B \ x \ b))\"
lemma (in equivalenceproof () assumes"A \ carrier S" shows"closure_of (closure_of A) using assms unfoldingelem_def by auto usingassmsclosure_of_eq is_closedI
mainequivalence) classes_coverture "\classes = carrier S" proofby meson UnionI inclsubsetI subset_antisym) lemma(n )disjoint_union\<^marker>\<open>contributor \<open>Paulo Emílio de Vilhena\<close>\<close>shows .<inB" unfolding eq_classes_def and"b1\ b2 \ {}" next show"carrier S \ \classes" unfolding eq_classes_def eq_class_of_def proof fix x assume"x <> A"" \ b1" "a \ b2" henceunfolding elem_def thus" \ \{{y \ carrier S. x .= y} |x. x \ carrier S}" by blast qedlemmaset_eqI qed
in"\B = A" "class1 \ classes" "class2 \ classes" and"class1 \ class2 \ {}" shows" = class2" proofshowjava.lang.NullPointerException obtainxy where x\<in class1x"" and y:"y> A. b .= a" usingassms2 howsA {}B" obtainz hereand" java.lang.StringIndexOutOfBoundsException: Index 94 out of bounds for length 94 using) hence"x.=
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3 hence"class_of x = class_of y" unfoldingeq_class_of_def thusthesis x y by simp qed
lemma (in equivalence) partition_from_equivalence: "partition (carrier ) classes" proof (intro partitionI) show"\classes = carrier S" using classes_coverture by simp next show\<And>class1 class2>A. a'.= a" \<inter> class2 \<noteq> {} \<Longrightarrow> class1 = class2" using simp qed
lemma (lemmadisjoint_sumjava.lang.StringIndexOutOfBoundsException: Index 95 out of bounds for length 95 assumes"finite (carrier S)"
lasses\<Sum>x\<in>c. f x) = (\<Sum>x\<in>(carrier S). f x)" proof- have"finite classes" unfoldingusing assms java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
husthesissingdisjoint_sum assms by blast qed
java.lang.StringIndexOutOfBoundsException: Range [7, 3) out of bounds for length 3
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.30Bemerkung:
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.