src/HOLCF/Sprod1.ML
author nipkow
Wed Jan 19 17:35:01 1994 +0100 (1994-01-19)
changeset 243 c22b85994e17
child 892 d0dc8d057929
permissions -rw-r--r--
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
in HOL.
nipkow@243
     1
(*  Title: 	HOLCF/sprod1.ML
nipkow@243
     2
    ID:         $Id$
nipkow@243
     3
    Author: 	Franz Regensburger
nipkow@243
     4
    Copyright   1993  Technische Universitaet Muenchen
nipkow@243
     5
nipkow@243
     6
Lemmas for theory sprod1.thy
nipkow@243
     7
*)
nipkow@243
     8
nipkow@243
     9
open Sprod1;
nipkow@243
    10
nipkow@243
    11
(* ------------------------------------------------------------------------ *)
nipkow@243
    12
(* reduction properties for less_sprod                                      *)
nipkow@243
    13
(* ------------------------------------------------------------------------ *)
nipkow@243
    14
nipkow@243
    15
nipkow@243
    16
val less_sprod1a = prove_goalw Sprod1.thy [less_sprod_def]
nipkow@243
    17
	"p1=Ispair(UU,UU) ==> less_sprod(p1,p2)"
nipkow@243
    18
(fn prems =>
nipkow@243
    19
	[
nipkow@243
    20
	(cut_facts_tac prems 1),
nipkow@243
    21
	(rtac eqTrueE 1),
nipkow@243
    22
	(rtac select_equality 1),
nipkow@243
    23
	(rtac conjI 1),
nipkow@243
    24
	(fast_tac HOL_cs 1),
nipkow@243
    25
	(strip_tac 1),
nipkow@243
    26
	(contr_tac 1),
nipkow@243
    27
	(dtac conjunct1 1),
nipkow@243
    28
	(etac rev_mp 1),
nipkow@243
    29
	(atac 1)
nipkow@243
    30
	]);
nipkow@243
    31
nipkow@243
    32
val less_sprod1b = prove_goalw Sprod1.thy [less_sprod_def]
nipkow@243
    33
 "~p1=Ispair(UU,UU) ==> \
nipkow@243
    34
\ less_sprod(p1,p2) = ( Isfst(p1) << Isfst(p2) & Issnd(p1) << Issnd(p2))"
nipkow@243
    35
(fn prems =>
nipkow@243
    36
	[
nipkow@243
    37
	(cut_facts_tac prems 1),
nipkow@243
    38
	(rtac select_equality 1),
nipkow@243
    39
	(rtac conjI 1),
nipkow@243
    40
	(strip_tac 1),
nipkow@243
    41
	(contr_tac 1),
nipkow@243
    42
	(fast_tac HOL_cs 1),
nipkow@243
    43
	(dtac conjunct2 1),
nipkow@243
    44
	(etac rev_mp 1),
nipkow@243
    45
	(atac 1)
nipkow@243
    46
	]);
nipkow@243
    47
nipkow@243
    48
val less_sprod2a = prove_goal Sprod1.thy
nipkow@243
    49
	"less_sprod(Ispair(x,y),Ispair(UU,UU)) ==> x = UU | y = UU"
nipkow@243
    50
(fn prems =>
nipkow@243
    51
	[
nipkow@243
    52
	(cut_facts_tac prems 1),
nipkow@243
    53
	(rtac (excluded_middle RS disjE) 1),
nipkow@243
    54
	(atac 2),
nipkow@243
    55
	(rtac disjI1 1),
nipkow@243
    56
	(rtac antisym_less 1),
nipkow@243
    57
	(rtac minimal 2),
nipkow@243
    58
	(res_inst_tac [("s","Isfst(Ispair(x,y))"),("t","x")] subst 1),
nipkow@243
    59
	(rtac Isfst 1),
nipkow@243
    60
	(fast_tac HOL_cs 1),
nipkow@243
    61
	(fast_tac HOL_cs 1),
nipkow@243
    62
	(res_inst_tac [("s","Isfst(Ispair(UU,UU))"),("t","UU")] subst 1),
nipkow@243
    63
	(simp_tac Sprod_ss 1),
nipkow@243
    64
	(rtac (defined_Ispair RS less_sprod1b RS iffD1 RS conjunct1) 1),
nipkow@243
    65
	(REPEAT (fast_tac HOL_cs 1))
nipkow@243
    66
	]);
nipkow@243
    67
nipkow@243
    68
val less_sprod2b = prove_goal Sprod1.thy
nipkow@243
    69
 "less_sprod(p,Ispair(UU,UU)) ==> p = Ispair(UU,UU)"
nipkow@243
    70
(fn prems =>
nipkow@243
    71
	[
nipkow@243
    72
	(cut_facts_tac prems 1),
nipkow@243
    73
	(res_inst_tac [("p","p")] IsprodE 1),
nipkow@243
    74
	(atac 1),
nipkow@243
    75
	(hyp_subst_tac 1),
nipkow@243
    76
	(rtac strict_Ispair 1),
nipkow@243
    77
	(etac less_sprod2a 1)
nipkow@243
    78
	]);
nipkow@243
    79
nipkow@243
    80
val less_sprod2c = prove_goal Sprod1.thy 
nipkow@243
    81
 "[|less_sprod(Ispair(xa,ya),Ispair(x,y));\
nipkow@243
    82
\~ xa = UU ; ~ ya = UU;~ x = UU ; ~ y = UU |] ==> xa << x & ya << y"
nipkow@243
    83
(fn prems =>
nipkow@243
    84
	[
nipkow@243
    85
	(rtac conjI 1),
nipkow@243
    86
	(res_inst_tac [("s","Isfst(Ispair(xa,ya))"),("t","xa")] subst 1),
nipkow@243
    87
	(simp_tac (Sprod_ss addsimps prems)1),
nipkow@243
    88
	(res_inst_tac [("s","Isfst(Ispair(x,y))"),("t","x")] subst 1),
nipkow@243
    89
	(simp_tac (Sprod_ss addsimps prems)1),
nipkow@243
    90
	(rtac (defined_Ispair RS less_sprod1b RS iffD1 RS conjunct1) 1),
nipkow@243
    91
	(resolve_tac prems 1),
nipkow@243
    92
	(resolve_tac prems 1),
nipkow@243
    93
	(simp_tac (Sprod_ss addsimps prems)1),
nipkow@243
    94
	(res_inst_tac [("s","Issnd(Ispair(xa,ya))"),("t","ya")] subst 1),
nipkow@243
    95
	(simp_tac (Sprod_ss addsimps prems)1),
nipkow@243
    96
	(res_inst_tac [("s","Issnd(Ispair(x,y))"),("t","y")] subst 1),
nipkow@243
    97
	(simp_tac (Sprod_ss addsimps prems)1),
nipkow@243
    98
	(rtac (defined_Ispair RS less_sprod1b RS iffD1 RS conjunct2) 1),
nipkow@243
    99
	(resolve_tac prems 1),
nipkow@243
   100
	(resolve_tac prems 1),
nipkow@243
   101
	(simp_tac (Sprod_ss addsimps prems)1)
nipkow@243
   102
	]);
nipkow@243
   103
nipkow@243
   104
(* ------------------------------------------------------------------------ *)
nipkow@243
   105
(* less_sprod is a partial order on Sprod                                   *)
nipkow@243
   106
(* ------------------------------------------------------------------------ *)
nipkow@243
   107
nipkow@243
   108
val refl_less_sprod = prove_goal Sprod1.thy "less_sprod(p,p)"
nipkow@243
   109
(fn prems =>
nipkow@243
   110
	[
nipkow@243
   111
	(res_inst_tac [("p","p")] IsprodE 1),
nipkow@243
   112
	(etac less_sprod1a 1),
nipkow@243
   113
	(hyp_subst_tac 1),
nipkow@243
   114
	(rtac (less_sprod1b RS ssubst) 1),
nipkow@243
   115
	(rtac defined_Ispair 1),
nipkow@243
   116
	(REPEAT (fast_tac (HOL_cs addIs [refl_less]) 1))
nipkow@243
   117
	]);
nipkow@243
   118
nipkow@243
   119
nipkow@243
   120
val antisym_less_sprod = prove_goal Sprod1.thy 
nipkow@243
   121
 "[|less_sprod(p1,p2);less_sprod(p2,p1)|] ==> p1=p2"
nipkow@243
   122
 (fn prems =>
nipkow@243
   123
	[
nipkow@243
   124
	(cut_facts_tac prems 1),
nipkow@243
   125
	(res_inst_tac [("p","p1")] IsprodE 1),
nipkow@243
   126
	(hyp_subst_tac 1),
nipkow@243
   127
	(res_inst_tac [("p","p2")] IsprodE 1),
nipkow@243
   128
	(hyp_subst_tac 1),
nipkow@243
   129
	(rtac refl 1),
nipkow@243
   130
	(hyp_subst_tac 1),
nipkow@243
   131
	(rtac (strict_Ispair RS sym) 1),
nipkow@243
   132
	(etac less_sprod2a 1),
nipkow@243
   133
	(hyp_subst_tac 1),
nipkow@243
   134
	(res_inst_tac [("p","p2")] IsprodE 1),
nipkow@243
   135
	(hyp_subst_tac 1),
nipkow@243
   136
	(rtac (strict_Ispair) 1),
nipkow@243
   137
	(etac less_sprod2a 1),
nipkow@243
   138
	(hyp_subst_tac 1),
nipkow@243
   139
	(res_inst_tac [("x1","x"),("y1","xa"),("x","y"),("y","ya")] (arg_cong RS cong) 1),
nipkow@243
   140
	(rtac antisym_less 1),
nipkow@243
   141
	(asm_simp_tac (HOL_ss addsimps [less_sprod2c RS conjunct1]) 1),
nipkow@243
   142
	(asm_simp_tac (HOL_ss addsimps [less_sprod2c RS conjunct1]) 1),
nipkow@243
   143
	(rtac antisym_less 1),
nipkow@243
   144
	(asm_simp_tac (HOL_ss addsimps [less_sprod2c RS conjunct2]) 1),
nipkow@243
   145
	(asm_simp_tac (HOL_ss addsimps [less_sprod2c RS conjunct2]) 1)
nipkow@243
   146
	]);
nipkow@243
   147
nipkow@243
   148
val trans_less_sprod = prove_goal Sprod1.thy 
nipkow@243
   149
 "[|less_sprod(p1,p2);less_sprod(p2,p3)|] ==> less_sprod(p1,p3)"
nipkow@243
   150
(fn prems =>
nipkow@243
   151
	[
nipkow@243
   152
	(cut_facts_tac prems 1),
nipkow@243
   153
	(res_inst_tac [("p","p1")] IsprodE 1),
nipkow@243
   154
	(etac less_sprod1a 1),
nipkow@243
   155
	(hyp_subst_tac 1),
nipkow@243
   156
	(res_inst_tac [("p","p3")] IsprodE 1),
nipkow@243
   157
	(hyp_subst_tac 1),
nipkow@243
   158
	(res_inst_tac [("s","p2"),("t","Ispair(UU,UU)")] subst 1),
nipkow@243
   159
	(etac less_sprod2b 1),
nipkow@243
   160
	(atac 1),
nipkow@243
   161
	(hyp_subst_tac 1),
nipkow@243
   162
	(res_inst_tac [("Q","p2=Ispair(UU,UU)")]  
nipkow@243
   163
		(excluded_middle RS disjE) 1),
nipkow@243
   164
	(rtac (defined_Ispair RS less_sprod1b RS ssubst) 1),
nipkow@243
   165
	(atac 1),
nipkow@243
   166
	(atac 1),
nipkow@243
   167
	(rtac conjI 1),
nipkow@243
   168
	(res_inst_tac [("y","Isfst(p2)")] trans_less 1),
nipkow@243
   169
	(rtac conjunct1 1),
nipkow@243
   170
	(rtac (less_sprod1b RS subst) 1),
nipkow@243
   171
	(rtac defined_Ispair 1),
nipkow@243
   172
	(atac 1),
nipkow@243
   173
	(atac 1),
nipkow@243
   174
	(atac 1),
nipkow@243
   175
	(rtac conjunct1 1),
nipkow@243
   176
	(rtac (less_sprod1b RS subst) 1),
nipkow@243
   177
	(atac 1),
nipkow@243
   178
	(atac 1),
nipkow@243
   179
	(res_inst_tac [("y","Issnd(p2)")] trans_less 1),
nipkow@243
   180
	(rtac conjunct2 1),
nipkow@243
   181
	(rtac (less_sprod1b RS subst) 1),
nipkow@243
   182
	(rtac defined_Ispair 1),
nipkow@243
   183
	(atac 1),
nipkow@243
   184
	(atac 1),
nipkow@243
   185
	(atac 1),
nipkow@243
   186
	(rtac conjunct2 1),
nipkow@243
   187
	(rtac (less_sprod1b RS subst) 1),
nipkow@243
   188
	(atac 1),
nipkow@243
   189
	(atac 1),
nipkow@243
   190
	(hyp_subst_tac 1),
nipkow@243
   191
	(res_inst_tac [("s","Ispair(UU,UU)"),("t","Ispair(x,y)")] subst 1),
nipkow@243
   192
	(etac (less_sprod2b RS sym) 1),
nipkow@243
   193
	(atac 1)
nipkow@243
   194
	]);
nipkow@243
   195
nipkow@243
   196
nipkow@243
   197
nipkow@243
   198
nipkow@243
   199
nipkow@243
   200
nipkow@243
   201
nipkow@243
   202
nipkow@243
   203
nipkow@243
   204