src/HOL/Library/Order_Relation.thy
author blanchet
Wed, 04 Mar 2009 10:45:52 +0100
changeset 30240 5b25fee0362c
parent 30198 922f944f03b2
child 30661 54858c8ad226
permissions -rw-r--r--
Merge.
     1 (*  ID          : $Id$
     2     Author      : Tobias Nipkow
     3 *)
     4 
     5 header {* Orders as Relations *}
     6 
     7 theory Order_Relation
     8 imports Main
     9 begin
    10 
    11 subsection{* Orders on a set *}
    12 
    13 definition "preorder_on A r \<equiv> refl_on A r \<and> trans r"
    14 
    15 definition "partial_order_on A r \<equiv> preorder_on A r \<and> antisym r"
    16 
    17 definition "linear_order_on A r \<equiv> partial_order_on A r \<and> total_on A r"
    18 
    19 definition "strict_linear_order_on A r \<equiv> trans r \<and> irrefl r \<and> total_on A r"
    20 
    21 definition "well_order_on A r \<equiv> linear_order_on A r \<and> wf(r - Id)"
    22 
    23 lemmas order_on_defs =
    24   preorder_on_def partial_order_on_def linear_order_on_def
    25   strict_linear_order_on_def well_order_on_def
    26 
    27 
    28 lemma preorder_on_empty[simp]: "preorder_on {} {}"
    29 by(simp add:preorder_on_def trans_def)
    30 
    31 lemma partial_order_on_empty[simp]: "partial_order_on {} {}"
    32 by(simp add:partial_order_on_def)
    33 
    34 lemma lnear_order_on_empty[simp]: "linear_order_on {} {}"
    35 by(simp add:linear_order_on_def)
    36 
    37 lemma well_order_on_empty[simp]: "well_order_on {} {}"
    38 by(simp add:well_order_on_def)
    39 
    40 
    41 lemma preorder_on_converse[simp]: "preorder_on A (r^-1) = preorder_on A r"
    42 by (simp add:preorder_on_def)
    43 
    44 lemma partial_order_on_converse[simp]:
    45   "partial_order_on A (r^-1) = partial_order_on A r"
    46 by (simp add: partial_order_on_def)
    47 
    48 lemma linear_order_on_converse[simp]:
    49   "linear_order_on A (r^-1) = linear_order_on A r"
    50 by (simp add: linear_order_on_def)
    51 
    52 
    53 lemma strict_linear_order_on_diff_Id:
    54   "linear_order_on A r \<Longrightarrow> strict_linear_order_on A (r-Id)"
    55 by(simp add: order_on_defs trans_diff_Id)
    56 
    57 
    58 subsection{* Orders on the field *}
    59 
    60 abbreviation "Refl r \<equiv> refl_on (Field r) r"
    61 
    62 abbreviation "Preorder r \<equiv> preorder_on (Field r) r"
    63 
    64 abbreviation "Partial_order r \<equiv> partial_order_on (Field r) r"
    65 
    66 abbreviation "Total r \<equiv> total_on (Field r) r"
    67 
    68 abbreviation "Linear_order r \<equiv> linear_order_on (Field r) r"
    69 
    70 abbreviation "Well_order r \<equiv> well_order_on (Field r) r"
    71 
    72 
    73 lemma subset_Image_Image_iff:
    74   "\<lbrakk> Preorder r; A \<subseteq> Field r; B \<subseteq> Field r\<rbrakk> \<Longrightarrow>
    75    r `` A \<subseteq> r `` B \<longleftrightarrow> (\<forall>a\<in>A.\<exists>b\<in>B. (b,a):r)"
    76 apply(auto simp add: subset_eq preorder_on_def refl_on_def Image_def)
    77 apply metis
    78 by(metis trans_def)
    79 
    80 lemma subset_Image1_Image1_iff:
    81   "\<lbrakk> Preorder r; a : Field r; b : Field r\<rbrakk> \<Longrightarrow> r `` {a} \<subseteq> r `` {b} \<longleftrightarrow> (b,a):r"
    82 by(simp add:subset_Image_Image_iff)
    83 
    84 lemma Refl_antisym_eq_Image1_Image1_iff:
    85   "\<lbrakk>Refl r; antisym r; a:Field r; b:Field r\<rbrakk> \<Longrightarrow> r `` {a} = r `` {b} \<longleftrightarrow> a=b"
    86 by(simp add: expand_set_eq antisym_def refl_on_def) metis
    87 
    88 lemma Partial_order_eq_Image1_Image1_iff:
    89   "\<lbrakk>Partial_order r; a:Field r; b:Field r\<rbrakk> \<Longrightarrow> r `` {a} = r `` {b} \<longleftrightarrow> a=b"
    90 by(auto simp:order_on_defs Refl_antisym_eq_Image1_Image1_iff)
    91 
    92 
    93 subsection{* Orders on a type *}
    94 
    95 abbreviation "strict_linear_order \<equiv> strict_linear_order_on UNIV"
    96 
    97 abbreviation "linear_order \<equiv> linear_order_on UNIV"
    98 
    99 abbreviation "well_order r \<equiv> well_order_on UNIV"
   100 
   101 end