src/HOL/AxClasses/Lattice/Lattice.ML
author paulson
Wed, 05 Nov 1997 13:23:46 +0100
changeset 4153 e534c4c32d54
parent 4091 771b1f6422a8
child 5069 3ea049f7979d
permissions -rw-r--r--
Ran expandshort, especially to introduce Safe_tac
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
     1
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
     2
open Lattice;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
     3
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
     4
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
     5
(** basic properties of "&&" and "||" **)
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
     6
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
     7
(* unique existence *)
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
     8
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
     9
goalw thy [inf_def] "is_inf x y (x && y)";
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    10
  by (rtac (ex_inf RS spec RS spec RS selectI1) 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    11
qed "inf_is_inf";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    12
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    13
goal thy "is_inf x y inf --> x && y = inf";
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    14
  by (rtac impI 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    15
  by (rtac (is_inf_uniq RS mp) 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    16
  by (rtac conjI 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    17
  by (rtac inf_is_inf 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    18
  by (assume_tac 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    19
qed "inf_uniq";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    20
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    21
goalw thy [Ex1_def] "ALL x y. EX! inf::'a::lattice. is_inf x y inf";
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    22
  by Safe_tac;
1899
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1465
diff changeset
    23
  by (Step_tac 1);
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1465
diff changeset
    24
  by (Step_tac 1);
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    25
  by (rtac inf_is_inf 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    26
  by (rtac (inf_uniq RS mp RS sym) 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    27
  by (assume_tac 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    28
qed "ex1_inf";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    29
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    30
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    31
goalw thy [sup_def] "is_sup x y (x || y)";
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    32
  by (rtac (ex_sup RS spec RS spec RS selectI1) 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    33
qed "sup_is_sup";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    34
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    35
goal thy "is_sup x y sup --> x || y = sup";
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    36
  by (rtac impI 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    37
  by (rtac (is_sup_uniq RS mp) 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    38
  by (rtac conjI 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    39
  by (rtac sup_is_sup 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    40
  by (assume_tac 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    41
qed "sup_uniq";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    42
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    43
goalw thy [Ex1_def] "ALL x y. EX! sup::'a::lattice. is_sup x y sup";
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    44
  by Safe_tac;
1899
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1465
diff changeset
    45
  by (Step_tac 1);
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1465
diff changeset
    46
  by (Step_tac 1);
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    47
  by (rtac sup_is_sup 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    48
  by (rtac (sup_uniq RS mp RS sym) 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    49
  by (assume_tac 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    50
qed "ex1_sup";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    51
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    52
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    53
(* "&&" yields g.l.bs, "||" yields l.u.bs. --- in pieces *)
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    54
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    55
val tac =
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    56
  cut_facts_tac [inf_is_inf] 1 THEN
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    57
  rewrite_goals_tac [inf_def, is_inf_def] THEN
1899
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1465
diff changeset
    58
  Fast_tac 1;
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    59
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    60
goal thy "x && y [= x";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    61
  by tac;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    62
qed "inf_lb1";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    63
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    64
goal thy "x && y [= y";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    65
  by tac;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    66
qed "inf_lb2";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    67
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    68
val prems = goal thy "[| z [= x; z [= y |] ==> z [= x && y";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    69
  by (cut_facts_tac prems 1);
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    70
  by tac;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    71
qed "inf_ub_lbs";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    72
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    73
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    74
val tac =
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    75
  cut_facts_tac [sup_is_sup] 1 THEN
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    76
  rewrite_goals_tac [sup_def, is_sup_def] THEN
1899
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1465
diff changeset
    77
  Fast_tac 1;
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    78
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    79
goal thy "x [= x || y";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    80
  by tac;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    81
qed "sup_ub1";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    82
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    83
goal thy "y [= x || y";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    84
  by tac;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    85
qed "sup_ub2";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    86
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    87
val prems = goal thy "[| x [= z; y [= z |] ==> x || y [= z";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    88
  by (cut_facts_tac prems 1);
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    89
  by tac;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    90
qed "sup_lb_ubs";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    91
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    92
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    93
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    94
(** some equations concerning "&&" and "||" vs. "[=" **)
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    95
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    96
(* the Connection Theorems: "[=" expressed via "&&" or "||" *)
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    97
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    98
goal thy "(x && y = x) = (x [= y)";
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    99
  by (rtac iffI 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   100
  (*==>*)
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   101
    by (etac subst 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   102
    by (rtac inf_lb2 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   103
  (*<==*)
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   104
    by (rtac (inf_uniq RS mp) 1);
1465
5d7a7e439cec expanded tabs
clasohm
parents: 1440
diff changeset
   105
    by (rewtac is_inf_def);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   106
    by (REPEAT_FIRST (rtac conjI));
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   107
    by (rtac le_refl 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   108
    by (assume_tac 1);
1899
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1465
diff changeset
   109
    by (Fast_tac 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   110
qed "inf_connect";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   111
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   112
goal thy "(x || y = y) = (x [= y)";
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   113
  by (rtac iffI 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   114
  (*==>*)
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   115
    by (etac subst 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   116
    by (rtac sup_ub1 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   117
  (*<==*)
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   118
    by (rtac (sup_uniq RS mp) 1);
1465
5d7a7e439cec expanded tabs
clasohm
parents: 1440
diff changeset
   119
    by (rewtac is_sup_def);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   120
    by (REPEAT_FIRST (rtac conjI));
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   121
    by (assume_tac 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   122
    by (rtac le_refl 1);
1899
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1465
diff changeset
   123
    by (Fast_tac 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   124
qed "sup_connect";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   125
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   126
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   127
(* minorized infs / majorized sups *)
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   128
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   129
goal thy "(x [= y && z) = (x [= y & x [= z)";
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   130
  by (rtac iffI 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   131
  (*==> (level 1)*)
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   132
    by (cut_facts_tac [inf_lb1, inf_lb2] 1);
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   133
    by (rtac conjI 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   134
    by (rtac (le_trans RS mp) 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   135
    by (etac conjI 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   136
    by (assume_tac 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   137
    by (rtac (le_trans RS mp) 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   138
    by (etac conjI 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   139
    by (assume_tac 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   140
  (*<== (level 9)*)
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   141
    by (etac conjE 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   142
    by (etac inf_ub_lbs 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   143
    by (assume_tac 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   144
qed "le_inf_eq";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   145
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   146
goal thy "(x || y [= z) = (x [= z & y [= z)";
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   147
  by (rtac iffI 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   148
  (*==> (level 1)*)
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   149
    by (cut_facts_tac [sup_ub1, sup_ub2] 1);
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   150
    by (rtac conjI 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   151
    by (rtac (le_trans RS mp) 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   152
    by (etac conjI 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   153
    by (assume_tac 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   154
    by (rtac (le_trans RS mp) 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   155
    by (etac conjI 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   156
    by (assume_tac 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   157
  (*<== (level 9)*)
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   158
    by (etac conjE 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   159
    by (etac sup_lb_ubs 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   160
    by (assume_tac 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   161
qed "ge_sup_eq";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   162
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   163
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   164
(** algebraic properties of "&&" and "||": A, C, I, AB **)
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   165
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   166
(* associativity *)
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   167
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   168
goal thy "(x && y) && z = x && (y && z)";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   169
  by (stac (inf_uniq RS mp RS sym) 1);
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   170
  back();
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   171
  back();
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   172
  back();
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   173
  back();
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   174
  back();
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   175
  back();
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   176
  back();
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   177
  back();
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   178
  by (rtac refl 2);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   179
  by (rtac (is_inf_assoc RS mp) 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   180
  by (REPEAT_FIRST (rtac conjI));
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   181
  by (REPEAT_FIRST (rtac inf_is_inf));
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   182
qed "inf_assoc";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   183
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   184
goal thy "(x || y) || z = x || (y || z)";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   185
  by (stac (sup_uniq RS mp RS sym) 1);
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   186
  back();
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   187
  back();
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   188
  back();
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   189
  back();
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   190
  back();
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   191
  back();
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   192
  back();
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   193
  back();
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   194
  by (rtac refl 2);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   195
  by (rtac (is_sup_assoc RS mp) 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   196
  by (REPEAT_FIRST (rtac conjI));
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   197
  by (REPEAT_FIRST (rtac sup_is_sup));
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   198
qed "sup_assoc";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   199
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   200
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   201
(* commutativity *)
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   202
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   203
goalw thy [inf_def] "x && y = y && x";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   204
  by (stac (is_inf_commut RS ext) 1);
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   205
  by (rtac refl 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   206
qed "inf_commut";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   207
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   208
goalw thy [sup_def] "x || y = y || x";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   209
  by (stac (is_sup_commut RS ext) 1);
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   210
  by (rtac refl 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   211
qed "sup_commut";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   212
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   213
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   214
(* idempotency *)
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   215
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   216
goal thy "x && x = x";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   217
  by (stac inf_connect 1);
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   218
  by (rtac le_refl 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   219
qed "inf_idemp";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   220
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   221
goal thy "x || x = x";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   222
  by (stac sup_connect 1);
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   223
  by (rtac le_refl 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   224
qed "sup_idemp";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   225
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   226
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   227
(* absorption *)
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   228
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   229
goal thy "x || (x && y) = x";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   230
  by (stac sup_commut 1);
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   231
  by (stac sup_connect 1);
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   232
  by (rtac inf_lb1 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   233
qed "sup_inf_absorb";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   234
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   235
goal thy "x && (x || y) = x";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   236
  by (stac inf_connect 1);
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   237
  by (rtac sup_ub1 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   238
qed "inf_sup_absorb";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   239
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   240
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   241
(* monotonicity *)
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   242
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   243
val prems = goal thy "[| a [= b; x [= y |] ==> a && x [= b && y";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   244
  by (cut_facts_tac prems 1);
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   245
  by (stac le_inf_eq 1);
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   246
  by (rtac conjI 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   247
  by (rtac (le_trans RS mp) 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   248
  by (rtac conjI 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   249
  by (rtac inf_lb1 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   250
  by (assume_tac 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   251
  by (rtac (le_trans RS mp) 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   252
  by (rtac conjI 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   253
  by (rtac inf_lb2 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   254
  by (assume_tac 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   255
qed "inf_mon";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   256
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   257
val prems = goal thy "[| a [= b; x [= y |] ==> a || x [= b || y";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   258
  by (cut_facts_tac prems 1);
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   259
  by (stac ge_sup_eq 1);
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   260
  by (rtac conjI 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   261
  by (rtac (le_trans RS mp) 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   262
  by (rtac conjI 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   263
  by (assume_tac 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   264
  by (rtac sup_ub1 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   265
  by (rtac (le_trans RS mp) 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   266
  by (rtac conjI 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   267
  by (assume_tac 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   268
  by (rtac sup_ub2 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   269
qed "sup_mon";