src/HOL/Ord.thy
 author wenzelm Fri, 14 Feb 1997 15:32:00 +0100 changeset 2624 ab311b6e5e29 parent 2608 450c9b682a92 child 3143 d60e49b86c6a permissions -rw-r--r--
fixed comment;
```
(*  Title:      HOL/Ord.thy
ID:         \$Id\$
Author:     Tobias Nipkow, Cambridge University Computer Laboratory

Type classes for order signatures and orders.
*)

Ord = HOL +

axclass
ord < term

consts
"op <"        :: ['a::ord, 'a] => bool             ("(_/ < _)"  [50, 51] 50)
"op <="       :: ['a::ord, 'a] => bool             ("(_/ <= _)" [50, 51] 50)
mono          :: ['a::ord => 'b::ord] => bool       (*monotonicity*)
min, max      :: ['a::ord, 'a] => 'a

Least         :: ('a::ord=>bool) => 'a             (binder "LEAST " 10)

syntax
"op <"        :: ['a::ord, 'a] => bool             ("op <")
"op <="       :: ['a::ord, 'a] => bool             ("op <=")

syntax (symbols)
"op <="       :: ['a::ord, 'a] => bool             ("(_/ \\<le> _)"  [50, 51] 50)
"op <="       :: ['a::ord, 'a] => bool             ("op \\<le>")

defs
mono_def      "mono(f) == (!A B. A <= B --> f(A) <= f(B))"
min_def       "min a b == (if a <= b then a else b)"
max_def       "max a b == (if a <= b then b else a)"
Least_def     "Least P == @x. P(x) & (ALL y. y<x --> ~P(y))"

axclass order < ord
order_refl    "x <= x"
order_trans   "[| x <= y; y <= z |] ==> x <= z"
order_antisym "[| x <= y; y <= x |] ==> x = y"
order_less_le "x < y = (x <= y & x ~= y)"

end
```