# HG changeset patch # User haftmann # Date 1465654962 -7200 # Node ID 9ac558ab0906aca7ff4ec1a8a0b4a494202f396b # Parent 26134a00d06015c7271d842ac95b8674ca210e7e boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes diff -r 26134a00d060 -r 9ac558ab0906 NEWS --- a/NEWS Sat Jun 11 17:40:52 2016 +0200 +++ b/NEWS Sat Jun 11 16:22:42 2016 +0200 @@ -132,6 +132,14 @@ *** HOL *** +* Abstract locales semigroup, abel_semigroup, semilattice, +semilattice_neutr, ordering, ordering_top, semilattice_order, +semilattice_neutr_order, comm_monoid_set, semilattice_set, +semilattice_neutr_set, semilattice_order_set, semilattice_order_neutr_set +monoid_list, comm_monoid_list, comm_monoid_list_set, comm_monoid_mset, +comm_monoid_fun use boldified syntax uniformly that does not clash +with corresponding global syntax. INCOMPATIBILITY. + * Conventional syntax "%(). t" for unit abstractions. Slight syntactic INCOMPATIBILITY. diff -r 26134a00d060 -r 9ac558ab0906 src/HOL/Groups.thy --- a/src/HOL/Groups.thy Sat Jun 11 17:40:52 2016 +0200 +++ b/src/HOL/Groups.thy Sat Jun 11 16:22:42 2016 +0200 @@ -42,17 +42,17 @@ \ locale semigroup = - fixes f :: "'a \ 'a \ 'a" (infixl "*" 70) - assumes assoc [ac_simps]: "a * b * c = a * (b * c)" + fixes f :: "'a \ 'a \ 'a" (infixl "\<^bold>*" 70) + assumes assoc [ac_simps]: "a \<^bold>* b \<^bold>* c = a \<^bold>* (b \<^bold>* c)" locale abel_semigroup = semigroup + - assumes commute [ac_simps]: "a * b = b * a" + assumes commute [ac_simps]: "a \<^bold>* b = b \<^bold>* a" begin lemma left_commute [ac_simps]: - "b * (a * c) = a * (b * c)" + "b \<^bold>* (a \<^bold>* c) = a \<^bold>* (b \<^bold>* c)" proof - - have "(b * a) * c = (a * b) * c" + have "(b \<^bold>* a) \<^bold>* c = (a \<^bold>* b) \<^bold>* c" by (simp only: commute) then show ?thesis by (simp only: assoc) @@ -61,13 +61,13 @@ end locale monoid = semigroup + - fixes z :: 'a ("1") - assumes left_neutral [simp]: "1 * a = a" - assumes right_neutral [simp]: "a * 1 = a" + fixes z :: 'a ("\<^bold>1") + assumes left_neutral [simp]: "\<^bold>1 \<^bold>* a = a" + assumes right_neutral [simp]: "a \<^bold>* \<^bold>1 = a" locale comm_monoid = abel_semigroup + - fixes z :: 'a ("1") - assumes comm_neutral: "a * 1 = a" + fixes z :: 'a ("\<^bold>1") + assumes comm_neutral: "a \<^bold>* \<^bold>1 = a" begin sublocale monoid diff -r 26134a00d060 -r 9ac558ab0906 src/HOL/Groups_Big.thy --- a/src/HOL/Groups_Big.thy Sat Jun 11 17:40:52 2016 +0200 +++ b/src/HOL/Groups_Big.thy Sat Jun 11 16:22:42 2016 +0200 @@ -11,9 +11,6 @@ subsection \Generic monoid operation over a set\ -no_notation times (infixl "*" 70) -no_notation Groups.one ("1") - locale comm_monoid_set = comm_monoid begin @@ -25,24 +22,24 @@ definition F :: "('b \ 'a) \ 'b set \ 'a" where - eq_fold: "F g A = Finite_Set.fold (f \ g) 1 A" + eq_fold: "F g A = Finite_Set.fold (f \ g) \<^bold>1 A" lemma infinite [simp]: - "\ finite A \ F g A = 1" + "\ finite A \ F g A = \<^bold>1" by (simp add: eq_fold) lemma empty [simp]: - "F g {} = 1" + "F g {} = \<^bold>1" by (simp add: eq_fold) lemma insert [simp]: assumes "finite A" and "x \ A" - shows "F g (insert x A) = g x * F g A" + shows "F g (insert x A) = g x \<^bold>* F g A" using assms by (simp add: eq_fold) lemma remove: assumes "finite A" and "x \ A" - shows "F g A = g x * F g (A - {x})" + shows "F g A = g x \<^bold>* F g (A - {x})" proof - from \x \ A\ obtain B where A: "A = insert x B" and "x \ B" by (auto dest: mk_disjoint_insert) @@ -52,21 +49,21 @@ lemma insert_remove: assumes "finite A" - shows "F g (insert x A) = g x * F g (A - {x})" + shows "F g (insert x A) = g x \<^bold>* F g (A - {x})" using assms by (cases "x \ A") (simp_all add: remove insert_absorb) lemma neutral: - assumes "\x\A. g x = 1" - shows "F g A = 1" + assumes "\x\A. g x = \<^bold>1" + shows "F g A = \<^bold>1" using assms by (induct A rule: infinite_finite_induct) simp_all lemma neutral_const [simp]: - "F (\_. 1) A = 1" + "F (\_. \<^bold>1) A = \<^bold>1" by (simp add: neutral) lemma union_inter: assumes "finite A" and "finite B" - shows "F g (A \ B) * F g (A \ B) = F g A * F g B" + shows "F g (A \ B) \<^bold>* F g (A \ B) = F g A \<^bold>* F g B" \ \The reversed orientation looks more natural, but LOOPS as a simprule!\ using assms proof (induct A) case empty then show ?case by simp @@ -77,19 +74,19 @@ corollary union_inter_neutral: assumes "finite A" and "finite B" - and I0: "\x \ A \ B. g x = 1" - shows "F g (A \ B) = F g A * F g B" + and I0: "\x \ A \ B. g x = \<^bold>1" + shows "F g (A \ B) = F g A \<^bold>* F g B" using assms by (simp add: union_inter [symmetric] neutral) corollary union_disjoint: assumes "finite A" and "finite B" assumes "A \ B = {}" - shows "F g (A \ B) = F g A * F g B" + shows "F g (A \ B) = F g A \<^bold>* F g B" using assms by (simp add: union_inter_neutral) lemma union_diff2: assumes "finite A" and "finite B" - shows "F g (A \ B) = F g (A - B) * F g (B - A) * F g (A \ B)" + shows "F g (A \ B) = F g (A - B) \<^bold>* F g (B - A) \<^bold>* F g (A \ B)" proof - have "A \ B = A - B \ (B - A) \ A \ B" by auto @@ -98,12 +95,12 @@ lemma subset_diff: assumes "B \ A" and "finite A" - shows "F g A = F g (A - B) * F g B" + shows "F g A = F g (A - B) \<^bold>* F g B" proof - from assms have "finite (A - B)" by auto moreover from assms have "finite B" by (rule finite_subset) moreover from assms have "(A - B) \ B = {}" by auto - ultimately have "F g (A - B \ B) = F g (A - B) * F g B" by (rule union_disjoint) + ultimately have "F g (A - B \ B) = F g (A - B) \<^bold>* F g B" by (rule union_disjoint) moreover from assms have "A \ B = A" by auto ultimately show ?thesis by simp qed @@ -114,10 +111,10 @@ using assms by (induct A) (simp_all add: insert_Diff_if) lemma not_neutral_contains_not_neutral: - assumes "F g A \ z" - obtains a where "a \ A" and "g a \ z" + assumes "F g A \ \<^bold>1" + obtains a where "a \ A" and "g a \ \<^bold>1" proof - - from assms have "\a\A. g a \ z" + from assms have "\a\A. g a \ \<^bold>1" proof (induct A rule: infinite_finite_induct) case (insert a A) then show ?case by simp (rule, simp) @@ -180,7 +177,7 @@ qed (auto dest: finite_UnionD intro: infinite) lemma distrib: - "F (\x. g x * h x) A = F g A * F h A" + "F (\x. g x \<^bold>* h x) A = F g A \<^bold>* F h A" by (induct A rule: infinite_finite_induct) (simp_all add: assoc commute left_commute) lemma Sigma: @@ -197,14 +194,14 @@ done lemma related: - assumes Re: "R 1 1" - and Rop: "\x1 y1 x2 y2. R x1 x2 \ R y1 y2 \ R (x1 * y1) (x2 * y2)" + assumes Re: "R \<^bold>1 \<^bold>1" + and Rop: "\x1 y1 x2 y2. R x1 x2 \ R y1 y2 \ R (x1 \<^bold>* y1) (x2 \<^bold>* y2)" and fS: "finite S" and Rfg: "\x\S. R (h x) (g x)" shows "R (F h S) (F g S)" using fS by (rule finite_subset_induct) (insert assms, auto) lemma mono_neutral_cong_left: - assumes "finite T" and "S \ T" and "\i \ T - S. h i = 1" + assumes "finite T" and "S \ T" and "\i \ T - S. h i = \<^bold>1" and "\x. x \ S \ g x = h x" shows "F g S = F h T" proof- have eq: "T = S \ (T - S)" using \S \ T\ by blast @@ -216,16 +213,16 @@ qed lemma mono_neutral_cong_right: - "\ finite T; S \ T; \i \ T - S. g i = 1; \x. x \ S \ g x = h x \ + "\ finite T; S \ T; \i \ T - S. g i = \<^bold>1; \x. x \ S \ g x = h x \ \ F g T = F h S" by (auto intro!: mono_neutral_cong_left [symmetric]) lemma mono_neutral_left: - "\ finite T; S \ T; \i \ T - S. g i = 1 \ \ F g S = F g T" + "\ finite T; S \ T; \i \ T - S. g i = \<^bold>1 \ \ F g S = F g T" by (blast intro: mono_neutral_cong_left) lemma mono_neutral_right: - "\ finite T; S \ T; \i \ T - S. g i = 1 \ \ F g T = F g S" + "\ finite T; S \ T; \i \ T - S. g i = \<^bold>1 \ \ F g T = F g S" by (blast intro!: mono_neutral_left [symmetric]) lemma reindex_bij_betw: "bij_betw h S T \ F (\x. g (h x)) S = F g T" @@ -275,10 +272,10 @@ lemma reindex_nontrivial: assumes "finite A" - and nz: "\x y. x \ A \ y \ A \ x \ y \ h x = h y \ g (h x) = 1" + and nz: "\x y. x \ A \ y \ A \ x \ y \ h x = h y \ g (h x) = \<^bold>1" shows "F g (h ` A) = F (g \ h) A" proof (subst reindex_bij_betw_not_neutral [symmetric]) - show "bij_betw h (A - {x \ A. (g \ h) x = 1}) (h ` A - h ` {x \ A. (g \ h) x = 1})" + show "bij_betw h (A - {x \ A. (g \ h) x = \<^bold>1}) (h ` A - h ` {x \ A. (g \ h) x = \<^bold>1})" using nz by (auto intro!: inj_onI simp: bij_betw_def) qed (insert \finite A\, auto) @@ -307,11 +304,11 @@ lemma delta: assumes fS: "finite S" - shows "F (\k. if k = a then b k else 1) S = (if a \ S then b a else 1)" + shows "F (\k. if k = a then b k else \<^bold>1) S = (if a \ S then b a else \<^bold>1)" proof- - let ?f = "(\k. if k=a then b k else 1)" + let ?f = "(\k. if k=a then b k else \<^bold>1)" { assume a: "a \ S" - hence "\k\S. ?f k = 1" by simp + hence "\k\S. ?f k = \<^bold>1" by simp hence ?thesis using a by simp } moreover { assume a: "a \ S" @@ -320,7 +317,7 @@ have eq: "S = ?A \ ?B" using a by blast have dj: "?A \ ?B = {}" by simp from fS have fAB: "finite ?A" "finite ?B" by auto - have "F ?f S = F ?f ?A * F ?f ?B" + have "F ?f S = F ?f ?A \<^bold>* F ?f ?B" using union_disjoint [OF fAB dj, of ?f, unfolded eq [symmetric]] by simp then have ?thesis using a by simp } @@ -329,14 +326,14 @@ lemma delta': assumes fS: "finite S" - shows "F (\k. if a = k then b k else 1) S = (if a \ S then b a else 1)" + shows "F (\k. if a = k then b k else \<^bold>1) S = (if a \ S then b a else \<^bold>1)" using delta [OF fS, of a b, symmetric] by (auto intro: cong) lemma If_cases: fixes P :: "'b \ bool" and g h :: "'b \ 'a" assumes fA: "finite A" shows "F (\x. if P x then h x else g x) A = - F h (A \ {x. P x}) * F g (A \ - {x. P x})" + F h (A \ {x. P x}) \<^bold>* F g (A \ - {x. P x})" proof - have a: "A = A \ {x. P x} \ A \ -{x. P x}" "(A \ {x. P x}) \ (A \ -{x. P x}) = {}" @@ -363,10 +360,10 @@ lemma inter_restrict: assumes "finite A" - shows "F g (A \ B) = F (\x. if x \ B then g x else 1) A" + shows "F g (A \ B) = F (\x. if x \ B then g x else \<^bold>1) A" proof - - let ?g = "\x. if x \ A \ B then g x else 1" - have "\i\A - A \ B. (if i \ A \ B then g i else 1) = 1" + let ?g = "\x. if x \ A \ B then g x else \<^bold>1" + have "\i\A - A \ B. (if i \ A \ B then g i else \<^bold>1) = \<^bold>1" by simp moreover have "A \ B \ A" by blast ultimately have "F ?g (A \ B) = F ?g A" using \finite A\ @@ -375,12 +372,12 @@ qed lemma inter_filter: - "finite A \ F g {x \ A. P x} = F (\x. if P x then g x else 1) A" + "finite A \ F g {x \ A. P x} = F (\x. if P x then g x else \<^bold>1) A" by (simp add: inter_restrict [symmetric, of A "{x. P x}" g, simplified mem_Collect_eq] Int_def) lemma Union_comp: assumes "\A \ B. finite A" - and "\A1 A2 x. A1 \ B \ A2 \ B \ A1 \ A2 \ x \ A1 \ x \ A2 \ g x = 1" + and "\A1 A2 x. A1 \ B \ A2 \ B \ A1 \ A2 \ x \ A1 \ x \ A2 \ g x = \<^bold>1" shows "F g (\B) = (F \ F) g B" using assms proof (induct B rule: infinite_finite_induct) case (infinite A) @@ -391,9 +388,9 @@ next case (insert A B) then have "finite A" "finite B" "finite (\B)" "A \ B" - and "\x\A \ \B. g x = 1" + and "\x\A \ \B. g x = \<^bold>1" and H: "F g (\B) = (F o F) g B" by auto - then have "F g (A \ \B) = F g A * F g (\B)" + then have "F g (A \ \B) = F g A \<^bold>* F g (\B)" by (simp add: union_inter_neutral) with \finite B\ \A \ B\ show ?case by (simp add: H) @@ -412,7 +409,7 @@ lemma Plus: fixes A :: "'b set" and B :: "'c set" assumes fin: "finite A" "finite B" - shows "F g (A <+> B) = F (g \ Inl) A * F (g \ Inr) B" + shows "F g (A <+> B) = F (g \ Inl) A \<^bold>* F (g \ Inr) B" proof - have "A <+> B = Inl ` A \ Inr ` B" by auto moreover from fin have "finite (Inl ` A :: ('b + 'c) set)" "finite (Inr ` B :: ('b + 'c) set)" @@ -427,7 +424,7 @@ lemma same_carrier: assumes "finite C" assumes subset: "A \ C" "B \ C" - assumes trivial: "\a. a \ C - A \ g a = 1" "\b. b \ C - B \ h b = 1" + assumes trivial: "\a. a \ C - A \ g a = \<^bold>1" "\b. b \ C - B \ h b = \<^bold>1" shows "F g A = F h B \ F g C = F h C" proof - from \finite C\ subset have @@ -437,12 +434,12 @@ from subset have [simp]: "B - (C - B) = B" by auto from subset have "C = A \ (C - A)" by auto then have "F g C = F g (A \ (C - A))" by simp - also have "\ = F g (A - (C - A)) * F g (C - A - A) * F g (A \ (C - A))" + also have "\ = F g (A - (C - A)) \<^bold>* F g (C - A - A) \<^bold>* F g (A \ (C - A))" using \finite A\ \finite (C - A)\ by (simp only: union_diff2) finally have P: "F g C = F g A" using trivial by simp from subset have "C = B \ (C - B)" by auto then have "F h C = F h (B \ (C - B))" by simp - also have "\ = F h (B - (C - B)) * F h (C - B - B) * F h (B \ (C - B))" + also have "\ = F h (B - (C - B)) \<^bold>* F h (C - B - B) \<^bold>* F h (B \ (C - B))" using \finite B\ \finite (C - B)\ by (simp only: union_diff2) finally have Q: "F h C = F h B" using trivial by simp from P Q show ?thesis by simp @@ -451,16 +448,13 @@ lemma same_carrierI: assumes "finite C" assumes subset: "A \ C" "B \ C" - assumes trivial: "\a. a \ C - A \ g a = 1" "\b. b \ C - B \ h b = 1" + assumes trivial: "\a. a \ C - A \ g a = \<^bold>1" "\b. b \ C - B \ h b = \<^bold>1" assumes "F g C = F h C" shows "F g A = F h B" using assms same_carrier [of C A B] by simp end -notation times (infixl "*" 70) -notation Groups.one ("1") - subsection \Generalized summation over a set\ diff -r 26134a00d060 -r 9ac558ab0906 src/HOL/Groups_List.thy --- a/src/HOL/Groups_List.thy Sat Jun 11 17:40:52 2016 +0200 +++ b/src/HOL/Groups_List.thy Sat Jun 11 16:22:42 2016 +0200 @@ -6,26 +6,23 @@ imports List begin -no_notation times (infixl "*" 70) -no_notation Groups.one ("1") - locale monoid_list = monoid begin definition F :: "'a list \ 'a" where - eq_foldr [code]: "F xs = foldr f xs 1" + eq_foldr [code]: "F xs = foldr f xs \<^bold>1" lemma Nil [simp]: - "F [] = 1" + "F [] = \<^bold>1" by (simp add: eq_foldr) lemma Cons [simp]: - "F (x # xs) = x * F xs" + "F (x # xs) = x \<^bold>* F xs" by (simp add: eq_foldr) lemma append [simp]: - "F (xs @ ys) = F xs * F ys" + "F (xs @ ys) = F xs \<^bold>* F ys" by (induct xs) (simp_all add: assoc) end @@ -52,9 +49,6 @@ end -notation times (infixl "*" 70) -notation Groups.one ("1") - subsection \List summation\ diff -r 26134a00d060 -r 9ac558ab0906 src/HOL/Lattices.thy --- a/src/HOL/Lattices.thy Sat Jun 11 17:40:52 2016 +0200 +++ b/src/HOL/Lattices.thy Sat Jun 11 16:22:42 2016 +0200 @@ -16,17 +16,14 @@ undesired effects may occur due to interpretation. \ -no_notation times (infixl "*" 70) -no_notation Groups.one ("1") - locale semilattice = abel_semigroup + - assumes idem [simp]: "a * a = a" + assumes idem [simp]: "a \<^bold>* a = a" begin -lemma left_idem [simp]: "a * (a * b) = a * b" +lemma left_idem [simp]: "a \<^bold>* (a \<^bold>* b) = a \<^bold>* b" by (simp add: assoc [symmetric]) -lemma right_idem [simp]: "(a * b) * b = a * b" +lemma right_idem [simp]: "(a \<^bold>* b) \<^bold>* b = a \<^bold>* b" by (simp add: assoc) end @@ -34,109 +31,109 @@ locale semilattice_neutr = semilattice + comm_monoid locale semilattice_order = semilattice + - fixes less_eq :: "'a \ 'a \ bool" (infix "\" 50) - and less :: "'a \ 'a \ bool" (infix "\" 50) - assumes order_iff: "a \ b \ a = a * b" - and strict_order_iff: "a \ b \ a = a * b \ a \ b" + fixes less_eq :: "'a \ 'a \ bool" (infix "\<^bold>\" 50) + and less :: "'a \ 'a \ bool" (infix "\<^bold><" 50) + assumes order_iff: "a \<^bold>\ b \ a = a \<^bold>* b" + and strict_order_iff: "a \<^bold>< b \ a = a \<^bold>* b \ a \ b" begin lemma orderI: - "a = a * b \ a \ b" + "a = a \<^bold>* b \ a \<^bold>\ b" by (simp add: order_iff) lemma orderE: - assumes "a \ b" - obtains "a = a * b" + assumes "a \<^bold>\ b" + obtains "a = a \<^bold>* b" using assms by (unfold order_iff) sublocale ordering less_eq less proof fix a b - show "a \ b \ a \ b \ a \ b" + show "a \<^bold>< b \ a \<^bold>\ b \ a \ b" by (simp add: order_iff strict_order_iff) next fix a - show "a \ a" + show "a \<^bold>\ a" by (simp add: order_iff) next fix a b - assume "a \ b" "b \ a" - then have "a = a * b" "a * b = b" + assume "a \<^bold>\ b" "b \<^bold>\ a" + then have "a = a \<^bold>* b" "a \<^bold>* b = b" by (simp_all add: order_iff commute) then show "a = b" by simp next fix a b c - assume "a \ b" "b \ c" - then have "a = a * b" "b = b * c" + assume "a \<^bold>\ b" "b \<^bold>\ c" + then have "a = a \<^bold>* b" "b = b \<^bold>* c" by (simp_all add: order_iff commute) - then have "a = a * (b * c)" + then have "a = a \<^bold>* (b \<^bold>* c)" by simp - then have "a = (a * b) * c" + then have "a = (a \<^bold>* b) \<^bold>* c" by (simp add: assoc) - with \a = a * b\ [symmetric] have "a = a * c" by simp - then show "a \ c" by (rule orderI) + with \a = a \<^bold>* b\ [symmetric] have "a = a \<^bold>* c" by simp + then show "a \<^bold>\ c" by (rule orderI) qed lemma cobounded1 [simp]: - "a * b \ a" + "a \<^bold>* b \<^bold>\ a" by (simp add: order_iff commute) lemma cobounded2 [simp]: - "a * b \ b" + "a \<^bold>* b \<^bold>\ b" by (simp add: order_iff) lemma boundedI: - assumes "a \ b" and "a \ c" - shows "a \ b * c" + assumes "a \<^bold>\ b" and "a \<^bold>\ c" + shows "a \<^bold>\ b \<^bold>* c" proof (rule orderI) - from assms obtain "a * b = a" and "a * c = a" by (auto elim!: orderE) - then show "a = a * (b * c)" by (simp add: assoc [symmetric]) + from assms obtain "a \<^bold>* b = a" and "a \<^bold>* c = a" by (auto elim!: orderE) + then show "a = a \<^bold>* (b \<^bold>* c)" by (simp add: assoc [symmetric]) qed lemma boundedE: - assumes "a \ b * c" - obtains "a \ b" and "a \ c" + assumes "a \<^bold>\ b \<^bold>* c" + obtains "a \<^bold>\ b" and "a \<^bold>\ c" using assms by (blast intro: trans cobounded1 cobounded2) lemma bounded_iff [simp]: - "a \ b * c \ a \ b \ a \ c" + "a \<^bold>\ b \<^bold>* c \ a \<^bold>\ b \ a \<^bold>\ c" by (blast intro: boundedI elim: boundedE) lemma strict_boundedE: - assumes "a \ b * c" - obtains "a \ b" and "a \ c" + assumes "a \<^bold>< b \<^bold>* c" + obtains "a \<^bold>< b" and "a \<^bold>< c" using assms by (auto simp add: commute strict_iff_order elim: orderE intro!: that)+ lemma coboundedI1: - "a \ c \ a * b \ c" + "a \<^bold>\ c \ a \<^bold>* b \<^bold>\ c" by (rule trans) auto lemma coboundedI2: - "b \ c \ a * b \ c" + "b \<^bold>\ c \ a \<^bold>* b \<^bold>\ c" by (rule trans) auto lemma strict_coboundedI1: - "a \ c \ a * b \ c" + "a \<^bold>< c \ a \<^bold>* b \<^bold>< c" using irrefl by (auto intro: not_eq_order_implies_strict coboundedI1 strict_implies_order elim: strict_boundedE) lemma strict_coboundedI2: - "b \ c \ a * b \ c" + "b \<^bold>< c \ a \<^bold>* b \<^bold>< c" using strict_coboundedI1 [of b c a] by (simp add: commute) -lemma mono: "a \ c \ b \ d \ a * b \ c * d" +lemma mono: "a \<^bold>\ c \ b \<^bold>\ d \ a \<^bold>* b \<^bold>\ c \<^bold>* d" by (blast intro: boundedI coboundedI1 coboundedI2) -lemma absorb1: "a \ b \ a * b = a" +lemma absorb1: "a \<^bold>\ b \ a \<^bold>* b = a" by (rule antisym) (auto simp add: refl) -lemma absorb2: "b \ a \ a * b = b" +lemma absorb2: "b \<^bold>\ a \ a \<^bold>* b = b" by (rule antisym) (auto simp add: refl) -lemma absorb_iff1: "a \ b \ a * b = a" +lemma absorb_iff1: "a \<^bold>\ b \ a \<^bold>* b = a" using order_iff by auto -lemma absorb_iff2: "b \ a \ a * b = b" +lemma absorb_iff2: "b \<^bold>\ a \ a \<^bold>* b = b" using order_iff by (auto simp add: commute) end @@ -144,14 +141,11 @@ locale semilattice_neutr_order = semilattice_neutr + semilattice_order begin -sublocale ordering_top less_eq less 1 +sublocale ordering_top less_eq less "\<^bold>1" by standard (simp add: order_iff) end -notation times (infixl "*" 70) -notation Groups.one ("1") - subsection \Syntactic infimum and supremum operations\ diff -r 26134a00d060 -r 9ac558ab0906 src/HOL/Lattices_Big.thy --- a/src/HOL/Lattices_Big.thy Sat Jun 11 17:40:52 2016 +0200 +++ b/src/HOL/Lattices_Big.thy Sat Jun 11 16:22:42 2016 +0200 @@ -11,10 +11,6 @@ subsection \Generic lattice operations over a set\ -no_notation times (infixl "*" 70) -no_notation Groups.one ("1") - - subsubsection \Without neutral element\ locale semilattice_set = semilattice @@ -48,20 +44,20 @@ lemma insert_not_elem: assumes "finite A" and "x \ A" and "A \ {}" - shows "F (insert x A) = x * F A" + shows "F (insert x A) = x \<^bold>* F A" proof - from \A \ {}\ obtain b where "b \ A" by blast then obtain B where *: "A = insert b B" "b \ B" by (blast dest: mk_disjoint_insert) with \finite A\ and \x \ A\ have "finite (insert x B)" and "b \ insert x B" by auto - then have "F (insert b (insert x B)) = x * F (insert b B)" + then have "F (insert b (insert x B)) = x \<^bold>* F (insert b B)" by (simp add: eq_fold) then show ?thesis by (simp add: * insert_commute) qed lemma in_idem: assumes "finite A" and "x \ A" - shows "x * F A = F A" + shows "x \<^bold>* F A = F A" proof - from assms have "A \ {}" by auto with \finite A\ show ?thesis using \x \ A\ @@ -70,17 +66,17 @@ lemma insert [simp]: assumes "finite A" and "A \ {}" - shows "F (insert x A) = x * F A" + shows "F (insert x A) = x \<^bold>* F A" using assms by (cases "x \ A") (simp_all add: insert_absorb in_idem insert_not_elem) lemma union: assumes "finite A" "A \ {}" and "finite B" "B \ {}" - shows "F (A \ B) = F A * F B" + shows "F (A \ B) = F A \<^bold>* F B" using assms by (induct A rule: finite_ne_induct) (simp_all add: ac_simps) lemma remove: assumes "finite A" and "x \ A" - shows "F A = (if A - {x} = {} then x else x * F (A - {x}))" + shows "F A = (if A - {x} = {} then x else x \<^bold>* F (A - {x}))" proof - from assms obtain B where "A = insert x B" and "x \ B" by (blast dest: mk_disjoint_insert) with assms show ?thesis by simp @@ -88,19 +84,19 @@ lemma insert_remove: assumes "finite A" - shows "F (insert x A) = (if A - {x} = {} then x else x * F (A - {x}))" + shows "F (insert x A) = (if A - {x} = {} then x else x \<^bold>* F (A - {x}))" using assms by (cases "x \ A") (simp_all add: insert_absorb remove) lemma subset: assumes "finite A" "B \ {}" and "B \ A" - shows "F B * F A = F A" + shows "F B \<^bold>* F A = F A" proof - from assms have "A \ {}" and "finite B" by (auto dest: finite_subset) with assms show ?thesis by (simp add: union [symmetric] Un_absorb1) qed lemma closed: - assumes "finite A" "A \ {}" and elem: "\x y. x * y \ {x, y}" + assumes "finite A" "A \ {}" and elem: "\x y. x \<^bold>* y \ {x, y}" shows "F A \ A" using \finite A\ \A \ {}\ proof (induct rule: finite_ne_induct) case singleton then show ?case by simp @@ -109,17 +105,17 @@ qed lemma hom_commute: - assumes hom: "\x y. h (x * y) = h x * h y" + assumes hom: "\x y. h (x \<^bold>* y) = h x \<^bold>* h y" and N: "finite N" "N \ {}" shows "h (F N) = F (h ` N)" using N proof (induct rule: finite_ne_induct) case singleton thus ?case by simp next case (insert n N) - then have "h (F (insert n N)) = h (n * F N)" by simp - also have "\ = h n * h (F N)" by (rule hom) + then have "h (F (insert n N)) = h (n \<^bold>* F N)" by simp + also have "\ = h n \<^bold>* h (F N)" by (rule hom) also have "h (F N) = F (h ` N)" by (rule insert) - also have "h n * \ = F (insert (h n) (h ` N))" + also have "h n \<^bold>* \ = F (insert (h n) (h ` N))" using insert by simp also have "insert (h n) (h ` N) = h ` insert n N" by simp finally show ?case . @@ -135,25 +131,25 @@ lemma bounded_iff: assumes "finite A" and "A \ {}" - shows "x \ F A \ (\a\A. x \ a)" + shows "x \<^bold>\ F A \ (\a\A. x \<^bold>\ a)" using assms by (induct rule: finite_ne_induct) (simp_all add: bounded_iff) lemma boundedI: assumes "finite A" assumes "A \ {}" - assumes "\a. a \ A \ x \ a" - shows "x \ F A" + assumes "\a. a \ A \ x \<^bold>\ a" + shows "x \<^bold>\ F A" using assms by (simp add: bounded_iff) lemma boundedE: - assumes "finite A" and "A \ {}" and "x \ F A" - obtains "\a. a \ A \ x \ a" + assumes "finite A" and "A \ {}" and "x \<^bold>\ F A" + obtains "\a. a \ A \ x \<^bold>\ a" using assms by (simp add: bounded_iff) lemma coboundedI: assumes "finite A" and "a \ A" - shows "F A \ a" + shows "F A \<^bold>\ a" proof - from assms have "A \ {}" by auto from \finite A\ \A \ {}\ \a \ A\ show ?thesis @@ -168,15 +164,15 @@ lemma antimono: assumes "A \ B" and "A \ {}" and "finite B" - shows "F B \ F A" + shows "F B \<^bold>\ F A" proof (cases "A = B") case True then show ?thesis by (simp add: refl) next case False have B: "B = A \ (B - A)" using \A \ B\ by blast then have "F B = F (A \ (B - A))" by simp - also have "\ = F A * F (B - A)" using False assms by (subst union) (auto intro: finite_subset) - also have "\ \ F A" by simp + also have "\ = F A \<^bold>* F (B - A)" using False assms by (subst union) (auto intro: finite_subset) + also have "\ \<^bold>\ F A" by simp finally show ?thesis . qed @@ -193,24 +189,24 @@ definition F :: "'a set \ 'a" where - eq_fold: "F A = Finite_Set.fold f 1 A" + eq_fold: "F A = Finite_Set.fold f \<^bold>1 A" lemma infinite [simp]: - "\ finite A \ F A = 1" + "\ finite A \ F A = \<^bold>1" by (simp add: eq_fold) lemma empty [simp]: - "F {} = 1" + "F {} = \<^bold>1" by (simp add: eq_fold) lemma insert [simp]: assumes "finite A" - shows "F (insert x A) = x * F A" + shows "F (insert x A) = x \<^bold>* F A" using assms by (simp add: eq_fold) lemma in_idem: assumes "finite A" and "x \ A" - shows "x * F A = F A" + shows "x \<^bold>* F A = F A" proof - from assms have "A \ {}" by auto with \finite A\ show ?thesis using \x \ A\ @@ -219,12 +215,12 @@ lemma union: assumes "finite A" and "finite B" - shows "F (A \ B) = F A * F B" + shows "F (A \ B) = F A \<^bold>* F B" using assms by (induct A) (simp_all add: ac_simps) lemma remove: assumes "finite A" and "x \ A" - shows "F A = x * F (A - {x})" + shows "F A = x \<^bold>* F (A - {x})" proof - from assms obtain B where "A = insert x B" and "x \ B" by (blast dest: mk_disjoint_insert) with assms show ?thesis by simp @@ -232,19 +228,19 @@ lemma insert_remove: assumes "finite A" - shows "F (insert x A) = x * F (A - {x})" + shows "F (insert x A) = x \<^bold>* F (A - {x})" using assms by (cases "x \ A") (simp_all add: insert_absorb remove) lemma subset: assumes "finite A" and "B \ A" - shows "F B * F A = F A" + shows "F B \<^bold>* F A = F A" proof - from assms have "finite B" by (auto dest: finite_subset) with assms show ?thesis by (simp add: union [symmetric] Un_absorb1) qed lemma closed: - assumes "finite A" "A \ {}" and elem: "\x y. x * y \ {x, y}" + assumes "finite A" "A \ {}" and elem: "\x y. x \<^bold>* y \ {x, y}" shows "F A \ A" using \finite A\ \A \ {}\ proof (induct rule: finite_ne_induct) case singleton then show ?case by simp @@ -259,24 +255,24 @@ lemma bounded_iff: assumes "finite A" - shows "x \ F A \ (\a\A. x \ a)" + shows "x \<^bold>\ F A \ (\a\A. x \<^bold>\ a)" using assms by (induct A) (simp_all add: bounded_iff) lemma boundedI: assumes "finite A" - assumes "\a. a \ A \ x \ a" - shows "x \ F A" + assumes "\a. a \ A \ x \<^bold>\ a" + shows "x \<^bold>\ F A" using assms by (simp add: bounded_iff) lemma boundedE: - assumes "finite A" and "x \ F A" - obtains "\a. a \ A \ x \ a" + assumes "finite A" and "x \<^bold>\ F A" + obtains "\a. a \ A \ x \<^bold>\ a" using assms by (simp add: bounded_iff) lemma coboundedI: assumes "finite A" and "a \ A" - shows "F A \ a" + shows "F A \<^bold>\ a" proof - from assms have "A \ {}" by auto from \finite A\ \A \ {}\ \a \ A\ show ?thesis @@ -291,23 +287,20 @@ lemma antimono: assumes "A \ B" and "finite B" - shows "F B \ F A" + shows "F B \<^bold>\ F A" proof (cases "A = B") case True then show ?thesis by (simp add: refl) next case False have B: "B = A \ (B - A)" using \A \ B\ by blast then have "F B = F (A \ (B - A))" by simp - also have "\ = F A * F (B - A)" using False assms by (subst union) (auto intro: finite_subset) - also have "\ \ F A" by simp + also have "\ = F A \<^bold>* F (B - A)" using False assms by (subst union) (auto intro: finite_subset) + also have "\ \<^bold>\ F A" by simp finally show ?thesis . qed end -notation times (infixl "*" 70) -notation Groups.one ("1") - subsection \Lattice operations on finite sets\ diff -r 26134a00d060 -r 9ac558ab0906 src/HOL/Library/Groups_Big_Fun.thy --- a/src/HOL/Library/Groups_Big_Fun.thy Sat Jun 11 17:40:52 2016 +0200 +++ b/src/HOL/Library/Groups_Big_Fun.thy Sat Jun 11 16:22:42 2016 +0200 @@ -9,21 +9,18 @@ subsection \Abstract product\ -no_notation times (infixl "*" 70) -no_notation Groups.one ("1") - locale comm_monoid_fun = comm_monoid begin definition G :: "('b \ 'a) \ 'a" where - expand_set: "G g = comm_monoid_set.F f 1 g {a. g a \ 1}" + expand_set: "G g = comm_monoid_set.F f \<^bold>1 g {a. g a \ \<^bold>1}" -interpretation F: comm_monoid_set f 1 +interpretation F: comm_monoid_set f "\<^bold>1" .. lemma expand_superset: - assumes "finite A" and "{a. g a \ 1} \ A" + assumes "finite A" and "{a. g a \ \<^bold>1} \ A" shows "G g = F.F g A" apply (simp add: expand_set) apply (rule F.same_carrierI [of A]) @@ -32,7 +29,7 @@ lemma conditionalize: assumes "finite A" - shows "F.F g A = G (\a. if a \ A then g a else 1)" + shows "F.F g A = G (\a. if a \ A then g a else \<^bold>1)" using assms apply (simp add: expand_set) apply (rule F.same_carrierI [of A]) @@ -40,29 +37,29 @@ done lemma neutral [simp]: - "G (\a. 1) = 1" + "G (\a. \<^bold>1) = \<^bold>1" by (simp add: expand_set) lemma update [simp]: - assumes "finite {a. g a \ 1}" - assumes "g a = 1" - shows "G (g(a := b)) = b * G g" -proof (cases "b = 1") - case True with \g a = 1\ show ?thesis + assumes "finite {a. g a \ \<^bold>1}" + assumes "g a = \<^bold>1" + shows "G (g(a := b)) = b \<^bold>* G g" +proof (cases "b = \<^bold>1") + case True with \g a = \<^bold>1\ show ?thesis by (simp add: expand_set) (rule F.cong, auto) next case False - moreover have "{a'. a' \ a \ g a' \ 1} = insert a {a. g a \ 1}" + moreover have "{a'. a' \ a \ g a' \ \<^bold>1} = insert a {a. g a \ \<^bold>1}" by auto - moreover from \g a = 1\ have "a \ {a. g a \ 1}" + moreover from \g a = \<^bold>1\ have "a \ {a. g a \ \<^bold>1}" by simp - moreover have "F.F (\a'. if a' = a then b else g a') {a. g a \ 1} = F.F g {a. g a \ 1}" - by (rule F.cong) (auto simp add: \g a = 1\) - ultimately show ?thesis using \finite {a. g a \ 1}\ by (simp add: expand_set) + moreover have "F.F (\a'. if a' = a then b else g a') {a. g a \ \<^bold>1} = F.F g {a. g a \ \<^bold>1}" + by (rule F.cong) (auto simp add: \g a = \<^bold>1\) + ultimately show ?thesis using \finite {a. g a \ \<^bold>1}\ by (simp add: expand_set) qed lemma infinite [simp]: - "\ finite {a. g a \ 1} \ G g = 1" + "\ finite {a. g a \ \<^bold>1} \ G g = \<^bold>1" by (simp add: expand_set) lemma cong: @@ -76,8 +73,8 @@ using assms by (fact cong) lemma not_neutral_obtains_not_neutral: - assumes "G g \ 1" - obtains a where "g a \ 1" + assumes "G g \ \<^bold>1" + obtains a where "g a \ \<^bold>1" using assms by (auto elim: F.not_neutral_contains_not_neutral simp add: expand_set) lemma reindex_cong: @@ -87,59 +84,59 @@ proof - from assms have unfold: "h = g \ l" by simp from \bij l\ have "inj l" by (rule bij_is_inj) - then have "inj_on l {a. h a \ 1}" by (rule subset_inj_on) simp - moreover from \bij l\ have "{a. g a \ 1} = l ` {a. h a \ 1}" + then have "inj_on l {a. h a \ \<^bold>1}" by (rule subset_inj_on) simp + moreover from \bij l\ have "{a. g a \ \<^bold>1} = l ` {a. h a \ \<^bold>1}" by (auto simp add: image_Collect unfold elim: bij_pointE) - moreover have "\x. x \ {a. h a \ 1} \ g (l x) = h x" + moreover have "\x. x \ {a. h a \ \<^bold>1} \ g (l x) = h x" by (simp add: unfold) - ultimately have "F.F g {a. g a \ 1} = F.F h {a. h a \ 1}" + ultimately have "F.F g {a. g a \ \<^bold>1} = F.F h {a. h a \ \<^bold>1}" by (rule F.reindex_cong) then show ?thesis by (simp add: expand_set) qed lemma distrib: - assumes "finite {a. g a \ 1}" and "finite {a. h a \ 1}" - shows "G (\a. g a * h a) = G g * G h" + assumes "finite {a. g a \ \<^bold>1}" and "finite {a. h a \ \<^bold>1}" + shows "G (\a. g a \<^bold>* h a) = G g \<^bold>* G h" proof - - from assms have "finite ({a. g a \ 1} \ {a. h a \ 1})" by simp - moreover have "{a. g a * h a \ 1} \ {a. g a \ 1} \ {a. h a \ 1}" + from assms have "finite ({a. g a \ \<^bold>1} \ {a. h a \ \<^bold>1})" by simp + moreover have "{a. g a \<^bold>* h a \ \<^bold>1} \ {a. g a \ \<^bold>1} \ {a. h a \ \<^bold>1}" by auto (drule sym, simp) ultimately show ?thesis using assms - by (simp add: expand_superset [of "{a. g a \ 1} \ {a. h a \ 1}"] F.distrib) + by (simp add: expand_superset [of "{a. g a \ \<^bold>1} \ {a. h a \ \<^bold>1}"] F.distrib) qed lemma commute: assumes "finite C" - assumes subset: "{a. \b. g a b \ 1} \ {b. \a. g a b \ 1} \ C" (is "?A \ ?B \ C") + assumes subset: "{a. \b. g a b \ \<^bold>1} \ {b. \a. g a b \ \<^bold>1} \ C" (is "?A \ ?B \ C") shows "G (\a. G (g a)) = G (\b. G (\a. g a b))" proof - from \finite C\ subset - have "finite ({a. \b. g a b \ 1} \ {b. \a. g a b \ 1})" + have "finite ({a. \b. g a b \ \<^bold>1} \ {b. \a. g a b \ \<^bold>1})" by (rule rev_finite_subset) then have fins: - "finite {b. \a. g a b \ 1}" "finite {a. \b. g a b \ 1}" + "finite {b. \a. g a b \ \<^bold>1}" "finite {a. \b. g a b \ \<^bold>1}" by (auto simp add: finite_cartesian_product_iff) - have subsets: "\a. {b. g a b \ 1} \ {b. \a. g a b \ 1}" - "\b. {a. g a b \ 1} \ {a. \b. g a b \ 1}" - "{a. F.F (g a) {b. \a. g a b \ 1} \ 1} \ {a. \b. g a b \ 1}" - "{a. F.F (\aa. g aa a) {a. \b. g a b \ 1} \ 1} \ {b. \a. g a b \ 1}" + have subsets: "\a. {b. g a b \ \<^bold>1} \ {b. \a. g a b \ \<^bold>1}" + "\b. {a. g a b \ \<^bold>1} \ {a. \b. g a b \ \<^bold>1}" + "{a. F.F (g a) {b. \a. g a b \ \<^bold>1} \ \<^bold>1} \ {a. \b. g a b \ \<^bold>1}" + "{a. F.F (\aa. g aa a) {a. \b. g a b \ \<^bold>1} \ \<^bold>1} \ {b. \a. g a b \ \<^bold>1}" by (auto elim: F.not_neutral_contains_not_neutral) from F.commute have - "F.F (\a. F.F (g a) {b. \a. g a b \ 1}) {a. \b. g a b \ 1} = - F.F (\b. F.F (\a. g a b) {a. \b. g a b \ 1}) {b. \a. g a b \ 1}" . - with subsets fins have "G (\a. F.F (g a) {b. \a. g a b \ 1}) = - G (\b. F.F (\a. g a b) {a. \b. g a b \ 1})" - by (auto simp add: expand_superset [of "{b. \a. g a b \ 1}"] - expand_superset [of "{a. \b. g a b \ 1}"]) + "F.F (\a. F.F (g a) {b. \a. g a b \ \<^bold>1}) {a. \b. g a b \ \<^bold>1} = + F.F (\b. F.F (\a. g a b) {a. \b. g a b \ \<^bold>1}) {b. \a. g a b \ \<^bold>1}" . + with subsets fins have "G (\a. F.F (g a) {b. \a. g a b \ \<^bold>1}) = + G (\b. F.F (\a. g a b) {a. \b. g a b \ \<^bold>1})" + by (auto simp add: expand_superset [of "{b. \a. g a b \ \<^bold>1}"] + expand_superset [of "{a. \b. g a b \ \<^bold>1}"]) with subsets fins show ?thesis - by (auto simp add: expand_superset [of "{b. \a. g a b \ 1}"] - expand_superset [of "{a. \b. g a b \ 1}"]) + by (auto simp add: expand_superset [of "{b. \a. g a b \ \<^bold>1}"] + expand_superset [of "{a. \b. g a b \ \<^bold>1}"]) qed lemma cartesian_product: assumes "finite C" - assumes subset: "{a. \b. g a b \ 1} \ {b. \a. g a b \ 1} \ C" (is "?A \ ?B \ C") + assumes subset: "{a. \b. g a b \ \<^bold>1} \ {b. \a. g a b \ \<^bold>1} \ C" (is "?A \ ?B \ C") shows "G (\a. G (g a)) = G (\(a, b). g a b)" proof - from subset \finite C\ have fin_prod: "finite (?A \ ?B)" @@ -147,7 +144,7 @@ from fin_prod have "finite ?A" and "finite ?B" by (auto simp add: finite_cartesian_product_iff) have *: "G (\a. G (g a)) = - (F.F (\a. F.F (g a) {b. \a. g a b \ 1}) {a. \b. g a b \ 1})" + (F.F (\a. F.F (g a) {b. \a. g a b \ \<^bold>1}) {a. \b. g a b \ \<^bold>1})" apply (subst expand_superset [of "?B"]) apply (rule \finite ?B\) apply auto @@ -157,9 +154,9 @@ apply (erule F.not_neutral_contains_not_neutral) apply auto done - have "{p. (case p of (a, b) \ g a b) \ 1} \ ?A \ ?B" + have "{p. (case p of (a, b) \ g a b) \ \<^bold>1} \ ?A \ ?B" by auto - with subset have **: "{p. (case p of (a, b) \ g a b) \ 1} \ C" + with subset have **: "{p. (case p of (a, b) \ g a b) \ \<^bold>1} \ C" by blast show ?thesis apply (simp add: *) @@ -176,12 +173,12 @@ lemma cartesian_product2: assumes fin: "finite D" - assumes subset: "{(a, b). \c. g a b c \ 1} \ {c. \a b. g a b c \ 1} \ D" (is "?AB \ ?C \ D") + assumes subset: "{(a, b). \c. g a b c \ \<^bold>1} \ {c. \a b. g a b c \ \<^bold>1} \ D" (is "?AB \ ?C \ D") shows "G (\(a, b). G (g a b)) = G (\(a, b, c). g a b c)" proof - have bij: "bij (\(a, b, c). ((a, b), c))" by (auto intro!: bijI injI simp add: image_def) - have "{p. \c. g (fst p) (snd p) c \ 1} \ {c. \p. g (fst p) (snd p) c \ 1} \ D" + have "{p. \c. g (fst p) (snd p) c \ \<^bold>1} \ {c. \p. g (fst p) (snd p) c \ \<^bold>1} \ D" by auto (insert subset, blast) with fin have "G (\p. G (g (fst p) (snd p))) = G (\(p, c). g (fst p) (snd p) c)" by (rule cartesian_product) @@ -193,27 +190,24 @@ qed lemma delta [simp]: - "G (\b. if b = a then g b else 1) = g a" + "G (\b. if b = a then g b else \<^bold>1) = g a" proof - - have "{b. (if b = a then g b else 1) \ 1} \ {a}" by auto + have "{b. (if b = a then g b else \<^bold>1) \ \<^bold>1} \ {a}" by auto then show ?thesis by (simp add: expand_superset [of "{a}"]) qed lemma delta' [simp]: - "G (\b. if a = b then g b else 1) = g a" + "G (\b. if a = b then g b else \<^bold>1) = g a" proof - - have "(\b. if a = b then g b else 1) = (\b. if b = a then g b else 1)" + have "(\b. if a = b then g b else \<^bold>1) = (\b. if b = a then g b else \<^bold>1)" by (simp add: fun_eq_iff) - then have "G (\b. if a = b then g b else 1) = G (\b. if b = a then g b else 1)" + then have "G (\b. if a = b then g b else \<^bold>1) = G (\b. if b = a then g b else \<^bold>1)" by (simp cong del: strong_cong) then show ?thesis by simp qed end -notation times (infixl "*" 70) -notation Groups.one ("1") - subsection \Concrete sum\ @@ -339,4 +333,3 @@ qed end - diff -r 26134a00d060 -r 9ac558ab0906 src/HOL/Library/Multiset.thy --- a/src/HOL/Library/Multiset.thy Sat Jun 11 17:40:52 2016 +0200 +++ b/src/HOL/Library/Multiset.thy Sat Jun 11 16:22:42 2016 +0200 @@ -1562,16 +1562,13 @@ subsection \Big operators\ -no_notation times (infixl "*" 70) -no_notation Groups.one ("1") - locale comm_monoid_mset = comm_monoid begin definition F :: "'a multiset \ 'a" - where eq_fold: "F M = fold_mset f 1 M" - -lemma empty [simp]: "F {#} = 1" + where eq_fold: "F M = fold_mset f \<^bold>1 M" + +lemma empty [simp]: "F {#} = \<^bold>1" by (simp add: eq_fold) lemma singleton [simp]: "F {#x#} = x" @@ -1581,7 +1578,7 @@ show ?thesis by (simp add: eq_fold) qed -lemma union [simp]: "F (M + N) = F M * F N" +lemma union [simp]: "F (M + N) = F M \<^bold>* F N" proof - interpret comp_fun_commute f by standard (simp add: fun_eq_iff left_commute) @@ -1599,9 +1596,6 @@ lemma in_mset_fold_plus_iff[iff]: "x \# fold_mset (op +) M NN \ x \# M \ (\N. N \# NN \ x \# N)" by (induct NN) auto -notation times (infixl "*" 70) -notation Groups.one ("1") - context comm_monoid_add begin diff -r 26134a00d060 -r 9ac558ab0906 src/HOL/Orderings.thy --- a/src/HOL/Orderings.thy Sat Jun 11 17:40:52 2016 +0200 +++ b/src/HOL/Orderings.thy Sat Jun 11 16:22:42 2016 +0200 @@ -15,71 +15,71 @@ subsection \Abstract ordering\ locale ordering = - fixes less_eq :: "'a \ 'a \ bool" (infix "\" 50) - and less :: "'a \ 'a \ bool" (infix "\" 50) - assumes strict_iff_order: "a \ b \ a \ b \ a \ b" - assumes refl: "a \ a" \ \not \iff\: makes problems due to multiple (dual) interpretations\ - and antisym: "a \ b \ b \ a \ a = b" - and trans: "a \ b \ b \ c \ a \ c" + fixes less_eq :: "'a \ 'a \ bool" (infix "\<^bold>\" 50) + and less :: "'a \ 'a \ bool" (infix "\<^bold><" 50) + assumes strict_iff_order: "a \<^bold>< b \ a \<^bold>\ b \ a \ b" + assumes refl: "a \<^bold>\ a" \ \not \iff\: makes problems due to multiple (dual) interpretations\ + and antisym: "a \<^bold>\ b \ b \<^bold>\ a \ a = b" + and trans: "a \<^bold>\ b \ b \<^bold>\ c \ a \<^bold>\ c" begin lemma strict_implies_order: - "a \ b \ a \ b" + "a \<^bold>< b \ a \<^bold>\ b" by (simp add: strict_iff_order) lemma strict_implies_not_eq: - "a \ b \ a \ b" + "a \<^bold>< b \ a \ b" by (simp add: strict_iff_order) lemma not_eq_order_implies_strict: - "a \ b \ a \ b \ a \ b" + "a \ b \ a \<^bold>\ b \ a \<^bold>< b" by (simp add: strict_iff_order) lemma order_iff_strict: - "a \ b \ a \ b \ a = b" + "a \<^bold>\ b \ a \<^bold>< b \ a = b" by (auto simp add: strict_iff_order refl) lemma irrefl: \ \not \iff\: makes problems due to multiple (dual) interpretations\ - "\ a \ a" + "\ a \<^bold>< a" by (simp add: strict_iff_order) lemma asym: - "a \ b \ b \ a \ False" + "a \<^bold>< b \ b \<^bold>< a \ False" by (auto simp add: strict_iff_order intro: antisym) lemma strict_trans1: - "a \ b \ b \ c \ a \ c" + "a \<^bold>\ b \ b \<^bold>< c \ a \<^bold>< c" by (auto simp add: strict_iff_order intro: trans antisym) lemma strict_trans2: - "a \ b \ b \ c \ a \ c" + "a \<^bold>< b \ b \<^bold>\ c \ a \<^bold>< c" by (auto simp add: strict_iff_order intro: trans antisym) lemma strict_trans: - "a \ b \ b \ c \ a \ c" + "a \<^bold>< b \ b \<^bold>< c \ a \<^bold>< c" by (auto intro: strict_trans1 strict_implies_order) end locale ordering_top = ordering + - fixes top :: "'a" - assumes extremum [simp]: "a \ top" + fixes top :: "'a" ("\<^bold>\") + assumes extremum [simp]: "a \<^bold>\ \<^bold>\" begin lemma extremum_uniqueI: - "top \ a \ a = top" + "\<^bold>\ \<^bold>\ a \ a = \<^bold>\" by (rule antisym) auto lemma extremum_unique: - "top \ a \ a = top" + "\<^bold>\ \<^bold>\ a \ a = \<^bold>\" by (auto intro: antisym) lemma extremum_strict [simp]: - "\ (top \ a)" + "\ (\<^bold>\ \<^bold>< a)" using extremum [of a] by (auto simp add: order_iff_strict intro: asym irrefl) lemma not_eq_extremum: - "a \ top \ a \ top" + "a \ \<^bold>\ \ a \<^bold>< \<^bold>\" by (auto simp add: order_iff_strict intro: not_eq_order_implies_strict extremum) end