src/HOL/mono.ML
author berghofe
Tue, 30 May 2000 18:02:49 +0200
changeset 9001 93af64f54bf2
parent 7713 f4fe9d620107
child 9969 4753185f1dd2
permissions -rw-r--r--
the is now defined using primrec, avoiding explicit use of arbitrary.
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
5316
7a8975451a89 even more tidying of Goal commands
paulson
parents: 5100
diff changeset
     9
Goal "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
5316
7a8975451a89 even more tidying of Goal commands
paulson
parents: 5100
diff changeset
    13
Goal "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
5316
7a8975451a89 even more tidying of Goal commands
paulson
parents: 5100
diff changeset
    17
Goal "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
5316
7a8975451a89 even more tidying of Goal commands
paulson
parents: 5100
diff changeset
    21
Goal "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
5316
7a8975451a89 even more tidying of Goal commands
paulson
parents: 5100
diff changeset
    25
val prems = Goal
923
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! *)
5316
7a8975451a89 even more tidying of Goal commands
paulson
parents: 5100
diff changeset
    32
val prems = Goal
923
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
5316
7a8975451a89 even more tidying of Goal commands
paulson
parents: 5100
diff changeset
    38
Goal "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
5316
7a8975451a89 even more tidying of Goal commands
paulson
parents: 5100
diff changeset
    42
Goal "[| 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
5316
7a8975451a89 even more tidying of Goal commands
paulson
parents: 5100
diff changeset
    46
Goal "[| 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
5316
7a8975451a89 even more tidying of Goal commands
paulson
parents: 5100
diff changeset
    50
Goal "!!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
5490
85855f65d0c6 From Compl(A) to -A
paulson
parents: 5316
diff changeset
    54
Goal "!!A::'a set. A <= B ==> -B <= -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
5316
7a8975451a89 even more tidying of Goal commands
paulson
parents: 5100
diff changeset
    60
Goal "A<=B ==> x:A --> x:B";
923
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
5316
7a8975451a89 even more tidying of Goal commands
paulson
parents: 5100
diff changeset
    66
Goal "[| 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
5316
7a8975451a89 even more tidying of Goal commands
paulson
parents: 5100
diff changeset
    70
Goal "[| 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
5316
7a8975451a89 even more tidying of Goal commands
paulson
parents: 5100
diff changeset
    74
Goal "[| 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
5316
7a8975451a89 even more tidying of Goal commands
paulson
parents: 5100
diff changeset
    78
Goal "P-->P";
923
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
5316
7a8975451a89 even more tidying of Goal commands
paulson
parents: 5100
diff changeset
    83
val [PQimp] = Goal
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
5316
7a8975451a89 even more tidying of Goal commands
paulson
parents: 5100
diff changeset
    88
val [PQimp] = Goal
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
5316
7a8975451a89 even more tidying of Goal commands
paulson
parents: 5100
diff changeset
    93
val [PQimp] = Goal
923
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
5316
7a8975451a89 even more tidying of Goal commands
paulson
parents: 5100
diff changeset
    98
val [subs,PQimp] = Goal
923
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
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   104
val basic_monos = [subset_refl, imp_refl, disj_mono, conj_mono, 
1515
4ed79ebab64d Introduced normalize_thm into HOL.ML
nipkow
parents: 1465
diff changeset
   105
                   ex_mono, Collect_mono, in_mono];
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   106
7109
b02c6bdda05b fixed comments;
wenzelm
parents: 7064
diff changeset
   107
(* Courtesy of Stephan Merz *)
7064
b053e0ab9f60 New lemmas by Stefan Merz.
nipkow
parents: 5490
diff changeset
   108
Goalw [Least_def,mono_def]
b053e0ab9f60 New lemmas by Stefan Merz.
nipkow
parents: 5490
diff changeset
   109
  "[| mono (f::'a::order => 'b::order); ? x:S. ! y:S. x <= y |] \
b053e0ab9f60 New lemmas by Stefan Merz.
nipkow
parents: 5490
diff changeset
   110
\  ==> (LEAST y. y : f``S) = f(LEAST x. x : S)";
b053e0ab9f60 New lemmas by Stefan Merz.
nipkow
parents: 5490
diff changeset
   111
by (etac bexE 1);
b053e0ab9f60 New lemmas by Stefan Merz.
nipkow
parents: 5490
diff changeset
   112
by (rtac selectI2 1);
b053e0ab9f60 New lemmas by Stefan Merz.
nipkow
parents: 5490
diff changeset
   113
by (Force_tac 1);
b053e0ab9f60 New lemmas by Stefan Merz.
nipkow
parents: 5490
diff changeset
   114
by (rtac select_equality 1);
b053e0ab9f60 New lemmas by Stefan Merz.
nipkow
parents: 5490
diff changeset
   115
by (Force_tac 1);
b053e0ab9f60 New lemmas by Stefan Merz.
nipkow
parents: 5490
diff changeset
   116
by (force_tac (claset() addSIs [order_antisym], simpset()) 1);
b053e0ab9f60 New lemmas by Stefan Merz.
nipkow
parents: 5490
diff changeset
   117
qed "Least_mono";
7713
f4fe9d620107 Additional rules for inductive package.
berghofe
parents: 7109
diff changeset
   118
f4fe9d620107 Additional rules for inductive package.
berghofe
parents: 7109
diff changeset
   119
Goal "[| a = b; c = d; b --> d |] ==> a --> c";
f4fe9d620107 Additional rules for inductive package.
berghofe
parents: 7109
diff changeset
   120
by (Fast_tac 1);
f4fe9d620107 Additional rules for inductive package.
berghofe
parents: 7109
diff changeset
   121
qed "eq_to_mono";
f4fe9d620107 Additional rules for inductive package.
berghofe
parents: 7109
diff changeset
   122
f4fe9d620107 Additional rules for inductive package.
berghofe
parents: 7109
diff changeset
   123
Goal "[| a = b; c = d; ~ b --> ~ d |] ==> ~ a --> ~ c";
f4fe9d620107 Additional rules for inductive package.
berghofe
parents: 7109
diff changeset
   124
by (Fast_tac 1);
f4fe9d620107 Additional rules for inductive package.
berghofe
parents: 7109
diff changeset
   125
qed "eq_to_mono2";