src/HOLCF/Cfun1.ML
changeset 243 c22b85994e17
child 752 b89462f9d5f1
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/HOLCF/Cfun1.ML	Wed Jan 19 17:35:01 1994 +0100
     1.3 @@ -0,0 +1,129 @@
     1.4 +(*  Title: 	HOLCF/cfun1.ML
     1.5 +    ID:         $Id$
     1.6 +    Author: 	Franz Regensburger
     1.7 +    Copyright   1993 Technische Universitaet Muenchen
     1.8 +
     1.9 +Lemmas for cfun1.thy 
    1.10 +*)
    1.11 +
    1.12 +open Cfun1;
    1.13 +
    1.14 +(* ------------------------------------------------------------------------ *)
    1.15 +(* A non-emptyness result for Cfun                                          *)
    1.16 +(* ------------------------------------------------------------------------ *)
    1.17 +
    1.18 +val CfunI = prove_goalw Cfun1.thy [Cfun_def] "(% x.x):Cfun"
    1.19 + (fn prems =>
    1.20 +	[
    1.21 +	(rtac (mem_Collect_eq RS ssubst) 1),
    1.22 +	(rtac contX_id 1)
    1.23 +	]);
    1.24 +
    1.25 +
    1.26 +(* ------------------------------------------------------------------------ *)
    1.27 +(* less_cfun is a partial order on type 'a -> 'b                            *)
    1.28 +(* ------------------------------------------------------------------------ *)
    1.29 +
    1.30 +val refl_less_cfun = prove_goalw Cfun1.thy [less_cfun_def] "less_cfun(f,f)"
    1.31 +(fn prems =>
    1.32 +	[
    1.33 +	(rtac refl_less 1)
    1.34 +	]);
    1.35 +
    1.36 +val antisym_less_cfun = prove_goalw Cfun1.thy [less_cfun_def] 
    1.37 +	"[|less_cfun(f1,f2); less_cfun(f2,f1)|] ==> f1 = f2"
    1.38 +(fn prems =>
    1.39 +	[
    1.40 +	(cut_facts_tac prems 1),
    1.41 +	(rtac injD 1),
    1.42 +	(rtac antisym_less 2),
    1.43 +	(atac 3),
    1.44 +	(atac 2),
    1.45 +	(rtac inj_inverseI 1),
    1.46 +	(rtac Rep_Cfun_inverse 1)
    1.47 +	]);
    1.48 +
    1.49 +val trans_less_cfun = prove_goalw Cfun1.thy [less_cfun_def] 
    1.50 +	"[|less_cfun(f1,f2); less_cfun(f2,f3)|] ==> less_cfun(f1,f3)"
    1.51 +(fn prems =>
    1.52 +	[
    1.53 +	(cut_facts_tac prems 1),
    1.54 +	(etac trans_less 1),
    1.55 +	(atac 1)
    1.56 +	]);
    1.57 +
    1.58 +(* ------------------------------------------------------------------------ *)
    1.59 +(* lemmas about application of continuous functions                         *)
    1.60 +(* ------------------------------------------------------------------------ *)
    1.61 +
    1.62 +val cfun_cong = prove_goal Cfun1.thy 
    1.63 +	 "[| f=g; x=y |] ==> f[x] = g[y]"
    1.64 +(fn prems =>
    1.65 +	[
    1.66 +	(cut_facts_tac prems 1),
    1.67 +	(fast_tac HOL_cs 1)
    1.68 +	]);
    1.69 +
    1.70 +val cfun_fun_cong = prove_goal Cfun1.thy "f=g ==> f[x] = g[x]"
    1.71 +(fn prems =>
    1.72 +	[
    1.73 +	(cut_facts_tac prems 1),
    1.74 +	(etac cfun_cong 1),
    1.75 +	(rtac refl 1)
    1.76 +	]);
    1.77 +
    1.78 +val cfun_arg_cong = prove_goal Cfun1.thy "x=y ==> f[x] = f[y]"
    1.79 +(fn prems =>
    1.80 +	[
    1.81 +	(cut_facts_tac prems 1),
    1.82 +	(rtac cfun_cong 1),
    1.83 +	(rtac refl 1),
    1.84 +	(atac 1)
    1.85 +	]);
    1.86 +
    1.87 +
    1.88 +(* ------------------------------------------------------------------------ *)
    1.89 +(* additional lemma about the isomorphism between -> and Cfun               *)
    1.90 +(* ------------------------------------------------------------------------ *)
    1.91 +
    1.92 +val Abs_Cfun_inverse2 = prove_goal Cfun1.thy "contX(f) ==> fapp(fabs(f)) = f"
    1.93 +(fn prems =>
    1.94 +	[
    1.95 +	(cut_facts_tac prems 1),
    1.96 +	(rtac Abs_Cfun_inverse 1),
    1.97 +	(rewrite_goals_tac [Cfun_def]),
    1.98 +	(etac (mem_Collect_eq RS ssubst) 1)
    1.99 +	]);
   1.100 +
   1.101 +(* ------------------------------------------------------------------------ *)
   1.102 +(* simplification of application                                            *)
   1.103 +(* ------------------------------------------------------------------------ *)
   1.104 +
   1.105 +val Cfunapp2 = prove_goal Cfun1.thy 
   1.106 +	"contX(f) ==> (fabs(f))[x] = f(x)"
   1.107 +(fn prems =>
   1.108 +	[
   1.109 +	(cut_facts_tac prems 1),
   1.110 +	(etac (Abs_Cfun_inverse2 RS fun_cong) 1)
   1.111 +	]);
   1.112 +
   1.113 +(* ------------------------------------------------------------------------ *)
   1.114 +(* beta - equality for continuous functions                                 *)
   1.115 +(* ------------------------------------------------------------------------ *)
   1.116 +
   1.117 +val beta_cfun = prove_goal Cfun1.thy 
   1.118 +	"contX(c1) ==> (LAM x .c1(x))[u] = c1(u)"
   1.119 +(fn prems =>
   1.120 +	[
   1.121 +	(cut_facts_tac prems 1),
   1.122 +	(rtac Cfunapp2 1),
   1.123 +	(atac 1)
   1.124 +	]);
   1.125 +
   1.126 +(* ------------------------------------------------------------------------ *)
   1.127 +(* load ML file cinfix.ML                                                   *)
   1.128 +(* ------------------------------------------------------------------------ *)
   1.129 +
   1.130 +
   1.131 + writeln "Reading file  cinfix.ML"; 
   1.132 +use "cinfix.ML";