src/HOL/subset.ML
author paulson
Mon Dec 07 18:26:25 1998 +0100 (1998-12-07)
changeset 6019 0e55c2fb2ebb
parent 5316 7a8975451a89
child 7007 b46ccfee8e59
permissions -rw-r--r--
tidying
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
clasohm@923
    12
qed_goal "subset_insertI" Set.thy "B <= insert a B"
clasohm@923
    13
 (fn _=> [ (rtac subsetI 1), (etac insertI2 1) ]);
clasohm@923
    14
paulson@5316
    15
Goal "x ~: A ==> (A <= insert x B) = (A <= B)";
paulson@2893
    16
by (Blast_tac 1);
nipkow@1531
    17
qed "subset_insert";
nipkow@1531
    18
clasohm@923
    19
(*** Big Union -- least upper bound of a set  ***)
clasohm@923
    20
paulson@5316
    21
Goal "B:A ==> B <= Union(A)";
paulson@5316
    22
by (REPEAT (ares_tac [subsetI,UnionI] 1));
clasohm@923
    23
qed "Union_upper";
clasohm@923
    24
paulson@5316
    25
val [prem] = Goal "[| !!X. X:A ==> X<=C |] ==> Union(A) <= C";
clasohm@1465
    26
by (rtac subsetI 1);
clasohm@923
    27
by (REPEAT (eresolve_tac [asm_rl, UnionE, prem RS subsetD] 1));
clasohm@923
    28
qed "Union_least";
clasohm@923
    29
clasohm@923
    30
(** General union **)
clasohm@923
    31
paulson@5316
    32
Goal "a:A ==> B(a) <= (UN x:A. B(x))";
paulson@5316
    33
by (Blast_tac 1);
clasohm@923
    34
qed "UN_upper";
clasohm@923
    35
paulson@5316
    36
val [prem] = Goal "[| !!x. x:A ==> B(x)<=C |] ==> (UN x:A. B(x)) <= C";
clasohm@1465
    37
by (rtac subsetI 1);
clasohm@923
    38
by (REPEAT (eresolve_tac [asm_rl, UN_E, prem RS subsetD] 1));
clasohm@923
    39
qed "UN_least";
clasohm@923
    40
clasohm@923
    41
clasohm@923
    42
(*** Big Intersection -- greatest lower bound of a set ***)
clasohm@923
    43
paulson@5316
    44
Goal "B:A ==> Inter(A) <= B";
paulson@2893
    45
by (Blast_tac 1);
clasohm@923
    46
qed "Inter_lower";
clasohm@923
    47
paulson@5316
    48
val [prem] = Goal "[| !!X. X:A ==> C<=X |] ==> C <= Inter(A)";
clasohm@1465
    49
by (rtac (InterI RS subsetI) 1);
clasohm@923
    50
by (REPEAT (eresolve_tac [asm_rl, prem RS subsetD] 1));
clasohm@923
    51
qed "Inter_greatest";
clasohm@923
    52
paulson@5316
    53
Goal "a:A ==> (INT x:A. B(x)) <= B(a)";
paulson@5316
    54
by (Blast_tac 1);
clasohm@923
    55
qed "INT_lower";
clasohm@923
    56
paulson@5316
    57
val [prem] = Goal "[| !!x. x:A ==> C<=B(x) |] ==> C <= (INT x:A. B(x))";
clasohm@1465
    58
by (rtac (INT_I RS subsetI) 1);
clasohm@923
    59
by (REPEAT (eresolve_tac [asm_rl, prem RS subsetD] 1));
clasohm@923
    60
qed "INT_greatest";
clasohm@923
    61
clasohm@923
    62
(*** Finite Union -- the least upper bound of 2 sets ***)
clasohm@923
    63
paulson@5316
    64
Goal "A <= A Un B";
paulson@2893
    65
by (Blast_tac 1);
clasohm@923
    66
qed "Un_upper1";
clasohm@923
    67
paulson@5316
    68
Goal "B <= A Un B";
paulson@2893
    69
by (Blast_tac 1);
clasohm@923
    70
qed "Un_upper2";
clasohm@923
    71
paulson@5316
    72
Goal "[| A<=C;  B<=C |] ==> A Un B <= C";
paulson@2893
    73
by (Blast_tac 1);
clasohm@923
    74
qed "Un_least";
clasohm@923
    75
clasohm@923
    76
(*** Finite Intersection -- the greatest lower bound of 2 sets *)
clasohm@923
    77
paulson@5316
    78
Goal "A Int B <= A";
paulson@2893
    79
by (Blast_tac 1);
clasohm@923
    80
qed "Int_lower1";
clasohm@923
    81
paulson@5316
    82
Goal "A Int B <= B";
paulson@2893
    83
by (Blast_tac 1);
clasohm@923
    84
qed "Int_lower2";
clasohm@923
    85
paulson@5316
    86
Goal "[| C<=A;  C<=B |] ==> C <= A Int B";
paulson@2893
    87
by (Blast_tac 1);
clasohm@923
    88
qed "Int_greatest";
clasohm@923
    89
clasohm@923
    90
(*** Set difference ***)
clasohm@923
    91
clasohm@923
    92
qed_goal "Diff_subset" Set.thy "A-B <= (A::'a set)"
paulson@2893
    93
 (fn _ => [ (Blast_tac 1) ]);
clasohm@923
    94
clasohm@923
    95
(*** Monotonicity ***)
clasohm@923
    96
paulson@5316
    97
Goal "mono(f) ==> f(A) Un f(B) <= f(A Un B)";
clasohm@923
    98
by (rtac Un_least 1);
paulson@5316
    99
by (etac (Un_upper1 RSN (2,monoD)) 1);
paulson@5316
   100
by (etac (Un_upper2 RSN (2,monoD)) 1);
clasohm@923
   101
qed "mono_Un";
clasohm@923
   102
paulson@5316
   103
Goal "mono(f) ==> f(A Int B) <= f(A) Int f(B)";
clasohm@923
   104
by (rtac Int_greatest 1);
paulson@5316
   105
by (etac (Int_lower1 RSN (2,monoD)) 1);
paulson@5316
   106
by (etac (Int_lower2 RSN (2,monoD)) 1);
clasohm@923
   107
qed "mono_Int";