11479
|
1 |
(* Title: HOL/UNITY/UNITYMisc.ML
|
|
2 |
ID: $Id$
|
|
3 |
Author: Sidi O Ehmety, Computer Laboratory
|
|
4 |
Copyright 2001 University of Cambridge
|
|
5 |
|
|
6 |
Some miscellaneous and add-hoc set theory concepts.
|
|
7 |
|
|
8 |
*)
|
|
9 |
|
|
10 |
Goalw [measure_def, less_than_def]
|
|
11 |
"less_than(A) = {<x,y>:A*A. x<y}";
|
|
12 |
by Auto_tac;
|
|
13 |
qed "less_than_equals";
|
|
14 |
|
|
15 |
Goalw [less_than_def] "wf(less_than(A))";
|
|
16 |
by (rtac wf_measure 1);
|
|
17 |
qed "wf_less_than";
|
|
18 |
|
|
19 |
Goalw [less_than_def, measure_def]
|
|
20 |
"less_than(A)<= A*A";
|
|
21 |
by Auto_tac;
|
|
22 |
qed "less_than_subset";
|
|
23 |
|
|
24 |
Goalw [less_than_def, measure_def]
|
|
25 |
"<x,y>:less_than(A) <-> (x:A & y:A & x<y)";
|
|
26 |
by Auto_tac;
|
|
27 |
qed "less_than_iff";
|
|
28 |
|
|
29 |
Goalw [lessThan_def]
|
|
30 |
"i:lessThan(k,A) <-> i:A & i<k";
|
|
31 |
by Auto_tac;
|
|
32 |
qed "lessThan_iff";
|
|
33 |
|
|
34 |
Goalw [greaterThan_def]
|
|
35 |
"i:greaterThan(k,A) <-> i:A & k<i";
|
|
36 |
by Auto_tac;
|
|
37 |
qed "greaterThan_iff";
|
|
38 |
|
|
39 |
|
|
40 |
(** Needed for WF reasoning in WFair.ML **)
|
|
41 |
|
|
42 |
Goal "k:A ==>less_than(A)``{k} = greaterThan(k, A)";
|
|
43 |
by (rtac equalityI 1);
|
|
44 |
by (auto_tac (claset(), simpset() addsimps
|
|
45 |
[less_than_iff,greaterThan_iff]));
|
|
46 |
qed "Image_less_than";
|
|
47 |
|
|
48 |
Goal "k:A ==> less_than(A)-`` {k} = lessThan(k, A)";
|
|
49 |
by (rtac equalityI 1);
|
|
50 |
by (auto_tac (claset(), simpset() addsimps
|
|
51 |
[less_than_iff,lessThan_iff]));
|
|
52 |
qed "Image_inverse_less_than";
|
|
53 |
|
|
54 |
Addsimps [Image_less_than, Image_inverse_less_than];
|
|
55 |
|
|
56 |
|
|
57 |
(** Ad-hoc set-theory rules **)
|
|
58 |
|
|
59 |
Goal "Union(B) Int A = (UN b:B. b Int A)";
|
|
60 |
by Auto_tac;
|
|
61 |
qed "Int_Union_Union";
|
|
62 |
|
|
63 |
Goal "A Int Union(B) = (UN b:B. A Int b)";
|
|
64 |
by Auto_tac;
|
|
65 |
qed "Int_Union_Union2";
|
|
66 |
|
|
67 |
Goal "A Un B - (A - B) = B";
|
|
68 |
by (Blast_tac 1);
|
|
69 |
qed "Un_Diff_Diff";
|
|
70 |
AddIffs [Un_Diff_Diff];
|
|
71 |
|
|
72 |
|
|
73 |
(** Needed in State theory for the current definition of variables
|
|
74 |
where they are indexed by lists **)
|
|
75 |
|
|
76 |
Goal "i:list(nat) ==> i:univ(0)";
|
|
77 |
by (dres_inst_tac [("B", "0")] list_into_univ 1);
|
|
78 |
by (blast_tac (claset() addIs [nat_into_univ]) 1);
|
|
79 |
by (assume_tac 1);
|
|
80 |
qed "list_nat_into_univ";
|
|
81 |
|
|
82 |
(** To be moved to Update theory **)
|
|
83 |
|
|
84 |
Goalw [update_def]
|
|
85 |
"[| f:Pi(A,B); x:A; y:B(x) |] ==> f(x:=y):Pi(A, B)";
|
|
86 |
by (asm_simp_tac (simpset() addsimps [domain_of_fun, cons_absorb,
|
|
87 |
apply_funtype, lam_type]) 1);
|
|
88 |
qed "update_type2";
|
|
89 |
|
|
90 |
(** Simplication rules for Collect; To be moved elsewhere **)
|
|
91 |
Goal "{x:A. P(x)} Int A = {x:A. P(x)}";
|
|
92 |
by Auto_tac;
|
|
93 |
qed "Collect_Int2";
|
|
94 |
|
|
95 |
Goal "A Int {x:A. P(x)} = {x:A. P(x)}";
|
|
96 |
by Auto_tac;
|
|
97 |
qed "Collect_Int3";
|
|
98 |
|
|
99 |
AddIffs [Collect_Int2, Collect_Int3];
|
|
100 |
|
|
101 |
|
|
102 |
Goal "{x:A. P(x) | Q(x)} = Collect(A, P) Un Collect(A, Q)";
|
|
103 |
by Auto_tac;
|
|
104 |
qed "Collect_disj_eq";
|
|
105 |
|
|
106 |
Goal "{x:A. P(x) & Q(x)} = Collect(A, P) Int Collect(A, Q)";
|
|
107 |
by Auto_tac;
|
|
108 |
qed "Collect_conj_eq";
|
|
109 |
|
|
110 |
|
|
111 |
|