src/HOL/mono.ML
author paulson
Wed Nov 05 13:32:07 1997 +0100 (1997-11-05)
changeset 4159 4aff9b7e5597
parent 4089 96fba19bcbe2
child 5100 68775c0e40e7
permissions -rw-r--r--
UNIV now a constant; UNION1, INTER1 now translations and no longer have
separate rules for themselves
clasohm@1465
     1
(*  Title:      HOL/mono.ML
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
Monotonicity of various operations
clasohm@923
     7
*)
clasohm@923
     8
clasohm@923
     9
goal Set.thy "!!A B. A<=B ==> f``A <= f``B";
paulson@2922
    10
by (Blast_tac 1);
clasohm@923
    11
qed "image_mono";
clasohm@923
    12
clasohm@923
    13
goal Set.thy "!!A B. A<=B ==> Pow(A) <= Pow(B)";
paulson@2922
    14
by (Blast_tac 1);
clasohm@923
    15
qed "Pow_mono";
clasohm@923
    16
clasohm@923
    17
goal Set.thy "!!A B. A<=B ==> Union(A) <= Union(B)";
paulson@2922
    18
by (Blast_tac 1);
clasohm@923
    19
qed "Union_mono";
clasohm@923
    20
clasohm@923
    21
goal Set.thy "!!A B. B<=A ==> Inter(A) <= Inter(B)";
paulson@2922
    22
by (Blast_tac 1);
clasohm@923
    23
qed "Inter_anti_mono";
clasohm@923
    24
clasohm@923
    25
val prems = goal Set.thy
clasohm@923
    26
    "[| A<=B;  !!x. x:A ==> f(x)<=g(x) |] ==> \
clasohm@923
    27
\    (UN x:A. f(x)) <= (UN x:B. g(x))";
wenzelm@4089
    28
by (blast_tac (claset() addIs (prems RL [subsetD])) 1);
clasohm@923
    29
qed "UN_mono";
clasohm@923
    30
paulson@4159
    31
(*The last inclusion is POSITIVE! *)
clasohm@923
    32
val prems = goal Set.thy
clasohm@923
    33
    "[| B<=A;  !!x. x:A ==> f(x)<=g(x) |] ==> \
clasohm@923
    34
\    (INT x:A. f(x)) <= (INT x:A. g(x))";
wenzelm@4089
    35
by (blast_tac (claset() addIs (prems RL [subsetD])) 1);
clasohm@923
    36
qed "INT_anti_mono";
clasohm@923
    37
paulson@1849
    38
goal Set.thy "!!C D. C<=D ==> insert a C <= insert a D";
paulson@2922
    39
by (Blast_tac 1);
paulson@1849
    40
qed "insert_mono";
paulson@1849
    41
clasohm@923
    42
goal Set.thy "!!A B. [| A<=C;  B<=D |] ==> A Un B <= C Un D";
paulson@2922
    43
by (Blast_tac 1);
clasohm@923
    44
qed "Un_mono";
clasohm@923
    45
clasohm@923
    46
goal Set.thy "!!A B. [| A<=C;  B<=D |] ==> A Int B <= C Int D";
paulson@2922
    47
by (Blast_tac 1);
clasohm@923
    48
qed "Int_mono";
clasohm@923
    49
clasohm@923
    50
goal Set.thy "!!A::'a set. [| A<=C;  D<=B |] ==> A-B <= C-D";
paulson@2922
    51
by (Blast_tac 1);
clasohm@923
    52
qed "Diff_mono";
clasohm@923
    53
clasohm@923
    54
goal Set.thy "!!A B. A<=B ==> Compl(B) <= Compl(A)";
paulson@2922
    55
by (Blast_tac 1);
clasohm@923
    56
qed "Compl_anti_mono";
clasohm@923
    57
clasohm@923
    58
(** Monotonicity of implications.  For inductive definitions **)
clasohm@923
    59
clasohm@923
    60
goal Set.thy "!!A B x. A<=B ==> x:A --> x:B";
clasohm@923
    61
by (rtac impI 1);
clasohm@923
    62
by (etac subsetD 1);
clasohm@923
    63
by (assume_tac 1);
clasohm@923
    64
qed "in_mono";
clasohm@923
    65
clasohm@923
    66
goal HOL.thy "!!P1 P2 Q1 Q2. [| P1-->Q1; P2-->Q2 |] ==> (P1&P2) --> (Q1&Q2)";
paulson@2922
    67
by (Blast_tac 1);
clasohm@923
    68
qed "conj_mono";
clasohm@923
    69
clasohm@923
    70
goal HOL.thy "!!P1 P2 Q1 Q2. [| P1-->Q1; P2-->Q2 |] ==> (P1|P2) --> (Q1|Q2)";
paulson@2922
    71
by (Blast_tac 1);
clasohm@923
    72
qed "disj_mono";
clasohm@923
    73
clasohm@923
    74
goal HOL.thy "!!P1 P2 Q1 Q2.[| Q1-->P1; P2-->Q2 |] ==> (P1-->P2)-->(Q1-->Q2)";
paulson@2922
    75
by (Blast_tac 1);
clasohm@923
    76
qed "imp_mono";
clasohm@923
    77
clasohm@923
    78
goal HOL.thy "P-->P";
clasohm@923
    79
by (rtac impI 1);
clasohm@923
    80
by (assume_tac 1);
clasohm@923
    81
qed "imp_refl";
clasohm@923
    82
clasohm@923
    83
val [PQimp] = goal HOL.thy
wenzelm@3842
    84
    "[| !!x. P(x) --> Q(x) |] ==> (EX x. P(x)) --> (EX x. Q(x))";
wenzelm@4089
    85
by (blast_tac (claset() addIs [PQimp RS mp]) 1);
clasohm@923
    86
qed "ex_mono";
clasohm@923
    87
clasohm@923
    88
val [PQimp] = goal HOL.thy
wenzelm@3842
    89
    "[| !!x. P(x) --> Q(x) |] ==> (ALL x. P(x)) --> (ALL x. Q(x))";
wenzelm@4089
    90
by (blast_tac (claset() addIs [PQimp RS mp]) 1);
clasohm@923
    91
qed "all_mono";
clasohm@923
    92
clasohm@923
    93
val [PQimp] = goal Set.thy
clasohm@923
    94
    "[| !!x. P(x) --> Q(x) |] ==> Collect(P) <= Collect(Q)";
wenzelm@4089
    95
by (blast_tac (claset() addIs [PQimp RS mp]) 1);
clasohm@923
    96
qed "Collect_mono";
clasohm@923
    97
clasohm@923
    98
(*Used in indrule.ML*)
clasohm@923
    99
val [subs,PQimp] = goal Set.thy
clasohm@923
   100
    "[| A<=B;  !!x. x:A ==> P(x) --> Q(x) \
clasohm@923
   101
\    |] ==> A Int Collect(P) <= B Int Collect(Q)";
wenzelm@4089
   102
by (blast_tac (claset() addIs [subs RS subsetD, PQimp RS mp]) 1);
clasohm@923
   103
qed "Int_Collect_mono";
clasohm@923
   104
clasohm@923
   105
(*Used in intr_elim.ML and in individual datatype definitions*)
clasohm@923
   106
val basic_monos = [subset_refl, imp_refl, disj_mono, conj_mono, 
nipkow@1515
   107
                   ex_mono, Collect_mono, in_mono];
clasohm@923
   108