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