| 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";
 | 
| 1899 |     22 |   by (safe_tac (!claset));
 | 
|  |     23 |   by (Step_tac 1);
 | 
|  |     24 |   by (Step_tac 1);
 | 
| 1440 |     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";
 | 
| 1899 |     44 |   by (safe_tac (!claset));
 | 
|  |     45 |   by (Step_tac 1);
 | 
|  |     46 |   by (Step_tac 1);
 | 
| 1440 |     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;
 | 
| 1465 |     59 |   by (rewtac is_Inf_def);
 | 
| 1899 |     60 |   by (Fast_tac 1);
 | 
| 1440 |     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;
 | 
| 1465 |     66 |   by (rewtac is_Inf_def);
 | 
| 1899 |     67 |   by (Step_tac 1);
 | 
|  |     68 |   by (Step_tac 1);
 | 
| 1440 |     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;
 | 
| 1465 |     79 |   by (rewtac is_Sup_def);
 | 
| 1899 |     80 |   by (Fast_tac 1);
 | 
| 1440 |     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;
 | 
| 1465 |     86 |   by (rewtac is_Sup_def);
 | 
| 1899 |     87 |   by (Step_tac 1);
 | 
|  |     88 |   by (Step_tac 1);
 | 
| 1440 |     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;
 | 
| 1899 |    106 |     by (Fast_tac 1);
 | 
| 1440 |    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;
 | 
| 1899 |    119 |     by (Fast_tac 1);
 | 
| 1440 |    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);
 | 
| 1465 |    129 |   by (rewtac Ball_def);
 | 
| 1899 |    130 |   by (safe_tac (!claset));
 | 
| 1440 |    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);
 | 
| 1465 |    139 |   by (rewtac Ball_def);
 | 
| 1899 |    140 |   by (safe_tac (!claset));
 | 
| 1440 |    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;
 | 
| 1465 |    151 |   by (rewtac is_Inf_def);
 | 
| 1899 |    152 |   by (safe_tac (!claset));
 | 
| 1440 |    153 |   br le_refl 1;
 | 
| 1899 |    154 |   by (Fast_tac 1);
 | 
| 1440 |    155 | qed "sing_Inf_eq";
 | 
|  |    156 | 
 | 
|  |    157 | goal thy "Sup {x} = x";
 | 
|  |    158 |   br (Sup_uniq RS mp) 1;
 | 
| 1465 |    159 |   by (rewtac is_Sup_def);
 | 
| 1899 |    160 |   by (safe_tac (!claset));
 | 
| 1440 |    161 |   br le_refl 1;
 | 
| 1899 |    162 |   by (Fast_tac 1);
 | 
| 1440 |    163 | qed "sing_Sup_eq";
 | 
|  |    164 | 
 | 
|  |    165 | 
 | 
|  |    166 | goal thy "Inf {} = Sup {x. True}";
 | 
|  |    167 |   br (Inf_uniq RS mp) 1;
 | 
| 1465 |    168 |   by (rewtac is_Inf_def);
 | 
| 1899 |    169 |   by (safe_tac (!claset));
 | 
| 1440 |    170 |   br (sing_Sup_eq RS subst) 1;
 | 
|  |    171 |   back();
 | 
|  |    172 |   br (Sup_subset_mon RS mp) 1;
 | 
| 1899 |    173 |   by (Fast_tac 1);
 | 
| 1440 |    174 | qed "empty_Inf_eq";
 | 
|  |    175 | 
 | 
|  |    176 | goal thy "Sup {} = Inf {x. True}";
 | 
|  |    177 |   br (Sup_uniq RS mp) 1;
 | 
| 1465 |    178 |   by (rewtac is_Sup_def);
 | 
| 1899 |    179 |   by (safe_tac (!claset));
 | 
| 1440 |    180 |   br (sing_Inf_eq RS subst) 1;
 | 
|  |    181 |   br (Inf_subset_antimon RS mp) 1;
 | 
| 1899 |    182 |   by (Fast_tac 1);
 | 
| 1440 |    183 | qed "empty_Sup_eq";
 |