src/HOL/mono.ML
author paulson
Thu, 21 Mar 1996 13:02:26 +0100
changeset 1601 0ef6ea27ab15
parent 1515 4ed79ebab64d
child 1760 6f41a494f3b1
permissions -rw-r--r--
Changes required by removal of the theory argument of Theorem
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1465
5d7a7e439cec expanded tabs
clasohm
parents: 1264
diff changeset
     1
(*  Title:      HOL/mono.ML
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     2
    ID:         $Id$
1465
5d7a7e439cec expanded tabs
clasohm
parents: 1264
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
Monotonicity of various operations
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     7
*)
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
goal Set.thy "!!A B. A<=B ==> f``A <= f``B";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    10
by (fast_tac set_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    11
qed "image_mono";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    12
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    13
goal Set.thy "!!A B. A<=B ==> Pow(A) <= Pow(B)";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    14
by (fast_tac set_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    15
qed "Pow_mono";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    16
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    17
goal Set.thy "!!A B. A<=B ==> Union(A) <= Union(B)";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    18
by (fast_tac set_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    19
qed "Union_mono";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    20
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    21
goal Set.thy "!!A B. B<=A ==> Inter(A) <= Inter(B)";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    22
by (fast_tac set_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    23
qed "Inter_anti_mono";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    24
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    25
val prems = goal Set.thy
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    26
    "[| A<=B;  !!x. x:A ==> f(x)<=g(x) |] ==> \
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    27
\    (UN x:A. f(x)) <= (UN x:B. g(x))";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    28
by (fast_tac (set_cs addIs (prems RL [subsetD])) 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    29
qed "UN_mono";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    30
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    31
val [prem] = goal Set.thy
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    32
    "[| !!x. f(x)<=g(x) |] ==> (UN x. f(x)) <= (UN x. g(x))";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    33
by (fast_tac (set_cs addIs [prem RS subsetD]) 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    34
qed "UN1_mono";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    35
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    36
val prems = goal Set.thy
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    37
    "[| B<=A;  !!x. x:A ==> f(x)<=g(x) |] ==> \
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    38
\    (INT x:A. f(x)) <= (INT x:A. g(x))";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    39
by (fast_tac (set_cs addIs (prems RL [subsetD])) 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    40
qed "INT_anti_mono";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    41
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    42
(*The inclusion is POSITIVE! *)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    43
val [prem] = goal Set.thy
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    44
    "[| !!x. f(x)<=g(x) |] ==> (INT x. f(x)) <= (INT x. g(x))";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    45
by (fast_tac (set_cs addIs [prem RS subsetD]) 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    46
qed "INT1_mono";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    47
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    48
goal Set.thy "!!A B. [| A<=C;  B<=D |] ==> A Un B <= C Un D";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    49
by (fast_tac set_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    50
qed "Un_mono";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    51
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    52
goal Set.thy "!!A B. [| A<=C;  B<=D |] ==> A Int B <= C Int D";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    53
by (fast_tac set_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    54
qed "Int_mono";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    55
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    56
goal Set.thy "!!A::'a set. [| A<=C;  D<=B |] ==> A-B <= C-D";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    57
by (fast_tac set_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    58
qed "Diff_mono";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    59
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    60
goal Set.thy "!!A B. A<=B ==> Compl(B) <= Compl(A)";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    61
by (fast_tac set_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    62
qed "Compl_anti_mono";
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
(** Monotonicity of implications.  For inductive definitions **)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    65
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    66
goal Set.thy "!!A B x. A<=B ==> x:A --> x:B";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    67
by (rtac impI 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    68
by (etac subsetD 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    69
by (assume_tac 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    70
qed "in_mono";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    71
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    72
goal HOL.thy "!!P1 P2 Q1 Q2. [| P1-->Q1; P2-->Q2 |] ==> (P1&P2) --> (Q1&Q2)";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    73
by (fast_tac HOL_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    74
qed "conj_mono";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    75
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    76
goal HOL.thy "!!P1 P2 Q1 Q2. [| P1-->Q1; P2-->Q2 |] ==> (P1|P2) --> (Q1|Q2)";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    77
by (fast_tac HOL_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    78
qed "disj_mono";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    79
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    80
goal HOL.thy "!!P1 P2 Q1 Q2.[| Q1-->P1; P2-->Q2 |] ==> (P1-->P2)-->(Q1-->Q2)";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    81
by (fast_tac HOL_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    82
qed "imp_mono";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    83
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    84
goal HOL.thy "P-->P";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    85
by (rtac impI 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    86
by (assume_tac 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    87
qed "imp_refl";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    88
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    89
val [PQimp] = goal HOL.thy
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    90
    "[| !!x. P(x) --> Q(x) |] ==> (EX x.P(x)) --> (EX x.Q(x))";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    91
by (fast_tac (HOL_cs addIs [PQimp RS mp]) 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    92
qed "ex_mono";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    93
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    94
val [PQimp] = goal HOL.thy
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    95
    "[| !!x. P(x) --> Q(x) |] ==> (ALL x.P(x)) --> (ALL x.Q(x))";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    96
by (fast_tac (HOL_cs addIs [PQimp RS mp]) 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    97
qed "all_mono";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    98
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    99
val [PQimp] = goal Set.thy
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   100
    "[| !!x. P(x) --> Q(x) |] ==> Collect(P) <= Collect(Q)";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   101
by (fast_tac (set_cs addIs [PQimp RS mp]) 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   102
qed "Collect_mono";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   103
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   104
(*Used in indrule.ML*)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   105
val [subs,PQimp] = goal Set.thy
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   106
    "[| A<=B;  !!x. x:A ==> P(x) --> Q(x) \
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   107
\    |] ==> A Int Collect(P) <= B Int Collect(Q)";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   108
by (fast_tac (set_cs addIs [subs RS subsetD, PQimp RS mp]) 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   109
qed "Int_Collect_mono";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   110
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   111
(*Used in intr_elim.ML and in individual datatype definitions*)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   112
val basic_monos = [subset_refl, imp_refl, disj_mono, conj_mono, 
1515
4ed79ebab64d Introduced normalize_thm into HOL.ML
nipkow
parents: 1465
diff changeset
   113
                   ex_mono, Collect_mono, in_mono];
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   114