src/HOL/subset.ML
author oheimb
Wed Jan 31 10:15:55 2001 +0100 (2001-01-31)
changeset 11008 f7333f055ef6
parent 7007 b46ccfee8e59
child 11603 c3724decadef
permissions -rw-r--r--
improved theory reference in comment
clasohm@1465
     1
(*  Title:      HOL/subset
clasohm@923
     2
    ID:         $Id$
clasohm@1465
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
clasohm@923
     4
    Copyright   1991  University of Cambridge
clasohm@923
     5
clasohm@923
     6
Derived rules involving subsets
clasohm@923
     7
Union and Intersection as lattice operations
clasohm@923
     8
*)
clasohm@923
     9
clasohm@923
    10
(*** insert ***)
clasohm@923
    11
paulson@7007
    12
Goal "B <= insert a B";
paulson@7007
    13
by (rtac subsetI 1);
paulson@7007
    14
by (etac insertI2 1) ;
paulson@7007
    15
qed "subset_insertI";
clasohm@923
    16
paulson@5316
    17
Goal "x ~: A ==> (A <= insert x B) = (A <= B)";
paulson@2893
    18
by (Blast_tac 1);
nipkow@1531
    19
qed "subset_insert";
nipkow@1531
    20
clasohm@923
    21
(*** Big Union -- least upper bound of a set  ***)
clasohm@923
    22
paulson@5316
    23
Goal "B:A ==> B <= Union(A)";
paulson@5316
    24
by (REPEAT (ares_tac [subsetI,UnionI] 1));
clasohm@923
    25
qed "Union_upper";
clasohm@923
    26
paulson@5316
    27
val [prem] = Goal "[| !!X. X:A ==> X<=C |] ==> Union(A) <= C";
clasohm@1465
    28
by (rtac subsetI 1);
clasohm@923
    29
by (REPEAT (eresolve_tac [asm_rl, UnionE, prem RS subsetD] 1));
clasohm@923
    30
qed "Union_least";
clasohm@923
    31
clasohm@923
    32
(** General union **)
clasohm@923
    33
paulson@5316
    34
Goal "a:A ==> B(a) <= (UN x:A. B(x))";
paulson@5316
    35
by (Blast_tac 1);
clasohm@923
    36
qed "UN_upper";
clasohm@923
    37
paulson@5316
    38
val [prem] = Goal "[| !!x. x:A ==> B(x)<=C |] ==> (UN x:A. B(x)) <= C";
clasohm@1465
    39
by (rtac subsetI 1);
clasohm@923
    40
by (REPEAT (eresolve_tac [asm_rl, UN_E, prem RS subsetD] 1));
clasohm@923
    41
qed "UN_least";
clasohm@923
    42
clasohm@923
    43
clasohm@923
    44
(*** Big Intersection -- greatest lower bound of a set ***)
clasohm@923
    45
paulson@5316
    46
Goal "B:A ==> Inter(A) <= B";
paulson@2893
    47
by (Blast_tac 1);
clasohm@923
    48
qed "Inter_lower";
clasohm@923
    49
paulson@5316
    50
val [prem] = Goal "[| !!X. X:A ==> C<=X |] ==> C <= Inter(A)";
clasohm@1465
    51
by (rtac (InterI RS subsetI) 1);
clasohm@923
    52
by (REPEAT (eresolve_tac [asm_rl, prem RS subsetD] 1));
clasohm@923
    53
qed "Inter_greatest";
clasohm@923
    54
paulson@5316
    55
Goal "a:A ==> (INT x:A. B(x)) <= B(a)";
paulson@5316
    56
by (Blast_tac 1);
clasohm@923
    57
qed "INT_lower";
clasohm@923
    58
paulson@5316
    59
val [prem] = Goal "[| !!x. x:A ==> C<=B(x) |] ==> C <= (INT x:A. B(x))";
clasohm@1465
    60
by (rtac (INT_I RS subsetI) 1);
clasohm@923
    61
by (REPEAT (eresolve_tac [asm_rl, prem RS subsetD] 1));
clasohm@923
    62
qed "INT_greatest";
clasohm@923
    63
clasohm@923
    64
(*** Finite Union -- the least upper bound of 2 sets ***)
clasohm@923
    65
paulson@5316
    66
Goal "A <= A Un B";
paulson@2893
    67
by (Blast_tac 1);
clasohm@923
    68
qed "Un_upper1";
clasohm@923
    69
paulson@5316
    70
Goal "B <= A Un B";
paulson@2893
    71
by (Blast_tac 1);
clasohm@923
    72
qed "Un_upper2";
clasohm@923
    73
paulson@5316
    74
Goal "[| A<=C;  B<=C |] ==> A Un B <= C";
paulson@2893
    75
by (Blast_tac 1);
clasohm@923
    76
qed "Un_least";
clasohm@923
    77
clasohm@923
    78
(*** Finite Intersection -- the greatest lower bound of 2 sets *)
clasohm@923
    79
paulson@5316
    80
Goal "A Int B <= A";
paulson@2893
    81
by (Blast_tac 1);
clasohm@923
    82
qed "Int_lower1";
clasohm@923
    83
paulson@5316
    84
Goal "A Int B <= B";
paulson@2893
    85
by (Blast_tac 1);
clasohm@923
    86
qed "Int_lower2";
clasohm@923
    87
paulson@5316
    88
Goal "[| C<=A;  C<=B |] ==> C <= A Int B";
paulson@2893
    89
by (Blast_tac 1);
clasohm@923
    90
qed "Int_greatest";
clasohm@923
    91
clasohm@923
    92
(*** Set difference ***)
clasohm@923
    93
paulson@7007
    94
Goal "A-B <= (A::'a set)";
paulson@7007
    95
by (Blast_tac 1) ;
paulson@7007
    96
qed "Diff_subset";
clasohm@923
    97
clasohm@923
    98
(*** Monotonicity ***)
clasohm@923
    99
paulson@5316
   100
Goal "mono(f) ==> f(A) Un f(B) <= f(A Un B)";
clasohm@923
   101
by (rtac Un_least 1);
paulson@5316
   102
by (etac (Un_upper1 RSN (2,monoD)) 1);
paulson@5316
   103
by (etac (Un_upper2 RSN (2,monoD)) 1);
clasohm@923
   104
qed "mono_Un";
clasohm@923
   105
paulson@5316
   106
Goal "mono(f) ==> f(A Int B) <= f(A) Int f(B)";
clasohm@923
   107
by (rtac Int_greatest 1);
paulson@5316
   108
by (etac (Int_lower1 RSN (2,monoD)) 1);
paulson@5316
   109
by (etac (Int_lower2 RSN (2,monoD)) 1);
clasohm@923
   110
qed "mono_Int";