src/HOL/Subst/UTLemmas.ML
author clasohm
Tue, 21 Mar 1995 13:22:28 +0100
changeset 968 3cdaa8724175
child 1266 3ae9fe3c0f68
permissions -rw-r--r--
converted Subst with curried function application
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
968
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
     1
(*  Title: 	Substitutions/UTLemmas.ML
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
     2
    Author: 	Martin Coen, Cambridge University Computer Laboratory
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
     3
    Copyright   1993  University of Cambridge
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
     4
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
     5
For UTLemmas.thy.  
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
     6
*)
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
     7
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
     8
open UTLemmas;
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
     9
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    10
(***********)
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    11
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    12
val utlemmas_defs = [vars_of_def,occs_def];
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    13
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    14
local fun mk_thm s = prove_goalw UTLemmas.thy utlemmas_defs s 
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    15
                                 (fn _ => [simp_tac uterm_ss 1])
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    16
in val utlemmas_rews = map mk_thm 
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    17
      ["vars_of(Const(c)) = {}",
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    18
       "vars_of(Var(x)) = {x}",
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    19
       "vars_of(Comb t u) = vars_of(t) Un vars_of(u)",
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    20
       "t <: Const(c) = False",
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    21
       "t <: Var(x) = False",
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    22
       "t <: Comb u v = (t=u | t=v | t <: u | t <: v)"];
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    23
end;
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    24
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    25
val utlemmas_ss = prod_ss addsimps (setplus_rews @ uterm_rews @ utlemmas_rews);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    26
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    27
(****  occs irrefl ****)
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    28
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    29
goal UTLemmas.thy  "t <: u & u <: v --> t <: v";
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    30
by (uterm_ind_tac "v" 1);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    31
by (ALLGOALS (simp_tac utlemmas_ss));
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    32
by (fast_tac HOL_cs 1);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    33
val occs_trans  = store_thm("occs_trans", conjI RS (result() RS mp));
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    34
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    35
goal UTLemmas.thy   "~ t <: v --> ~ t <: u | ~ u <: v";
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    36
by (fast_tac (HOL_cs addIs [occs_trans]) 1);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    37
val contr_occs_trans  = store_thm("contr_occs_trans", result() RS mp);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    38
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    39
goal UTLemmas.thy   "t <: Comb t u";
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    40
by (simp_tac utlemmas_ss 1);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    41
qed "occs_Comb1";
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    42
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    43
goal UTLemmas.thy  "u <: Comb t u";
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    44
by (simp_tac utlemmas_ss 1);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    45
qed "occs_Comb2";
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    46
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    47
goal HOL.thy  "(~(P|Q)) = (~P & ~Q)";
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    48
by (fast_tac HOL_cs 1);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    49
qed "demorgan_disj";
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    50
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    51
goal UTLemmas.thy  "~ t <: t";
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    52
by (uterm_ind_tac "t" 1);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    53
by (ALLGOALS (simp_tac (utlemmas_ss addsimps [demorgan_disj])));
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    54
by (REPEAT (resolve_tac [impI,conjI] 1 ORELSE
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    55
            (etac contrapos 1 THEN etac subst 1 THEN 
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    56
             resolve_tac [occs_Comb1,occs_Comb2] 1) ORELSE
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    57
            (etac (contr_occs_trans RS disjE) 1 THEN assume_tac 2) ORELSE
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    58
            eresolve_tac ([occs_Comb1,occs_Comb2] RLN(2,[notE])) 1));
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    59
qed "occs_irrefl";
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    60
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    61
goal UTLemmas.thy  "t <: u --> ~t=u";
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    62
by (fast_tac (HOL_cs addEs [occs_irrefl RS notE]) 1);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    63
val occs_irrefl2  = store_thm("occs_irrefl2", result() RS mp);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    64
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    65
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    66
(**** vars_of lemmas  ****)
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    67
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    68
goal UTLemmas.thy "(v : vars_of(Var(w))) = (w=v)";
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    69
by (simp_tac utlemmas_ss 1);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    70
by (fast_tac HOL_cs 1);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    71
qed "vars_var_iff";
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    72
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    73
goal UTLemmas.thy  "(x : vars_of(t)) = (Var(x) <: t | Var(x) = t)";
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    74
by (uterm_ind_tac "t" 1);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    75
by (ALLGOALS (simp_tac utlemmas_ss));
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    76
by (fast_tac HOL_cs 1);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    77
qed "vars_iff_occseq";