src/HOL/Library/Product_ord.thy
author berghofe
Fri, 01 Jul 2005 13:54:12 +0200
changeset 16633 208ebc9311f2
parent 15737 c7e522520910
child 17200 3a4d03d1a31b
permissions -rw-r--r--
Implemented trick (due to Tobias Nipkow) for fine-tuning simplification of premises of congruence rules.

(*  Title:      HOL/Library/Product_ord.thy
    ID:         $Id$
    Author:     Norbert Voelker
*)

header {* Instantiation of order classes for product types *}

theory Product_ord
imports Main
begin

instance "*" :: (ord,ord) ord ..

defs (overloaded)
  prod_le_def: "(x \<le> y) \<equiv> (fst x < fst y) | (fst x = fst y & snd x \<le> snd y)" 
  prod_less_def: "(x < y) \<equiv> (fst x < fst y) | (fst x = fst y & snd x < snd y)"


lemmas prod_ord_defs = prod_less_def prod_le_def

instance "*" :: (order,order) order 
  apply (intro_classes, unfold prod_ord_defs)
  by (auto intro: order_less_trans)

instance "*":: (linorder,linorder)linorder
  by (intro_classes, unfold prod_le_def, auto)

end