src/HOL/mono.ML
author paulson
Mon Oct 07 10:28:44 1996 +0200 (1996-10-07)
changeset 2056 93c093620c28
parent 1849 bec272e3e888
child 2922 580647a879cf
permissions -rw-r--r--
Removed commands made redundant by new one-point rules
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";
berghofe@1760
    10
by (Fast_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)";
berghofe@1760
    14
by (Fast_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)";
berghofe@1760
    18
by (Fast_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)";
berghofe@1760
    22
by (Fast_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))";
berghofe@1760
    28
by (fast_tac (!claset addIs (prems RL [subsetD])) 1);
clasohm@923
    29
qed "UN_mono";
clasohm@923
    30
clasohm@923
    31
val [prem] = goal Set.thy
clasohm@923
    32
    "[| !!x. f(x)<=g(x) |] ==> (UN x. f(x)) <= (UN x. g(x))";
berghofe@1760
    33
by (fast_tac (!claset addIs [prem RS subsetD]) 1);
clasohm@923
    34
qed "UN1_mono";
clasohm@923
    35
clasohm@923
    36
val prems = goal Set.thy
clasohm@923
    37
    "[| B<=A;  !!x. x:A ==> f(x)<=g(x) |] ==> \
clasohm@923
    38
\    (INT x:A. f(x)) <= (INT x:A. g(x))";
berghofe@1760
    39
by (fast_tac (!claset addIs (prems RL [subsetD])) 1);
clasohm@923
    40
qed "INT_anti_mono";
clasohm@923
    41
clasohm@923
    42
(*The inclusion is POSITIVE! *)
clasohm@923
    43
val [prem] = goal Set.thy
clasohm@923
    44
    "[| !!x. f(x)<=g(x) |] ==> (INT x. f(x)) <= (INT x. g(x))";
berghofe@1760
    45
by (fast_tac (!claset addIs [prem RS subsetD]) 1);
clasohm@923
    46
qed "INT1_mono";
clasohm@923
    47
paulson@1849
    48
goal Set.thy "!!C D. C<=D ==> insert a C <= insert a D";
paulson@1849
    49
by (Fast_tac 1);
paulson@1849
    50
qed "insert_mono";
paulson@1849
    51
clasohm@923
    52
goal Set.thy "!!A B. [| A<=C;  B<=D |] ==> A Un B <= C Un D";
berghofe@1760
    53
by (Fast_tac 1);
clasohm@923
    54
qed "Un_mono";
clasohm@923
    55
clasohm@923
    56
goal Set.thy "!!A B. [| A<=C;  B<=D |] ==> A Int B <= C Int D";
berghofe@1760
    57
by (Fast_tac 1);
clasohm@923
    58
qed "Int_mono";
clasohm@923
    59
clasohm@923
    60
goal Set.thy "!!A::'a set. [| A<=C;  D<=B |] ==> A-B <= C-D";
berghofe@1760
    61
by (Fast_tac 1);
clasohm@923
    62
qed "Diff_mono";
clasohm@923
    63
clasohm@923
    64
goal Set.thy "!!A B. A<=B ==> Compl(B) <= Compl(A)";
berghofe@1760
    65
by (Fast_tac 1);
clasohm@923
    66
qed "Compl_anti_mono";
clasohm@923
    67
clasohm@923
    68
(** Monotonicity of implications.  For inductive definitions **)
clasohm@923
    69
clasohm@923
    70
goal Set.thy "!!A B x. A<=B ==> x:A --> x:B";
clasohm@923
    71
by (rtac impI 1);
clasohm@923
    72
by (etac subsetD 1);
clasohm@923
    73
by (assume_tac 1);
clasohm@923
    74
qed "in_mono";
clasohm@923
    75
clasohm@923
    76
goal HOL.thy "!!P1 P2 Q1 Q2. [| P1-->Q1; P2-->Q2 |] ==> (P1&P2) --> (Q1&Q2)";
berghofe@1760
    77
by (Fast_tac 1);
clasohm@923
    78
qed "conj_mono";
clasohm@923
    79
clasohm@923
    80
goal HOL.thy "!!P1 P2 Q1 Q2. [| P1-->Q1; P2-->Q2 |] ==> (P1|P2) --> (Q1|Q2)";
berghofe@1760
    81
by (Fast_tac 1);
clasohm@923
    82
qed "disj_mono";
clasohm@923
    83
clasohm@923
    84
goal HOL.thy "!!P1 P2 Q1 Q2.[| Q1-->P1; P2-->Q2 |] ==> (P1-->P2)-->(Q1-->Q2)";
berghofe@1760
    85
by (Fast_tac 1);
clasohm@923
    86
qed "imp_mono";
clasohm@923
    87
clasohm@923
    88
goal HOL.thy "P-->P";
clasohm@923
    89
by (rtac impI 1);
clasohm@923
    90
by (assume_tac 1);
clasohm@923
    91
qed "imp_refl";
clasohm@923
    92
clasohm@923
    93
val [PQimp] = goal HOL.thy
clasohm@923
    94
    "[| !!x. P(x) --> Q(x) |] ==> (EX x.P(x)) --> (EX x.Q(x))";
berghofe@1760
    95
by (fast_tac (!claset addIs [PQimp RS mp]) 1);
clasohm@923
    96
qed "ex_mono";
clasohm@923
    97
clasohm@923
    98
val [PQimp] = goal HOL.thy
clasohm@923
    99
    "[| !!x. P(x) --> Q(x) |] ==> (ALL x.P(x)) --> (ALL x.Q(x))";
berghofe@1760
   100
by (fast_tac (!claset addIs [PQimp RS mp]) 1);
clasohm@923
   101
qed "all_mono";
clasohm@923
   102
clasohm@923
   103
val [PQimp] = goal Set.thy
clasohm@923
   104
    "[| !!x. P(x) --> Q(x) |] ==> Collect(P) <= Collect(Q)";
berghofe@1760
   105
by (fast_tac (!claset addIs [PQimp RS mp]) 1);
clasohm@923
   106
qed "Collect_mono";
clasohm@923
   107
clasohm@923
   108
(*Used in indrule.ML*)
clasohm@923
   109
val [subs,PQimp] = goal Set.thy
clasohm@923
   110
    "[| A<=B;  !!x. x:A ==> P(x) --> Q(x) \
clasohm@923
   111
\    |] ==> A Int Collect(P) <= B Int Collect(Q)";
berghofe@1760
   112
by (fast_tac (!claset addIs [subs RS subsetD, PQimp RS mp]) 1);
clasohm@923
   113
qed "Int_Collect_mono";
clasohm@923
   114
clasohm@923
   115
(*Used in intr_elim.ML and in individual datatype definitions*)
clasohm@923
   116
val basic_monos = [subset_refl, imp_refl, disj_mono, conj_mono, 
nipkow@1515
   117
                   ex_mono, Collect_mono, in_mono];
clasohm@923
   118