author | haftmann |
Sun, 26 Feb 2012 20:10:14 +0100 | |
changeset 46691 | 72d81e789106 |
parent 46689 | f559866a7aa2 |
child 46692 | 1f8b766224f6 |
permissions | -rw-r--r-- |
10358 | 1 |
(* Title: HOL/Relation.thy |
46664
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
2 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory; Stefan Berghofer, TU Muenchen |
1128
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
3 |
*) |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
4 |
|
46664
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
5 |
header {* Relations – as sets of pairs, and binary predicates *} |
12905 | 6 |
|
15131 | 7 |
theory Relation |
32850 | 8 |
imports Datatype Finite_Set |
15131 | 9 |
begin |
5978
fa2c2dd74f8c
moved diag (diagonal relation) from Univ to Relation
paulson
parents:
5608
diff
changeset
|
10 |
|
46664
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
11 |
notation |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
12 |
bot ("\<bottom>") and |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
13 |
top ("\<top>") and |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
14 |
inf (infixl "\<sqinter>" 70) and |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
15 |
sup (infixl "\<squnion>" 65) and |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
16 |
Inf ("\<Sqinter>_" [900] 900) and |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
17 |
Sup ("\<Squnion>_" [900] 900) |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
18 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
19 |
syntax (xsymbols) |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
20 |
"_INF1" :: "pttrns \<Rightarrow> 'b \<Rightarrow> 'b" ("(3\<Sqinter>_./ _)" [0, 10] 10) |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
21 |
"_INF" :: "pttrn \<Rightarrow> 'a set \<Rightarrow> 'b \<Rightarrow> 'b" ("(3\<Sqinter>_\<in>_./ _)" [0, 0, 10] 10) |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
22 |
"_SUP1" :: "pttrns \<Rightarrow> 'b \<Rightarrow> 'b" ("(3\<Squnion>_./ _)" [0, 10] 10) |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
23 |
"_SUP" :: "pttrn \<Rightarrow> 'a set \<Rightarrow> 'b \<Rightarrow> 'b" ("(3\<Squnion>_\<in>_./ _)" [0, 0, 10] 10) |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
24 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
25 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
26 |
subsection {* Classical rules for reasoning on predicates *} |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
27 |
|
46689 | 28 |
(* CANDIDATE declare predicate1I [Pure.intro!, intro!] *) |
46664
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
29 |
declare predicate1D [Pure.dest?, dest?] |
46689 | 30 |
(* CANDIDATE declare predicate1D [Pure.dest, dest] *) |
46664
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
31 |
declare predicate2I [Pure.intro!, intro!] |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
32 |
declare predicate2D [Pure.dest, dest] |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
33 |
declare bot1E [elim!] |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
34 |
declare bot2E [elim!] |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
35 |
declare top1I [intro!] |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
36 |
declare top2I [intro!] |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
37 |
declare inf1I [intro!] |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
38 |
declare inf2I [intro!] |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
39 |
declare inf1E [elim!] |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
40 |
declare inf2E [elim!] |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
41 |
declare sup1I1 [intro?] |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
42 |
declare sup2I1 [intro?] |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
43 |
declare sup1I2 [intro?] |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
44 |
declare sup2I2 [intro?] |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
45 |
declare sup1E [elim!] |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
46 |
declare sup2E [elim!] |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
47 |
declare sup1CI [intro!] |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
48 |
declare sup2CI [intro!] |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
49 |
declare INF1_I [intro!] |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
50 |
declare INF2_I [intro!] |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
51 |
declare INF1_D [elim] |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
52 |
declare INF2_D [elim] |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
53 |
declare INF1_E [elim] |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
54 |
declare INF2_E [elim] |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
55 |
declare SUP1_I [intro] |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
56 |
declare SUP2_I [intro] |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
57 |
declare SUP1_E [elim!] |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
58 |
declare SUP2_E [elim!] |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
59 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
60 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
61 |
subsection {* Conversions between set and predicate relations *} |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
62 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
63 |
lemma pred_equals_eq [pred_set_conv]: "((\<lambda>x. x \<in> R) = (\<lambda>x. x \<in> S)) \<longleftrightarrow> (R = S)" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
64 |
by (simp add: set_eq_iff fun_eq_iff) |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
65 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
66 |
lemma pred_equals_eq2 [pred_set_conv]: "((\<lambda>x y. (x, y) \<in> R) = (\<lambda>x y. (x, y) \<in> S)) \<longleftrightarrow> (R = S)" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
67 |
by (simp add: set_eq_iff fun_eq_iff) |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
68 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
69 |
lemma pred_subset_eq [pred_set_conv]: "((\<lambda>x. x \<in> R) \<le> (\<lambda>x. x \<in> S)) \<longleftrightarrow> (R \<subseteq> S)" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
70 |
by (simp add: subset_iff le_fun_def) |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
71 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
72 |
lemma pred_subset_eq2 [pred_set_conv]: "((\<lambda>x y. (x, y) \<in> R) \<le> (\<lambda>x y. (x, y) \<in> S)) \<longleftrightarrow> (R \<subseteq> S)" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
73 |
by (simp add: subset_iff le_fun_def) |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
74 |
|
46689 | 75 |
lemma bot_empty_eq (* CANDIDATE [pred_set_conv] *): "\<bottom> = (\<lambda>x. x \<in> {})" |
76 |
by (auto simp add: fun_eq_iff) |
|
77 |
||
78 |
lemma bot_empty_eq2 (* CANDIDATE [pred_set_conv] *): "\<bottom> = (\<lambda>x y. (x, y) \<in> {})" |
|
46664
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
79 |
by (auto simp add: fun_eq_iff) |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
80 |
|
46689 | 81 |
(* CANDIDATE lemma top_empty_eq [pred_set_conv]: "\<top> = (\<lambda>x. x \<in> UNIV)" |
82 |
by (auto simp add: fun_eq_iff) *) |
|
83 |
||
84 |
(* CANDIDATE lemma top_empty_eq2 [pred_set_conv]: "\<top> = (\<lambda>x y. (x, y) \<in> UNIV)" |
|
85 |
by (auto simp add: fun_eq_iff) *) |
|
46664
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
86 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
87 |
lemma inf_Int_eq [pred_set_conv]: "(\<lambda>x. x \<in> R) \<sqinter> (\<lambda>x. x \<in> S) = (\<lambda>x. x \<in> R \<inter> S)" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
88 |
by (simp add: inf_fun_def) |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
89 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
90 |
lemma inf_Int_eq2 [pred_set_conv]: "(\<lambda>x y. (x, y) \<in> R) \<sqinter> (\<lambda>x y. (x, y) \<in> S) = (\<lambda>x y. (x, y) \<in> R \<inter> S)" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
91 |
by (simp add: inf_fun_def) |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
92 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
93 |
lemma sup_Un_eq [pred_set_conv]: "(\<lambda>x. x \<in> R) \<squnion> (\<lambda>x. x \<in> S) = (\<lambda>x. x \<in> R \<union> S)" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
94 |
by (simp add: sup_fun_def) |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
95 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
96 |
lemma sup_Un_eq2 [pred_set_conv]: "(\<lambda>x y. (x, y) \<in> R) \<squnion> (\<lambda>x y. (x, y) \<in> S) = (\<lambda>x y. (x, y) \<in> R \<union> S)" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
97 |
by (simp add: sup_fun_def) |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
98 |
|
46689 | 99 |
lemma INF_INT_eq (* CANDIDATE [pred_set_conv] *): "(\<Sqinter>i. (\<lambda>x. x \<in> r i)) = (\<lambda>x. x \<in> (\<Inter>i. r i))" |
46664
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
100 |
by (simp add: INF_apply fun_eq_iff) |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
101 |
|
46689 | 102 |
lemma INF_INT_eq2 (* CANDIDATE [pred_set_conv] *): "(\<Sqinter>i. (\<lambda>x y. (x, y) \<in> r i)) = (\<lambda>x y. (x, y) \<in> (\<Inter>i. r i))" |
46664
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
103 |
by (simp add: INF_apply fun_eq_iff) |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
104 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
105 |
lemma SUP_UN_eq [pred_set_conv]: "(\<Squnion>i. (\<lambda>x. x \<in> r i)) = (\<lambda>x. x \<in> (\<Union>i. r i))" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
106 |
by (simp add: SUP_apply fun_eq_iff) |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
107 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
108 |
lemma SUP_UN_eq2 [pred_set_conv]: "(\<Squnion>i. (\<lambda>x y. (x, y) \<in> r i)) = (\<lambda>x y. (x, y) \<in> (\<Union>i. r i))" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
109 |
by (simp add: SUP_apply fun_eq_iff) |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
110 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
111 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
112 |
subsection {* Relations as sets of pairs *} |
12913 | 113 |
|
46372 | 114 |
type_synonym 'a rel = "('a * 'a) set" |
115 |
||
19656
09be06943252
tuned concrete syntax -- abbreviation/const_syntax;
wenzelm
parents:
19363
diff
changeset
|
116 |
definition |
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21210
diff
changeset
|
117 |
converse :: "('a * 'b) set => ('b * 'a) set" |
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21210
diff
changeset
|
118 |
("(_^-1)" [1000] 999) where |
45137 | 119 |
"r^-1 = {(y, x). (x, y) : r}" |
7912 | 120 |
|
21210 | 121 |
notation (xsymbols) |
19656
09be06943252
tuned concrete syntax -- abbreviation/const_syntax;
wenzelm
parents:
19363
diff
changeset
|
122 |
converse ("(_\<inverse>)" [1000] 999) |
09be06943252
tuned concrete syntax -- abbreviation/const_syntax;
wenzelm
parents:
19363
diff
changeset
|
123 |
|
09be06943252
tuned concrete syntax -- abbreviation/const_syntax;
wenzelm
parents:
19363
diff
changeset
|
124 |
definition |
32235
8f9b8d14fc9f
"more standard" argument order of relation composition (op O)
krauss
parents:
31011
diff
changeset
|
125 |
rel_comp :: "[('a * 'b) set, ('b * 'c) set] => ('a * 'c) set" |
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21210
diff
changeset
|
126 |
(infixr "O" 75) where |
45137 | 127 |
"r O s = {(x,z). EX y. (x, y) : r & (y, z) : s}" |
12913 | 128 |
|
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21210
diff
changeset
|
129 |
definition |
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21210
diff
changeset
|
130 |
Image :: "[('a * 'b) set, 'a set] => 'b set" |
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21210
diff
changeset
|
131 |
(infixl "``" 90) where |
45137 | 132 |
"r `` s = {y. EX x:s. (x,y):r}" |
7912 | 133 |
|
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21210
diff
changeset
|
134 |
definition |
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21210
diff
changeset
|
135 |
Id :: "('a * 'a) set" where -- {* the identity relation *} |
45137 | 136 |
"Id = {p. EX x. p = (x,x)}" |
7912 | 137 |
|
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21210
diff
changeset
|
138 |
definition |
30198 | 139 |
Id_on :: "'a set => ('a * 'a) set" where -- {* diagonal: identity over a set *} |
45137 | 140 |
"Id_on A = (\<Union>x\<in>A. {(x,x)})" |
12913 | 141 |
|
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21210
diff
changeset
|
142 |
definition |
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21210
diff
changeset
|
143 |
Domain :: "('a * 'b) set => 'a set" where |
45137 | 144 |
"Domain r = {x. EX y. (x,y):r}" |
5978
fa2c2dd74f8c
moved diag (diagonal relation) from Univ to Relation
paulson
parents:
5608
diff
changeset
|
145 |
|
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21210
diff
changeset
|
146 |
definition |
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21210
diff
changeset
|
147 |
Range :: "('a * 'b) set => 'b set" where |
45137 | 148 |
"Range r = Domain(r^-1)" |
5978
fa2c2dd74f8c
moved diag (diagonal relation) from Univ to Relation
paulson
parents:
5608
diff
changeset
|
149 |
|
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21210
diff
changeset
|
150 |
definition |
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21210
diff
changeset
|
151 |
Field :: "('a * 'a) set => 'a set" where |
45137 | 152 |
"Field r = Domain r \<union> Range r" |
10786 | 153 |
|
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21210
diff
changeset
|
154 |
definition |
30198 | 155 |
refl_on :: "['a set, ('a * 'a) set] => bool" where -- {* reflexivity over a set *} |
45137 | 156 |
"refl_on A r \<longleftrightarrow> r \<subseteq> A \<times> A & (ALL x: A. (x,x) : r)" |
6806
43c081a0858d
new preficates refl, sym [from Integ/Equiv], antisym
paulson
parents:
5978
diff
changeset
|
157 |
|
26297 | 158 |
abbreviation |
30198 | 159 |
refl :: "('a * 'a) set => bool" where -- {* reflexivity over a type *} |
45137 | 160 |
"refl \<equiv> refl_on UNIV" |
26297 | 161 |
|
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21210
diff
changeset
|
162 |
definition |
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21210
diff
changeset
|
163 |
sym :: "('a * 'a) set => bool" where -- {* symmetry predicate *} |
45137 | 164 |
"sym r \<longleftrightarrow> (ALL x y. (x,y): r --> (y,x): r)" |
6806
43c081a0858d
new preficates refl, sym [from Integ/Equiv], antisym
paulson
parents:
5978
diff
changeset
|
165 |
|
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21210
diff
changeset
|
166 |
definition |
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21210
diff
changeset
|
167 |
antisym :: "('a * 'a) set => bool" where -- {* antisymmetry predicate *} |
45137 | 168 |
"antisym r \<longleftrightarrow> (ALL x y. (x,y):r --> (y,x):r --> x=y)" |
6806
43c081a0858d
new preficates refl, sym [from Integ/Equiv], antisym
paulson
parents:
5978
diff
changeset
|
169 |
|
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21210
diff
changeset
|
170 |
definition |
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21210
diff
changeset
|
171 |
trans :: "('a * 'a) set => bool" where -- {* transitivity predicate *} |
45137 | 172 |
"trans r \<longleftrightarrow> (ALL x y z. (x,y):r --> (y,z):r --> (x,z):r)" |
5978
fa2c2dd74f8c
moved diag (diagonal relation) from Univ to Relation
paulson
parents:
5608
diff
changeset
|
173 |
|
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21210
diff
changeset
|
174 |
definition |
45137 | 175 |
irrefl :: "('a * 'a) set => bool" where |
176 |
"irrefl r \<longleftrightarrow> (\<forall>x. (x,x) \<notin> r)" |
|
29859
33bff35f1335
Moved Order_Relation into Library and moved some of it into Relation.
nipkow
parents:
29609
diff
changeset
|
177 |
|
33bff35f1335
Moved Order_Relation into Library and moved some of it into Relation.
nipkow
parents:
29609
diff
changeset
|
178 |
definition |
45137 | 179 |
total_on :: "'a set => ('a * 'a) set => bool" where |
180 |
"total_on A r \<longleftrightarrow> (\<forall>x\<in>A.\<forall>y\<in>A. x\<noteq>y \<longrightarrow> (x,y)\<in>r \<or> (y,x)\<in>r)" |
|
29859
33bff35f1335
Moved Order_Relation into Library and moved some of it into Relation.
nipkow
parents:
29609
diff
changeset
|
181 |
|
33bff35f1335
Moved Order_Relation into Library and moved some of it into Relation.
nipkow
parents:
29609
diff
changeset
|
182 |
abbreviation "total \<equiv> total_on UNIV" |
33bff35f1335
Moved Order_Relation into Library and moved some of it into Relation.
nipkow
parents:
29609
diff
changeset
|
183 |
|
33bff35f1335
Moved Order_Relation into Library and moved some of it into Relation.
nipkow
parents:
29609
diff
changeset
|
184 |
definition |
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21210
diff
changeset
|
185 |
single_valued :: "('a * 'b) set => bool" where |
45137 | 186 |
"single_valued r \<longleftrightarrow> (ALL x y. (x,y):r --> (ALL z. (x,z):r --> y=z))" |
7014
11ee650edcd2
Added some definitions and theorems needed for the
berghofe
parents:
6806
diff
changeset
|
187 |
|
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21210
diff
changeset
|
188 |
definition |
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21210
diff
changeset
|
189 |
inv_image :: "('b * 'b) set => ('a => 'b) => ('a * 'a) set" where |
45137 | 190 |
"inv_image r f = {(x, y). (f x, f y) : r}" |
11136 | 191 |
|
12905 | 192 |
|
46664
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
193 |
subsubsection {* The identity relation *} |
12905 | 194 |
|
195 |
lemma IdI [intro]: "(a, a) : Id" |
|
26271 | 196 |
by (simp add: Id_def) |
12905 | 197 |
|
198 |
lemma IdE [elim!]: "p : Id ==> (!!x. p = (x, x) ==> P) ==> P" |
|
26271 | 199 |
by (unfold Id_def) (iprover elim: CollectE) |
12905 | 200 |
|
201 |
lemma pair_in_Id_conv [iff]: "((a, b) : Id) = (a = b)" |
|
26271 | 202 |
by (unfold Id_def) blast |
12905 | 203 |
|
30198 | 204 |
lemma refl_Id: "refl Id" |
205 |
by (simp add: refl_on_def) |
|
12905 | 206 |
|
207 |
lemma antisym_Id: "antisym Id" |
|
208 |
-- {* A strange result, since @{text Id} is also symmetric. *} |
|
26271 | 209 |
by (simp add: antisym_def) |
12905 | 210 |
|
19228 | 211 |
lemma sym_Id: "sym Id" |
26271 | 212 |
by (simp add: sym_def) |
19228 | 213 |
|
12905 | 214 |
lemma trans_Id: "trans Id" |
26271 | 215 |
by (simp add: trans_def) |
12905 | 216 |
|
217 |
||
46664
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
218 |
subsubsection {* Diagonal: identity over a set *} |
12905 | 219 |
|
30198 | 220 |
lemma Id_on_empty [simp]: "Id_on {} = {}" |
221 |
by (simp add: Id_on_def) |
|
13812
91713a1915ee
converting HOL/UNITY to use unconditional fairness
paulson
parents:
13639
diff
changeset
|
222 |
|
30198 | 223 |
lemma Id_on_eqI: "a = b ==> a : A ==> (a, b) : Id_on A" |
224 |
by (simp add: Id_on_def) |
|
12905 | 225 |
|
35828
46cfc4b8112e
now use "Named_Thms" for "noatp", and renamed "noatp" to "no_atp"
blanchet
parents:
33218
diff
changeset
|
226 |
lemma Id_onI [intro!,no_atp]: "a : A ==> (a, a) : Id_on A" |
30198 | 227 |
by (rule Id_on_eqI) (rule refl) |
12905 | 228 |
|
30198 | 229 |
lemma Id_onE [elim!]: |
230 |
"c : Id_on A ==> (!!x. x : A ==> c = (x, x) ==> P) ==> P" |
|
12913 | 231 |
-- {* The general elimination rule. *} |
30198 | 232 |
by (unfold Id_on_def) (iprover elim!: UN_E singletonE) |
12905 | 233 |
|
30198 | 234 |
lemma Id_on_iff: "((x, y) : Id_on A) = (x = y & x : A)" |
26271 | 235 |
by blast |
12905 | 236 |
|
45967 | 237 |
lemma Id_on_def' [nitpick_unfold]: |
44278
1220ecb81e8f
observe distinction between sets and predicates more properly
haftmann
parents:
41792
diff
changeset
|
238 |
"Id_on {x. A x} = Collect (\<lambda>(x, y). x = y \<and> A x)" |
1220ecb81e8f
observe distinction between sets and predicates more properly
haftmann
parents:
41792
diff
changeset
|
239 |
by auto |
40923
be80c93ac0a2
adding a nice definition of Id_on for quickcheck and nitpick
bulwahn
parents:
36772
diff
changeset
|
240 |
|
30198 | 241 |
lemma Id_on_subset_Times: "Id_on A \<subseteq> A \<times> A" |
26271 | 242 |
by blast |
12905 | 243 |
|
244 |
||
46664
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
245 |
subsubsection {* Composition of two relations *} |
12905 | 246 |
|
12913 | 247 |
lemma rel_compI [intro]: |
32235
8f9b8d14fc9f
"more standard" argument order of relation composition (op O)
krauss
parents:
31011
diff
changeset
|
248 |
"(a, b) : r ==> (b, c) : s ==> (a, c) : r O s" |
26271 | 249 |
by (unfold rel_comp_def) blast |
12905 | 250 |
|
12913 | 251 |
lemma rel_compE [elim!]: "xz : r O s ==> |
32235
8f9b8d14fc9f
"more standard" argument order of relation composition (op O)
krauss
parents:
31011
diff
changeset
|
252 |
(!!x y z. xz = (x, z) ==> (x, y) : r ==> (y, z) : s ==> P) ==> P" |
26271 | 253 |
by (unfold rel_comp_def) (iprover elim!: CollectE splitE exE conjE) |
12905 | 254 |
|
255 |
lemma rel_compEpair: |
|
32235
8f9b8d14fc9f
"more standard" argument order of relation composition (op O)
krauss
parents:
31011
diff
changeset
|
256 |
"(a, c) : r O s ==> (!!y. (a, y) : r ==> (y, c) : s ==> P) ==> P" |
26271 | 257 |
by (iprover elim: rel_compE Pair_inject ssubst) |
12905 | 258 |
|
259 |
lemma R_O_Id [simp]: "R O Id = R" |
|
26271 | 260 |
by fast |
12905 | 261 |
|
262 |
lemma Id_O_R [simp]: "Id O R = R" |
|
26271 | 263 |
by fast |
12905 | 264 |
|
23185 | 265 |
lemma rel_comp_empty1[simp]: "{} O R = {}" |
26271 | 266 |
by blast |
23185 | 267 |
|
268 |
lemma rel_comp_empty2[simp]: "R O {} = {}" |
|
26271 | 269 |
by blast |
23185 | 270 |
|
12905 | 271 |
lemma O_assoc: "(R O S) O T = R O (S O T)" |
26271 | 272 |
by blast |
12905 | 273 |
|
12913 | 274 |
lemma trans_O_subset: "trans r ==> r O r \<subseteq> r" |
26271 | 275 |
by (unfold trans_def) blast |
12905 | 276 |
|
12913 | 277 |
lemma rel_comp_mono: "r' \<subseteq> r ==> s' \<subseteq> s ==> (r' O s') \<subseteq> (r O s)" |
26271 | 278 |
by blast |
12905 | 279 |
|
280 |
lemma rel_comp_subset_Sigma: |
|
32235
8f9b8d14fc9f
"more standard" argument order of relation composition (op O)
krauss
parents:
31011
diff
changeset
|
281 |
"r \<subseteq> A \<times> B ==> s \<subseteq> B \<times> C ==> (r O s) \<subseteq> A \<times> C" |
26271 | 282 |
by blast |
12905 | 283 |
|
28008
f945f8d9ad4d
added distributivity of relation composition over union [simp]
krauss
parents:
26297
diff
changeset
|
284 |
lemma rel_comp_distrib[simp]: "R O (S \<union> T) = (R O S) \<union> (R O T)" |
f945f8d9ad4d
added distributivity of relation composition over union [simp]
krauss
parents:
26297
diff
changeset
|
285 |
by auto |
f945f8d9ad4d
added distributivity of relation composition over union [simp]
krauss
parents:
26297
diff
changeset
|
286 |
|
f945f8d9ad4d
added distributivity of relation composition over union [simp]
krauss
parents:
26297
diff
changeset
|
287 |
lemma rel_comp_distrib2[simp]: "(S \<union> T) O R = (S O R) \<union> (T O R)" |
f945f8d9ad4d
added distributivity of relation composition over union [simp]
krauss
parents:
26297
diff
changeset
|
288 |
by auto |
f945f8d9ad4d
added distributivity of relation composition over union [simp]
krauss
parents:
26297
diff
changeset
|
289 |
|
36772 | 290 |
lemma rel_comp_UNION_distrib: "s O UNION I r = UNION I (%i. s O r i)" |
291 |
by auto |
|
292 |
||
293 |
lemma rel_comp_UNION_distrib2: "UNION I r O s = UNION I (%i. r i O s)" |
|
294 |
by auto |
|
295 |
||
12913 | 296 |
|
46664
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
297 |
subsubsection {* Reflexivity *} |
12913 | 298 |
|
30198 | 299 |
lemma refl_onI: "r \<subseteq> A \<times> A ==> (!!x. x : A ==> (x, x) : r) ==> refl_on A r" |
300 |
by (unfold refl_on_def) (iprover intro!: ballI) |
|
12905 | 301 |
|
30198 | 302 |
lemma refl_onD: "refl_on A r ==> a : A ==> (a, a) : r" |
303 |
by (unfold refl_on_def) blast |
|
12905 | 304 |
|
30198 | 305 |
lemma refl_onD1: "refl_on A r ==> (x, y) : r ==> x : A" |
306 |
by (unfold refl_on_def) blast |
|
19228 | 307 |
|
30198 | 308 |
lemma refl_onD2: "refl_on A r ==> (x, y) : r ==> y : A" |
309 |
by (unfold refl_on_def) blast |
|
19228 | 310 |
|
30198 | 311 |
lemma refl_on_Int: "refl_on A r ==> refl_on B s ==> refl_on (A \<inter> B) (r \<inter> s)" |
312 |
by (unfold refl_on_def) blast |
|
19228 | 313 |
|
30198 | 314 |
lemma refl_on_Un: "refl_on A r ==> refl_on B s ==> refl_on (A \<union> B) (r \<union> s)" |
315 |
by (unfold refl_on_def) blast |
|
19228 | 316 |
|
30198 | 317 |
lemma refl_on_INTER: |
318 |
"ALL x:S. refl_on (A x) (r x) ==> refl_on (INTER S A) (INTER S r)" |
|
319 |
by (unfold refl_on_def) fast |
|
19228 | 320 |
|
30198 | 321 |
lemma refl_on_UNION: |
322 |
"ALL x:S. refl_on (A x) (r x) \<Longrightarrow> refl_on (UNION S A) (UNION S r)" |
|
323 |
by (unfold refl_on_def) blast |
|
19228 | 324 |
|
30198 | 325 |
lemma refl_on_empty[simp]: "refl_on {} {}" |
326 |
by(simp add:refl_on_def) |
|
26297 | 327 |
|
30198 | 328 |
lemma refl_on_Id_on: "refl_on A (Id_on A)" |
329 |
by (rule refl_onI [OF Id_on_subset_Times Id_onI]) |
|
19228 | 330 |
|
41792
ff3cb0c418b7
renamed "nitpick\_def" to "nitpick_unfold" to reflect its new semantics
blanchet
parents:
41056
diff
changeset
|
331 |
lemma refl_on_def' [nitpick_unfold, code]: |
41056
dcec9bc71ee9
adding a definition for refl_on which is friendly for quickcheck and nitpick
bulwahn
parents:
40923
diff
changeset
|
332 |
"refl_on A r = ((\<forall>(x, y) \<in> r. x : A \<and> y : A) \<and> (\<forall>x \<in> A. (x, x) : r))" |
dcec9bc71ee9
adding a definition for refl_on which is friendly for quickcheck and nitpick
bulwahn
parents:
40923
diff
changeset
|
333 |
by (auto intro: refl_onI dest: refl_onD refl_onD1 refl_onD2) |
12913 | 334 |
|
46664
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
335 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
336 |
subsubsection {* Antisymmetry *} |
12905 | 337 |
|
338 |
lemma antisymI: |
|
339 |
"(!!x y. (x, y) : r ==> (y, x) : r ==> x=y) ==> antisym r" |
|
26271 | 340 |
by (unfold antisym_def) iprover |
12905 | 341 |
|
342 |
lemma antisymD: "antisym r ==> (a, b) : r ==> (b, a) : r ==> a = b" |
|
26271 | 343 |
by (unfold antisym_def) iprover |
12905 | 344 |
|
19228 | 345 |
lemma antisym_subset: "r \<subseteq> s ==> antisym s ==> antisym r" |
26271 | 346 |
by (unfold antisym_def) blast |
12913 | 347 |
|
19228 | 348 |
lemma antisym_empty [simp]: "antisym {}" |
26271 | 349 |
by (unfold antisym_def) blast |
19228 | 350 |
|
30198 | 351 |
lemma antisym_Id_on [simp]: "antisym (Id_on A)" |
26271 | 352 |
by (unfold antisym_def) blast |
19228 | 353 |
|
354 |
||
46664
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
355 |
subsubsection {* Symmetry *} |
19228 | 356 |
|
357 |
lemma symI: "(!!a b. (a, b) : r ==> (b, a) : r) ==> sym r" |
|
26271 | 358 |
by (unfold sym_def) iprover |
15177 | 359 |
|
360 |
lemma symD: "sym r ==> (a, b) : r ==> (b, a) : r" |
|
26271 | 361 |
by (unfold sym_def, blast) |
12905 | 362 |
|
19228 | 363 |
lemma sym_Int: "sym r ==> sym s ==> sym (r \<inter> s)" |
26271 | 364 |
by (fast intro: symI dest: symD) |
19228 | 365 |
|
366 |
lemma sym_Un: "sym r ==> sym s ==> sym (r \<union> s)" |
|
26271 | 367 |
by (fast intro: symI dest: symD) |
19228 | 368 |
|
369 |
lemma sym_INTER: "ALL x:S. sym (r x) ==> sym (INTER S r)" |
|
26271 | 370 |
by (fast intro: symI dest: symD) |
19228 | 371 |
|
372 |
lemma sym_UNION: "ALL x:S. sym (r x) ==> sym (UNION S r)" |
|
26271 | 373 |
by (fast intro: symI dest: symD) |
19228 | 374 |
|
30198 | 375 |
lemma sym_Id_on [simp]: "sym (Id_on A)" |
26271 | 376 |
by (rule symI) clarify |
19228 | 377 |
|
378 |
||
46664
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
379 |
subsubsection {* Transitivity *} |
19228 | 380 |
|
46127 | 381 |
lemma trans_join [code]: |
45012
060f76635bfe
tuned specification and lemma distribution among theories; tuned proofs
haftmann
parents:
44921
diff
changeset
|
382 |
"trans r \<longleftrightarrow> (\<forall>(x, y1) \<in> r. \<forall>(y2, z) \<in> r. y1 = y2 \<longrightarrow> (x, z) \<in> r)" |
060f76635bfe
tuned specification and lemma distribution among theories; tuned proofs
haftmann
parents:
44921
diff
changeset
|
383 |
by (auto simp add: trans_def) |
060f76635bfe
tuned specification and lemma distribution among theories; tuned proofs
haftmann
parents:
44921
diff
changeset
|
384 |
|
12905 | 385 |
lemma transI: |
386 |
"(!!x y z. (x, y) : r ==> (y, z) : r ==> (x, z) : r) ==> trans r" |
|
26271 | 387 |
by (unfold trans_def) iprover |
12905 | 388 |
|
389 |
lemma transD: "trans r ==> (a, b) : r ==> (b, c) : r ==> (a, c) : r" |
|
26271 | 390 |
by (unfold trans_def) iprover |
12905 | 391 |
|
19228 | 392 |
lemma trans_Int: "trans r ==> trans s ==> trans (r \<inter> s)" |
26271 | 393 |
by (fast intro: transI elim: transD) |
19228 | 394 |
|
395 |
lemma trans_INTER: "ALL x:S. trans (r x) ==> trans (INTER S r)" |
|
26271 | 396 |
by (fast intro: transI elim: transD) |
19228 | 397 |
|
30198 | 398 |
lemma trans_Id_on [simp]: "trans (Id_on A)" |
26271 | 399 |
by (fast intro: transI elim: transD) |
19228 | 400 |
|
29859
33bff35f1335
Moved Order_Relation into Library and moved some of it into Relation.
nipkow
parents:
29609
diff
changeset
|
401 |
lemma trans_diff_Id: " trans r \<Longrightarrow> antisym r \<Longrightarrow> trans (r-Id)" |
33bff35f1335
Moved Order_Relation into Library and moved some of it into Relation.
nipkow
parents:
29609
diff
changeset
|
402 |
unfolding antisym_def trans_def by blast |
33bff35f1335
Moved Order_Relation into Library and moved some of it into Relation.
nipkow
parents:
29609
diff
changeset
|
403 |
|
46664
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
404 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
405 |
subsubsection {* Irreflexivity *} |
29859
33bff35f1335
Moved Order_Relation into Library and moved some of it into Relation.
nipkow
parents:
29609
diff
changeset
|
406 |
|
46127 | 407 |
lemma irrefl_distinct [code]: |
45012
060f76635bfe
tuned specification and lemma distribution among theories; tuned proofs
haftmann
parents:
44921
diff
changeset
|
408 |
"irrefl r \<longleftrightarrow> (\<forall>(x, y) \<in> r. x \<noteq> y)" |
060f76635bfe
tuned specification and lemma distribution among theories; tuned proofs
haftmann
parents:
44921
diff
changeset
|
409 |
by (auto simp add: irrefl_def) |
060f76635bfe
tuned specification and lemma distribution among theories; tuned proofs
haftmann
parents:
44921
diff
changeset
|
410 |
|
29859
33bff35f1335
Moved Order_Relation into Library and moved some of it into Relation.
nipkow
parents:
29609
diff
changeset
|
411 |
lemma irrefl_diff_Id[simp]: "irrefl(r-Id)" |
33bff35f1335
Moved Order_Relation into Library and moved some of it into Relation.
nipkow
parents:
29609
diff
changeset
|
412 |
by(simp add:irrefl_def) |
33bff35f1335
Moved Order_Relation into Library and moved some of it into Relation.
nipkow
parents:
29609
diff
changeset
|
413 |
|
45139 | 414 |
|
46664
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
415 |
subsubsection {* Totality *} |
29859
33bff35f1335
Moved Order_Relation into Library and moved some of it into Relation.
nipkow
parents:
29609
diff
changeset
|
416 |
|
33bff35f1335
Moved Order_Relation into Library and moved some of it into Relation.
nipkow
parents:
29609
diff
changeset
|
417 |
lemma total_on_empty[simp]: "total_on {} r" |
33bff35f1335
Moved Order_Relation into Library and moved some of it into Relation.
nipkow
parents:
29609
diff
changeset
|
418 |
by(simp add:total_on_def) |
33bff35f1335
Moved Order_Relation into Library and moved some of it into Relation.
nipkow
parents:
29609
diff
changeset
|
419 |
|
33bff35f1335
Moved Order_Relation into Library and moved some of it into Relation.
nipkow
parents:
29609
diff
changeset
|
420 |
lemma total_on_diff_Id[simp]: "total_on A (r-Id) = total_on A r" |
33bff35f1335
Moved Order_Relation into Library and moved some of it into Relation.
nipkow
parents:
29609
diff
changeset
|
421 |
by(simp add: total_on_def) |
12905 | 422 |
|
46664
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
423 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
424 |
subsubsection {* Converse *} |
12913 | 425 |
|
426 |
lemma converse_iff [iff]: "((a,b): r^-1) = ((b,a) : r)" |
|
26271 | 427 |
by (simp add: converse_def) |
12905 | 428 |
|
13343 | 429 |
lemma converseI[sym]: "(a, b) : r ==> (b, a) : r^-1" |
26271 | 430 |
by (simp add: converse_def) |
12905 | 431 |
|
13343 | 432 |
lemma converseD[sym]: "(a,b) : r^-1 ==> (b, a) : r" |
26271 | 433 |
by (simp add: converse_def) |
12905 | 434 |
|
435 |
lemma converseE [elim!]: |
|
436 |
"yx : r^-1 ==> (!!x y. yx = (y, x) ==> (x, y) : r ==> P) ==> P" |
|
12913 | 437 |
-- {* More general than @{text converseD}, as it ``splits'' the member of the relation. *} |
26271 | 438 |
by (unfold converse_def) (iprover elim!: CollectE splitE bexE) |
12905 | 439 |
|
440 |
lemma converse_converse [simp]: "(r^-1)^-1 = r" |
|
26271 | 441 |
by (unfold converse_def) blast |
12905 | 442 |
|
443 |
lemma converse_rel_comp: "(r O s)^-1 = s^-1 O r^-1" |
|
26271 | 444 |
by blast |
12905 | 445 |
|
19228 | 446 |
lemma converse_Int: "(r \<inter> s)^-1 = r^-1 \<inter> s^-1" |
26271 | 447 |
by blast |
19228 | 448 |
|
449 |
lemma converse_Un: "(r \<union> s)^-1 = r^-1 \<union> s^-1" |
|
26271 | 450 |
by blast |
19228 | 451 |
|
452 |
lemma converse_INTER: "(INTER S r)^-1 = (INT x:S. (r x)^-1)" |
|
26271 | 453 |
by fast |
19228 | 454 |
|
455 |
lemma converse_UNION: "(UNION S r)^-1 = (UN x:S. (r x)^-1)" |
|
26271 | 456 |
by blast |
19228 | 457 |
|
12905 | 458 |
lemma converse_Id [simp]: "Id^-1 = Id" |
26271 | 459 |
by blast |
12905 | 460 |
|
30198 | 461 |
lemma converse_Id_on [simp]: "(Id_on A)^-1 = Id_on A" |
26271 | 462 |
by blast |
12905 | 463 |
|
30198 | 464 |
lemma refl_on_converse [simp]: "refl_on A (converse r) = refl_on A r" |
465 |
by (unfold refl_on_def) auto |
|
12905 | 466 |
|
19228 | 467 |
lemma sym_converse [simp]: "sym (converse r) = sym r" |
26271 | 468 |
by (unfold sym_def) blast |
19228 | 469 |
|
470 |
lemma antisym_converse [simp]: "antisym (converse r) = antisym r" |
|
26271 | 471 |
by (unfold antisym_def) blast |
12905 | 472 |
|
19228 | 473 |
lemma trans_converse [simp]: "trans (converse r) = trans r" |
26271 | 474 |
by (unfold trans_def) blast |
12905 | 475 |
|
19228 | 476 |
lemma sym_conv_converse_eq: "sym r = (r^-1 = r)" |
26271 | 477 |
by (unfold sym_def) fast |
19228 | 478 |
|
479 |
lemma sym_Un_converse: "sym (r \<union> r^-1)" |
|
26271 | 480 |
by (unfold sym_def) blast |
19228 | 481 |
|
482 |
lemma sym_Int_converse: "sym (r \<inter> r^-1)" |
|
26271 | 483 |
by (unfold sym_def) blast |
19228 | 484 |
|
29859
33bff35f1335
Moved Order_Relation into Library and moved some of it into Relation.
nipkow
parents:
29609
diff
changeset
|
485 |
lemma total_on_converse[simp]: "total_on A (r^-1) = total_on A r" |
33bff35f1335
Moved Order_Relation into Library and moved some of it into Relation.
nipkow
parents:
29609
diff
changeset
|
486 |
by (auto simp: total_on_def) |
33bff35f1335
Moved Order_Relation into Library and moved some of it into Relation.
nipkow
parents:
29609
diff
changeset
|
487 |
|
12913 | 488 |
|
46664
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
489 |
subsubsection {* Domain *} |
12905 | 490 |
|
35828
46cfc4b8112e
now use "Named_Thms" for "noatp", and renamed "noatp" to "no_atp"
blanchet
parents:
33218
diff
changeset
|
491 |
declare Domain_def [no_atp] |
24286
7619080e49f0
ATP blacklisting is now in theory data, attribute noatp
paulson
parents:
23709
diff
changeset
|
492 |
|
12905 | 493 |
lemma Domain_iff: "(a : Domain r) = (EX y. (a, y) : r)" |
26271 | 494 |
by (unfold Domain_def) blast |
12905 | 495 |
|
496 |
lemma DomainI [intro]: "(a, b) : r ==> a : Domain r" |
|
26271 | 497 |
by (iprover intro!: iffD2 [OF Domain_iff]) |
12905 | 498 |
|
499 |
lemma DomainE [elim!]: |
|
500 |
"a : Domain r ==> (!!y. (a, y) : r ==> P) ==> P" |
|
26271 | 501 |
by (iprover dest!: iffD1 [OF Domain_iff]) |
12905 | 502 |
|
46127 | 503 |
lemma Domain_fst [code]: |
45012
060f76635bfe
tuned specification and lemma distribution among theories; tuned proofs
haftmann
parents:
44921
diff
changeset
|
504 |
"Domain r = fst ` r" |
060f76635bfe
tuned specification and lemma distribution among theories; tuned proofs
haftmann
parents:
44921
diff
changeset
|
505 |
by (auto simp add: image_def Bex_def) |
060f76635bfe
tuned specification and lemma distribution among theories; tuned proofs
haftmann
parents:
44921
diff
changeset
|
506 |
|
12905 | 507 |
lemma Domain_empty [simp]: "Domain {} = {}" |
26271 | 508 |
by blast |
12905 | 509 |
|
32876 | 510 |
lemma Domain_empty_iff: "Domain r = {} \<longleftrightarrow> r = {}" |
511 |
by auto |
|
512 |
||
12905 | 513 |
lemma Domain_insert: "Domain (insert (a, b) r) = insert a (Domain r)" |
26271 | 514 |
by blast |
12905 | 515 |
|
516 |
lemma Domain_Id [simp]: "Domain Id = UNIV" |
|
26271 | 517 |
by blast |
12905 | 518 |
|
30198 | 519 |
lemma Domain_Id_on [simp]: "Domain (Id_on A) = A" |
26271 | 520 |
by blast |
12905 | 521 |
|
13830 | 522 |
lemma Domain_Un_eq: "Domain(A \<union> B) = Domain(A) \<union> Domain(B)" |
26271 | 523 |
by blast |
12905 | 524 |
|
13830 | 525 |
lemma Domain_Int_subset: "Domain(A \<inter> B) \<subseteq> Domain(A) \<inter> Domain(B)" |
26271 | 526 |
by blast |
12905 | 527 |
|
12913 | 528 |
lemma Domain_Diff_subset: "Domain(A) - Domain(B) \<subseteq> Domain(A - B)" |
26271 | 529 |
by blast |
12905 | 530 |
|
13830 | 531 |
lemma Domain_Union: "Domain (Union S) = (\<Union>A\<in>S. Domain A)" |
26271 | 532 |
by blast |
533 |
||
534 |
lemma Domain_converse[simp]: "Domain(r^-1) = Range r" |
|
535 |
by(auto simp:Range_def) |
|
12905 | 536 |
|
12913 | 537 |
lemma Domain_mono: "r \<subseteq> s ==> Domain r \<subseteq> Domain s" |
26271 | 538 |
by blast |
12905 | 539 |
|
36729 | 540 |
lemma fst_eq_Domain: "fst ` R = Domain R" |
44921 | 541 |
by force |
22172 | 542 |
|
29609 | 543 |
lemma Domain_dprod [simp]: "Domain (dprod r s) = uprod (Domain r) (Domain s)" |
544 |
by auto |
|
545 |
||
546 |
lemma Domain_dsum [simp]: "Domain (dsum r s) = usum (Domain r) (Domain s)" |
|
547 |
by auto |
|
548 |
||
12905 | 549 |
|
46664
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
550 |
subsubsection {* Range *} |
12905 | 551 |
|
552 |
lemma Range_iff: "(a : Range r) = (EX y. (y, a) : r)" |
|
26271 | 553 |
by (simp add: Domain_def Range_def) |
12905 | 554 |
|
555 |
lemma RangeI [intro]: "(a, b) : r ==> b : Range r" |
|
26271 | 556 |
by (unfold Range_def) (iprover intro!: converseI DomainI) |
12905 | 557 |
|
558 |
lemma RangeE [elim!]: "b : Range r ==> (!!x. (x, b) : r ==> P) ==> P" |
|
26271 | 559 |
by (unfold Range_def) (iprover elim!: DomainE dest!: converseD) |
12905 | 560 |
|
46127 | 561 |
lemma Range_snd [code]: |
45012
060f76635bfe
tuned specification and lemma distribution among theories; tuned proofs
haftmann
parents:
44921
diff
changeset
|
562 |
"Range r = snd ` r" |
060f76635bfe
tuned specification and lemma distribution among theories; tuned proofs
haftmann
parents:
44921
diff
changeset
|
563 |
by (auto simp add: image_def Bex_def) |
060f76635bfe
tuned specification and lemma distribution among theories; tuned proofs
haftmann
parents:
44921
diff
changeset
|
564 |
|
12905 | 565 |
lemma Range_empty [simp]: "Range {} = {}" |
26271 | 566 |
by blast |
12905 | 567 |
|
32876 | 568 |
lemma Range_empty_iff: "Range r = {} \<longleftrightarrow> r = {}" |
569 |
by auto |
|
570 |
||
12905 | 571 |
lemma Range_insert: "Range (insert (a, b) r) = insert b (Range r)" |
26271 | 572 |
by blast |
12905 | 573 |
|
574 |
lemma Range_Id [simp]: "Range Id = UNIV" |
|
26271 | 575 |
by blast |
12905 | 576 |
|
30198 | 577 |
lemma Range_Id_on [simp]: "Range (Id_on A) = A" |
26271 | 578 |
by auto |
12905 | 579 |
|
13830 | 580 |
lemma Range_Un_eq: "Range(A \<union> B) = Range(A) \<union> Range(B)" |
26271 | 581 |
by blast |
12905 | 582 |
|
13830 | 583 |
lemma Range_Int_subset: "Range(A \<inter> B) \<subseteq> Range(A) \<inter> Range(B)" |
26271 | 584 |
by blast |
12905 | 585 |
|
12913 | 586 |
lemma Range_Diff_subset: "Range(A) - Range(B) \<subseteq> Range(A - B)" |
26271 | 587 |
by blast |
12905 | 588 |
|
13830 | 589 |
lemma Range_Union: "Range (Union S) = (\<Union>A\<in>S. Range A)" |
26271 | 590 |
by blast |
591 |
||
592 |
lemma Range_converse[simp]: "Range(r^-1) = Domain r" |
|
593 |
by blast |
|
12905 | 594 |
|
36729 | 595 |
lemma snd_eq_Range: "snd ` R = Range R" |
44921 | 596 |
by force |
26271 | 597 |
|
598 |
||
46664
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
599 |
subsubsection {* Field *} |
26271 | 600 |
|
601 |
lemma mono_Field: "r \<subseteq> s \<Longrightarrow> Field r \<subseteq> Field s" |
|
602 |
by(auto simp:Field_def Domain_def Range_def) |
|
603 |
||
604 |
lemma Field_empty[simp]: "Field {} = {}" |
|
605 |
by(auto simp:Field_def) |
|
606 |
||
607 |
lemma Field_insert[simp]: "Field (insert (a,b) r) = {a,b} \<union> Field r" |
|
608 |
by(auto simp:Field_def) |
|
609 |
||
610 |
lemma Field_Un[simp]: "Field (r \<union> s) = Field r \<union> Field s" |
|
611 |
by(auto simp:Field_def) |
|
612 |
||
613 |
lemma Field_Union[simp]: "Field (\<Union>R) = \<Union>(Field ` R)" |
|
614 |
by(auto simp:Field_def) |
|
615 |
||
616 |
lemma Field_converse[simp]: "Field(r^-1) = Field r" |
|
617 |
by(auto simp:Field_def) |
|
22172 | 618 |
|
12905 | 619 |
|
46664
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
620 |
subsubsection {* Image of a set under a relation *} |
12905 | 621 |
|
35828
46cfc4b8112e
now use "Named_Thms" for "noatp", and renamed "noatp" to "no_atp"
blanchet
parents:
33218
diff
changeset
|
622 |
declare Image_def [no_atp] |
24286
7619080e49f0
ATP blacklisting is now in theory data, attribute noatp
paulson
parents:
23709
diff
changeset
|
623 |
|
12913 | 624 |
lemma Image_iff: "(b : r``A) = (EX x:A. (x, b) : r)" |
26271 | 625 |
by (simp add: Image_def) |
12905 | 626 |
|
12913 | 627 |
lemma Image_singleton: "r``{a} = {b. (a, b) : r}" |
26271 | 628 |
by (simp add: Image_def) |
12905 | 629 |
|
12913 | 630 |
lemma Image_singleton_iff [iff]: "(b : r``{a}) = ((a, b) : r)" |
26271 | 631 |
by (rule Image_iff [THEN trans]) simp |
12905 | 632 |
|
35828
46cfc4b8112e
now use "Named_Thms" for "noatp", and renamed "noatp" to "no_atp"
blanchet
parents:
33218
diff
changeset
|
633 |
lemma ImageI [intro,no_atp]: "(a, b) : r ==> a : A ==> b : r``A" |
26271 | 634 |
by (unfold Image_def) blast |
12905 | 635 |
|
636 |
lemma ImageE [elim!]: |
|
12913 | 637 |
"b : r `` A ==> (!!x. (x, b) : r ==> x : A ==> P) ==> P" |
26271 | 638 |
by (unfold Image_def) (iprover elim!: CollectE bexE) |
12905 | 639 |
|
640 |
lemma rev_ImageI: "a : A ==> (a, b) : r ==> b : r `` A" |
|
641 |
-- {* This version's more effective when we already have the required @{text a} *} |
|
26271 | 642 |
by blast |
12905 | 643 |
|
644 |
lemma Image_empty [simp]: "R``{} = {}" |
|
26271 | 645 |
by blast |
12905 | 646 |
|
647 |
lemma Image_Id [simp]: "Id `` A = A" |
|
26271 | 648 |
by blast |
12905 | 649 |
|
30198 | 650 |
lemma Image_Id_on [simp]: "Id_on A `` B = A \<inter> B" |
26271 | 651 |
by blast |
13830 | 652 |
|
653 |
lemma Image_Int_subset: "R `` (A \<inter> B) \<subseteq> R `` A \<inter> R `` B" |
|
26271 | 654 |
by blast |
12905 | 655 |
|
13830 | 656 |
lemma Image_Int_eq: |
657 |
"single_valued (converse R) ==> R `` (A \<inter> B) = R `` A \<inter> R `` B" |
|
26271 | 658 |
by (simp add: single_valued_def, blast) |
12905 | 659 |
|
13830 | 660 |
lemma Image_Un: "R `` (A \<union> B) = R `` A \<union> R `` B" |
26271 | 661 |
by blast |
12905 | 662 |
|
13812
91713a1915ee
converting HOL/UNITY to use unconditional fairness
paulson
parents:
13639
diff
changeset
|
663 |
lemma Un_Image: "(R \<union> S) `` A = R `` A \<union> S `` A" |
26271 | 664 |
by blast |
13812
91713a1915ee
converting HOL/UNITY to use unconditional fairness
paulson
parents:
13639
diff
changeset
|
665 |
|
12913 | 666 |
lemma Image_subset: "r \<subseteq> A \<times> B ==> r``C \<subseteq> B" |
26271 | 667 |
by (iprover intro!: subsetI elim!: ImageE dest!: subsetD SigmaD2) |
12905 | 668 |
|
13830 | 669 |
lemma Image_eq_UN: "r``B = (\<Union>y\<in> B. r``{y})" |
12905 | 670 |
-- {* NOT suitable for rewriting *} |
26271 | 671 |
by blast |
12905 | 672 |
|
12913 | 673 |
lemma Image_mono: "r' \<subseteq> r ==> A' \<subseteq> A ==> (r' `` A') \<subseteq> (r `` A)" |
26271 | 674 |
by blast |
12905 | 675 |
|
13830 | 676 |
lemma Image_UN: "(r `` (UNION A B)) = (\<Union>x\<in>A. r `` (B x))" |
26271 | 677 |
by blast |
13830 | 678 |
|
679 |
lemma Image_INT_subset: "(r `` INTER A B) \<subseteq> (\<Inter>x\<in>A. r `` (B x))" |
|
26271 | 680 |
by blast |
12905 | 681 |
|
13830 | 682 |
text{*Converse inclusion requires some assumptions*} |
683 |
lemma Image_INT_eq: |
|
684 |
"[|single_valued (r\<inverse>); A\<noteq>{}|] ==> r `` INTER A B = (\<Inter>x\<in>A. r `` B x)" |
|
685 |
apply (rule equalityI) |
|
686 |
apply (rule Image_INT_subset) |
|
687 |
apply (simp add: single_valued_def, blast) |
|
688 |
done |
|
12905 | 689 |
|
12913 | 690 |
lemma Image_subset_eq: "(r``A \<subseteq> B) = (A \<subseteq> - ((r^-1) `` (-B)))" |
26271 | 691 |
by blast |
12905 | 692 |
|
693 |
||
46664
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
694 |
subsubsection {* Single valued relations *} |
12913 | 695 |
|
696 |
lemma single_valuedI: |
|
12905 | 697 |
"ALL x y. (x,y):r --> (ALL z. (x,z):r --> y=z) ==> single_valued r" |
26271 | 698 |
by (unfold single_valued_def) |
12905 | 699 |
|
700 |
lemma single_valuedD: |
|
701 |
"single_valued r ==> (x, y) : r ==> (x, z) : r ==> y = z" |
|
26271 | 702 |
by (simp add: single_valued_def) |
12905 | 703 |
|
19228 | 704 |
lemma single_valued_rel_comp: |
705 |
"single_valued r ==> single_valued s ==> single_valued (r O s)" |
|
26271 | 706 |
by (unfold single_valued_def) blast |
19228 | 707 |
|
708 |
lemma single_valued_subset: |
|
709 |
"r \<subseteq> s ==> single_valued s ==> single_valued r" |
|
26271 | 710 |
by (unfold single_valued_def) blast |
19228 | 711 |
|
712 |
lemma single_valued_Id [simp]: "single_valued Id" |
|
26271 | 713 |
by (unfold single_valued_def) blast |
19228 | 714 |
|
30198 | 715 |
lemma single_valued_Id_on [simp]: "single_valued (Id_on A)" |
26271 | 716 |
by (unfold single_valued_def) blast |
19228 | 717 |
|
12905 | 718 |
|
46664
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
719 |
subsubsection {* Graphs given by @{text Collect} *} |
12905 | 720 |
|
721 |
lemma Domain_Collect_split [simp]: "Domain{(x,y). P x y} = {x. EX y. P x y}" |
|
26271 | 722 |
by auto |
12905 | 723 |
|
724 |
lemma Range_Collect_split [simp]: "Range{(x,y). P x y} = {y. EX x. P x y}" |
|
26271 | 725 |
by auto |
12905 | 726 |
|
727 |
lemma Image_Collect_split [simp]: "{(x,y). P x y} `` A = {y. EX x:A. P x y}" |
|
26271 | 728 |
by auto |
12905 | 729 |
|
730 |
||
46664
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
731 |
subsubsection {* Inverse image *} |
12905 | 732 |
|
19228 | 733 |
lemma sym_inv_image: "sym r ==> sym (inv_image r f)" |
26271 | 734 |
by (unfold sym_def inv_image_def) blast |
19228 | 735 |
|
12913 | 736 |
lemma trans_inv_image: "trans r ==> trans (inv_image r f)" |
12905 | 737 |
apply (unfold trans_def inv_image_def) |
738 |
apply (simp (no_asm)) |
|
739 |
apply blast |
|
740 |
done |
|
741 |
||
32463
3a0a65ca2261
moved lemma Wellfounded.in_inv_image to Relation.thy
krauss
parents:
32235
diff
changeset
|
742 |
lemma in_inv_image[simp]: "((x,y) : inv_image r f) = ((f x, f y) : r)" |
3a0a65ca2261
moved lemma Wellfounded.in_inv_image to Relation.thy
krauss
parents:
32235
diff
changeset
|
743 |
by (auto simp:inv_image_def) |
3a0a65ca2261
moved lemma Wellfounded.in_inv_image to Relation.thy
krauss
parents:
32235
diff
changeset
|
744 |
|
33218 | 745 |
lemma converse_inv_image[simp]: "(inv_image R f)^-1 = inv_image (R^-1) f" |
746 |
unfolding inv_image_def converse_def by auto |
|
747 |
||
23709 | 748 |
|
46664
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
749 |
subsubsection {* Finiteness *} |
29609 | 750 |
|
751 |
lemma finite_converse [iff]: "finite (r^-1) = finite r" |
|
752 |
apply (subgoal_tac "r^-1 = (%(x,y). (y,x))`r") |
|
753 |
apply simp |
|
754 |
apply (rule iffI) |
|
755 |
apply (erule finite_imageD [unfolded inj_on_def]) |
|
756 |
apply (simp split add: split_split) |
|
757 |
apply (erule finite_imageI) |
|
758 |
apply (simp add: converse_def image_def, auto) |
|
759 |
apply (rule bexI) |
|
760 |
prefer 2 apply assumption |
|
761 |
apply simp |
|
762 |
done |
|
763 |
||
32876 | 764 |
lemma finite_Domain: "finite r ==> finite (Domain r)" |
765 |
by (induct set: finite) (auto simp add: Domain_insert) |
|
766 |
||
767 |
lemma finite_Range: "finite r ==> finite (Range r)" |
|
768 |
by (induct set: finite) (auto simp add: Range_insert) |
|
29609 | 769 |
|
770 |
lemma finite_Field: "finite r ==> finite (Field r)" |
|
771 |
-- {* A finite relation has a finite field (@{text "= domain \<union> range"}. *} |
|
772 |
apply (induct set: finite) |
|
773 |
apply (auto simp add: Field_def Domain_insert Range_insert) |
|
774 |
done |
|
775 |
||
776 |
||
46664
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
777 |
subsubsection {* Miscellaneous *} |
36728
ae397b810c8b
rule subrelI (for nice Isar proofs of relation inequalities)
krauss
parents:
35828
diff
changeset
|
778 |
|
ae397b810c8b
rule subrelI (for nice Isar proofs of relation inequalities)
krauss
parents:
35828
diff
changeset
|
779 |
text {* Version of @{thm[source] lfp_induct} for binary relations *} |
23709 | 780 |
|
781 |
lemmas lfp_induct2 = |
|
782 |
lfp_induct_set [of "(a, b)", split_format (complete)] |
|
783 |
||
36728
ae397b810c8b
rule subrelI (for nice Isar proofs of relation inequalities)
krauss
parents:
35828
diff
changeset
|
784 |
text {* Version of @{thm[source] subsetI} for binary relations *} |
ae397b810c8b
rule subrelI (for nice Isar proofs of relation inequalities)
krauss
parents:
35828
diff
changeset
|
785 |
|
ae397b810c8b
rule subrelI (for nice Isar proofs of relation inequalities)
krauss
parents:
35828
diff
changeset
|
786 |
lemma subrelI: "(\<And>x y. (x, y) \<in> r \<Longrightarrow> (x, y) \<in> s) \<Longrightarrow> r \<subseteq> s" |
ae397b810c8b
rule subrelI (for nice Isar proofs of relation inequalities)
krauss
parents:
35828
diff
changeset
|
787 |
by auto |
ae397b810c8b
rule subrelI (for nice Isar proofs of relation inequalities)
krauss
parents:
35828
diff
changeset
|
788 |
|
46664
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
789 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
790 |
subsection {* Relations as binary predicates *} |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
791 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
792 |
subsubsection {* Composition *} |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
793 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
794 |
inductive pred_comp :: "['a \<Rightarrow> 'b \<Rightarrow> bool, 'b \<Rightarrow> 'c \<Rightarrow> bool] \<Rightarrow> 'a \<Rightarrow> 'c \<Rightarrow> bool" (infixr "OO" 75) |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
795 |
for r :: "'a \<Rightarrow> 'b \<Rightarrow> bool" and s :: "'b \<Rightarrow> 'c \<Rightarrow> bool" where |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
796 |
pred_compI [intro]: "r a b \<Longrightarrow> s b c \<Longrightarrow> (r OO s) a c" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
797 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
798 |
inductive_cases pred_compE [elim!]: "(r OO s) a c" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
799 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
800 |
lemma pred_comp_rel_comp_eq [pred_set_conv]: |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
801 |
"((\<lambda>x y. (x, y) \<in> r) OO (\<lambda>x y. (x, y) \<in> s)) = (\<lambda>x y. (x, y) \<in> r O s)" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
802 |
by (auto simp add: fun_eq_iff) |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
803 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
804 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
805 |
subsubsection {* Converse *} |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
806 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
807 |
inductive conversep :: "('a \<Rightarrow> 'b \<Rightarrow> bool) \<Rightarrow> 'b \<Rightarrow> 'a \<Rightarrow> bool" ("(_^--1)" [1000] 1000) |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
808 |
for r :: "'a \<Rightarrow> 'b \<Rightarrow> bool" where |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
809 |
conversepI: "r a b \<Longrightarrow> r^--1 b a" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
810 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
811 |
notation (xsymbols) |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
812 |
conversep ("(_\<inverse>\<inverse>)" [1000] 1000) |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
813 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
814 |
lemma conversepD: |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
815 |
assumes ab: "r^--1 a b" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
816 |
shows "r b a" using ab |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
817 |
by cases simp |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
818 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
819 |
lemma conversep_iff [iff]: "r^--1 a b = r b a" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
820 |
by (iprover intro: conversepI dest: conversepD) |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
821 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
822 |
lemma conversep_converse_eq [pred_set_conv]: |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
823 |
"(\<lambda>x y. (x, y) \<in> r)^--1 = (\<lambda>x y. (x, y) \<in> r^-1)" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
824 |
by (auto simp add: fun_eq_iff) |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
825 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
826 |
lemma conversep_conversep [simp]: "(r^--1)^--1 = r" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
827 |
by (iprover intro: order_antisym conversepI dest: conversepD) |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
828 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
829 |
lemma converse_pred_comp: "(r OO s)^--1 = s^--1 OO r^--1" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
830 |
by (iprover intro: order_antisym conversepI pred_compI |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
831 |
elim: pred_compE dest: conversepD) |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
832 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
833 |
lemma converse_meet: "(r \<sqinter> s)^--1 = r^--1 \<sqinter> s^--1" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
834 |
by (simp add: inf_fun_def) (iprover intro: conversepI ext dest: conversepD) |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
835 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
836 |
lemma converse_join: "(r \<squnion> s)^--1 = r^--1 \<squnion> s^--1" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
837 |
by (simp add: sup_fun_def) (iprover intro: conversepI ext dest: conversepD) |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
838 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
839 |
lemma conversep_noteq [simp]: "(op \<noteq>)^--1 = op \<noteq>" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
840 |
by (auto simp add: fun_eq_iff) |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
841 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
842 |
lemma conversep_eq [simp]: "(op =)^--1 = op =" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
843 |
by (auto simp add: fun_eq_iff) |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
844 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
845 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
846 |
subsubsection {* Domain *} |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
847 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
848 |
inductive DomainP :: "('a \<Rightarrow> 'b \<Rightarrow> bool) \<Rightarrow> 'a \<Rightarrow> bool" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
849 |
for r :: "'a \<Rightarrow> 'b \<Rightarrow> bool" where |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
850 |
DomainPI [intro]: "r a b \<Longrightarrow> DomainP r a" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
851 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
852 |
inductive_cases DomainPE [elim!]: "DomainP r a" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
853 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
854 |
lemma DomainP_Domain_eq [pred_set_conv]: "DomainP (\<lambda>x y. (x, y) \<in> r) = (\<lambda>x. x \<in> Domain r)" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
855 |
by (blast intro!: Orderings.order_antisym predicate1I) |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
856 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
857 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
858 |
subsubsection {* Range *} |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
859 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
860 |
inductive RangeP :: "('a \<Rightarrow> 'b \<Rightarrow> bool) \<Rightarrow> 'b \<Rightarrow> bool" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
861 |
for r :: "'a \<Rightarrow> 'b \<Rightarrow> bool" where |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
862 |
RangePI [intro]: "r a b \<Longrightarrow> RangeP r b" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
863 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
864 |
inductive_cases RangePE [elim!]: "RangeP r b" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
865 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
866 |
lemma RangeP_Range_eq [pred_set_conv]: "RangeP (\<lambda>x y. (x, y) \<in> r) = (\<lambda>x. x \<in> Range r)" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
867 |
by (blast intro!: Orderings.order_antisym predicate1I) |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
868 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
869 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
870 |
subsubsection {* Inverse image *} |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
871 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
872 |
definition inv_imagep :: "('b \<Rightarrow> 'b \<Rightarrow> bool) \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> 'a \<Rightarrow> 'a \<Rightarrow> bool" where |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
873 |
"inv_imagep r f = (\<lambda>x y. r (f x) (f y))" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
874 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
875 |
lemma [pred_set_conv]: "inv_imagep (\<lambda>x y. (x, y) \<in> r) f = (\<lambda>x y. (x, y) \<in> inv_image r f)" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
876 |
by (simp add: inv_image_def inv_imagep_def) |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
877 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
878 |
lemma in_inv_imagep [simp]: "inv_imagep r f x y = r (f x) (f y)" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
879 |
by (simp add: inv_imagep_def) |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
880 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
881 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
882 |
subsubsection {* Powerset *} |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
883 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
884 |
definition Powp :: "('a \<Rightarrow> bool) \<Rightarrow> 'a set \<Rightarrow> bool" where |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
885 |
"Powp A = (\<lambda>B. \<forall>x \<in> B. A x)" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
886 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
887 |
lemma Powp_Pow_eq [pred_set_conv]: "Powp (\<lambda>x. x \<in> A) = (\<lambda>x. x \<in> Pow A)" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
888 |
by (auto simp add: Powp_def fun_eq_iff) |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
889 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
890 |
lemmas Powp_mono [mono] = Pow_mono [to_pred] |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
891 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
892 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
893 |
subsubsection {* Properties of predicate relations *} |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
894 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
895 |
abbreviation antisymP :: "('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> bool" where |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
896 |
"antisymP r \<equiv> antisym {(x, y). r x y}" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
897 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
898 |
abbreviation transP :: "('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> bool" where |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
899 |
"transP r \<equiv> trans {(x, y). r x y}" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
900 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
901 |
abbreviation single_valuedP :: "('a \<Rightarrow> 'b \<Rightarrow> bool) \<Rightarrow> bool" where |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
902 |
"single_valuedP r \<equiv> single_valued {(x, y). r x y}" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
903 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
904 |
(*FIXME inconsistencies: abbreviations vs. definitions, suffix `P` vs. suffix `p`*) |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
905 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
906 |
definition reflp :: "('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> bool" where |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
907 |
"reflp r \<longleftrightarrow> refl {(x, y). r x y}" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
908 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
909 |
definition symp :: "('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> bool" where |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
910 |
"symp r \<longleftrightarrow> sym {(x, y). r x y}" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
911 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
912 |
definition transp :: "('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> bool" where |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
913 |
"transp r \<longleftrightarrow> trans {(x, y). r x y}" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
914 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
915 |
lemma reflpI: |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
916 |
"(\<And>x. r x x) \<Longrightarrow> reflp r" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
917 |
by (auto intro: refl_onI simp add: reflp_def) |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
918 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
919 |
lemma reflpE: |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
920 |
assumes "reflp r" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
921 |
obtains "r x x" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
922 |
using assms by (auto dest: refl_onD simp add: reflp_def) |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
923 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
924 |
lemma sympI: |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
925 |
"(\<And>x y. r x y \<Longrightarrow> r y x) \<Longrightarrow> symp r" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
926 |
by (auto intro: symI simp add: symp_def) |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
927 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
928 |
lemma sympE: |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
929 |
assumes "symp r" and "r x y" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
930 |
obtains "r y x" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
931 |
using assms by (auto dest: symD simp add: symp_def) |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
932 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
933 |
lemma transpI: |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
934 |
"(\<And>x y z. r x y \<Longrightarrow> r y z \<Longrightarrow> r x z) \<Longrightarrow> transp r" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
935 |
by (auto intro: transI simp add: transp_def) |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
936 |
|
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
937 |
lemma transpE: |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
938 |
assumes "transp r" and "r x y" and "r y z" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
939 |
obtains "r x z" |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
940 |
using assms by (auto dest: transD simp add: transp_def) |
1f6c140f9c72
moved predicate relations and conversion rules between set and predicate relations from Predicate.thy to Relation.thy; moved Predicate.thy upwards in theory hierarchy
haftmann
parents:
46638
diff
changeset
|
941 |
|
1128
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
942 |
end |
46689 | 943 |