src/HOL/Library/Product_ord.thy
author paulson
Tue Jun 28 15:27:45 2005 +0200 (2005-06-28)
changeset 16587 b34c8aa657a5
parent 15737 c7e522520910
child 17200 3a4d03d1a31b
permissions -rw-r--r--
Constant "If" is now local
nipkow@15737
     1
(*  Title:      HOL/Library/Product_ord.thy
nipkow@15737
     2
    ID:         $Id$
nipkow@15737
     3
    Author:     Norbert Voelker
nipkow@15737
     4
*)
nipkow@15737
     5
nipkow@15737
     6
header {* Instantiation of order classes for product types *}
nipkow@15737
     7
nipkow@15737
     8
theory Product_ord
nipkow@15737
     9
imports Main
nipkow@15737
    10
begin
nipkow@15737
    11
nipkow@15737
    12
instance "*" :: (ord,ord) ord ..
nipkow@15737
    13
nipkow@15737
    14
defs (overloaded)
nipkow@15737
    15
  prod_le_def: "(x \<le> y) \<equiv> (fst x < fst y) | (fst x = fst y & snd x \<le> snd y)" 
nipkow@15737
    16
  prod_less_def: "(x < y) \<equiv> (fst x < fst y) | (fst x = fst y & snd x < snd y)"
nipkow@15737
    17
nipkow@15737
    18
nipkow@15737
    19
lemmas prod_ord_defs = prod_less_def prod_le_def
nipkow@15737
    20
nipkow@15737
    21
instance "*" :: (order,order) order 
nipkow@15737
    22
  apply (intro_classes, unfold prod_ord_defs)
nipkow@15737
    23
  by (auto intro: order_less_trans)
nipkow@15737
    24
nipkow@15737
    25
instance "*":: (linorder,linorder)linorder
nipkow@15737
    26
  by (intro_classes, unfold prod_le_def, auto)
nipkow@15737
    27
nipkow@15737
    28
end