src/HOL/UNITY/LessThan.ML
author paulson
Sun, 13 Jun 1999 13:54:56 +0200
changeset 6825 30e09714eef5
parent 6707 3b07e62a718c
child 7521 a18adacbdbd2
permissions -rw-r--r--
new finiteness theorems
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     1
(*  Title:      HOL/LessThan/LessThan
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     2
    ID:         $Id$
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     4
    Copyright   1998  University of Cambridge
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     5
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     6
lessThan, greaterThan, atLeast, atMost
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     7
*)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     8
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     9
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    10
(*** lessThan ***)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    11
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4776
diff changeset
    12
Goalw [lessThan_def] "(i: lessThan k) = (i<k)";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    13
by (Blast_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    14
qed "lessThan_iff";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    15
AddIffs [lessThan_iff];
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    16
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4776
diff changeset
    17
Goalw [lessThan_def] "lessThan 0 = {}";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    18
by (Simp_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    19
qed "lessThan_0";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    20
Addsimps [lessThan_0];
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    21
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4776
diff changeset
    22
Goalw [lessThan_def] "lessThan (Suc k) = insert k (lessThan k)";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    23
by (simp_tac (simpset() addsimps [less_Suc_eq]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    24
by (Blast_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    25
qed "lessThan_Suc";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    26
5648
fe887910e32e specifications as sets of programs
paulson
parents: 5625
diff changeset
    27
Goalw [lessThan_def, atMost_def] "lessThan (Suc k) = atMost k";
fe887910e32e specifications as sets of programs
paulson
parents: 5625
diff changeset
    28
by (simp_tac (simpset() addsimps [less_Suc_eq_le]) 1);
fe887910e32e specifications as sets of programs
paulson
parents: 5625
diff changeset
    29
qed "lessThan_Suc_atMost";
fe887910e32e specifications as sets of programs
paulson
parents: 5625
diff changeset
    30
6825
30e09714eef5 new finiteness theorems
paulson
parents: 6707
diff changeset
    31
Goal "finite (lessThan k)";
30e09714eef5 new finiteness theorems
paulson
parents: 6707
diff changeset
    32
by (induct_tac "k" 1);
30e09714eef5 new finiteness theorems
paulson
parents: 6707
diff changeset
    33
by (simp_tac (simpset() addsimps [lessThan_Suc]) 2);
30e09714eef5 new finiteness theorems
paulson
parents: 6707
diff changeset
    34
by Auto_tac;
30e09714eef5 new finiteness theorems
paulson
parents: 6707
diff changeset
    35
qed "finite_lessThan";
30e09714eef5 new finiteness theorems
paulson
parents: 6707
diff changeset
    36
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4776
diff changeset
    37
Goal "(UN m. lessThan m) = UNIV";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    38
by (Blast_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    39
qed "UN_lessThan_UNIV";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    40
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4776
diff changeset
    41
Goalw [lessThan_def, atLeast_def, le_def]
5490
85855f65d0c6 From Compl(A) to -A
paulson
parents: 5355
diff changeset
    42
    "-lessThan k = atLeast k";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    43
by (Blast_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    44
qed "Compl_lessThan";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    45
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    46
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    47
(*** greaterThan ***)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    48
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4776
diff changeset
    49
Goalw [greaterThan_def] "(i: greaterThan k) = (k<i)";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    50
by (Blast_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    51
qed "greaterThan_iff";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    52
AddIffs [greaterThan_iff];
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    53
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4776
diff changeset
    54
Goalw [greaterThan_def] "greaterThan 0 = range Suc";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    55
by (blast_tac (claset() addIs [Suc_pred RS sym]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    56
qed "greaterThan_0";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    57
Addsimps [greaterThan_0];
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    58
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4776
diff changeset
    59
Goalw [greaterThan_def] "greaterThan (Suc k) = greaterThan k - {Suc k}";
5625
77e9ab9cd7b1 polymorphic versions of nat_neq_iff and nat_neqE
paulson
parents: 5596
diff changeset
    60
by (auto_tac (claset() addEs [linorder_neqE], simpset()));
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    61
qed "greaterThan_Suc";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    62
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4776
diff changeset
    63
Goal "(INT m. greaterThan m) = {}";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    64
by (Blast_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    65
qed "INT_greaterThan_UNIV";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    66
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4776
diff changeset
    67
Goalw [greaterThan_def, atMost_def, le_def]
5490
85855f65d0c6 From Compl(A) to -A
paulson
parents: 5355
diff changeset
    68
    "-greaterThan k = atMost k";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    69
by (Blast_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    70
qed "Compl_greaterThan";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    71
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4776
diff changeset
    72
Goalw [greaterThan_def, atMost_def, le_def]
5490
85855f65d0c6 From Compl(A) to -A
paulson
parents: 5355
diff changeset
    73
    "-atMost k = greaterThan k";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    74
by (Blast_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    75
qed "Compl_atMost";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    76
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4776
diff changeset
    77
Goal "less_than ^^ {k} = greaterThan k";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    78
by (Blast_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    79
qed "Image_less_than";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    80
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    81
Addsimps [Compl_greaterThan, Compl_atMost, Image_less_than];
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    82
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    83
(*** atLeast ***)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    84
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4776
diff changeset
    85
Goalw [atLeast_def] "(i: atLeast k) = (k<=i)";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    86
by (Blast_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    87
qed "atLeast_iff";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    88
AddIffs [atLeast_iff];
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    89
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4776
diff changeset
    90
Goalw [atLeast_def, UNIV_def] "atLeast 0 = UNIV";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    91
by (Simp_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    92
qed "atLeast_0";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    93
Addsimps [atLeast_0];
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    94
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4776
diff changeset
    95
Goalw [atLeast_def] "atLeast (Suc k) = atLeast k - {k}";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    96
by (simp_tac (simpset() addsimps [Suc_le_eq]) 1);
5596
b29d18d8c4d2 abstype of programs
paulson
parents: 5490
diff changeset
    97
by (simp_tac (simpset() addsimps [order_le_less]) 1);
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    98
by (Blast_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    99
qed "atLeast_Suc";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   100
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4776
diff changeset
   101
Goal "(UN m. atLeast m) = UNIV";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   102
by (Blast_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   103
qed "UN_atLeast_UNIV";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   104
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4776
diff changeset
   105
Goalw [lessThan_def, atLeast_def, le_def]
5490
85855f65d0c6 From Compl(A) to -A
paulson
parents: 5355
diff changeset
   106
    "-atLeast k = lessThan k";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   107
by (Blast_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   108
qed "Compl_atLeast";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   109
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4776
diff changeset
   110
Goal "less_than^-1 ^^ {k} = lessThan k";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   111
by (Blast_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   112
qed "Image_inverse_less_than";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   113
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   114
Addsimps [Compl_lessThan, Compl_atLeast, Image_inverse_less_than];
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   115
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   116
(*** atMost ***)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   117
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4776
diff changeset
   118
Goalw [atMost_def] "(i: atMost k) = (i<=k)";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   119
by (Blast_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   120
qed "atMost_iff";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   121
AddIffs [atMost_iff];
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   122
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4776
diff changeset
   123
Goalw [atMost_def] "atMost 0 = {0}";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   124
by (Simp_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   125
qed "atMost_0";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   126
Addsimps [atMost_0];
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   127
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4776
diff changeset
   128
Goalw [atMost_def] "atMost (Suc k) = insert (Suc k) (atMost k)";
5596
b29d18d8c4d2 abstype of programs
paulson
parents: 5490
diff changeset
   129
by (simp_tac (simpset() addsimps [less_Suc_eq, order_le_less]) 1);
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   130
by (Blast_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   131
qed "atMost_Suc";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   132
6825
30e09714eef5 new finiteness theorems
paulson
parents: 6707
diff changeset
   133
Goal "finite (atMost k)";
30e09714eef5 new finiteness theorems
paulson
parents: 6707
diff changeset
   134
by (induct_tac "k" 1);
30e09714eef5 new finiteness theorems
paulson
parents: 6707
diff changeset
   135
by (simp_tac (simpset() addsimps [atMost_Suc]) 2);
30e09714eef5 new finiteness theorems
paulson
parents: 6707
diff changeset
   136
by Auto_tac;
30e09714eef5 new finiteness theorems
paulson
parents: 6707
diff changeset
   137
qed "finite_atMost";
30e09714eef5 new finiteness theorems
paulson
parents: 6707
diff changeset
   138
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4776
diff changeset
   139
Goal "(UN m. atMost m) = UNIV";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   140
by (Blast_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   141
qed "UN_atMost_UNIV";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   142
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4776
diff changeset
   143
Goalw [atMost_def, le_def]
5490
85855f65d0c6 From Compl(A) to -A
paulson
parents: 5355
diff changeset
   144
    "-atMost k = greaterThan k";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   145
by (Blast_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   146
qed "Compl_atMost";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   147
Addsimps [Compl_atMost];
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   148
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   149
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   150
(*** Combined properties ***)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   151
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4776
diff changeset
   152
Goal "atMost n Int atLeast n = {n}";
6707
3b07e62a718c using generic rules when possible
paulson
parents: 6128
diff changeset
   153
by (blast_tac (claset() addIs [order_antisym]) 1);
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   154
qed "atMost_Int_atLeast";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   155
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   156
5232
e5a7cdd07ea5 Tidied; uses records
paulson
parents: 5069
diff changeset
   157
e5a7cdd07ea5 Tidied; uses records
paulson
parents: 5069
diff changeset
   158
e5a7cdd07ea5 Tidied; uses records
paulson
parents: 5069
diff changeset
   159
(*** Finally, a few set-theoretic laws...
e5a7cdd07ea5 Tidied; uses records
paulson
parents: 5069
diff changeset
   160
     CAN BOOLEAN SIMPLIFICATION BE AUTOMATED? ***)
e5a7cdd07ea5 Tidied; uses records
paulson
parents: 5069
diff changeset
   161
e5a7cdd07ea5 Tidied; uses records
paulson
parents: 5069
diff changeset
   162
context Set.thy;
e5a7cdd07ea5 Tidied; uses records
paulson
parents: 5069
diff changeset
   163
5490
85855f65d0c6 From Compl(A) to -A
paulson
parents: 5355
diff changeset
   164
(** Rewrite rules to eliminate A.  Conditions can be satisfied by letting B
5232
e5a7cdd07ea5 Tidied; uses records
paulson
parents: 5069
diff changeset
   165
    be any set including A Int C and contained in A Un C, such as B=A or B=C.
e5a7cdd07ea5 Tidied; uses records
paulson
parents: 5069
diff changeset
   166
**)
e5a7cdd07ea5 Tidied; uses records
paulson
parents: 5069
diff changeset
   167
e5a7cdd07ea5 Tidied; uses records
paulson
parents: 5069
diff changeset
   168
Goal "[| A Int C <= B; B <= A Un C |] \
5490
85855f65d0c6 From Compl(A) to -A
paulson
parents: 5355
diff changeset
   169
\     ==> (A Int B) Un (-A Int C) = B Un C";
5232
e5a7cdd07ea5 Tidied; uses records
paulson
parents: 5069
diff changeset
   170
by (Blast_tac 1);
5490
85855f65d0c6 From Compl(A) to -A
paulson
parents: 5355
diff changeset
   171
qed "set_cancel1";
5232
e5a7cdd07ea5 Tidied; uses records
paulson
parents: 5069
diff changeset
   172
e5a7cdd07ea5 Tidied; uses records
paulson
parents: 5069
diff changeset
   173
Goal "[| A Int C <= B; B <= A Un C |] \
5490
85855f65d0c6 From Compl(A) to -A
paulson
parents: 5355
diff changeset
   174
\     ==> (A Un B) Int (-A Un C) = B Int C";
5232
e5a7cdd07ea5 Tidied; uses records
paulson
parents: 5069
diff changeset
   175
by (Blast_tac 1);
5490
85855f65d0c6 From Compl(A) to -A
paulson
parents: 5355
diff changeset
   176
qed "set_cancel2";
5232
e5a7cdd07ea5 Tidied; uses records
paulson
parents: 5069
diff changeset
   177
e5a7cdd07ea5 Tidied; uses records
paulson
parents: 5069
diff changeset
   178
(*The base B=A*)
5490
85855f65d0c6 From Compl(A) to -A
paulson
parents: 5355
diff changeset
   179
Goal "A Un (-A Int C) = A Un C";
5232
e5a7cdd07ea5 Tidied; uses records
paulson
parents: 5069
diff changeset
   180
by (Blast_tac 1);
5490
85855f65d0c6 From Compl(A) to -A
paulson
parents: 5355
diff changeset
   181
qed "set_cancel3";
5232
e5a7cdd07ea5 Tidied; uses records
paulson
parents: 5069
diff changeset
   182
5490
85855f65d0c6 From Compl(A) to -A
paulson
parents: 5355
diff changeset
   183
Goal "A Int (-A Un C) = A Int C";
5232
e5a7cdd07ea5 Tidied; uses records
paulson
parents: 5069
diff changeset
   184
by (Blast_tac 1);
5490
85855f65d0c6 From Compl(A) to -A
paulson
parents: 5355
diff changeset
   185
qed "set_cancel4";
5232
e5a7cdd07ea5 Tidied; uses records
paulson
parents: 5069
diff changeset
   186
e5a7cdd07ea5 Tidied; uses records
paulson
parents: 5069
diff changeset
   187
(*The base B=C*)
5490
85855f65d0c6 From Compl(A) to -A
paulson
parents: 5355
diff changeset
   188
Goal "(A Int C) Un (-A Int C) = C";
5232
e5a7cdd07ea5 Tidied; uses records
paulson
parents: 5069
diff changeset
   189
by (Blast_tac 1);
5490
85855f65d0c6 From Compl(A) to -A
paulson
parents: 5355
diff changeset
   190
qed "set_cancel5";
5232
e5a7cdd07ea5 Tidied; uses records
paulson
parents: 5069
diff changeset
   191
5490
85855f65d0c6 From Compl(A) to -A
paulson
parents: 5355
diff changeset
   192
Goal "(A Un C) Int (-A Un C) = C";
5232
e5a7cdd07ea5 Tidied; uses records
paulson
parents: 5069
diff changeset
   193
by (Blast_tac 1);
5490
85855f65d0c6 From Compl(A) to -A
paulson
parents: 5355
diff changeset
   194
qed "set_cancel6";
85855f65d0c6 From Compl(A) to -A
paulson
parents: 5355
diff changeset
   195
85855f65d0c6 From Compl(A) to -A
paulson
parents: 5355
diff changeset
   196
Addsimps [set_cancel1, set_cancel2, set_cancel3,
85855f65d0c6 From Compl(A) to -A
paulson
parents: 5355
diff changeset
   197
	  set_cancel4, set_cancel5, set_cancel6];
5232
e5a7cdd07ea5 Tidied; uses records
paulson
parents: 5069
diff changeset
   198
e5a7cdd07ea5 Tidied; uses records
paulson
parents: 5069
diff changeset
   199
e5a7cdd07ea5 Tidied; uses records
paulson
parents: 5069
diff changeset
   200
(** More ad-hoc rules **)
e5a7cdd07ea5 Tidied; uses records
paulson
parents: 5069
diff changeset
   201
e5a7cdd07ea5 Tidied; uses records
paulson
parents: 5069
diff changeset
   202
Goal "A Un B - (A - B) = B";
e5a7cdd07ea5 Tidied; uses records
paulson
parents: 5069
diff changeset
   203
by (Blast_tac 1);
e5a7cdd07ea5 Tidied; uses records
paulson
parents: 5069
diff changeset
   204
qed "Un_Diff_Diff";
5490
85855f65d0c6 From Compl(A) to -A
paulson
parents: 5355
diff changeset
   205
Addsimps [Un_Diff_Diff];
5232
e5a7cdd07ea5 Tidied; uses records
paulson
parents: 5069
diff changeset
   206
e5a7cdd07ea5 Tidied; uses records
paulson
parents: 5069
diff changeset
   207
Goal "A Int (B - C) Un C = A Int B Un C";
e5a7cdd07ea5 Tidied; uses records
paulson
parents: 5069
diff changeset
   208
by (Blast_tac 1);
e5a7cdd07ea5 Tidied; uses records
paulson
parents: 5069
diff changeset
   209
qed "Int_Diff_Un";
e5a7cdd07ea5 Tidied; uses records
paulson
parents: 5069
diff changeset
   210
e5a7cdd07ea5 Tidied; uses records
paulson
parents: 5069
diff changeset
   211
Goal "Union(B) Int A = (UN C:B. C Int A)";
e5a7cdd07ea5 Tidied; uses records
paulson
parents: 5069
diff changeset
   212
by (Blast_tac 1);
e5a7cdd07ea5 Tidied; uses records
paulson
parents: 5069
diff changeset
   213
qed "Int_Union2";
e5a7cdd07ea5 Tidied; uses records
paulson
parents: 5069
diff changeset
   214
e5a7cdd07ea5 Tidied; uses records
paulson
parents: 5069
diff changeset
   215
Goal "Union(B) Int A = Union((%C. C Int A)``B)";
e5a7cdd07ea5 Tidied; uses records
paulson
parents: 5069
diff changeset
   216
by (Blast_tac 1);
e5a7cdd07ea5 Tidied; uses records
paulson
parents: 5069
diff changeset
   217
qed "Int_Union_Union";
e5a7cdd07ea5 Tidied; uses records
paulson
parents: 5069
diff changeset
   218