src/HOL/Library/Product_ord.thy
changeset 15737 c7e522520910
child 17200 3a4d03d1a31b
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/HOL/Library/Product_ord.thy	Fri Apr 15 14:14:24 2005 +0200
     1.3 @@ -0,0 +1,28 @@
     1.4 +(*  Title:      HOL/Library/Product_ord.thy
     1.5 +    ID:         $Id$
     1.6 +    Author:     Norbert Voelker
     1.7 +*)
     1.8 +
     1.9 +header {* Instantiation of order classes for product types *}
    1.10 +
    1.11 +theory Product_ord
    1.12 +imports Main
    1.13 +begin
    1.14 +
    1.15 +instance "*" :: (ord,ord) ord ..
    1.16 +
    1.17 +defs (overloaded)
    1.18 +  prod_le_def: "(x \<le> y) \<equiv> (fst x < fst y) | (fst x = fst y & snd x \<le> snd y)" 
    1.19 +  prod_less_def: "(x < y) \<equiv> (fst x < fst y) | (fst x = fst y & snd x < snd y)"
    1.20 +
    1.21 +
    1.22 +lemmas prod_ord_defs = prod_less_def prod_le_def
    1.23 +
    1.24 +instance "*" :: (order,order) order 
    1.25 +  apply (intro_classes, unfold prod_ord_defs)
    1.26 +  by (auto intro: order_less_trans)
    1.27 +
    1.28 +instance "*":: (linorder,linorder)linorder
    1.29 +  by (intro_classes, unfold prod_le_def, auto)
    1.30 +
    1.31 +end
    1.32 \ No newline at end of file