src/HOL/mono.ML
author oheimb
Wed, 12 Aug 1998 16:23:25 +0200
changeset 5305 513925de8962
parent 5100 68775c0e40e7
child 5316 7a8975451a89
permissions -rw-r--r--
cleanup for Fun.thy: merged Update.{thy|ML} into Fun.{thy|ML} moved o_def from HOL.thy to Fun.thy added Id_def to Fun.thy moved image_compose from Set.ML to Fun.ML moved o_apply and o_assoc from simpdata.ML to Fun.ML moved fun_upd_same and fun_upd_other (from Map.ML) to Fun.ML added fun_upd_twist to Fun.ML
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";
2922
580647a879cf Using Blast_tac
paulson
parents: 1849
diff changeset
    10
by (Blast_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)";
2922
580647a879cf Using Blast_tac
paulson
parents: 1849
diff changeset
    14
by (Blast_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)";
2922
580647a879cf Using Blast_tac
paulson
parents: 1849
diff changeset
    18
by (Blast_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)";
2922
580647a879cf Using Blast_tac
paulson
parents: 1849
diff changeset
    22
by (Blast_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))";
4089
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3842
diff changeset
    28
by (blast_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
4159
4aff9b7e5597 UNIV now a constant; UNION1, INTER1 now translations and no longer have
paulson
parents: 4089
diff changeset
    31
(*The last inclusion is POSITIVE! *)
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    32
val prems = goal Set.thy
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    33
    "[| B<=A;  !!x. x:A ==> f(x)<=g(x) |] ==> \
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    34
\    (INT x:A. f(x)) <= (INT x:A. g(x))";
4089
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3842
diff changeset
    35
by (blast_tac (claset() addIs (prems RL [subsetD])) 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    36
qed "INT_anti_mono";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    37
1849
bec272e3e888 Added insert_mono
paulson
parents: 1760
diff changeset
    38
goal Set.thy "!!C D. C<=D ==> insert a C <= insert a D";
2922
580647a879cf Using Blast_tac
paulson
parents: 1849
diff changeset
    39
by (Blast_tac 1);
1849
bec272e3e888 Added insert_mono
paulson
parents: 1760
diff changeset
    40
qed "insert_mono";
bec272e3e888 Added insert_mono
paulson
parents: 1760
diff changeset
    41
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    42
goal Set.thy "!!A B. [| A<=C;  B<=D |] ==> A Un B <= C Un D";
2922
580647a879cf Using Blast_tac
paulson
parents: 1849
diff changeset
    43
by (Blast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    44
qed "Un_mono";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    45
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    46
goal Set.thy "!!A B. [| A<=C;  B<=D |] ==> A Int B <= C Int D";
2922
580647a879cf Using Blast_tac
paulson
parents: 1849
diff changeset
    47
by (Blast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    48
qed "Int_mono";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    49
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    50
goal Set.thy "!!A::'a set. [| A<=C;  D<=B |] ==> A-B <= C-D";
2922
580647a879cf Using Blast_tac
paulson
parents: 1849
diff changeset
    51
by (Blast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    52
qed "Diff_mono";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    53
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    54
goal Set.thy "!!A B. A<=B ==> Compl(B) <= Compl(A)";
2922
580647a879cf Using Blast_tac
paulson
parents: 1849
diff changeset
    55
by (Blast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    56
qed "Compl_anti_mono";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    57
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    58
(** Monotonicity of implications.  For inductive definitions **)
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 x. A<=B ==> x:A --> x:B";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    61
by (rtac impI 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    62
by (etac subsetD 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    63
by (assume_tac 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    64
qed "in_mono";
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 HOL.thy "!!P1 P2 Q1 Q2. [| P1-->Q1; P2-->Q2 |] ==> (P1&P2) --> (Q1&Q2)";
2922
580647a879cf Using Blast_tac
paulson
parents: 1849
diff changeset
    67
by (Blast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    68
qed "conj_mono";
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 HOL.thy "!!P1 P2 Q1 Q2. [| P1-->Q1; P2-->Q2 |] ==> (P1|P2) --> (Q1|Q2)";
2922
580647a879cf Using Blast_tac
paulson
parents: 1849
diff changeset
    71
by (Blast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    72
qed "disj_mono";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    73
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    74
goal HOL.thy "!!P1 P2 Q1 Q2.[| Q1-->P1; P2-->Q2 |] ==> (P1-->P2)-->(Q1-->Q2)";
2922
580647a879cf Using Blast_tac
paulson
parents: 1849
diff changeset
    75
by (Blast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    76
qed "imp_mono";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    77
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    78
goal HOL.thy "P-->P";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    79
by (rtac impI 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    80
by (assume_tac 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    81
qed "imp_refl";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    82
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    83
val [PQimp] = goal HOL.thy
3842
b55686a7b22c fixed dots;
wenzelm
parents: 2922
diff changeset
    84
    "[| !!x. P(x) --> Q(x) |] ==> (EX x. P(x)) --> (EX x. Q(x))";
4089
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3842
diff changeset
    85
by (blast_tac (claset() addIs [PQimp RS mp]) 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    86
qed "ex_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
val [PQimp] = goal HOL.thy
3842
b55686a7b22c fixed dots;
wenzelm
parents: 2922
diff changeset
    89
    "[| !!x. P(x) --> Q(x) |] ==> (ALL x. P(x)) --> (ALL x. Q(x))";
4089
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3842
diff changeset
    90
by (blast_tac (claset() addIs [PQimp RS mp]) 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    91
qed "all_mono";
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 Set.thy
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    94
    "[| !!x. P(x) --> Q(x) |] ==> Collect(P) <= Collect(Q)";
4089
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3842
diff changeset
    95
by (blast_tac (claset() addIs [PQimp RS mp]) 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    96
qed "Collect_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 [subs,PQimp] = goal Set.thy
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    99
    "[| A<=B;  !!x. x:A ==> P(x) --> Q(x) \
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   100
\    |] ==> A Int Collect(P) <= B Int Collect(Q)";
4089
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3842
diff changeset
   101
by (blast_tac (claset() addIs [subs RS subsetD, PQimp RS mp]) 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   102
qed "Int_Collect_mono";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   103
5100
68775c0e40e7 Removed obsolete comments.
berghofe
parents: 4159
diff changeset
   104
(*Used in individual datatype definitions*)
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   105
val basic_monos = [subset_refl, imp_refl, disj_mono, conj_mono, 
1515
4ed79ebab64d Introduced normalize_thm into HOL.ML
nipkow
parents: 1465
diff changeset
   106
                   ex_mono, Collect_mono, in_mono];
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   107