src/HOL/subset.ML
author nipkow
Fri, 24 Nov 2000 16:49:27 +0100
changeset 10519 ade64af4c57c
parent 7007 b46ccfee8e59
child 11603 c3724decadef
permissions -rw-r--r--
hide many names from Datatype_Universe.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1465
5d7a7e439cec expanded tabs
clasohm
parents: 923
diff changeset
     1
(*  Title:      HOL/subset
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     2
    ID:         $Id$
1465
5d7a7e439cec expanded tabs
clasohm
parents: 923
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     4
    Copyright   1991  University of Cambridge
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     5
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     6
Derived rules involving subsets
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     7
Union and Intersection as lattice operations
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     8
*)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     9
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    10
(*** insert ***)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    11
7007
b46ccfee8e59 qed_goal -> Goal
paulson
parents: 5316
diff changeset
    12
Goal "B <= insert a B";
b46ccfee8e59 qed_goal -> Goal
paulson
parents: 5316
diff changeset
    13
by (rtac subsetI 1);
b46ccfee8e59 qed_goal -> Goal
paulson
parents: 5316
diff changeset
    14
by (etac insertI2 1) ;
b46ccfee8e59 qed_goal -> Goal
paulson
parents: 5316
diff changeset
    15
qed "subset_insertI";
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    16
5316
7a8975451a89 even more tidying of Goal commands
paulson
parents: 4159
diff changeset
    17
Goal "x ~: A ==> (A <= insert x B) = (A <= B)";
2893
2ee005e46d6d Calls Blast_tac. Tidied some proofs
paulson
parents: 2515
diff changeset
    18
by (Blast_tac 1);
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
    19
qed "subset_insert";
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
    20
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    21
(*** Big Union -- least upper bound of a set  ***)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    22
5316
7a8975451a89 even more tidying of Goal commands
paulson
parents: 4159
diff changeset
    23
Goal "B:A ==> B <= Union(A)";
7a8975451a89 even more tidying of Goal commands
paulson
parents: 4159
diff changeset
    24
by (REPEAT (ares_tac [subsetI,UnionI] 1));
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    25
qed "Union_upper";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    26
5316
7a8975451a89 even more tidying of Goal commands
paulson
parents: 4159
diff changeset
    27
val [prem] = Goal "[| !!X. X:A ==> X<=C |] ==> Union(A) <= C";
1465
5d7a7e439cec expanded tabs
clasohm
parents: 923
diff changeset
    28
by (rtac subsetI 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    29
by (REPEAT (eresolve_tac [asm_rl, UnionE, prem RS subsetD] 1));
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    30
qed "Union_least";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    31
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    32
(** General union **)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    33
5316
7a8975451a89 even more tidying of Goal commands
paulson
parents: 4159
diff changeset
    34
Goal "a:A ==> B(a) <= (UN x:A. B(x))";
7a8975451a89 even more tidying of Goal commands
paulson
parents: 4159
diff changeset
    35
by (Blast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    36
qed "UN_upper";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    37
5316
7a8975451a89 even more tidying of Goal commands
paulson
parents: 4159
diff changeset
    38
val [prem] = Goal "[| !!x. x:A ==> B(x)<=C |] ==> (UN x:A. B(x)) <= C";
1465
5d7a7e439cec expanded tabs
clasohm
parents: 923
diff changeset
    39
by (rtac subsetI 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    40
by (REPEAT (eresolve_tac [asm_rl, UN_E, prem RS subsetD] 1));
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    41
qed "UN_least";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    42
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    43
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    44
(*** Big Intersection -- greatest lower bound of a set ***)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    45
5316
7a8975451a89 even more tidying of Goal commands
paulson
parents: 4159
diff changeset
    46
Goal "B:A ==> Inter(A) <= B";
2893
2ee005e46d6d Calls Blast_tac. Tidied some proofs
paulson
parents: 2515
diff changeset
    47
by (Blast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    48
qed "Inter_lower";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    49
5316
7a8975451a89 even more tidying of Goal commands
paulson
parents: 4159
diff changeset
    50
val [prem] = Goal "[| !!X. X:A ==> C<=X |] ==> C <= Inter(A)";
1465
5d7a7e439cec expanded tabs
clasohm
parents: 923
diff changeset
    51
by (rtac (InterI RS subsetI) 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    52
by (REPEAT (eresolve_tac [asm_rl, prem RS subsetD] 1));
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    53
qed "Inter_greatest";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    54
5316
7a8975451a89 even more tidying of Goal commands
paulson
parents: 4159
diff changeset
    55
Goal "a:A ==> (INT x:A. B(x)) <= B(a)";
7a8975451a89 even more tidying of Goal commands
paulson
parents: 4159
diff changeset
    56
by (Blast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    57
qed "INT_lower";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    58
5316
7a8975451a89 even more tidying of Goal commands
paulson
parents: 4159
diff changeset
    59
val [prem] = Goal "[| !!x. x:A ==> C<=B(x) |] ==> C <= (INT x:A. B(x))";
1465
5d7a7e439cec expanded tabs
clasohm
parents: 923
diff changeset
    60
by (rtac (INT_I RS subsetI) 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    61
by (REPEAT (eresolve_tac [asm_rl, prem RS subsetD] 1));
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    62
qed "INT_greatest";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    63
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    64
(*** Finite Union -- the least upper bound of 2 sets ***)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    65
5316
7a8975451a89 even more tidying of Goal commands
paulson
parents: 4159
diff changeset
    66
Goal "A <= A Un B";
2893
2ee005e46d6d Calls Blast_tac. Tidied some proofs
paulson
parents: 2515
diff changeset
    67
by (Blast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    68
qed "Un_upper1";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    69
5316
7a8975451a89 even more tidying of Goal commands
paulson
parents: 4159
diff changeset
    70
Goal "B <= A Un B";
2893
2ee005e46d6d Calls Blast_tac. Tidied some proofs
paulson
parents: 2515
diff changeset
    71
by (Blast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    72
qed "Un_upper2";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    73
5316
7a8975451a89 even more tidying of Goal commands
paulson
parents: 4159
diff changeset
    74
Goal "[| A<=C;  B<=C |] ==> A Un B <= C";
2893
2ee005e46d6d Calls Blast_tac. Tidied some proofs
paulson
parents: 2515
diff changeset
    75
by (Blast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    76
qed "Un_least";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    77
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    78
(*** Finite Intersection -- the greatest lower bound of 2 sets *)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    79
5316
7a8975451a89 even more tidying of Goal commands
paulson
parents: 4159
diff changeset
    80
Goal "A Int B <= A";
2893
2ee005e46d6d Calls Blast_tac. Tidied some proofs
paulson
parents: 2515
diff changeset
    81
by (Blast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    82
qed "Int_lower1";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    83
5316
7a8975451a89 even more tidying of Goal commands
paulson
parents: 4159
diff changeset
    84
Goal "A Int B <= B";
2893
2ee005e46d6d Calls Blast_tac. Tidied some proofs
paulson
parents: 2515
diff changeset
    85
by (Blast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    86
qed "Int_lower2";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    87
5316
7a8975451a89 even more tidying of Goal commands
paulson
parents: 4159
diff changeset
    88
Goal "[| C<=A;  C<=B |] ==> C <= A Int B";
2893
2ee005e46d6d Calls Blast_tac. Tidied some proofs
paulson
parents: 2515
diff changeset
    89
by (Blast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    90
qed "Int_greatest";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    91
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    92
(*** Set difference ***)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    93
7007
b46ccfee8e59 qed_goal -> Goal
paulson
parents: 5316
diff changeset
    94
Goal "A-B <= (A::'a set)";
b46ccfee8e59 qed_goal -> Goal
paulson
parents: 5316
diff changeset
    95
by (Blast_tac 1) ;
b46ccfee8e59 qed_goal -> Goal
paulson
parents: 5316
diff changeset
    96
qed "Diff_subset";
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    97
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    98
(*** Monotonicity ***)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    99
5316
7a8975451a89 even more tidying of Goal commands
paulson
parents: 4159
diff changeset
   100
Goal "mono(f) ==> f(A) Un f(B) <= f(A Un B)";
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   101
by (rtac Un_least 1);
5316
7a8975451a89 even more tidying of Goal commands
paulson
parents: 4159
diff changeset
   102
by (etac (Un_upper1 RSN (2,monoD)) 1);
7a8975451a89 even more tidying of Goal commands
paulson
parents: 4159
diff changeset
   103
by (etac (Un_upper2 RSN (2,monoD)) 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   104
qed "mono_Un";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   105
5316
7a8975451a89 even more tidying of Goal commands
paulson
parents: 4159
diff changeset
   106
Goal "mono(f) ==> f(A Int B) <= f(A) Int f(B)";
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   107
by (rtac Int_greatest 1);
5316
7a8975451a89 even more tidying of Goal commands
paulson
parents: 4159
diff changeset
   108
by (etac (Int_lower1 RSN (2,monoD)) 1);
7a8975451a89 even more tidying of Goal commands
paulson
parents: 4159
diff changeset
   109
by (etac (Int_lower2 RSN (2,monoD)) 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   110
qed "mono_Int";