src/ZF/mono.ML
author clasohm
Thu, 16 Sep 1993 12:20:38 +0200
changeset 0 a5a9c433f639
child 485 5e00a676a211
permissions -rw-r--r--
Initial revision
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     1
(*  Title: 	ZF/mono
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     2
    ID:         $Id$
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     3
    Author: 	Lawrence C Paulson, Cambridge University Computer Laboratory
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     4
    Copyright   1993  University of Cambridge
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     5
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     6
Monotonicity of various operations (for lattice properties see subset.ML)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     7
*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     8
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     9
(** Replacement, in its various formulations **)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    10
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    11
(*Not easy to express monotonicity in P, since any "bigger" predicate
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    12
  would have to be single-valued*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    13
goal ZF.thy "!!A B. A<=B ==> Replace(A,P) <= Replace(B,P)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    14
by (fast_tac ZF_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    15
val Replace_mono = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    16
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    17
goal ZF.thy "!!A B. A<=B ==> {f(x). x:A} <= {f(x). x:B}";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    18
by (fast_tac ZF_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    19
val RepFun_mono = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    20
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    21
goal ZF.thy "!!A B. A<=B ==> Pow(A) <= Pow(B)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    22
by (fast_tac ZF_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    23
val Pow_mono = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    24
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    25
goal ZF.thy "!!A B. A<=B ==> Union(A) <= Union(B)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    26
by (fast_tac ZF_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    27
val Union_mono = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    28
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    29
val prems = goal ZF.thy
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    30
    "[| A<=C;  !!x. x:A ==> B(x)<=D(x) \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    31
\    |] ==> (UN x:A. B(x)) <= (UN x:C. D(x))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    32
by (fast_tac (ZF_cs addIs (prems RL [subsetD])) 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    33
val UN_mono = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    34
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    35
(*Intersection is ANTI-monotonic.  There are TWO premises! *)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    36
goal ZF.thy "!!A B. [| A<=B;  a:A |] ==> Inter(B) <= Inter(A)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    37
by (fast_tac ZF_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    38
val Inter_anti_mono = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    39
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    40
goal ZF.thy "!!C D. C<=D ==> cons(a,C) <= cons(a,D)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    41
by (fast_tac ZF_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    42
val cons_mono = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    43
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    44
goal ZF.thy "!!A B C D. [| A<=C;  B<=D |] ==> A Un B <= C Un D";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    45
by (fast_tac ZF_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    46
val Un_mono = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    47
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    48
goal ZF.thy "!!A B C D. [| A<=C;  B<=D |] ==> A Int B <= C Int D";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    49
by (fast_tac ZF_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    50
val Int_mono = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    51
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    52
goal ZF.thy "!!A B C D. [| A<=C;  D<=B |] ==> A-B <= C-D";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    53
by (fast_tac ZF_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    54
val Diff_mono = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    55
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    56
(** Standard products, sums and function spaces **)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    57
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    58
goal ZF.thy "!!A B C D. [| A<=C;  ALL x:A. B(x) <= D(x) |] ==> \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    59
\                       Sigma(A,B) <= Sigma(C,D)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    60
by (fast_tac ZF_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    61
val Sigma_mono_lemma = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    62
val Sigma_mono = ballI RSN (2,Sigma_mono_lemma);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    63
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    64
goalw Sum.thy sum_defs "!!A B C D. [| A<=C;  B<=D |] ==> A+B <= C+D";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    65
by (REPEAT (ares_tac [subset_refl,Un_mono,Sigma_mono] 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    66
val sum_mono = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    67
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    68
(*Note that B->A and C->A are typically disjoint!*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    69
goal ZF.thy "!!A B C. B<=C ==> A->B <= A->C";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    70
by (fast_tac (ZF_cs addIs [lam_type] addEs [Pi_lamE]) 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    71
val Pi_mono = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    72
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    73
goalw ZF.thy [lam_def] "!!A B. A<=B ==> Lambda(A,c) <= Lambda(B,c)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    74
by (etac RepFun_mono 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    75
val lam_mono = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    76
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    77
(** Quine-inspired ordered pairs, products, injections and sums **)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    78
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    79
goalw QPair.thy [QPair_def] "!!a b c d. [| a<=c;  b<=d |] ==> <a;b> <= <c;d>";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    80
by (REPEAT (ares_tac [sum_mono] 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    81
val QPair_mono = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    82
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    83
goal QPair.thy "!!A B C D. [| A<=C;  ALL x:A. B(x) <= D(x) |] ==>  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    84
\                          QSigma(A,B) <= QSigma(C,D)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    85
by (fast_tac (ZF_cs addIs [QSigmaI] addSEs [QSigmaE]) 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    86
val QSigma_mono_lemma = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    87
val QSigma_mono = ballI RSN (2,QSigma_mono_lemma);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    88
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    89
goalw QPair.thy [QInl_def] "!!a b. a<=b ==> QInl(a) <= QInl(b)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    90
by (REPEAT (ares_tac [subset_refl RS QPair_mono] 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    91
val QInl_mono = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    92
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    93
goalw QPair.thy [QInr_def] "!!a b. a<=b ==> QInr(a) <= QInr(b)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    94
by (REPEAT (ares_tac [subset_refl RS QPair_mono] 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    95
val QInr_mono = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    96
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    97
goal QPair.thy "!!A B C D. [| A<=C;  B<=D |] ==> A <+> B <= C <+> D";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    98
by (fast_tac qsum_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    99
val qsum_mono = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   100
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   101
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   102
(** Converse, domain, range, field **)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   103
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   104
goal ZF.thy "!!r s. r<=s ==> converse(r) <= converse(s)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   105
by (fast_tac ZF_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   106
val converse_mono = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   107
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   108
goal ZF.thy "!!r s. r<=s ==> domain(r)<=domain(s)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   109
by (fast_tac ZF_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   110
val domain_mono = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   111
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   112
val [prem] = goal ZF.thy "r <= Sigma(A,B) ==> domain(r) <= A";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   113
by (rtac (domain_subset RS (prem RS domain_mono RS subset_trans)) 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   114
val domain_rel_subset = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   115
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   116
goal ZF.thy "!!r s. r<=s ==> range(r)<=range(s)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   117
by (fast_tac ZF_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   118
val range_mono = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   119
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   120
val [prem] = goal ZF.thy "r <= A*B ==> range(r) <= B";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   121
by (rtac (range_subset RS (prem RS range_mono RS subset_trans)) 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   122
val range_rel_subset = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   123
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   124
goal ZF.thy "!!r s. r<=s ==> field(r)<=field(s)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   125
by (fast_tac ZF_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   126
val field_mono = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   127
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   128
goal ZF.thy "!!r A. r <= A*A ==> field(r) <= A";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   129
by (etac (field_mono RS subset_trans) 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   130
by (fast_tac ZF_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   131
val field_rel_subset = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   132
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   133
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   134
(** Images **)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   135
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   136
val [prem1,prem2] = goal ZF.thy
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   137
    "[| !! x y. <x,y>:r ==> <x,y>:s;  A<=B |] ==> r``A <= s``B";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   138
by (fast_tac (ZF_cs addIs [prem1, prem2 RS subsetD]) 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   139
val image_pair_mono = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   140
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   141
val [prem1,prem2] = goal ZF.thy
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   142
    "[| !! x y. <x,y>:r ==> <x,y>:s;  A<=B |] ==> r-``A <= s-``B";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   143
by (fast_tac (ZF_cs addIs [prem1, prem2 RS subsetD]) 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   144
val vimage_pair_mono = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   145
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   146
goal ZF.thy "!!r s. [| r<=s;  A<=B |] ==> r``A <= s``B";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   147
by (fast_tac ZF_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   148
val image_mono = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   149
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   150
goal ZF.thy "!!r s. [| r<=s;  A<=B |] ==> r-``A <= s-``B";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   151
by (fast_tac ZF_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   152
val vimage_mono = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   153
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   154
val [sub,PQimp] = goal ZF.thy
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   155
    "[| A<=B;  !!x. x:A ==> P(x) --> Q(x) |] ==> Collect(A,P) <= Collect(B,Q)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   156
by (fast_tac (ZF_cs addIs [sub RS subsetD, PQimp RS mp]) 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   157
val Collect_mono = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   158
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   159
(** Monotonicity of implications -- some could go to FOL **)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   160
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   161
goal ZF.thy "!!A B x. A<=B ==> x:A --> x:B";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   162
by (rtac impI 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   163
by (etac subsetD 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   164
by (assume_tac 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   165
val in_mono = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   166
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   167
goal IFOL.thy "!!P1 P2 Q1 Q2. [| P1-->Q1; P2-->Q2 |] ==> (P1&P2) --> (Q1&Q2)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   168
by (Int.fast_tac 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   169
val conj_mono = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   170
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   171
goal IFOL.thy "!!P1 P2 Q1 Q2. [| P1-->Q1; P2-->Q2 |] ==> (P1|P2) --> (Q1|Q2)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   172
by (Int.fast_tac 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   173
val disj_mono = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   174
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   175
goal IFOL.thy "!!P1 P2 Q1 Q2.[| Q1-->P1; P2-->Q2 |] ==> (P1-->P2)-->(Q1-->Q2)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   176
by (Int.fast_tac 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   177
val imp_mono = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   178
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   179
goal IFOL.thy "P-->P";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   180
by (rtac impI 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   181
by (assume_tac 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   182
val imp_refl = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   183
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   184
val [PQimp] = goal IFOL.thy
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   185
    "[| !!x. P(x) --> Q(x) |] ==> (EX x.P(x)) --> (EX x.Q(x))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   186
by (fast_tac (FOL_cs addIs [PQimp RS mp]) 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   187
val ex_mono = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   188
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   189
val [PQimp] = goal IFOL.thy
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   190
    "[| !!x. P(x) --> Q(x) |] ==> (ALL x.P(x)) --> (ALL x.Q(x))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   191
by (fast_tac (FOL_cs addIs [PQimp RS mp]) 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   192
val all_mono = result();