1440
|
1 |
|
|
2 |
open CLattice;
|
|
3 |
|
|
4 |
|
|
5 |
(** basic properties of "Inf" and "Sup" **)
|
|
6 |
|
|
7 |
(* unique existence *)
|
|
8 |
|
|
9 |
goalw thy [Inf_def] "is_Inf A (Inf A)";
|
|
10 |
br (ex_Inf RS spec RS selectI1) 1;
|
|
11 |
qed "Inf_is_Inf";
|
|
12 |
|
|
13 |
goal thy "is_Inf A inf --> Inf A = inf";
|
|
14 |
br impI 1;
|
|
15 |
br (is_Inf_uniq RS mp) 1;
|
|
16 |
br conjI 1;
|
|
17 |
br Inf_is_Inf 1;
|
|
18 |
ba 1;
|
|
19 |
qed "Inf_uniq";
|
|
20 |
|
|
21 |
goalw thy [Ex1_def] "ALL A. EX! inf::'a::clattice. is_Inf A inf";
|
|
22 |
by (safe_tac HOL_cs);
|
|
23 |
by (step_tac HOL_cs 1);
|
|
24 |
by (step_tac HOL_cs 1);
|
|
25 |
br Inf_is_Inf 1;
|
|
26 |
br (Inf_uniq RS mp RS sym) 1;
|
|
27 |
ba 1;
|
|
28 |
qed "ex1_Inf";
|
|
29 |
|
|
30 |
|
|
31 |
goalw thy [Sup_def] "is_Sup A (Sup A)";
|
|
32 |
br (ex_Sup RS spec RS selectI1) 1;
|
|
33 |
qed "Sup_is_Sup";
|
|
34 |
|
|
35 |
goal thy "is_Sup A sup --> Sup A = sup";
|
|
36 |
br impI 1;
|
|
37 |
br (is_Sup_uniq RS mp) 1;
|
|
38 |
br conjI 1;
|
|
39 |
br Sup_is_Sup 1;
|
|
40 |
ba 1;
|
|
41 |
qed "Sup_uniq";
|
|
42 |
|
|
43 |
goalw thy [Ex1_def] "ALL A. EX! sup::'a::clattice. is_Sup A sup";
|
|
44 |
by (safe_tac HOL_cs);
|
|
45 |
by (step_tac HOL_cs 1);
|
|
46 |
by (step_tac HOL_cs 1);
|
|
47 |
br Sup_is_Sup 1;
|
|
48 |
br (Sup_uniq RS mp RS sym) 1;
|
|
49 |
ba 1;
|
|
50 |
qed "ex1_Sup";
|
|
51 |
|
|
52 |
|
|
53 |
(* "Inf" yields g.l.bs, "Sup" yields l.u.bs. --- in pieces *)
|
|
54 |
|
|
55 |
val prems = goalw thy [Inf_def] "x:A ==> Inf A [= x";
|
|
56 |
by (cut_facts_tac prems 1);
|
|
57 |
br selectI2 1;
|
|
58 |
br Inf_is_Inf 1;
|
|
59 |
by (rewrite_goals_tac [is_Inf_def]);
|
|
60 |
by (fast_tac set_cs 1);
|
|
61 |
qed "Inf_lb";
|
|
62 |
|
|
63 |
val [prem] = goalw thy [Inf_def] "(!!x. x:A ==> z [= x) ==> z [= Inf A";
|
|
64 |
br selectI2 1;
|
|
65 |
br Inf_is_Inf 1;
|
|
66 |
by (rewrite_goals_tac [is_Inf_def]);
|
|
67 |
by (step_tac HOL_cs 1);
|
|
68 |
by (step_tac HOL_cs 1);
|
|
69 |
be mp 1;
|
|
70 |
br ballI 1;
|
|
71 |
be prem 1;
|
|
72 |
qed "Inf_ub_lbs";
|
|
73 |
|
|
74 |
|
|
75 |
val prems = goalw thy [Sup_def] "x:A ==> x [= Sup A";
|
|
76 |
by (cut_facts_tac prems 1);
|
|
77 |
br selectI2 1;
|
|
78 |
br Sup_is_Sup 1;
|
|
79 |
by (rewrite_goals_tac [is_Sup_def]);
|
|
80 |
by (fast_tac set_cs 1);
|
|
81 |
qed "Sup_ub";
|
|
82 |
|
|
83 |
val [prem] = goalw thy [Sup_def] "(!!x. x:A ==> x [= z) ==> Sup A [= z";
|
|
84 |
br selectI2 1;
|
|
85 |
br Sup_is_Sup 1;
|
|
86 |
by (rewrite_goals_tac [is_Sup_def]);
|
|
87 |
by (step_tac HOL_cs 1);
|
|
88 |
by (step_tac HOL_cs 1);
|
|
89 |
be mp 1;
|
|
90 |
br ballI 1;
|
|
91 |
be prem 1;
|
|
92 |
qed "Sup_lb_ubs";
|
|
93 |
|
|
94 |
|
|
95 |
(** minorized Infs / majorized Sups **)
|
|
96 |
|
|
97 |
goal thy "(x [= Inf A) = (ALL y:A. x [= y)";
|
|
98 |
br iffI 1;
|
|
99 |
(*==>*)
|
|
100 |
br ballI 1;
|
|
101 |
br (le_trans RS mp) 1;
|
|
102 |
be conjI 1;
|
|
103 |
be Inf_lb 1;
|
|
104 |
(*<==*)
|
|
105 |
br Inf_ub_lbs 1;
|
|
106 |
by (fast_tac set_cs 1);
|
|
107 |
qed "le_Inf_eq";
|
|
108 |
|
|
109 |
goal thy "(Sup A [= x) = (ALL y:A. y [= x)";
|
|
110 |
br iffI 1;
|
|
111 |
(*==>*)
|
|
112 |
br ballI 1;
|
|
113 |
br (le_trans RS mp) 1;
|
|
114 |
br conjI 1;
|
|
115 |
be Sup_ub 1;
|
|
116 |
ba 1;
|
|
117 |
(*<==*)
|
|
118 |
br Sup_lb_ubs 1;
|
|
119 |
by (fast_tac set_cs 1);
|
|
120 |
qed "ge_Sup_eq";
|
|
121 |
|
|
122 |
|
|
123 |
|
|
124 |
(** Subsets and limits **)
|
|
125 |
|
|
126 |
goal thy "A <= B --> Inf B [= Inf A";
|
|
127 |
br impI 1;
|
|
128 |
by (stac le_Inf_eq 1);
|
|
129 |
by (rewrite_goals_tac [Ball_def]);
|
|
130 |
by (safe_tac set_cs);
|
|
131 |
bd subsetD 1;
|
|
132 |
ba 1;
|
|
133 |
be Inf_lb 1;
|
|
134 |
qed "Inf_subset_antimon";
|
|
135 |
|
|
136 |
goal thy "A <= B --> Sup A [= Sup B";
|
|
137 |
br impI 1;
|
|
138 |
by (stac ge_Sup_eq 1);
|
|
139 |
by (rewrite_goals_tac [Ball_def]);
|
|
140 |
by (safe_tac set_cs);
|
|
141 |
bd subsetD 1;
|
|
142 |
ba 1;
|
|
143 |
be Sup_ub 1;
|
|
144 |
qed "Sup_subset_mon";
|
|
145 |
|
|
146 |
|
|
147 |
(** singleton / empty limits **)
|
|
148 |
|
|
149 |
goal thy "Inf {x} = x";
|
|
150 |
br (Inf_uniq RS mp) 1;
|
|
151 |
by (rewrite_goals_tac [is_Inf_def]);
|
|
152 |
by (safe_tac set_cs);
|
|
153 |
br le_refl 1;
|
|
154 |
by (fast_tac set_cs 1);
|
|
155 |
qed "sing_Inf_eq";
|
|
156 |
|
|
157 |
goal thy "Sup {x} = x";
|
|
158 |
br (Sup_uniq RS mp) 1;
|
|
159 |
by (rewrite_goals_tac [is_Sup_def]);
|
|
160 |
by (safe_tac set_cs);
|
|
161 |
br le_refl 1;
|
|
162 |
by (fast_tac set_cs 1);
|
|
163 |
qed "sing_Sup_eq";
|
|
164 |
|
|
165 |
|
|
166 |
goal thy "Inf {} = Sup {x. True}";
|
|
167 |
br (Inf_uniq RS mp) 1;
|
|
168 |
by (rewrite_goals_tac [is_Inf_def]);
|
|
169 |
by (safe_tac set_cs);
|
|
170 |
br (sing_Sup_eq RS subst) 1;
|
|
171 |
back();
|
|
172 |
br (Sup_subset_mon RS mp) 1;
|
|
173 |
by (fast_tac set_cs 1);
|
|
174 |
qed "empty_Inf_eq";
|
|
175 |
|
|
176 |
goal thy "Sup {} = Inf {x. True}";
|
|
177 |
br (Sup_uniq RS mp) 1;
|
|
178 |
by (rewrite_goals_tac [is_Sup_def]);
|
|
179 |
by (safe_tac set_cs);
|
|
180 |
br (sing_Inf_eq RS subst) 1;
|
|
181 |
br (Inf_subset_antimon RS mp) 1;
|
|
182 |
by (fast_tac set_cs 1);
|
|
183 |
qed "empty_Sup_eq";
|