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