src/HOL/mono.ML
author wenzelm
Fri, 07 Mar 1997 11:48:46 +0100
changeset 2754 59bd96046ad6
parent 1849 bec272e3e888
child 2922 580647a879cf
permissions -rw-r--r--
moved settings comment to build;
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";
1760
6f41a494f3b1 Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1515
diff changeset
    10
by (Fast_tac 1);
923
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)";
1760
6f41a494f3b1 Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1515
diff changeset
    14
by (Fast_tac 1);
923
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)";
1760
6f41a494f3b1 Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1515
diff changeset
    18
by (Fast_tac 1);
923
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)";
1760
6f41a494f3b1 Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1515
diff changeset
    22
by (Fast_tac 1);
923
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))";
1760
6f41a494f3b1 Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1515
diff changeset
    28
by (fast_tac (!claset addIs (prems RL [subsetD])) 1);
923
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))";
1760
6f41a494f3b1 Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1515
diff changeset
    33
by (fast_tac (!claset addIs [prem RS subsetD]) 1);
923
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))";
1760
6f41a494f3b1 Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1515
diff changeset
    39
by (fast_tac (!claset addIs (prems RL [subsetD])) 1);
923
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))";
1760
6f41a494f3b1 Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1515
diff changeset
    45
by (fast_tac (!claset addIs [prem RS subsetD]) 1);
923
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
1849
bec272e3e888 Added insert_mono
paulson
parents: 1760
diff changeset
    48
goal Set.thy "!!C D. C<=D ==> insert a C <= insert a D";
bec272e3e888 Added insert_mono
paulson
parents: 1760
diff changeset
    49
by (Fast_tac 1);
bec272e3e888 Added insert_mono
paulson
parents: 1760
diff changeset
    50
qed "insert_mono";
bec272e3e888 Added insert_mono
paulson
parents: 1760
diff changeset
    51
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    52
goal Set.thy "!!A B. [| A<=C;  B<=D |] ==> A Un B <= C Un D";
1760
6f41a494f3b1 Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1515
diff changeset
    53
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    54
qed "Un_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 B. [| A<=C;  B<=D |] ==> A Int B <= C Int D";
1760
6f41a494f3b1 Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1515
diff changeset
    57
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    58
qed "Int_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::'a set. [| A<=C;  D<=B |] ==> A-B <= C-D";
1760
6f41a494f3b1 Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1515
diff changeset
    61
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    62
qed "Diff_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
goal Set.thy "!!A B. A<=B ==> Compl(B) <= Compl(A)";
1760
6f41a494f3b1 Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1515
diff changeset
    65
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    66
qed "Compl_anti_mono";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    67
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    68
(** Monotonicity of implications.  For inductive definitions **)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    69
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    70
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
    71
by (rtac impI 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    72
by (etac subsetD 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    73
by (assume_tac 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    74
qed "in_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)";
1760
6f41a494f3b1 Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1515
diff changeset
    77
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    78
qed "conj_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. [| P1-->Q1; P2-->Q2 |] ==> (P1|P2) --> (Q1|Q2)";
1760
6f41a494f3b1 Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1515
diff changeset
    81
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    82
qed "disj_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 "!!P1 P2 Q1 Q2.[| Q1-->P1; P2-->Q2 |] ==> (P1-->P2)-->(Q1-->Q2)";
1760
6f41a494f3b1 Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1515
diff changeset
    85
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    86
qed "imp_mono";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    87
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    88
goal HOL.thy "P-->P";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    89
by (rtac impI 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    90
by (assume_tac 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    91
qed "imp_refl";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    92
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    93
val [PQimp] = goal HOL.thy
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    94
    "[| !!x. P(x) --> Q(x) |] ==> (EX x.P(x)) --> (EX x.Q(x))";
1760
6f41a494f3b1 Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1515
diff changeset
    95
by (fast_tac (!claset addIs [PQimp RS mp]) 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    96
qed "ex_mono";
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
val [PQimp] = goal HOL.thy
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    99
    "[| !!x. P(x) --> Q(x) |] ==> (ALL x.P(x)) --> (ALL x.Q(x))";
1760
6f41a494f3b1 Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1515
diff changeset
   100
by (fast_tac (!claset addIs [PQimp RS mp]) 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   101
qed "all_mono";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   102
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   103
val [PQimp] = goal Set.thy
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   104
    "[| !!x. P(x) --> Q(x) |] ==> Collect(P) <= Collect(Q)";
1760
6f41a494f3b1 Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1515
diff changeset
   105
by (fast_tac (!claset addIs [PQimp RS mp]) 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   106
qed "Collect_mono";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   107
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   108
(*Used in indrule.ML*)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   109
val [subs,PQimp] = goal Set.thy
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   110
    "[| A<=B;  !!x. x:A ==> P(x) --> Q(x) \
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   111
\    |] ==> A Int Collect(P) <= B Int Collect(Q)";
1760
6f41a494f3b1 Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1515
diff changeset
   112
by (fast_tac (!claset addIs [subs RS subsetD, PQimp RS mp]) 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   113
qed "Int_Collect_mono";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   114
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   115
(*Used in intr_elim.ML and in individual datatype definitions*)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   116
val basic_monos = [subset_refl, imp_refl, disj_mono, conj_mono, 
1515
4ed79ebab64d Introduced normalize_thm into HOL.ML
nipkow
parents: 1465
diff changeset
   117
                   ex_mono, Collect_mono, in_mono];
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   118