src/HOL/Library/Order_Relation.thy
 author haftmann Wed Apr 22 19:09:21 2009 +0200 (2009-04-22) changeset 30960 fec1a04b7220 parent 30661 54858c8ad226 child 39198 f967a16dfcdd permissions -rw-r--r--
power operation defined generic
1 (* Author: Tobias Nipkow *)
3 header {* Orders as Relations *}
5 theory Order_Relation
6 imports Main
7 begin
9 subsection{* Orders on a set *}
11 definition "preorder_on A r \<equiv> refl_on A r \<and> trans r"
13 definition "partial_order_on A r \<equiv> preorder_on A r \<and> antisym r"
15 definition "linear_order_on A r \<equiv> partial_order_on A r \<and> total_on A r"
17 definition "strict_linear_order_on A r \<equiv> trans r \<and> irrefl r \<and> total_on A r"
19 definition "well_order_on A r \<equiv> linear_order_on A r \<and> wf(r - Id)"
21 lemmas order_on_defs =
22   preorder_on_def partial_order_on_def linear_order_on_def
23   strict_linear_order_on_def well_order_on_def
26 lemma preorder_on_empty[simp]: "preorder_on {} {}"
29 lemma partial_order_on_empty[simp]: "partial_order_on {} {}"
32 lemma lnear_order_on_empty[simp]: "linear_order_on {} {}"
35 lemma well_order_on_empty[simp]: "well_order_on {} {}"
39 lemma preorder_on_converse[simp]: "preorder_on A (r^-1) = preorder_on A r"
42 lemma partial_order_on_converse[simp]:
43   "partial_order_on A (r^-1) = partial_order_on A r"
46 lemma linear_order_on_converse[simp]:
47   "linear_order_on A (r^-1) = linear_order_on A r"
51 lemma strict_linear_order_on_diff_Id:
52   "linear_order_on A r \<Longrightarrow> strict_linear_order_on A (r-Id)"
56 subsection{* Orders on the field *}
58 abbreviation "Refl r \<equiv> refl_on (Field r) r"
60 abbreviation "Preorder r \<equiv> preorder_on (Field r) r"
62 abbreviation "Partial_order r \<equiv> partial_order_on (Field r) r"
64 abbreviation "Total r \<equiv> total_on (Field r) r"
66 abbreviation "Linear_order r \<equiv> linear_order_on (Field r) r"
68 abbreviation "Well_order r \<equiv> well_order_on (Field r) r"
71 lemma subset_Image_Image_iff:
72   "\<lbrakk> Preorder r; A \<subseteq> Field r; B \<subseteq> Field r\<rbrakk> \<Longrightarrow>
73    r `` A \<subseteq> r `` B \<longleftrightarrow> (\<forall>a\<in>A.\<exists>b\<in>B. (b,a):r)"
74 apply(auto simp add: subset_eq preorder_on_def refl_on_def Image_def)
75 apply metis
76 by(metis trans_def)
78 lemma subset_Image1_Image1_iff:
79   "\<lbrakk> Preorder r; a : Field r; b : Field r\<rbrakk> \<Longrightarrow> r `` {a} \<subseteq> r `` {b} \<longleftrightarrow> (b,a):r"
82 lemma Refl_antisym_eq_Image1_Image1_iff:
83   "\<lbrakk>Refl r; antisym r; a:Field r; b:Field r\<rbrakk> \<Longrightarrow> r `` {a} = r `` {b} \<longleftrightarrow> a=b"
84 by(simp add: expand_set_eq antisym_def refl_on_def) metis
86 lemma Partial_order_eq_Image1_Image1_iff:
87   "\<lbrakk>Partial_order r; a:Field r; b:Field r\<rbrakk> \<Longrightarrow> r `` {a} = r `` {b} \<longleftrightarrow> a=b"
88 by(auto simp:order_on_defs Refl_antisym_eq_Image1_Image1_iff)
91 subsection{* Orders on a type *}
93 abbreviation "strict_linear_order \<equiv> strict_linear_order_on UNIV"
95 abbreviation "linear_order \<equiv> linear_order_on UNIV"
97 abbreviation "well_order r \<equiv> well_order_on UNIV"
99 end