| author | wenzelm | 
| Thu, 24 May 2012 15:33:45 +0200 | |
| changeset 47980 | c81801f881b3 | 
| parent 47508 | 85c6268b4071 | 
| child 48611 | b34ff75c23a7 | 
| permissions | -rw-r--r-- | 
| 16417 | 1  | 
theory Relations imports Main begin  | 
| 10294 | 2  | 
|
| 36745 | 3  | 
ML "Pretty.margin_default := 64"  | 
| 10294 | 4  | 
|
5  | 
(*Id is only used in UNITY*)  | 
|
6  | 
(*refl, antisym,trans,univalent,\<dots> ho hum*)  | 
|
7  | 
||
8  | 
text{*
 | 
|
| 
10864
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
9  | 
@{thm[display] Id_def[no_vars]}
 | 
| 10294 | 10  | 
\rulename{Id_def}
 | 
11  | 
*}  | 
|
12  | 
||
13  | 
text{*
 | 
|
| 47508 | 14  | 
@{thm[display] relcomp_unfold[no_vars]}
 | 
15  | 
\rulename{relcomp_unfold}
 | 
|
| 10294 | 16  | 
*}  | 
17  | 
||
18  | 
text{*
 | 
|
| 
10864
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
19  | 
@{thm[display] R_O_Id[no_vars]}
 | 
| 10294 | 20  | 
\rulename{R_O_Id}
 | 
21  | 
*}  | 
|
22  | 
||
23  | 
text{*
 | 
|
| 47508 | 24  | 
@{thm[display] relcomp_mono[no_vars]}
 | 
25  | 
\rulename{relcomp_mono}
 | 
|
| 10294 | 26  | 
*}  | 
27  | 
||
28  | 
text{*
 | 
|
| 
10864
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
29  | 
@{thm[display] converse_iff[no_vars]}
 | 
| 10294 | 30  | 
\rulename{converse_iff}
 | 
31  | 
*}  | 
|
32  | 
||
33  | 
text{*
 | 
|
| 47508 | 34  | 
@{thm[display] converse_relcomp[no_vars]}
 | 
35  | 
\rulename{converse_relcomp}
 | 
|
| 10294 | 36  | 
*}  | 
37  | 
||
38  | 
text{*
 | 
|
| 
10864
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
39  | 
@{thm[display] Image_iff[no_vars]}
 | 
| 10294 | 40  | 
\rulename{Image_iff}
 | 
41  | 
*}  | 
|
42  | 
||
43  | 
text{*
 | 
|
| 
10864
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
44  | 
@{thm[display] Image_UN[no_vars]}
 | 
| 10294 | 45  | 
\rulename{Image_UN}
 | 
46  | 
*}  | 
|
47  | 
||
48  | 
text{*
 | 
|
| 
10864
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
49  | 
@{thm[display] Domain_iff[no_vars]}
 | 
| 10294 | 50  | 
\rulename{Domain_iff}
 | 
51  | 
*}  | 
|
52  | 
||
53  | 
text{*
 | 
|
| 
10864
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
54  | 
@{thm[display] Range_iff[no_vars]}
 | 
| 10294 | 55  | 
\rulename{Range_iff}
 | 
56  | 
*}  | 
|
57  | 
||
58  | 
text{*
 | 
|
| 
10864
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
59  | 
@{thm[display] relpow.simps[no_vars]}
 | 
| 10294 | 60  | 
\rulename{relpow.simps}
 | 
61  | 
||
| 
10864
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
62  | 
@{thm[display] rtrancl_refl[no_vars]}
 | 
| 10294 | 63  | 
\rulename{rtrancl_refl}
 | 
64  | 
||
| 
10864
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
65  | 
@{thm[display] r_into_rtrancl[no_vars]}
 | 
| 10294 | 66  | 
\rulename{r_into_rtrancl}
 | 
67  | 
||
| 
10864
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
68  | 
@{thm[display] rtrancl_trans[no_vars]}
 | 
| 10294 | 69  | 
\rulename{rtrancl_trans}
 | 
70  | 
||
| 
10864
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
71  | 
@{thm[display] rtrancl_induct[no_vars]}
 | 
| 10294 | 72  | 
\rulename{rtrancl_induct}
 | 
73  | 
||
| 
10864
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
74  | 
@{thm[display] rtrancl_idemp[no_vars]}
 | 
| 10294 | 75  | 
\rulename{rtrancl_idemp}
 | 
76  | 
||
| 
10864
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
77  | 
@{thm[display] r_into_trancl[no_vars]}
 | 
| 10294 | 78  | 
\rulename{r_into_trancl}
 | 
79  | 
||
| 
10864
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
80  | 
@{thm[display] trancl_trans[no_vars]}
 | 
| 10294 | 81  | 
\rulename{trancl_trans}
 | 
82  | 
||
| 
10864
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
83  | 
@{thm[display] trancl_into_rtrancl[no_vars]}
 | 
| 10294 | 84  | 
\rulename{trancl_into_rtrancl}
 | 
85  | 
||
| 
10864
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
86  | 
@{thm[display] trancl_converse[no_vars]}
 | 
| 10294 | 87  | 
\rulename{trancl_converse}
 | 
88  | 
*}  | 
|
89  | 
||
90  | 
text{*Relations.  transitive closure*}
 | 
|
91  | 
||
| 
11080
 
22855d091249
various revisions in response to comments from Tobias
 
paulson 
parents: 
10864 
diff
changeset
 | 
92  | 
lemma rtrancl_converseD: "(x,y) \<in> (r\<inverse>)\<^sup>* \<Longrightarrow> (y,x) \<in> r\<^sup>*"  | 
| 
10864
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
93  | 
apply (erule rtrancl_induct)  | 
| 
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
94  | 
txt{*
 | 
| 
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
95  | 
@{subgoals[display,indent=0,margin=65]}
 | 
| 
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
96  | 
*};  | 
| 
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
97  | 
apply (rule rtrancl_refl)  | 
| 
11080
 
22855d091249
various revisions in response to comments from Tobias
 
paulson 
parents: 
10864 
diff
changeset
 | 
98  | 
apply (blast intro: rtrancl_trans)  | 
| 
10864
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
99  | 
done  | 
| 10294 | 100  | 
|
101  | 
||
| 
11080
 
22855d091249
various revisions in response to comments from Tobias
 
paulson 
parents: 
10864 
diff
changeset
 | 
102  | 
lemma rtrancl_converseI: "(y,x) \<in> r\<^sup>* \<Longrightarrow> (x,y) \<in> (r\<inverse>)\<^sup>*"  | 
| 
10864
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
103  | 
apply (erule rtrancl_induct)  | 
| 
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
104  | 
apply (rule rtrancl_refl)  | 
| 
11080
 
22855d091249
various revisions in response to comments from Tobias
 
paulson 
parents: 
10864 
diff
changeset
 | 
105  | 
apply (blast intro: rtrancl_trans)  | 
| 
10864
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
106  | 
done  | 
| 
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
107  | 
|
| 
11080
 
22855d091249
various revisions in response to comments from Tobias
 
paulson 
parents: 
10864 
diff
changeset
 | 
108  | 
lemma rtrancl_converse: "(r\<inverse>)\<^sup>* = (r\<^sup>*)\<inverse>"  | 
| 
10864
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
109  | 
by (auto intro: rtrancl_converseI dest: rtrancl_converseD)  | 
| 10294 | 110  | 
|
| 
11080
 
22855d091249
various revisions in response to comments from Tobias
 
paulson 
parents: 
10864 
diff
changeset
 | 
111  | 
lemma rtrancl_converse: "(r\<inverse>)\<^sup>* = (r\<^sup>*)\<inverse>"  | 
| 
10864
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
112  | 
apply (intro equalityI subsetI)  | 
| 
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
113  | 
txt{*
 | 
| 
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
114  | 
after intro rules  | 
| 
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
115  | 
|
| 
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
116  | 
@{subgoals[display,indent=0,margin=65]}
 | 
| 
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
117  | 
*};  | 
| 
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
118  | 
apply clarify  | 
| 
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
119  | 
txt{*
 | 
| 
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
120  | 
after splitting  | 
| 
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
121  | 
@{subgoals[display,indent=0,margin=65]}
 | 
| 
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
122  | 
*};  | 
| 
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
123  | 
oops  | 
| 10294 | 124  | 
|
125  | 
||
| 
10864
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
126  | 
lemma "(\<forall>u v. (u,v) \<in> A \<longrightarrow> u=v) \<Longrightarrow> A \<subseteq> Id"  | 
| 
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
127  | 
apply (rule subsetI)  | 
| 
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
128  | 
txt{*
 | 
| 
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
129  | 
@{subgoals[display,indent=0,margin=65]}
 | 
| 10294 | 130  | 
|
| 
10864
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
131  | 
after subsetI  | 
| 
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
132  | 
*};  | 
| 
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
133  | 
apply clarify  | 
| 
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
134  | 
txt{*
 | 
| 
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
135  | 
@{subgoals[display,indent=0,margin=65]}
 | 
| 10294 | 136  | 
|
| 
10864
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
137  | 
subgoals after clarify  | 
| 
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
138  | 
*};  | 
| 
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
139  | 
by blast  | 
| 10294 | 140  | 
|
| 
10864
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
141  | 
|
| 10294 | 142  | 
|
143  | 
||
144  | 
text{*rejects*}
 | 
|
145  | 
||
146  | 
lemma "(a \<in> {z. P z} \<union> {y. Q y}) = P a \<or> Q a"
 | 
|
| 
10864
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
147  | 
apply (blast)  | 
| 
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
148  | 
done  | 
| 10294 | 149  | 
|
150  | 
text{*Pow, Inter too little used*}
 | 
|
151  | 
||
152  | 
lemma "(A \<subset> B) = (A \<subseteq> B \<and> A \<noteq> B)"  | 
|
| 26806 | 153  | 
apply (simp add: psubset_eq)  | 
| 
10864
 
f0b0a125ae4b
revisions corresponding to the new version of sets.tex
 
paulson 
parents: 
10341 
diff
changeset
 | 
154  | 
done  | 
| 10294 | 155  | 
|
156  | 
end  |