Merge.
5 header {* Orders as Relations *}
11 subsection{* Orders on a set *}
13 definition "preorder_on A r \<equiv> refl_on A r \<and> trans r"
15 definition "partial_order_on A r \<equiv> preorder_on A r \<and> antisym r"
17 definition "linear_order_on A r \<equiv> partial_order_on A r \<and> total_on A r"
19 definition "strict_linear_order_on A r \<equiv> trans r \<and> irrefl r \<and> total_on A r"
21 definition "well_order_on A r \<equiv> linear_order_on A r \<and> wf(r - Id)"
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
28 lemma preorder_on_empty[simp]: "preorder_on {} {}"
29 by(simp add:preorder_on_def trans_def)
31 lemma partial_order_on_empty[simp]: "partial_order_on {} {}"
32 by(simp add:partial_order_on_def)
34 lemma lnear_order_on_empty[simp]: "linear_order_on {} {}"
35 by(simp add:linear_order_on_def)
37 lemma well_order_on_empty[simp]: "well_order_on {} {}"
38 by(simp add:well_order_on_def)
41 lemma preorder_on_converse[simp]: "preorder_on A (r^-1) = preorder_on A r"
42 by (simp add:preorder_on_def)
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)
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)
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)
58 subsection{* Orders on the field *}
60 abbreviation "Refl r \<equiv> refl_on (Field r) r"
62 abbreviation "Preorder r \<equiv> preorder_on (Field r) r"
64 abbreviation "Partial_order r \<equiv> partial_order_on (Field r) r"
66 abbreviation "Total r \<equiv> total_on (Field r) r"
68 abbreviation "Linear_order r \<equiv> linear_order_on (Field r) r"
70 abbreviation "Well_order r \<equiv> well_order_on (Field r) r"
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)
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)
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
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)
93 subsection{* Orders on a type *}
95 abbreviation "strict_linear_order \<equiv> strict_linear_order_on UNIV"
97 abbreviation "linear_order \<equiv> linear_order_on UNIV"
99 abbreviation "well_order r \<equiv> well_order_on UNIV"