# HG changeset patch # User desharna # Date 1669194124 -3600 # Node ID 5a13f1519f5d19058826cb4bef05a82a8a3eb3ee # Parent 608489919ecf4b61c1004ea1a1d9234c99dbec4b added type annotations and tuned formatting diff -r 608489919ecf -r 5a13f1519f5d NEWS --- a/NEWS Wed Nov 23 09:57:59 2022 +0100 +++ b/NEWS Wed Nov 23 10:02:04 2022 +0100 @@ -56,6 +56,7 @@ preorder.reflp_on_ge[simp] preorder.reflp_on_le[simp] reflp_on_conversp[simp] + totalI totalp_on_singleton[simp] * Theory "HOL.Transitive_Closure": diff -r 608489919ecf -r 5a13f1519f5d src/HOL/Relation.thy --- a/src/HOL/Relation.thy Wed Nov 23 09:57:59 2022 +0100 +++ b/src/HOL/Relation.thy Wed Nov 23 10:02:04 2022 +0100 @@ -580,26 +580,29 @@ subsubsection \Totality\ -definition total_on :: "'a set \ 'a rel \ bool" - where "total_on A r \ (\x\A. \y\A. x \ y \ (x, y) \ r \ (y, x) \ r)" +definition total_on :: "'a set \ 'a rel \ bool" where + "total_on A r \ (\x\A. \y\A. x \ y \ (x, y) \ r \ (y, x) \ r)" -lemma total_onI [intro?]: - "(\x y. \x \ A; y \ A; x \ y\ \ (x, y) \ r \ (y, x) \ r) \ total_on A r" - unfolding total_on_def by blast +abbreviation total :: "'a rel \ bool" where + "total \ total_on UNIV" -abbreviation "total \ total_on UNIV" - -definition totalp_on where +definition totalp_on :: "'a set \ ('a \ 'a \ bool) \ bool" where "totalp_on A R \ (\x \ A. \y \ A. x \ y \ R x y \ R y x)" -abbreviation totalp where +abbreviation totalp :: "('a \ 'a \ bool) \ bool" where "totalp \ totalp_on UNIV" lemma totalp_on_refl_on_eq[pred_set_conv]: "totalp_on A (\x y. (x, y) \ r) \ total_on A r" by (simp add: totalp_on_def total_on_def) -lemma totalp_onI: - "(\x y. x \ A \ y \ A \ x \ y \ R x y \ R y x) \ totalp_on A R" +lemma total_onI [intro?]: + "(\x y. x \ A \ y \ A \ x \ y \ (x, y) \ r \ (y, x) \ r) \ total_on A r" + unfolding total_on_def by blast + +lemma totalI: "(\x y. x \ y \ (x, y) \ r \ (y, x) \ r) \ total r" + by (rule total_onI) + +lemma totalp_onI: "(\x y. x \ A \ y \ A \ x \ y \ R x y \ R y x) \ totalp_on A R" by (simp add: totalp_on_def) lemma totalpI: "(\x y. x \ y \ R x y \ R y x) \ totalp R"