src/HOLCF/Cfun1.ML
author wenzelm
Mon, 22 Oct 2001 17:58:26 +0200
changeset 11880 a625de9ad62a
parent 10834 a7897aebbffc
child 12030 46d57d0290a2
permissions -rw-r--r--
quick_and_dirty_prove_goalw_cterm;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2640
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents: 2033
diff changeset
     1
(*  Title:      HOLCF/Cfun1.ML
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
     2
    ID:         $Id$
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1168
diff changeset
     3
    Author:     Franz Regensburger
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
     4
    Copyright   1993 Technische Universitaet Muenchen
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
     5
9245
428385c4bc50 removed most batch-style proofs
paulson
parents: 5291
diff changeset
     6
The type ->  of continuous functions.
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
     7
*)
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
     8
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
     9
(* ------------------------------------------------------------------------ *)
5291
5706f0ef1d43 eliminated fabs,fapp.
slotosch
parents: 3323
diff changeset
    10
(* derive old type definition rules for Abs_CFun & Rep_CFun                         *)
5706f0ef1d43 eliminated fabs,fapp.
slotosch
parents: 3323
diff changeset
    11
(* Rep_CFun and Abs_CFun should be replaced by Rep_Cfun anf Abs_Cfun in future      *)
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    12
(* ------------------------------------------------------------------------ *)
9248
e1dee89de037 massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents: 9245
diff changeset
    13
Goal "Rep_CFun fo : CFun";
9245
428385c4bc50 removed most batch-style proofs
paulson
parents: 5291
diff changeset
    14
by (rtac Rep_CFun 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 5291
diff changeset
    15
qed "Rep_Cfun";
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    16
9248
e1dee89de037 massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents: 9245
diff changeset
    17
Goal "Abs_CFun (Rep_CFun fo) = fo";
9245
428385c4bc50 removed most batch-style proofs
paulson
parents: 5291
diff changeset
    18
by (rtac Rep_CFun_inverse 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 5291
diff changeset
    19
qed "Rep_Cfun_inverse";
2640
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents: 2033
diff changeset
    20
9248
e1dee89de037 massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents: 9245
diff changeset
    21
Goal "f:CFun==>Rep_CFun(Abs_CFun f)=f";
9245
428385c4bc50 removed most batch-style proofs
paulson
parents: 5291
diff changeset
    22
by (etac Abs_CFun_inverse 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 5291
diff changeset
    23
qed "Abs_Cfun_inverse";
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    24
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    25
(* ------------------------------------------------------------------------ *)
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    26
(* less_cfun is a partial order on type 'a -> 'b                            *)
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    27
(* ------------------------------------------------------------------------ *)
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    28
9248
e1dee89de037 massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents: 9245
diff changeset
    29
Goalw [less_cfun_def] "(f::'a->'b) << f";
9245
428385c4bc50 removed most batch-style proofs
paulson
parents: 5291
diff changeset
    30
by (rtac refl_less 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 5291
diff changeset
    31
qed "refl_less_cfun";
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    32
9248
e1dee89de037 massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents: 9245
diff changeset
    33
Goalw [less_cfun_def] 
9245
428385c4bc50 removed most batch-style proofs
paulson
parents: 5291
diff changeset
    34
        "[|(f1::'a->'b) << f2; f2 << f1|] ==> f1 = f2";
428385c4bc50 removed most batch-style proofs
paulson
parents: 5291
diff changeset
    35
by (rtac injD 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 5291
diff changeset
    36
by (rtac antisym_less 2);
428385c4bc50 removed most batch-style proofs
paulson
parents: 5291
diff changeset
    37
by (atac 3);
428385c4bc50 removed most batch-style proofs
paulson
parents: 5291
diff changeset
    38
by (atac 2);
428385c4bc50 removed most batch-style proofs
paulson
parents: 5291
diff changeset
    39
by (rtac inj_inverseI 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 5291
diff changeset
    40
by (rtac Rep_Cfun_inverse 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 5291
diff changeset
    41
qed "antisym_less_cfun";
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    42
9248
e1dee89de037 massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents: 9245
diff changeset
    43
Goalw [less_cfun_def] 
9245
428385c4bc50 removed most batch-style proofs
paulson
parents: 5291
diff changeset
    44
        "[|(f1::'a->'b) << f2; f2 << f3|] ==> f1 << f3";
428385c4bc50 removed most batch-style proofs
paulson
parents: 5291
diff changeset
    45
by (etac trans_less 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 5291
diff changeset
    46
by (atac 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 5291
diff changeset
    47
qed "trans_less_cfun";
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    48
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    49
(* ------------------------------------------------------------------------ *)
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    50
(* lemmas about application of continuous functions                         *)
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    51
(* ------------------------------------------------------------------------ *)
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    52
10834
a7897aebbffc *** empty log message ***
nipkow
parents: 9248
diff changeset
    53
Goal "[| f=g; x=y |] ==> f$x = g$y";
9248
e1dee89de037 massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents: 9245
diff changeset
    54
by (Asm_simp_tac 1);
9245
428385c4bc50 removed most batch-style proofs
paulson
parents: 5291
diff changeset
    55
qed "cfun_cong";
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    56
10834
a7897aebbffc *** empty log message ***
nipkow
parents: 9248
diff changeset
    57
Goal "f=g ==> f$x = g$x";
9248
e1dee89de037 massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents: 9245
diff changeset
    58
by (Asm_simp_tac 1);
9245
428385c4bc50 removed most batch-style proofs
paulson
parents: 5291
diff changeset
    59
qed "cfun_fun_cong";
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    60
10834
a7897aebbffc *** empty log message ***
nipkow
parents: 9248
diff changeset
    61
Goal "x=y ==> f$x = f$y";
9248
e1dee89de037 massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents: 9245
diff changeset
    62
by (Asm_simp_tac 1);
9245
428385c4bc50 removed most batch-style proofs
paulson
parents: 5291
diff changeset
    63
qed "cfun_arg_cong";
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    64
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    65
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    66
(* ------------------------------------------------------------------------ *)
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    67
(* additional lemma about the isomorphism between -> and Cfun               *)
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    68
(* ------------------------------------------------------------------------ *)
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    69
9248
e1dee89de037 massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents: 9245
diff changeset
    70
Goal "cont f ==> Rep_CFun (Abs_CFun f) = f";
9245
428385c4bc50 removed most batch-style proofs
paulson
parents: 5291
diff changeset
    71
by (rtac Abs_Cfun_inverse 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 5291
diff changeset
    72
by (rewtac CFun_def);
428385c4bc50 removed most batch-style proofs
paulson
parents: 5291
diff changeset
    73
by (etac (mem_Collect_eq RS ssubst) 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 5291
diff changeset
    74
qed "Abs_Cfun_inverse2";
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    75
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    76
(* ------------------------------------------------------------------------ *)
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    77
(* simplification of application                                            *)
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    78
(* ------------------------------------------------------------------------ *)
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    79
10834
a7897aebbffc *** empty log message ***
nipkow
parents: 9248
diff changeset
    80
Goal "cont f ==> (Abs_CFun f)$x = f x";
9245
428385c4bc50 removed most batch-style proofs
paulson
parents: 5291
diff changeset
    81
by (etac (Abs_Cfun_inverse2 RS fun_cong) 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 5291
diff changeset
    82
qed "Cfunapp2";
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    83
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    84
(* ------------------------------------------------------------------------ *)
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    85
(* beta - equality for continuous functions                                 *)
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    86
(* ------------------------------------------------------------------------ *)
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    87
10834
a7897aebbffc *** empty log message ***
nipkow
parents: 9248
diff changeset
    88
Goal "cont(c1) ==> (LAM x .c1 x)$u = c1 u";
9245
428385c4bc50 removed most batch-style proofs
paulson
parents: 5291
diff changeset
    89
by (rtac Cfunapp2 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 5291
diff changeset
    90
by (atac 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 5291
diff changeset
    91
qed "beta_cfun";