# HG changeset patch # User desharna # Date 1671460393 -3600 # Node ID d33fc5228aaec7b346e30bd4670add5081a6833a # Parent 0b5efc6de3858af497e67fe794ce6890338f5f4c added predicates trans_on and transp_on and redefined trans and transp to be abbreviations diff -r 0b5efc6de385 -r d33fc5228aae NEWS --- a/NEWS Mon Dec 19 14:09:37 2022 +0100 +++ b/NEWS Mon Dec 19 15:33:13 2022 +0100 @@ -40,6 +40,10 @@ antisymp to be abbreviations. Lemmas antisym_def and antisymp_def are explicitly provided for backward compatibility but their usage is discouraged. Minor INCOMPATIBILITY. + - Added predicates trans_on and transp_on and redefined trans and transp to + be abbreviations. Lemmas trans_def and transp_def are explicitly provided + for backward compatibility but their usage is discouraged. + Minor INCOMPATIBILITY. - Strengthened (and renamed) lemmas. Minor INCOMPATIBILITY. order.antisymp_ge[simp] ~> order.antisymp_on_ge[simp] order.antisymp_le[simp] ~> order.antisymp_on_le[simp] diff -r 0b5efc6de385 -r d33fc5228aae src/HOL/Relation.thy --- a/src/HOL/Relation.thy Mon Dec 19 14:09:37 2022 +0100 +++ b/src/HOL/Relation.thy Mon Dec 19 15:33:13 2022 +0100 @@ -603,11 +603,25 @@ subsubsection \Transitivity\ -definition trans :: "'a rel \ bool" - where "trans r \ (\x y z. (x, y) \ r \ (y, z) \ r \ (x, z) \ r)" +definition trans_on :: "'a set \ 'a rel \ bool" where + "trans_on A r \ (\x \ A. \y \ A. \z \ A. (x, y) \ r \ (y, z) \ r \ (x, z) \ r)" + +abbreviation trans :: "'a rel \ bool" where + "trans \ trans_on UNIV" + +definition transp_on :: "'a set \ ('a \ 'a \ bool) \ bool" where + "transp_on A R \ (\x \ A. \y \ A. \z \ A. R x y \ R y z \ R x z)" -definition transp :: "('a \ 'a \ bool) \ bool" - where "transp r \ (\x y z. r x y \ r y z \ r x z)" +abbreviation transp :: "('a \ 'a \ bool) \ bool" where + "transp \ transp_on UNIV" + +lemma trans_def[no_atp]: "trans r \ (\x y z. (x, y) \ r \ (y, z) \ r \ (x, z) \ r)" + by (simp add: trans_on_def) + +lemma transp_def: "transp R \ (\x y z. R x y \ R y z \ R x z)" + by (simp add: transp_on_def) + +text \@{thm [source] trans_def} and @{thm [source] transp_def} are for backward compatibility.\ lemma transp_trans_eq [pred_set_conv]: "transp (\x y. (x, y) \ r) \ trans r" by (simp add: trans_def transp_def) diff -r 0b5efc6de385 -r d33fc5228aae src/HOL/Tools/BNF/bnf_util.ML --- a/src/HOL/Tools/BNF/bnf_util.ML Mon Dec 19 14:09:37 2022 +0100 +++ b/src/HOL/Tools/BNF/bnf_util.ML Mon Dec 19 15:33:13 2022 +0100 @@ -400,7 +400,7 @@ Const (name, uncurry mk_pred2T (fastype_of R |> dest_pred2T) --> HOLogic.boolT) $ R; val mk_reflp = mk_pred \<^const_abbrev>\reflp\; val mk_symp = mk_pred \<^const_abbrev>\symp\; -val mk_transp = mk_pred \<^const_name>\transp\; +val mk_transp = mk_pred \<^const_abbrev>\transp\; fun mk_trans thm1 thm2 = trans OF [thm1, thm2]; fun mk_sym thm = thm RS sym;