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