src/HOLCF/Lift.ML
author wenzelm
Mon, 03 Nov 1997 14:06:27 +0100
changeset 4098 71e05eb27fb6
parent 3842 b55686a7b22c
child 4477 b3e5857d8d99
permissions -rw-r--r--
isatool fixclasimp;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3655
0531f2c64c91 new extended adm tactic introduced;
mueller
parents: 3457
diff changeset
     1
(*  Title:      HOLCF/Lift.ML
0531f2c64c91 new extended adm tactic introduced;
mueller
parents: 3457
diff changeset
     2
    ID:         $Id$
0531f2c64c91 new extended adm tactic introduced;
mueller
parents: 3457
diff changeset
     3
    Author:     Olaf Mueller
0531f2c64c91 new extended adm tactic introduced;
mueller
parents: 3457
diff changeset
     4
    Copyright   1997 Technische Universitaet Muenchen
0531f2c64c91 new extended adm tactic introduced;
mueller
parents: 3457
diff changeset
     5
0531f2c64c91 new extended adm tactic introduced;
mueller
parents: 3457
diff changeset
     6
Theorems for Lift.thy
0531f2c64c91 new extended adm tactic introduced;
mueller
parents: 3457
diff changeset
     7
*)
0531f2c64c91 new extended adm tactic introduced;
mueller
parents: 3457
diff changeset
     8
3324
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
     9
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    10
(* ---------------------------------------------------------- *)
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    11
    section"Continuity Proofs for flift1, flift2, if";
3655
0531f2c64c91 new extended adm tactic introduced;
mueller
parents: 3457
diff changeset
    12
(* ---------------------------------------------------------- *)
3324
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    13
(* need the instance into flat *)
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    14
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    15
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    16
(* flift1 is continuous in its argument itself*)
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    17
goal thy "cont (lift_case UU f)"; 
3457
a8ab7c64817c Ran expandshort
paulson
parents: 3324
diff changeset
    18
by (rtac flatdom_strict2cont 1);
3324
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    19
by (Simp_tac 1);
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    20
qed"cont_flift1_arg";
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    21
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    22
(* flift1 is continuous in a variable that occurs only 
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    23
   in the Def branch *)
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    24
3842
b55686a7b22c fixed dots;
wenzelm
parents: 3661
diff changeset
    25
goal thy "!!f. [| !! a. cont (%y. (f y) a) |] ==> \
3324
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    26
\          cont (%y. lift_case UU (f y))";
3457
a8ab7c64817c Ran expandshort
paulson
parents: 3324
diff changeset
    27
by (rtac cont2cont_CF1L_rev 1);
3324
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    28
by (strip_tac 1);
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    29
by (res_inst_tac [("x","y")] Lift_cases 1);
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    30
by (Asm_simp_tac 1);
4098
71e05eb27fb6 isatool fixclasimp;
wenzelm
parents: 3842
diff changeset
    31
by (fast_tac (HOL_cs addss simpset()) 1);
3324
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    32
qed"cont_flift1_not_arg";
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    33
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    34
(* flift1 is continuous in a variable that occurs either 
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    35
   in the Def branch or in the argument *)
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    36
3842
b55686a7b22c fixed dots;
wenzelm
parents: 3661
diff changeset
    37
goal thy "!!f. [| !! a. cont (%y. (f y) a); cont g|] ==> \
3324
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    38
\   cont (%y. lift_case UU (f y) (g y))";
3457
a8ab7c64817c Ran expandshort
paulson
parents: 3324
diff changeset
    39
by (rtac cont2cont_app 1);
3324
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    40
back();
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    41
by (safe_tac set_cs);
3457
a8ab7c64817c Ran expandshort
paulson
parents: 3324
diff changeset
    42
by (rtac cont_flift1_not_arg 1);
a8ab7c64817c Ran expandshort
paulson
parents: 3324
diff changeset
    43
by (Auto_tac());
a8ab7c64817c Ran expandshort
paulson
parents: 3324
diff changeset
    44
by (rtac cont_flift1_arg 1);
3324
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    45
qed"cont_flift1_arg_and_not_arg";
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    46
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    47
(* flift2 is continuous in its argument itself *)
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    48
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    49
goal thy "cont (lift_case UU (%y. Def (f y)))";
3457
a8ab7c64817c Ran expandshort
paulson
parents: 3324
diff changeset
    50
by (rtac flatdom_strict2cont 1);
3324
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    51
by (Simp_tac 1);
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    52
qed"cont_flift2_arg";
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    53
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    54
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    55
(* ---------------------------------------------------------- *)
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    56
(*    Extension of cont_tac and installation of simplifier    *)
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    57
(* ---------------------------------------------------------- *)
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    58
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    59
bind_thm("cont2cont_CF1L_rev2",allI RS cont2cont_CF1L_rev);
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    60
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    61
val cont_lemmas_ext = [cont_flift1_arg,cont_flift2_arg,
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    62
                       cont_flift1_arg_and_not_arg,cont2cont_CF1L_rev2, 
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    63
                       cont_fapp_app,cont_fapp_app_app,cont_if];
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    64
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    65
val cont_lemmas2 =  cont_lemmas1 @ cont_lemmas_ext;
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    66
                 
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    67
Addsimps cont_lemmas_ext;         
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    68
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    69
fun cont_tac  i = resolve_tac cont_lemmas2 i;
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    70
fun cont_tacR i = REPEAT (cont_tac i);
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    71
4098
71e05eb27fb6 isatool fixclasimp;
wenzelm
parents: 3842
diff changeset
    72
fun cont_tacRs i = simp_tac (simpset() addsimps [flift1_def,flift2_def]) i THEN
3324
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    73
                  REPEAT (cont_tac i);
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    74
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    75
4098
71e05eb27fb6 isatool fixclasimp;
wenzelm
parents: 3842
diff changeset
    76
simpset_ref() := simpset() addSolver (K (DEPTH_SOLVE_1 o cont_tac));
3324
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    77
3661
1ea4a45b9412 moved extended adm_tac to new place
mueller
parents: 3655
diff changeset
    78
1ea4a45b9412 moved extended adm_tac to new place
mueller
parents: 3655
diff changeset
    79
3324
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    80
(* ---------------------------------------------------------- *)
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    81
              section"flift1, flift2";
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    82
(* ---------------------------------------------------------- *)
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    83
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    84
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    85
goal thy "flift1 f`(Def x) = (f x)";
4098
71e05eb27fb6 isatool fixclasimp;
wenzelm
parents: 3842
diff changeset
    86
by (simp_tac (simpset() addsimps [flift1_def]) 1);
3324
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    87
qed"flift1_Def";
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    88
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    89
goal thy "flift2 f`(Def x) = Def (f x)";
4098
71e05eb27fb6 isatool fixclasimp;
wenzelm
parents: 3842
diff changeset
    90
by (simp_tac (simpset() addsimps [flift2_def]) 1);
3324
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    91
qed"flift2_Def";
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    92
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    93
goal thy "flift1 f`UU = UU";
4098
71e05eb27fb6 isatool fixclasimp;
wenzelm
parents: 3842
diff changeset
    94
by (simp_tac (simpset() addsimps [flift1_def]) 1);
3324
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    95
qed"flift1_UU";
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    96
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    97
goal thy "flift2 f`UU = UU";
4098
71e05eb27fb6 isatool fixclasimp;
wenzelm
parents: 3842
diff changeset
    98
by (simp_tac (simpset() addsimps [flift2_def]) 1);
3324
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
    99
qed"flift2_UU";
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
   100
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
   101
Addsimps [flift1_Def,flift2_Def,flift1_UU,flift2_UU];
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
   102
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
   103
goal thy "!!x. x~=UU ==> (flift2 f)`x~=UU";
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
   104
by (def_tac 1);
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
   105
qed"flift2_nUU";
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
   106
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
   107
Addsimps [flift2_nUU];
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
   108
6b26b886ff69 Eliminated the prediates flat,chfin
slotosch
parents:
diff changeset
   109