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