src/HOL/ex/Sorting.thy
changeset 21404 eb85850d3eb7
parent 19736 d8d0f8f51d69
child 41413 64cd30d6b0b8
equal deleted inserted replaced
21403:dd58f13a8eb4 21404:eb85850d3eb7
    23   "sorted le [] = True"
    23   "sorted le [] = True"
    24   "sorted le (x#xs) = ((\<forall>y \<in> set xs. le x y) & sorted le xs)"
    24   "sorted le (x#xs) = ((\<forall>y \<in> set xs. le x y) & sorted le xs)"
    25 
    25 
    26 
    26 
    27 definition
    27 definition
    28   total  :: "('a \<Rightarrow> 'a \<Rightarrow> bool) => bool"
    28   total  :: "('a \<Rightarrow> 'a \<Rightarrow> bool) => bool" where
    29    "total r = (\<forall>x y. r x y | r y x)"
    29    "total r = (\<forall>x y. r x y | r y x)"
    30   
    30   
    31   transf :: "('a \<Rightarrow> 'a \<Rightarrow> bool) => bool"
    31 definition
       
    32   transf :: "('a \<Rightarrow> 'a \<Rightarrow> bool) => bool" where
    32    "transf f = (\<forall>x y z. f x y & f y z --> f x z)"
    33    "transf f = (\<forall>x y z. f x y & f y z --> f x z)"
    33 
    34 
    34 
    35 
    35 
    36 
    36 (* Equivalence of two definitions of `sorted' *)
    37 (* Equivalence of two definitions of `sorted' *)