src/HOL/Univ.ML
author wenzelm
Mon, 03 Nov 1997 12:13:18 +0100
changeset 4089 96fba19bcbe2
parent 3842 b55686a7b22c
child 4153 e534c4c32d54
permissions -rw-r--r--
isatool fixclasimp;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2935
998cb95fdd43 Yet more fast_tac->blast_tac, and other tidying
paulson
parents: 2891
diff changeset
     1
(*  Title:      HOL/Univ
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
For univ.thy
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
open Univ;
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    10
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    11
(** apfst -- can be used in similar type definitions **)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    12
972
e61b058d58d2 changed syntax of tuples from <..., ...> to (..., ...)
clasohm
parents: 923
diff changeset
    13
goalw Univ.thy [apfst_def] "apfst f (a,b) = (f(a),b)";
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    14
by (rtac split 1);
976
14b55f7fbf15 renamed theorem "apfst" to "apfst_conv" to avoid conflict with function
clasohm
parents: 972
diff changeset
    15
qed "apfst_conv";
923
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
val [major,minor] = goal Univ.thy
972
e61b058d58d2 changed syntax of tuples from <..., ...> to (..., ...)
clasohm
parents: 923
diff changeset
    18
    "[| q = apfst f p;  !!x y. [| p = (x,y);  q = (f(x),y) |] ==> R \
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    19
\    |] ==> R";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    20
by (rtac PairE 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    21
by (rtac minor 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    22
by (assume_tac 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    23
by (rtac (major RS trans) 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    24
by (etac ssubst 1);
976
14b55f7fbf15 renamed theorem "apfst" to "apfst_conv" to avoid conflict with function
clasohm
parents: 972
diff changeset
    25
by (rtac apfst_conv 1);
14b55f7fbf15 renamed theorem "apfst" to "apfst_conv" to avoid conflict with function
clasohm
parents: 972
diff changeset
    26
qed "apfst_convE";
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    27
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    28
(** Push -- an injection, analogous to Cons on lists **)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    29
1985
84cf16192e03 Tidied many proofs, using AddIffs to let equivalences take
paulson
parents: 1786
diff changeset
    30
val [major] = goalw Univ.thy [Push_def] "Push i f = Push j g  ==> i=j";
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    31
by (rtac (major RS fun_cong RS box_equals RS Suc_inject) 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    32
by (rtac nat_case_0 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    33
by (rtac nat_case_0 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    34
qed "Push_inject1";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    35
1985
84cf16192e03 Tidied many proofs, using AddIffs to let equivalences take
paulson
parents: 1786
diff changeset
    36
val [major] = goalw Univ.thy [Push_def] "Push i f = Push j g  ==> f=g";
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    37
by (rtac (major RS fun_cong RS ext RS box_equals) 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    38
by (rtac (nat_case_Suc RS ext) 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    39
by (rtac (nat_case_Suc RS ext) 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    40
qed "Push_inject2";
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
val [major,minor] = goal Univ.thy
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    43
    "[| Push i f =Push j g;  [| i=j;  f=g |] ==> P \
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    44
\    |] ==> P";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    45
by (rtac ((major RS Push_inject2) RS ((major RS Push_inject1) RS minor)) 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    46
qed "Push_inject";
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
val [major] = goalw Univ.thy [Push_def] "Push k f =(%z.0) ==> P";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    49
by (rtac (major RS fun_cong RS box_equals RS Suc_neq_Zero) 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    50
by (rtac nat_case_0 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    51
by (rtac refl 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    52
qed "Push_neq_K0";
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
(*** Isomorphisms ***)
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 Univ.thy "inj(Rep_Node)";
1465
5d7a7e439cec expanded tabs
clasohm
parents: 1264
diff changeset
    57
by (rtac inj_inverseI 1);       (*cannot combine by RS: multiple unifiers*)
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    58
by (rtac Rep_Node_inverse 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    59
qed "inj_Rep_Node";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    60
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    61
goal Univ.thy "inj_onto Abs_Node Node";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    62
by (rtac inj_onto_inverseI 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    63
by (etac Abs_Node_inverse 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    64
qed "inj_onto_Abs_Node";
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
val Abs_Node_inject = inj_onto_Abs_Node RS inj_ontoD;
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
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    69
(*** Introduction rules for Node ***)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    70
972
e61b058d58d2 changed syntax of tuples from <..., ...> to (..., ...)
clasohm
parents: 923
diff changeset
    71
goalw Univ.thy [Node_def] "(%k. 0,a) : Node";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 1985
diff changeset
    72
by (Blast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    73
qed "Node_K0_I";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    74
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    75
goalw Univ.thy [Node_def,Push_def]
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    76
    "!!p. p: Node ==> apfst (Push i) p : Node";
4089
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3842
diff changeset
    77
by (blast_tac (claset() addSIs [apfst_conv, nat_case_Suc RS trans]) 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    78
qed "Node_Push_I";
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
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    81
(*** Distinctness of constructors ***)
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
(** Scons vs Atom **)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    84
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    85
goalw Univ.thy [Atom_def,Scons_def,Push_Node_def] "(M$N) ~= Atom(a)";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    86
by (rtac notI 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    87
by (etac (equalityD2 RS subsetD RS UnE) 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    88
by (rtac singletonI 1);
976
14b55f7fbf15 renamed theorem "apfst" to "apfst_conv" to avoid conflict with function
clasohm
parents: 972
diff changeset
    89
by (REPEAT (eresolve_tac [imageE, Abs_Node_inject RS apfst_convE, 
1465
5d7a7e439cec expanded tabs
clasohm
parents: 1264
diff changeset
    90
                          Pair_inject, sym RS Push_neq_K0] 1
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    91
     ORELSE resolve_tac [Node_K0_I, Rep_Node RS Node_Push_I] 1));
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    92
qed "Scons_not_Atom";
1985
84cf16192e03 Tidied many proofs, using AddIffs to let equivalences take
paulson
parents: 1786
diff changeset
    93
bind_thm ("Atom_not_Scons", Scons_not_Atom RS not_sym);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    94
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    95
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    96
(*** Injectiveness ***)
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
(** Atomic nodes **)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    99
1563
717f8816eca5 New, one-line proof of inj_Atom
paulson
parents: 1531
diff changeset
   100
goalw Univ.thy [Atom_def, inj_def] "inj(Atom)";
4089
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3842
diff changeset
   101
by (blast_tac (claset() addSIs [Node_K0_I] addSDs [Abs_Node_inject]) 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   102
qed "inj_Atom";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   103
val Atom_inject = inj_Atom RS injD;
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   104
1985
84cf16192e03 Tidied many proofs, using AddIffs to let equivalences take
paulson
parents: 1786
diff changeset
   105
goal Univ.thy "(Atom(a)=Atom(b)) = (a=b)";
4089
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3842
diff changeset
   106
by (blast_tac (claset() addSDs [Atom_inject]) 1);
1985
84cf16192e03 Tidied many proofs, using AddIffs to let equivalences take
paulson
parents: 1786
diff changeset
   107
qed "Atom_Atom_eq";
84cf16192e03 Tidied many proofs, using AddIffs to let equivalences take
paulson
parents: 1786
diff changeset
   108
AddIffs [Atom_Atom_eq];
84cf16192e03 Tidied many proofs, using AddIffs to let equivalences take
paulson
parents: 1786
diff changeset
   109
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   110
goalw Univ.thy [Leaf_def,o_def] "inj(Leaf)";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   111
by (rtac injI 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   112
by (etac (Atom_inject RS Inl_inject) 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   113
qed "inj_Leaf";
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
val Leaf_inject = inj_Leaf RS injD;
1985
84cf16192e03 Tidied many proofs, using AddIffs to let equivalences take
paulson
parents: 1786
diff changeset
   116
AddSDs [Leaf_inject];
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   117
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   118
goalw Univ.thy [Numb_def,o_def] "inj(Numb)";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   119
by (rtac injI 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   120
by (etac (Atom_inject RS Inr_inject) 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   121
qed "inj_Numb";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   122
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   123
val Numb_inject = inj_Numb RS injD;
1985
84cf16192e03 Tidied many proofs, using AddIffs to let equivalences take
paulson
parents: 1786
diff changeset
   124
AddSDs [Numb_inject];
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   125
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   126
(** Injectiveness of Push_Node **)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   127
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   128
val [major,minor] = goalw Univ.thy [Push_Node_def]
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   129
    "[| Push_Node i m =Push_Node j n;  [| i=j;  m=n |] ==> P \
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   130
\    |] ==> P";
976
14b55f7fbf15 renamed theorem "apfst" to "apfst_conv" to avoid conflict with function
clasohm
parents: 972
diff changeset
   131
by (rtac (major RS Abs_Node_inject RS apfst_convE) 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   132
by (REPEAT (resolve_tac [Rep_Node RS Node_Push_I] 1));
976
14b55f7fbf15 renamed theorem "apfst" to "apfst_conv" to avoid conflict with function
clasohm
parents: 972
diff changeset
   133
by (etac (sym RS apfst_convE) 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   134
by (rtac minor 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   135
by (etac Pair_inject 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   136
by (etac (Push_inject1 RS sym) 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   137
by (rtac (inj_Rep_Node RS injD) 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   138
by (etac trans 1);
4089
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3842
diff changeset
   139
by (safe_tac (claset() addSEs [Push_inject,sym]));
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   140
qed "Push_Node_inject";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   141
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   142
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   143
(** Injectiveness of Scons **)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   144
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 1985
diff changeset
   145
goalw Univ.thy [Scons_def] "!!M. M$N <= M'$N' ==> M<=M'";
4089
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3842
diff changeset
   146
by (blast_tac (claset() addSDs [Push_Node_inject]) 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   147
qed "Scons_inject_lemma1";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   148
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 1985
diff changeset
   149
goalw Univ.thy [Scons_def] "!!M. M$N <= M'$N' ==> N<=N'";
4089
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3842
diff changeset
   150
by (blast_tac (claset() addSDs [Push_Node_inject]) 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   151
qed "Scons_inject_lemma2";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   152
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   153
val [major] = goal Univ.thy "M$N = M'$N' ==> M=M'";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   154
by (rtac (major RS equalityE) 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   155
by (REPEAT (ares_tac [equalityI, Scons_inject_lemma1] 1));
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   156
qed "Scons_inject1";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   157
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   158
val [major] = goal Univ.thy "M$N = M'$N' ==> N=N'";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   159
by (rtac (major RS equalityE) 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   160
by (REPEAT (ares_tac [equalityI, Scons_inject_lemma2] 1));
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   161
qed "Scons_inject2";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   162
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   163
val [major,minor] = goal Univ.thy
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   164
    "[| M$N = M'$N';  [| M=M';  N=N' |] ==> P \
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   165
\    |] ==> P";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   166
by (rtac ((major RS Scons_inject2) RS ((major RS Scons_inject1) RS minor)) 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   167
qed "Scons_inject";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   168
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   169
goal Univ.thy "(M$N = M'$N') = (M=M' & N=N')";
4089
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3842
diff changeset
   170
by (blast_tac (claset() addSEs [Scons_inject]) 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   171
qed "Scons_Scons_eq";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   172
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   173
(*** Distinctness involving Leaf and Numb ***)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   174
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   175
(** Scons vs Leaf **)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   176
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   177
goalw Univ.thy [Leaf_def,o_def] "(M$N) ~= Leaf(a)";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   178
by (rtac Scons_not_Atom 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   179
qed "Scons_not_Leaf";
1985
84cf16192e03 Tidied many proofs, using AddIffs to let equivalences take
paulson
parents: 1786
diff changeset
   180
bind_thm ("Leaf_not_Scons", Scons_not_Leaf RS not_sym);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   181
1985
84cf16192e03 Tidied many proofs, using AddIffs to let equivalences take
paulson
parents: 1786
diff changeset
   182
AddIffs [Scons_not_Leaf, Leaf_not_Scons];
84cf16192e03 Tidied many proofs, using AddIffs to let equivalences take
paulson
parents: 1786
diff changeset
   183
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   184
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   185
(** Scons vs Numb **)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   186
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   187
goalw Univ.thy [Numb_def,o_def] "(M$N) ~= Numb(k)";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   188
by (rtac Scons_not_Atom 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   189
qed "Scons_not_Numb";
1985
84cf16192e03 Tidied many proofs, using AddIffs to let equivalences take
paulson
parents: 1786
diff changeset
   190
bind_thm ("Numb_not_Scons", Scons_not_Numb RS not_sym);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   191
1985
84cf16192e03 Tidied many proofs, using AddIffs to let equivalences take
paulson
parents: 1786
diff changeset
   192
AddIffs [Scons_not_Numb, Numb_not_Scons];
84cf16192e03 Tidied many proofs, using AddIffs to let equivalences take
paulson
parents: 1786
diff changeset
   193
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   194
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   195
(** Leaf vs Numb **)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   196
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   197
goalw Univ.thy [Leaf_def,Numb_def] "Leaf(a) ~= Numb(k)";
4089
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3842
diff changeset
   198
by (simp_tac (simpset() addsimps [Inl_not_Inr]) 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   199
qed "Leaf_not_Numb";
1985
84cf16192e03 Tidied many proofs, using AddIffs to let equivalences take
paulson
parents: 1786
diff changeset
   200
bind_thm ("Numb_not_Leaf", Leaf_not_Numb RS not_sym);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   201
1985
84cf16192e03 Tidied many proofs, using AddIffs to let equivalences take
paulson
parents: 1786
diff changeset
   202
AddIffs [Leaf_not_Numb, Numb_not_Leaf];
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   203
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   204
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   205
(*** ndepth -- the depth of a node ***)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   206
1985
84cf16192e03 Tidied many proofs, using AddIffs to let equivalences take
paulson
parents: 1786
diff changeset
   207
Addsimps [apfst_conv];
84cf16192e03 Tidied many proofs, using AddIffs to let equivalences take
paulson
parents: 1786
diff changeset
   208
AddIffs  [Scons_not_Atom, Atom_not_Scons, Scons_Scons_eq];
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   209
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   210
972
e61b058d58d2 changed syntax of tuples from <..., ...> to (..., ...)
clasohm
parents: 923
diff changeset
   211
goalw Univ.thy [ndepth_def] "ndepth (Abs_Node((%k.0, x))) = 0";
1485
240cc98b94a7 Added qed_spec_mp to avoid renaming of bound vars in 'th RS spec'
nipkow
parents: 1465
diff changeset
   212
by (EVERY1[stac (Node_K0_I RS Abs_Node_inverse), stac split]);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   213
by (rtac Least_equality 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   214
by (rtac refl 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   215
by (etac less_zeroE 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   216
qed "ndepth_K0";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   217
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   218
goal Univ.thy "k < Suc(LEAST x. f(x)=0) --> nat_case (Suc i) f k ~= 0";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   219
by (nat_ind_tac "k" 1);
1264
3eb91524b938 added local simpsets; removed IOA from 'make test'
clasohm
parents: 976
diff changeset
   220
by (ALLGOALS Simp_tac);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   221
by (rtac impI 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   222
by (etac not_less_Least 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   223
qed "ndepth_Push_lemma";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   224
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   225
goalw Univ.thy [ndepth_def,Push_Node_def]
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   226
    "ndepth (Push_Node i n) = Suc(ndepth(n))";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   227
by (stac (Rep_Node RS Node_Push_I RS Abs_Node_inverse) 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   228
by (cut_facts_tac [rewrite_rule [Node_def] Rep_Node] 1);
4089
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3842
diff changeset
   229
by (safe_tac (claset()));
1465
5d7a7e439cec expanded tabs
clasohm
parents: 1264
diff changeset
   230
by (etac ssubst 1);  (*instantiates type variables!*)
1264
3eb91524b938 added local simpsets; removed IOA from 'make test'
clasohm
parents: 976
diff changeset
   231
by (Simp_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   232
by (rtac Least_equality 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   233
by (rewtac Push_def);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   234
by (rtac (nat_case_Suc RS trans) 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   235
by (etac LeastI 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   236
by (etac (ndepth_Push_lemma RS mp) 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   237
qed "ndepth_Push_Node";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   238
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   239
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   240
(*** ntrunc applied to the various node sets ***)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   241
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   242
goalw Univ.thy [ntrunc_def] "ntrunc 0 M = {}";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 1985
diff changeset
   243
by (Blast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   244
qed "ntrunc_0";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   245
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   246
goalw Univ.thy [Atom_def,ntrunc_def] "ntrunc (Suc k) (Atom a) = Atom(a)";
4089
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3842
diff changeset
   247
by (fast_tac (claset() addss (simpset() addsimps [ndepth_K0])) 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   248
qed "ntrunc_Atom";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   249
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   250
goalw Univ.thy [Leaf_def,o_def] "ntrunc (Suc k) (Leaf a) = Leaf(a)";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   251
by (rtac ntrunc_Atom 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   252
qed "ntrunc_Leaf";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   253
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   254
goalw Univ.thy [Numb_def,o_def] "ntrunc (Suc k) (Numb i) = Numb(i)";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   255
by (rtac ntrunc_Atom 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   256
qed "ntrunc_Numb";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   257
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   258
goalw Univ.thy [Scons_def,ntrunc_def]
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   259
    "ntrunc (Suc k) (M$N) = ntrunc k M $ ntrunc k N";
4089
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3842
diff changeset
   260
by (safe_tac (claset() addSIs [imageI]));
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   261
by (REPEAT (stac ndepth_Push_Node 3 THEN etac Suc_mono 3));
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   262
by (REPEAT (rtac Suc_less_SucD 1 THEN 
1465
5d7a7e439cec expanded tabs
clasohm
parents: 1264
diff changeset
   263
            rtac (ndepth_Push_Node RS subst) 1 THEN 
5d7a7e439cec expanded tabs
clasohm
parents: 1264
diff changeset
   264
            assume_tac 1));
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   265
qed "ntrunc_Scons";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   266
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   267
(** Injection nodes **)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   268
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   269
goalw Univ.thy [In0_def] "ntrunc (Suc 0) (In0 M) = {}";
4089
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3842
diff changeset
   270
by (simp_tac (simpset() addsimps [ntrunc_Scons,ntrunc_0]) 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   271
by (rewtac Scons_def);
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 1985
diff changeset
   272
by (Blast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   273
qed "ntrunc_one_In0";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   274
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   275
goalw Univ.thy [In0_def]
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   276
    "ntrunc (Suc (Suc k)) (In0 M) = In0 (ntrunc (Suc k) M)";
4089
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3842
diff changeset
   277
by (simp_tac (simpset() addsimps [ntrunc_Scons,ntrunc_Numb]) 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   278
qed "ntrunc_In0";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   279
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   280
goalw Univ.thy [In1_def] "ntrunc (Suc 0) (In1 M) = {}";
4089
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3842
diff changeset
   281
by (simp_tac (simpset() addsimps [ntrunc_Scons,ntrunc_0]) 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   282
by (rewtac Scons_def);
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 1985
diff changeset
   283
by (Blast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   284
qed "ntrunc_one_In1";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   285
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   286
goalw Univ.thy [In1_def]
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   287
    "ntrunc (Suc (Suc k)) (In1 M) = In1 (ntrunc (Suc k) M)";
4089
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3842
diff changeset
   288
by (simp_tac (simpset() addsimps [ntrunc_Scons,ntrunc_Numb]) 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   289
qed "ntrunc_In1";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   290
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   291
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   292
(*** Cartesian Product ***)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   293
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   294
goalw Univ.thy [uprod_def] "!!M N. [| M:A;  N:B |] ==> (M$N) : A<*>B";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   295
by (REPEAT (ares_tac [singletonI,UN_I] 1));
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   296
qed "uprodI";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   297
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   298
(*The general elimination rule*)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   299
val major::prems = goalw Univ.thy [uprod_def]
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   300
    "[| c : A<*>B;  \
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   301
\       !!x y. [| x:A;  y:B;  c=x$y |] ==> P \
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   302
\    |] ==> P";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   303
by (cut_facts_tac [major] 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   304
by (REPEAT (eresolve_tac [asm_rl,singletonE,UN_E] 1
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   305
     ORELSE resolve_tac prems 1));
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   306
qed "uprodE";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   307
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   308
(*Elimination of a pair -- introduces no eigenvariables*)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   309
val prems = goal Univ.thy
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   310
    "[| (M$N) : A<*>B;      [| M:A;  N:B |] ==> P   \
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   311
\    |] ==> P";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   312
by (rtac uprodE 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   313
by (REPEAT (ares_tac prems 1 ORELSE eresolve_tac [Scons_inject,ssubst] 1));
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   314
qed "uprodE2";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   315
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   316
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   317
(*** Disjoint Sum ***)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   318
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   319
goalw Univ.thy [usum_def] "!!M. M:A ==> In0(M) : A<+>B";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 1985
diff changeset
   320
by (Blast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   321
qed "usum_In0I";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   322
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   323
goalw Univ.thy [usum_def] "!!N. N:B ==> In1(N) : A<+>B";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 1985
diff changeset
   324
by (Blast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   325
qed "usum_In1I";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   326
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   327
val major::prems = goalw Univ.thy [usum_def]
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   328
    "[| u : A<+>B;  \
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   329
\       !!x. [| x:A;  u=In0(x) |] ==> P; \
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   330
\       !!y. [| y:B;  u=In1(y) |] ==> P \
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   331
\    |] ==> P";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   332
by (rtac (major RS UnE) 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   333
by (REPEAT (rtac refl 1 
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   334
     ORELSE eresolve_tac (prems@[imageE,ssubst]) 1));
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   335
qed "usumE";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   336
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   337
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   338
(** Injection **)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   339
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   340
goalw Univ.thy [In0_def,In1_def] "In0(M) ~= In1(N)";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   341
by (rtac notI 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   342
by (etac (Scons_inject1 RS Numb_inject RS Zero_neq_Suc) 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   343
qed "In0_not_In1";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   344
1985
84cf16192e03 Tidied many proofs, using AddIffs to let equivalences take
paulson
parents: 1786
diff changeset
   345
bind_thm ("In1_not_In0", In0_not_In1 RS not_sym);
84cf16192e03 Tidied many proofs, using AddIffs to let equivalences take
paulson
parents: 1786
diff changeset
   346
84cf16192e03 Tidied many proofs, using AddIffs to let equivalences take
paulson
parents: 1786
diff changeset
   347
AddIffs [In0_not_In1, In1_not_In0];
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   348
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   349
val [major] = goalw Univ.thy [In0_def] "In0(M) = In0(N) ==>  M=N";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   350
by (rtac (major RS Scons_inject2) 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   351
qed "In0_inject";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   352
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   353
val [major] = goalw Univ.thy [In1_def] "In1(M) = In1(N) ==>  M=N";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   354
by (rtac (major RS Scons_inject2) 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   355
qed "In1_inject";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   356
3421
be777156c7e9 New facts about In0/1 by Burkhart Wolff
paulson
parents: 2949
diff changeset
   357
goal Univ.thy "(In0 M = In0 N) = (M=N)";
4089
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3842
diff changeset
   358
by (blast_tac (claset() addSDs [In0_inject]) 1);
3421
be777156c7e9 New facts about In0/1 by Burkhart Wolff
paulson
parents: 2949
diff changeset
   359
qed "In0_eq";
be777156c7e9 New facts about In0/1 by Burkhart Wolff
paulson
parents: 2949
diff changeset
   360
be777156c7e9 New facts about In0/1 by Burkhart Wolff
paulson
parents: 2949
diff changeset
   361
goal Univ.thy "(In1 M = In1 N) = (M=N)";
4089
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3842
diff changeset
   362
by (blast_tac (claset() addSDs [In1_inject]) 1);
3421
be777156c7e9 New facts about In0/1 by Burkhart Wolff
paulson
parents: 2949
diff changeset
   363
qed "In1_eq";
be777156c7e9 New facts about In0/1 by Burkhart Wolff
paulson
parents: 2949
diff changeset
   364
be777156c7e9 New facts about In0/1 by Burkhart Wolff
paulson
parents: 2949
diff changeset
   365
AddIffs [In0_eq, In1_eq];
be777156c7e9 New facts about In0/1 by Burkhart Wolff
paulson
parents: 2949
diff changeset
   366
be777156c7e9 New facts about In0/1 by Burkhart Wolff
paulson
parents: 2949
diff changeset
   367
goalw Univ.thy [inj_def] "inj In0";
be777156c7e9 New facts about In0/1 by Burkhart Wolff
paulson
parents: 2949
diff changeset
   368
by (Blast_tac 1);
be777156c7e9 New facts about In0/1 by Burkhart Wolff
paulson
parents: 2949
diff changeset
   369
qed "inj_In0";
be777156c7e9 New facts about In0/1 by Burkhart Wolff
paulson
parents: 2949
diff changeset
   370
be777156c7e9 New facts about In0/1 by Burkhart Wolff
paulson
parents: 2949
diff changeset
   371
goalw Univ.thy [inj_def] "inj In1";
be777156c7e9 New facts about In0/1 by Burkhart Wolff
paulson
parents: 2949
diff changeset
   372
by (Blast_tac 1);
be777156c7e9 New facts about In0/1 by Burkhart Wolff
paulson
parents: 2949
diff changeset
   373
qed "inj_In1";
be777156c7e9 New facts about In0/1 by Burkhart Wolff
paulson
parents: 2949
diff changeset
   374
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   375
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   376
(*** proving equality of sets and functions using ntrunc ***)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   377
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   378
goalw Univ.thy [ntrunc_def] "ntrunc k M <= M";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 1985
diff changeset
   379
by (Blast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   380
qed "ntrunc_subsetI";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   381
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   382
val [major] = goalw Univ.thy [ntrunc_def]
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   383
    "(!!k. ntrunc k M <= N) ==> M<=N";
4089
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3842
diff changeset
   384
by (blast_tac (claset() addIs [less_add_Suc1, less_add_Suc2, 
1465
5d7a7e439cec expanded tabs
clasohm
parents: 1264
diff changeset
   385
                            major RS subsetD]) 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   386
qed "ntrunc_subsetD";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   387
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   388
(*A generalized form of the take-lemma*)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   389
val [major] = goal Univ.thy "(!!k. ntrunc k M = ntrunc k N) ==> M=N";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   390
by (rtac equalityI 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   391
by (ALLGOALS (rtac ntrunc_subsetD));
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   392
by (ALLGOALS (rtac (ntrunc_subsetI RSN (2, subset_trans))));
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   393
by (rtac (major RS equalityD1) 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   394
by (rtac (major RS equalityD2) 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   395
qed "ntrunc_equality";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   396
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   397
val [major] = goalw Univ.thy [o_def]
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   398
    "[| !!k. (ntrunc(k) o h1) = (ntrunc(k) o h2) |] ==> h1=h2";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   399
by (rtac (ntrunc_equality RS ext) 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   400
by (rtac (major RS fun_cong) 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   401
qed "ntrunc_o_equality";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   402
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   403
(*** Monotonicity ***)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   404
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   405
goalw Univ.thy [uprod_def] "!!A B. [| A<=A';  B<=B' |] ==> A<*>B <= A'<*>B'";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 1985
diff changeset
   406
by (Blast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   407
qed "uprod_mono";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   408
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   409
goalw Univ.thy [usum_def] "!!A B. [| A<=A';  B<=B' |] ==> A<+>B <= A'<+>B'";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 1985
diff changeset
   410
by (Blast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   411
qed "usum_mono";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   412
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   413
goalw Univ.thy [Scons_def] "!!M N. [| M<=M';  N<=N' |] ==> M$N <= M'$N'";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 1985
diff changeset
   414
by (Blast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   415
qed "Scons_mono";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   416
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   417
goalw Univ.thy [In0_def] "!!M N. M<=N ==> In0(M) <= In0(N)";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   418
by (REPEAT (ares_tac [subset_refl,Scons_mono] 1));
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   419
qed "In0_mono";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   420
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   421
goalw Univ.thy [In1_def] "!!M N. M<=N ==> In1(M) <= In1(N)";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   422
by (REPEAT (ares_tac [subset_refl,Scons_mono] 1));
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   423
qed "In1_mono";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   424
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   425
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   426
(*** Split and Case ***)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   427
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   428
goalw Univ.thy [Split_def] "Split c (M$N) = c M N";
4089
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3842
diff changeset
   429
by (blast_tac (claset() addIs [select_equality]) 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   430
qed "Split";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   431
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   432
goalw Univ.thy [Case_def] "Case c d (In0 M) = c(M)";
4089
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3842
diff changeset
   433
by (blast_tac (claset() addIs [select_equality]) 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   434
qed "Case_In0";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   435
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   436
goalw Univ.thy [Case_def] "Case c d (In1 N) = d(N)";
4089
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3842
diff changeset
   437
by (blast_tac (claset() addIs [select_equality]) 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   438
qed "Case_In1";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   439
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   440
(**** UN x. B(x) rules ****)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   441
3842
b55686a7b22c fixed dots;
wenzelm
parents: 3427
diff changeset
   442
goalw Univ.thy [ntrunc_def] "ntrunc k (UN x. f(x)) = (UN x. ntrunc k (f x))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 1985
diff changeset
   443
by (Blast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   444
qed "ntrunc_UN1";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   445
3842
b55686a7b22c fixed dots;
wenzelm
parents: 3427
diff changeset
   446
goalw Univ.thy [Scons_def] "(UN x. f(x)) $ M = (UN x. f(x) $ M)";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 1985
diff changeset
   447
by (Blast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   448
qed "Scons_UN1_x";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   449
3842
b55686a7b22c fixed dots;
wenzelm
parents: 3427
diff changeset
   450
goalw Univ.thy [Scons_def] "M $ (UN x. f(x)) = (UN x. M $ f(x))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 1985
diff changeset
   451
by (Blast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   452
qed "Scons_UN1_y";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   453
3842
b55686a7b22c fixed dots;
wenzelm
parents: 3427
diff changeset
   454
goalw Univ.thy [In0_def] "In0(UN x. f(x)) = (UN x. In0(f(x)))";
1465
5d7a7e439cec expanded tabs
clasohm
parents: 1264
diff changeset
   455
by (rtac Scons_UN1_y 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   456
qed "In0_UN1";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   457
3842
b55686a7b22c fixed dots;
wenzelm
parents: 3427
diff changeset
   458
goalw Univ.thy [In1_def] "In1(UN x. f(x)) = (UN x. In1(f(x)))";
1465
5d7a7e439cec expanded tabs
clasohm
parents: 1264
diff changeset
   459
by (rtac Scons_UN1_y 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   460
qed "In1_UN1";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   461
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   462
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   463
(*** Equality : the diagonal relation ***)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   464
972
e61b058d58d2 changed syntax of tuples from <..., ...> to (..., ...)
clasohm
parents: 923
diff changeset
   465
goalw Univ.thy [diag_def] "!!a A. [| a=b;  a:A |] ==> (a,b) : diag(A)";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 1985
diff changeset
   466
by (Blast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   467
qed "diag_eqI";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   468
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   469
val diagI = refl RS diag_eqI |> standard;
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   470
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   471
(*The general elimination rule*)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   472
val major::prems = goalw Univ.thy [diag_def]
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   473
    "[| c : diag(A);  \
972
e61b058d58d2 changed syntax of tuples from <..., ...> to (..., ...)
clasohm
parents: 923
diff changeset
   474
\       !!x y. [| x:A;  c = (x,x) |] ==> P \
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   475
\    |] ==> P";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   476
by (rtac (major RS UN_E) 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   477
by (REPEAT (eresolve_tac [asm_rl,singletonE] 1 ORELSE resolve_tac prems 1));
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   478
qed "diagE";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   479
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   480
(*** Equality for Cartesian Product ***)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   481
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   482
goalw Univ.thy [dprod_def]
972
e61b058d58d2 changed syntax of tuples from <..., ...> to (..., ...)
clasohm
parents: 923
diff changeset
   483
    "!!r s. [| (M,M'):r;  (N,N'):s |] ==> (M$N, M'$N') : r<**>s";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 1985
diff changeset
   484
by (Blast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   485
qed "dprodI";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   486
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   487
(*The general elimination rule*)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   488
val major::prems = goalw Univ.thy [dprod_def]
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   489
    "[| c : r<**>s;  \
972
e61b058d58d2 changed syntax of tuples from <..., ...> to (..., ...)
clasohm
parents: 923
diff changeset
   490
\       !!x y x' y'. [| (x,x') : r;  (y,y') : s;  c = (x$y,x'$y') |] ==> P \
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   491
\    |] ==> P";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   492
by (cut_facts_tac [major] 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   493
by (REPEAT_FIRST (eresolve_tac [asm_rl, UN_E, mem_splitE, singletonE]));
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   494
by (REPEAT (ares_tac prems 1 ORELSE hyp_subst_tac 1));
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   495
qed "dprodE";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   496
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   497
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   498
(*** Equality for Disjoint Sum ***)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   499
972
e61b058d58d2 changed syntax of tuples from <..., ...> to (..., ...)
clasohm
parents: 923
diff changeset
   500
goalw Univ.thy [dsum_def]  "!!r. (M,M'):r ==> (In0(M), In0(M')) : r<++>s";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 1985
diff changeset
   501
by (Blast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   502
qed "dsum_In0I";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   503
972
e61b058d58d2 changed syntax of tuples from <..., ...> to (..., ...)
clasohm
parents: 923
diff changeset
   504
goalw Univ.thy [dsum_def]  "!!r. (N,N'):s ==> (In1(N), In1(N')) : r<++>s";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 1985
diff changeset
   505
by (Blast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   506
qed "dsum_In1I";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   507
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   508
val major::prems = goalw Univ.thy [dsum_def]
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   509
    "[| w : r<++>s;  \
972
e61b058d58d2 changed syntax of tuples from <..., ...> to (..., ...)
clasohm
parents: 923
diff changeset
   510
\       !!x x'. [| (x,x') : r;  w = (In0(x), In0(x')) |] ==> P; \
e61b058d58d2 changed syntax of tuples from <..., ...> to (..., ...)
clasohm
parents: 923
diff changeset
   511
\       !!y y'. [| (y,y') : s;  w = (In1(y), In1(y')) |] ==> P \
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   512
\    |] ==> P";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   513
by (cut_facts_tac [major] 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   514
by (REPEAT_FIRST (eresolve_tac [asm_rl, UN_E, UnE, mem_splitE, singletonE]));
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   515
by (DEPTH_SOLVE (ares_tac prems 1 ORELSE hyp_subst_tac 1));
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   516
qed "dsumE";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   517
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   518
1760
6f41a494f3b1 Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1642
diff changeset
   519
AddSIs [diagI, uprodI, dprodI];
6f41a494f3b1 Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1642
diff changeset
   520
AddIs  [usum_In0I, usum_In1I, dsum_In0I, dsum_In1I];
6f41a494f3b1 Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1642
diff changeset
   521
AddSEs [diagE, uprodE, dprodE, usumE, dsumE];
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   522
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   523
(*** Monotonicity ***)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   524
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   525
goal Univ.thy "!!r s. [| r<=r';  s<=s' |] ==> r<**>s <= r'<**>s'";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 1985
diff changeset
   526
by (Blast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   527
qed "dprod_mono";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   528
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   529
goal Univ.thy "!!r s. [| r<=r';  s<=s' |] ==> r<++>s <= r'<++>s'";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 1985
diff changeset
   530
by (Blast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   531
qed "dsum_mono";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   532
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   533
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   534
(*** Bounding theorems ***)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   535
1642
21db0cf9a1a4 Using new "Times" infix
paulson
parents: 1563
diff changeset
   536
goal Univ.thy "diag(A) <= A Times A";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 1985
diff changeset
   537
by (Blast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   538
qed "diag_subset_Sigma";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   539
1642
21db0cf9a1a4 Using new "Times" infix
paulson
parents: 1563
diff changeset
   540
goal Univ.thy "((A Times B) <**> (C Times D)) <= (A<*>C) Times (B<*>D)";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 1985
diff changeset
   541
by (Blast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   542
qed "dprod_Sigma";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   543
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   544
val dprod_subset_Sigma = [dprod_mono, dprod_Sigma] MRS subset_trans |>standard;
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   545
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   546
(*Dependent version*)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   547
goal Univ.thy
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   548
    "(Sigma A B <**> Sigma C D) <= Sigma (A<*>C) (Split(%x y. B(x)<*>D(y)))";
4089
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3842
diff changeset
   549
by (safe_tac (claset()));
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   550
by (stac Split 1);
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 1985
diff changeset
   551
by (Blast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   552
qed "dprod_subset_Sigma2";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   553
1642
21db0cf9a1a4 Using new "Times" infix
paulson
parents: 1563
diff changeset
   554
goal Univ.thy "(A Times B <++> C Times D) <= (A<+>C) Times (B<+>D)";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 1985
diff changeset
   555
by (Blast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   556
qed "dsum_Sigma";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   557
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   558
val dsum_subset_Sigma = [dsum_mono, dsum_Sigma] MRS subset_trans |> standard;
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   559
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   560
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   561
(*** Domain ***)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   562
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   563
goal Univ.thy "fst `` diag(A) = A";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 1985
diff changeset
   564
by (Blast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   565
qed "fst_image_diag";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   566
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   567
goal Univ.thy "fst `` (r<**>s) = (fst``r) <*> (fst``s)";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 1985
diff changeset
   568
by (Blast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   569
qed "fst_image_dprod";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   570
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   571
goal Univ.thy "fst `` (r<++>s) = (fst``r) <+> (fst``s)";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 1985
diff changeset
   572
by (Blast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   573
qed "fst_image_dsum";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   574
1264
3eb91524b938 added local simpsets; removed IOA from 'make test'
clasohm
parents: 976
diff changeset
   575
Addsimps [fst_image_diag, fst_image_dprod, fst_image_dsum];