author | blanchet |
Wed, 04 Mar 2009 10:45:52 +0100 | |
changeset 30240 | 5b25fee0362c |
parent 29859 | 33bff35f1335 |
child 30661 | 54858c8ad226 |
permissions | -rw-r--r-- |
26273 | 1 |
(* ID : $Id$ |
2 |
Author : Tobias Nipkow |
|
3 |
*) |
|
4 |
||
5 |
header {* Orders as Relations *} |
|
6 |
||
7 |
theory Order_Relation |
|
29859
33bff35f1335
Moved Order_Relation into Library and moved some of it into Relation.
nipkow
parents:
28952
diff
changeset
|
8 |
imports Main |
26273 | 9 |
begin |
10 |
||
26295 | 11 |
subsection{* Orders on a set *} |
12 |
||
30240 | 13 |
definition "preorder_on A r \<equiv> refl_on A r \<and> trans r" |
26295 | 14 |
|
15 |
definition "partial_order_on A r \<equiv> preorder_on A r \<and> antisym r" |
|
26273 | 16 |
|
26295 | 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)" |
|
26273 | 22 |
|
26295 | 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 |
||
26273 | 27 |
|
26295 | 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) |
|
26273 | 33 |
|
26295 | 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 |
||
26273 | 40 |
|
26295 | 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) |
|
26273 | 47 |
|
26295 | 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 |
||
26273 | 52 |
|
26295 | 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 *} |
|
26273 | 59 |
|
30240 | 60 |
abbreviation "Refl r \<equiv> refl_on (Field r) r" |
26295 | 61 |
|
62 |
abbreviation "Preorder r \<equiv> preorder_on (Field r) r" |
|
63 |
||
64 |
abbreviation "Partial_order r \<equiv> partial_order_on (Field r) r" |
|
26273 | 65 |
|
26295 | 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 |
||
26273 | 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)" |
|
30240 | 76 |
apply(auto simp add: subset_eq preorder_on_def refl_on_def Image_def) |
26273 | 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" |
|
30240 | 86 |
by(simp add: expand_set_eq antisym_def refl_on_def) metis |
26273 | 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" |
|
26295 | 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" |
|
26273 | 100 |
|
101 |
end |