15737
|
1 |
(* Title: HOL/Library/Product_ord.thy
|
|
2 |
ID: $Id$
|
|
3 |
Author: Norbert Voelker
|
|
4 |
*)
|
|
5 |
|
|
6 |
header {* Instantiation of order classes for product types *}
|
|
7 |
|
|
8 |
theory Product_ord
|
|
9 |
imports Main
|
|
10 |
begin
|
|
11 |
|
|
12 |
instance "*" :: (ord,ord) ord ..
|
|
13 |
|
|
14 |
defs (overloaded)
|
|
15 |
prod_le_def: "(x \<le> y) \<equiv> (fst x < fst y) | (fst x = fst y & snd x \<le> snd y)"
|
|
16 |
prod_less_def: "(x < y) \<equiv> (fst x < fst y) | (fst x = fst y & snd x < snd y)"
|
|
17 |
|
|
18 |
|
|
19 |
lemmas prod_ord_defs = prod_less_def prod_le_def
|
|
20 |
|
|
21 |
instance "*" :: (order,order) order
|
|
22 |
apply (intro_classes, unfold prod_ord_defs)
|
|
23 |
by (auto intro: order_less_trans)
|
|
24 |
|
|
25 |
instance "*":: (linorder,linorder)linorder
|
|
26 |
by (intro_classes, unfold prod_le_def, auto)
|
|
27 |
|
|
28 |
end |