author | paulson |
Thu, 20 Nov 1997 11:03:26 +0100 | |
changeset 4242 | 97601cf26262 |
parent 3947 | eb707467f8c5 |
child 4640 | ac6cf9f18653 |
permissions | -rw-r--r-- |
923 | 1 |
(* Title: HOL/Ord.thy |
2 |
ID: $Id$ |
|
3 |
Author: Tobias Nipkow, Cambridge University Computer Laboratory |
|
4 |
Copyright 1993 University of Cambridge |
|
5 |
||
2624 | 6 |
Type classes for order signatures and orders. |
923 | 7 |
*) |
8 |
||
9 |
Ord = HOL + |
|
10 |
||
11 |
axclass |
|
12 |
ord < term |
|
13 |
||
3947 | 14 |
global |
15 |
||
3820 | 16 |
syntax |
17 |
"op <" :: ['a::ord, 'a] => bool ("op <") |
|
18 |
"op <=" :: ['a::ord, 'a] => bool ("op <=") |
|
19 |
||
923 | 20 |
consts |
2259 | 21 |
"op <" :: ['a::ord, 'a] => bool ("(_/ < _)" [50, 51] 50) |
22 |
"op <=" :: ['a::ord, 'a] => bool ("(_/ <= _)" [50, 51] 50) |
|
1370
7361ac9b024d
removed quotes from types in consts and syntax sections
clasohm
parents:
965
diff
changeset
|
23 |
mono :: ['a::ord => 'b::ord] => bool (*monotonicity*) |
7361ac9b024d
removed quotes from types in consts and syntax sections
clasohm
parents:
965
diff
changeset
|
24 |
min, max :: ['a::ord, 'a] => 'a |
923 | 25 |
|
2608 | 26 |
Least :: ('a::ord=>bool) => 'a (binder "LEAST " 10) |
27 |
||
3820 | 28 |
syntax (symbols) |
29 |
"op <=" :: ['a::ord, 'a] => bool ("op \\<le>") |
|
30 |
"op <=" :: ['a::ord, 'a] => bool ("(_/ \\<le> _)" [50, 51] 50) |
|
2259 | 31 |
|
32 |
||
3947 | 33 |
local |
34 |
||
923 | 35 |
defs |
36 |
mono_def "mono(f) == (!A B. A <= B --> f(A) <= f(B))" |
|
965 | 37 |
min_def "min a b == (if a <= b then a else b)" |
38 |
max_def "max a b == (if a <= b then b else a)" |
|
3143
d60e49b86c6a
Modified def of Least, which, as Markus correctly complained, looked like
nipkow
parents:
2624
diff
changeset
|
39 |
Least_def "Least P == @x. P(x) & (ALL y. P(y) --> x <= y)" |
2608 | 40 |
|
41 |
||
42 |
axclass order < ord |
|
43 |
order_refl "x <= x" |
|
44 |
order_trans "[| x <= y; y <= z |] ==> x <= z" |
|
45 |
order_antisym "[| x <= y; y <= x |] ==> x = y" |
|
46 |
order_less_le "x < y = (x <= y & x ~= y)" |
|
923 | 47 |
|
48 |
end |