src/HOL/mono.ML
author clasohm
Fri Mar 03 12:02:25 1995 +0100 (1995-03-03)
changeset 923 ff1574a81019
child 1264 3eb91524b938
permissions -rw-r--r--
new version of HOL with curried function application
clasohm@923
     1
(*  Title: 	HOL/mono
clasohm@923
     2
    ID:         $Id$
clasohm@923
     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";
clasohm@923
    10
by (fast_tac set_cs 1);
clasohm@923
    11
qed "image_mono";
clasohm@923
    12
clasohm@923
    13
goal Set.thy "!!A B. A<=B ==> Pow(A) <= Pow(B)";
clasohm@923
    14
by (fast_tac set_cs 1);
clasohm@923
    15
qed "Pow_mono";
clasohm@923
    16
clasohm@923
    17
goal Set.thy "!!A B. A<=B ==> Union(A) <= Union(B)";
clasohm@923
    18
by (fast_tac set_cs 1);
clasohm@923
    19
qed "Union_mono";
clasohm@923
    20
clasohm@923
    21
goal Set.thy "!!A B. B<=A ==> Inter(A) <= Inter(B)";
clasohm@923
    22
by (fast_tac set_cs 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))";
clasohm@923
    28
by (fast_tac (set_cs 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))";
clasohm@923
    33
by (fast_tac (set_cs 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))";
clasohm@923
    39
by (fast_tac (set_cs 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))";
clasohm@923
    45
by (fast_tac (set_cs addIs [prem RS subsetD]) 1);
clasohm@923
    46
qed "INT1_mono";
clasohm@923
    47
clasohm@923
    48
goal Set.thy "!!A B. [| A<=C;  B<=D |] ==> A Un B <= C Un D";
clasohm@923
    49
by (fast_tac set_cs 1);
clasohm@923
    50
qed "Un_mono";
clasohm@923
    51
clasohm@923
    52
goal Set.thy "!!A B. [| A<=C;  B<=D |] ==> A Int B <= C Int D";
clasohm@923
    53
by (fast_tac set_cs 1);
clasohm@923
    54
qed "Int_mono";
clasohm@923
    55
clasohm@923
    56
goal Set.thy "!!A::'a set. [| A<=C;  D<=B |] ==> A-B <= C-D";
clasohm@923
    57
by (fast_tac set_cs 1);
clasohm@923
    58
qed "Diff_mono";
clasohm@923
    59
clasohm@923
    60
goal Set.thy "!!A B. A<=B ==> Compl(B) <= Compl(A)";
clasohm@923
    61
by (fast_tac set_cs 1);
clasohm@923
    62
qed "Compl_anti_mono";
clasohm@923
    63
clasohm@923
    64
val prems = goal Prod.thy
clasohm@923
    65
    "[| A<=C;  !!x. x:A ==> B<=D |] ==> Sigma A (%x.B) <= Sigma C (%x.D)";
clasohm@923
    66
by (cut_facts_tac prems 1);
clasohm@923
    67
by (fast_tac (set_cs addIs (prems RL [subsetD]) 
clasohm@923
    68
                     addSIs [SigmaI] 
clasohm@923
    69
                     addSEs [SigmaE]) 1);
clasohm@923
    70
qed "Sigma_mono";
clasohm@923
    71
clasohm@923
    72
clasohm@923
    73
(** Monotonicity of implications.  For inductive definitions **)
clasohm@923
    74
clasohm@923
    75
goal Set.thy "!!A B x. A<=B ==> x:A --> x:B";
clasohm@923
    76
by (rtac impI 1);
clasohm@923
    77
by (etac subsetD 1);
clasohm@923
    78
by (assume_tac 1);
clasohm@923
    79
qed "in_mono";
clasohm@923
    80
clasohm@923
    81
goal HOL.thy "!!P1 P2 Q1 Q2. [| P1-->Q1; P2-->Q2 |] ==> (P1&P2) --> (Q1&Q2)";
clasohm@923
    82
by (fast_tac HOL_cs 1);
clasohm@923
    83
qed "conj_mono";
clasohm@923
    84
clasohm@923
    85
goal HOL.thy "!!P1 P2 Q1 Q2. [| P1-->Q1; P2-->Q2 |] ==> (P1|P2) --> (Q1|Q2)";
clasohm@923
    86
by (fast_tac HOL_cs 1);
clasohm@923
    87
qed "disj_mono";
clasohm@923
    88
clasohm@923
    89
goal HOL.thy "!!P1 P2 Q1 Q2.[| Q1-->P1; P2-->Q2 |] ==> (P1-->P2)-->(Q1-->Q2)";
clasohm@923
    90
by (fast_tac HOL_cs 1);
clasohm@923
    91
qed "imp_mono";
clasohm@923
    92
clasohm@923
    93
goal HOL.thy "P-->P";
clasohm@923
    94
by (rtac impI 1);
clasohm@923
    95
by (assume_tac 1);
clasohm@923
    96
qed "imp_refl";
clasohm@923
    97
clasohm@923
    98
val [PQimp] = goal HOL.thy
clasohm@923
    99
    "[| !!x. P(x) --> Q(x) |] ==> (EX x.P(x)) --> (EX x.Q(x))";
clasohm@923
   100
by (fast_tac (HOL_cs addIs [PQimp RS mp]) 1);
clasohm@923
   101
qed "ex_mono";
clasohm@923
   102
clasohm@923
   103
val [PQimp] = goal HOL.thy
clasohm@923
   104
    "[| !!x. P(x) --> Q(x) |] ==> (ALL x.P(x)) --> (ALL x.Q(x))";
clasohm@923
   105
by (fast_tac (HOL_cs addIs [PQimp RS mp]) 1);
clasohm@923
   106
qed "all_mono";
clasohm@923
   107
clasohm@923
   108
val [PQimp] = goal Set.thy
clasohm@923
   109
    "[| !!x. P(x) --> Q(x) |] ==> Collect(P) <= Collect(Q)";
clasohm@923
   110
by (fast_tac (set_cs addIs [PQimp RS mp]) 1);
clasohm@923
   111
qed "Collect_mono";
clasohm@923
   112
clasohm@923
   113
(*Used in indrule.ML*)
clasohm@923
   114
val [subs,PQimp] = goal Set.thy
clasohm@923
   115
    "[| A<=B;  !!x. x:A ==> P(x) --> Q(x) \
clasohm@923
   116
\    |] ==> A Int Collect(P) <= B Int Collect(Q)";
clasohm@923
   117
by (fast_tac (set_cs addIs [subs RS subsetD, PQimp RS mp]) 1);
clasohm@923
   118
qed "Int_Collect_mono";
clasohm@923
   119
clasohm@923
   120
(*Used in intr_elim.ML and in individual datatype definitions*)
clasohm@923
   121
val basic_monos = [subset_refl, imp_refl, disj_mono, conj_mono, 
clasohm@923
   122
		   ex_mono, Collect_mono, Part_mono, in_mono];
clasohm@923
   123