thanks
AuthorBallarin 0 with thanks to Paulo Emílio de Vilhena
*)
theory Congruence imports
Main "HOL-Library.FuncSet" begin
section \<open>Objects\<close>
subsection \<open>Structure with Carrier Set.\<close>
record'a partial_object =
carrier :: "'a set"
lemma funcset_carrier: "\ f \ carrier X \ carrier Y; x \ carrier X \ \ f x \ carrier Y" by (fact funcset_mem)
lemma funcset_carrier': imports by factfuncset_mem
subsection \<open>Structure with Carrier and Equivalence Relation \<open>eq\<close>\<close>
record apartial_object
eqsection\<open>Objects\<close>
definition
: _\<Rightarrow> 'a \<Rightarrow> 'a set \<Rightarrow> bool" (infixl \<open>.\<in>\<index>\<close> 50)funcset_carrier"> \ carrier X \ carrier Y; x \ carrier X \ \ f x \ carrier Y" by (factfuncset_mem ':
definition
fact
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
eq_classes :: "_ \ ('a set) set" (\classes\\) where"classes\<^bsub>S\<^esub> = {class_of\<^bsub>S\<^esub> x | x. x \ carrier S}"
definition
eq_closure_of :: "_ \ 'a set \ 'a set" (\closure'_of\\)
(funcset_memset_eq" \ 'a set \ 'a set \ bool" (infixl \{.=}\\ 50)
definition "A .=\ where
abbreviation
not_eq :: " .remove_elemof insert b ' ].prems where"x .\\<^bsub>S\<^esub> y \ \(x .=\<^bsub>S\<^esub> y)"
abbreviation
not_elem :: "_ \ 'a \ 'a set \ bool" (infixl \.\\\ 50) where"x .\\<^bsub>S\<^esub> A \ \(x .\\<^bsub>S\<^esub> A)"
abbreviation
set_not_eq :: "_ by (metis add.commute insert_iff partition.incl sum.subset_diff)
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
locale equivalence java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
Sstructure
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
thesis assms and trans [trans
): \<^marker>\<open>contributor \<open>Paulo Emílio de Vilhena\<close>\<close>
equivalenceI
a java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58 assumesmetis)(4 (5) elemI) and
equivalencejava.lang.NullPointerException shows"equivalence \ carrier = E, eq = P \" unfolding equivalence_def\> S" by (metis . A
locale partition set_eqI ) fixes
equivalence and incl: "\b. b \ B \ b \ A"
and carr: "x \ carrier S" "x' \ carrier S" "y \ carrier S" assumes"shows", ,
L proof -
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
show ? " A by (java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 qedstructure
(* Lemmas by Stephan Hohe *)
" fixes R bymetis closure_inclusion assumesequivalencejava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
ajava.lang.NullPointerException
ldingjava.lang.StringIndexOutOfBoundsException: Range [26, 21) out of bounds for length 40
Sjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 in"\Ajava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
unfolding elem_def "java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
lemma elemE
assumes(closure_of}java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47 and java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 0
java.lang.NullPointerException
auto by (using complete_classesauto
() []:
s "java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
simp) shows: lemmajava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
lemma
): "a\>Bjava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
inter
lemma java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
s x using assms byblastthusthus
: fixes R (structure)
and "A\ using
java.lang.StringIndexOutOfBoundsException: Range [4, 3) out of bounds for length 27
x inclass1 assumes"\a. a \ A \ \b \ B. a .= b"
java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
A= using assms w z "java.lang.StringIndexOutOfBoundsException: Index 94 out of bounds for length 94
lemma set_eqD1
(java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21 assumes}anda\<in> A"
eq_class_of_def
thesis
lemma b java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
RstructureSjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4 ' " using assms byclass1
:
f by assumes java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3 and"\ \a \ A. a .\ B; \b \ B. b .\ A \ \ P"
( arbitrary usingunfolding set_eq_def
lemma set_eqE2 eq_classes_def byauto fixes Rcase udisjoint_sumpartition_from_equivalence assumes and shows" simpa: .hyps .hyps2java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48 using simp:)
lemma (java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3 assumesA\<subseteq> carrier S" "A' \<subseteq> carrier S" "A {.=} A'" shows"finiteAjava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20 using finite_UnionD)
lemmausing assmsblast
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 shows"A {.=} B \ B {.=} A" using assmsjava.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
lemma (in
by simp
lemma"java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
meson sym by simp
lemma (in equivalence) set_eq_trans_aux: assumesxxx." and"A {.=} B""B {.=} C" showsjava.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
assms(simp add subset_iff
corollary (in
assumes is_closed
shows " Ajava.lang.NullPointerException
set_eqI show next show qed
lemma assms : : ) assumes closed and\<subseteq shows" java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
unfolding using S by (blast dest: closed sym)
lemmain) closure_of_eq assumes"A \ carrier S" "x \ closure_of A" shows"java.lang.StringIndexOutOfBoundsException: Range [0, 81) out of bounds for length 47
equivalence
Ajava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35 assumes assms is_closedI shows using AA eq_is_closed_def
corollary ( assumes" closure_of)" shows"\ x .= x'; x \ carrier S \ \ x \ A" using symusing ( add)
,intro "Union= " shows"closure_of A \ carrier S" "java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
lemma java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 fixes S ( " \ class2 \ {}" assumes- "\inclosure_of Ajava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
assms eq_classes_def
lemma zwhere fixes S hence java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75 and"\a \ carrier S; a .\ A\ \ P"
java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11 using eq_closure_of_def
equivalencejava.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
S) assumes"a \ closure_of A"
and shows"P"
assms( closure_of_memE)
)java.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 124 "equivalence \ carrier = A, eq = (\x y. y \ (THE b. b \ B \ x \ b))\" unfolding partition_def equivalence_def
(auto letjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 show"(Sum\java.lang.StringIndexOutOfBoundsException: Index 84 out of bounds for length 84 usingunique_classmetis, lifting'
finite by (, lifting) showusingby blast using unique_class by ( qed
lemma (in partition) partition_coverture: "\B = A" \<^marker>\contributor \Paulo Emílio de Vilhena\\ by (meson Sup_le_iff UnionI unique_class incl subsetI subset_antisym)
lemma (in partition) disjoint_union: \<^marker>\<open>contributor \<open>Paulo Emílio de Vilhena\<close>\<close> assumes"b1 \ B" "b2 \ B" and"b1 \ b2 \ {}" shows"b1 = b2" proof (rule ccontr) assume"b1 \ b2" obtain a where"a \ A" "a \ b1" "a \ b2" using assms(2-3) incl by blast thus False using unique_class \<open>b1 \<noteq> b2\<close> assms(1) assms(2) by blast qed
lemma partitionI: \<^marker>\<open>contributor \<open>Paulo Emílio de Vilhena\<close>\<close> fixes A :: "'a set"and B :: "('a set) set" assumes"\B = A" and"\b1 b2. \ b1 \ B; b2 \ B \ \ b1 \ b2 \ {} \ b1 = b2" shows"partition A B" proof show"\a. a \ A \ \!b. b \ B \ a \ b" proof (rule ccontr) fix a assume"a \ A" "\!b. b \ B \ a \ b" thenobtain b1 b2 where"b1 \ B" "a \ b1" and"b2 \ B" "a \ b2" "b1 \ b2" using assms(1) by blast thus False using assms(2) by blast qed next show"\b. b \ B \ b \ A" using assms(1) by blast qed
lemma (in partition) remove_elem: \<^marker>\<open>contributor \<open>Paulo Emílio de Vilhena\<close>\<close> assumes"b \ B" shows"partition (A - b) (B - {b})" proof show"\a. a \ A - b \ \!b'. b' \ B - {b} \ a \ b'" using unique_class by fastforce next show"\b'. b' \ B - {b} \ b' \ A - b" using assms unique_class incl partition_axioms partition_coverture by 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)" using partition.remove_elem[of A "insert b B'" b] insert.prems by (metis add.commute insert_iff partition.incl sum.subset_diff) 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)" proof - have"finite B" by (simp add: assms finite_UnionD partition_coverture) thus ?thesis using disjoint_sum assms partition_axioms by blast qed
lemma (in equivalence) set_eq_insert_aux: \<^marker>\<open>contributor \<open>Paulo Emílio de Vilhena\<close>\<close> assumes"A \ carrier S" and"x \ carrier S" "x' \ carrier S" "x .= x'" and"y \ insert x A" shows"y .\ insert x' A" by (metis assms(1) assms(4) assms(5) contra_subsetD elemI elem_exact insert_iff)
corollary (in equivalence) 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'" shows"insert x A {.=} insert x' A" by (meson set_eqI assms set_eq_insert_aux sym equivalence_axioms)
lemma (in equivalence) set_eq_pairI: \<^marker>\<open>contributor \<open>Paulo Emílio de Vilhena\<close>\<close> assumes xx': "x .= x'" and carr: "x \ carrier S" "x' \ carrier S" "y \ carrier S" shows"{x, y} {.=} {x', y}" using assms set_eq_insert by simp
lemma (in equivalence) closure_inclusion: assumes"A \ B" shows"closure_of A \ closure_of B" unfolding eq_closure_of_def using assms elem_subsetD by auto
lemma (in equivalence) classes_small: assumes"is_closed B" and"A \ B" shows"closure_of A \ B" by (metis assms closure_inclusion eq_is_closed_def)
lemma (in equivalence) classes_eq: assumes"A \ carrier S" shows"A {.=} closure_of A" using assms by (blast intro: set_eqI elem_exact closure_of_memI elim: closure_of_memE)
lemma (in equivalence) complete_classes: assumes"is_closed A" shows"A = closure_of A" using assms by (simp add: eq_is_closed_def)
lemma (in equivalence) closure_idem_weak: "closure_of (closure_of A) {.=} closure_of A" by (simp add: classes_eq set_eq_sym)
lemma (in equivalence) closure_idem_strong: assumes"A \ carrier S" shows"closure_of (closure_of A) = closure_of A" using assms closure_of_eq complete_classes is_closedI by auto
lemma (in equivalence) classes_consistent: assumes"A \ carrier S" shows"is_closed (closure_of A)" using closure_idem_strong by (simp add: assms eq_is_closed_def)
lemma (in equivalence) classes_coverture: "\classes = carrier S" proof show"\classes \ carrier S" unfolding eq_classes_def eq_class_of_def by blast next show"carrier S \ \classes" unfolding eq_classes_def eq_class_of_def proof fix x assume"x \ carrier S" hence"x \ {y \ carrier S. x .= y}" using refl by simp thus"x \ \{{y \ carrier S. x .= y} |x. x \ carrier S}" by blast qed qed
lemma (in equivalence) disjoint_union: assumes"class1 \ classes" "class2 \ classes" and"class1 \ class2 \ {}" shows"class1 = class2" proof - obtain x y where x: "x \ carrier S" "class1 = class_of x" and y: "y \ carrier S" "class2 = class_of y" using assms(1-2) unfolding eq_classes_def by blast obtain z where z: "z \ carrier S" "z \ class1 \ class2" using assms classes_coverture by fastforce hence"x .= z \ y .= z" using x y unfolding eq_class_of_def by blast hence"x .= y"using x y z trans sym by meson hence"class_of x = class_of y" unfolding eq_class_of_def usinglocal.sym trans x y by blast thus ?thesis using x y by simp qed
lemma (in equivalence) partition_from_equivalence: "partition (carrier S) classes" proof (intro partitionI) show"\classes = carrier S" using classes_coverture by simp next show"\class1 class2. \ class1 \ classes; class2 \ classes \ \
class1 \<inter> class2 \<noteq> {} \<Longrightarrow> class1 = class2" using disjoint_union by simp qed
lemma (in equivalence) disjoint_sum: assumes"finite (carrier S)" shows"(\c\classes. \x\c. f x) = (\x\(carrier S). f x)" proof - have"finite classes" unfolding eq_classes_def using assms by auto thus ?thesis using disjoint_sum assms partition_from_equivalence by blast qed
end
olor:red'>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
¤ Dauer der Verarbeitung: 0.17 Sekunden
(vorverarbeitet)
¤
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.