src/HOL/Subst/Subst.ML
author paulson
Thu, 10 Oct 1996 11:58:40 +0200
changeset 2087 6405a3bb490b
parent 1465 5d7a7e439cec
child 3192 a75558a4ed37
permissions -rw-r--r--
Simpset removes the de Morgan laws
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1465
5d7a7e439cec expanded tabs
clasohm
parents: 1266
diff changeset
     1
(*  Title:      HOL/Subst/subst.ML
1266
3ae9fe3c0f68 added local simpsets
clasohm
parents: 972
diff changeset
     2
    ID:         $Id$
1465
5d7a7e439cec expanded tabs
clasohm
parents: 1266
diff changeset
     3
    Author:     Martin Coen, Cambridge University Computer Laboratory
968
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
     4
    Copyright   1993  University of Cambridge
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
     5
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
     6
For subst.thy.  
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
     7
*)
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
     8
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
     9
open Subst;
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
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    13
val subst_defs = [subst_def,comp_def,sdom_def];
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    14
1266
3ae9fe3c0f68 added local simpsets
clasohm
parents: 972
diff changeset
    15
val raw_subst_ss = simpset_of "UTLemmas" addsimps al_rews;
968
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    16
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    17
local fun mk_thm s = prove_goalw Subst.thy subst_defs s 
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    18
                                 (fn _ => [simp_tac raw_subst_ss 1])
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    19
in val subst_rews = map mk_thm 
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    20
["Const(c) <| al = Const(c)",
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    21
 "Comb t u <| al = Comb (t <| al) (u <| al)",
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    22
 "[] <> bl = bl",
972
e61b058d58d2 changed syntax of tuples from <..., ...> to (..., ...)
clasohm
parents: 968
diff changeset
    23
 "((a,b)#al) <> bl = (a,b <| bl) # (al <> bl)",
968
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    24
 "sdom([]) = {}",
972
e61b058d58d2 changed syntax of tuples from <..., ...> to (..., ...)
clasohm
parents: 968
diff changeset
    25
 "sdom((a,b)#al) = (if Var(a)=b then (sdom al) Int Compl({a}) \
968
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    26
\                               else (sdom al) Un {a})"
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    27
];
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    28
   (* This rewrite isn't always desired *)
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    29
   val Var_subst = mk_thm "Var(x) <| al = assoc x (Var x) al";
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    30
end;
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    31
2087
6405a3bb490b Simpset removes the de Morgan laws
paulson
parents: 1465
diff changeset
    32
val subst_ss = raw_subst_ss addsimps subst_rews 
6405a3bb490b Simpset removes the de Morgan laws
paulson
parents: 1465
diff changeset
    33
                            delsimps [de_Morgan_conj, de_Morgan_disj];
968
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    34
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    35
(**** Substitutions ****)
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    36
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    37
goal Subst.thy "t <| [] = t";
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    38
by (uterm_ind_tac "t" 1);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    39
by (ALLGOALS (asm_simp_tac (subst_ss addsimps [Var_subst])));
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    40
qed "subst_Nil";
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    41
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    42
goal Subst.thy "t <: u --> t <| s <: u <| s";
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    43
by (uterm_ind_tac "u" 1);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    44
by (ALLGOALS (asm_simp_tac subst_ss));
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    45
val subst_mono  = store_thm("subst_mono", result() RS mp);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    46
972
e61b058d58d2 changed syntax of tuples from <..., ...> to (..., ...)
clasohm
parents: 968
diff changeset
    47
goal Subst.thy  "~ (Var(v) <: t) --> t <| (v,t <| s)#s = t <| s";
968
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    48
by (imp_excluded_middle_tac "t = Var(v)" 1);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    49
by (res_inst_tac [("P",
972
e61b058d58d2 changed syntax of tuples from <..., ...> to (..., ...)
clasohm
parents: 968
diff changeset
    50
    "%x.~x=Var(v) --> ~(Var(v) <: x) --> x <| (v,t<|s)#s=x<|s")]
968
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    51
    uterm_induct 2);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    52
by (ALLGOALS (simp_tac (subst_ss addsimps [Var_subst])));
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    53
by (fast_tac HOL_cs 1);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    54
val Var_not_occs  = store_thm("Var_not_occs", result() RS mp);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    55
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    56
goal Subst.thy
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    57
    "(t <|r = t <|s) = (! v.v : vars_of(t) --> Var(v) <|r = Var(v) <|s)";
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    58
by (uterm_ind_tac "t" 1);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    59
by (REPEAT (etac rev_mp 3));
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    60
by (ALLGOALS (asm_simp_tac subst_ss));
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    61
by (ALLGOALS (fast_tac HOL_cs));
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    62
qed "agreement";
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    63
972
e61b058d58d2 changed syntax of tuples from <..., ...> to (..., ...)
clasohm
parents: 968
diff changeset
    64
goal Subst.thy   "~ v: vars_of(t) --> t <| (v,u)#s = t <| s";
968
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    65
by(simp_tac(subst_ss addsimps [agreement,Var_subst]
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    66
                     setloop (split_tac [expand_if])) 1);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    67
val repl_invariance  = store_thm("repl_invariance", result() RS mp);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    68
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    69
val asms = goal Subst.thy 
972
e61b058d58d2 changed syntax of tuples from <..., ...> to (..., ...)
clasohm
parents: 968
diff changeset
    70
     "v : vars_of(t) --> w : vars_of(t <| (v,Var(w))#s)";
968
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    71
by (uterm_ind_tac "t" 1);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    72
by (ALLGOALS (asm_simp_tac (subst_ss addsimps [Var_subst])));
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    73
val Var_in_subst  = store_thm("Var_in_subst", result() RS mp);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    74
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    75
(**** Equality between Substitutions ****)
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    76
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    77
goalw Subst.thy [subst_eq_def] "r =s= s = (! t.t <| r = t <| s)";
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    78
by (simp_tac subst_ss 1);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    79
qed "subst_eq_iff";
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    80
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    81
local fun mk_thm s = prove_goal Subst.thy s
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    82
                  (fn prems => [cut_facts_tac prems 1,
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    83
                                REPEAT (etac rev_mp 1),
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    84
                                simp_tac (subst_ss addsimps [subst_eq_iff]) 1])
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    85
in 
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    86
  val subst_refl      = mk_thm "r = s ==> r =s= s";
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    87
  val subst_sym       = mk_thm "r =s= s ==> s =s= r";
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    88
  val subst_trans     = mk_thm "[| q =s= r; r =s= s |] ==> q =s= s";
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    89
end;
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    90
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    91
val eq::prems = goalw Subst.thy [subst_eq_def] 
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    92
    "[| r =s= s; P (t <| r) (u <| r) |] ==> P (t <| s) (u <| s)";
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    93
by (resolve_tac [eq RS spec RS subst] 1);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    94
by (resolve_tac (prems RL [eq RS spec RS subst]) 1);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    95
qed "subst_subst2";
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    96
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    97
val ssubst_subst2 = subst_sym RS subst_subst2;
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    98
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
    99
(**** Composition of Substitutions ****)
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   100
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   101
goal Subst.thy "s <> [] = s";
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   102
by (alist_ind_tac "s" 1);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   103
by (ALLGOALS (asm_simp_tac (subst_ss addsimps [subst_Nil])));
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   104
qed "comp_Nil";
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   105
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   106
goal Subst.thy "(t <| r <> s) = (t <| r <| s)";
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   107
by (uterm_ind_tac "t" 1);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   108
by (ALLGOALS (asm_simp_tac (subst_ss addsimps [Var_subst])));
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   109
by (alist_ind_tac "r" 1);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   110
by (ALLGOALS (asm_simp_tac (subst_ss addsimps [Var_subst,subst_Nil]
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   111
                                     setloop (split_tac [expand_if]))));
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   112
qed "subst_comp";
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   113
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   114
goal Subst.thy "(q <> r) <> s =s= q <> (r <> s)";
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   115
by (simp_tac (subst_ss addsimps [subst_eq_iff,subst_comp]) 1);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   116
qed "comp_assoc";
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   117
972
e61b058d58d2 changed syntax of tuples from <..., ...> to (..., ...)
clasohm
parents: 968
diff changeset
   118
goal Subst.thy "(w,Var(w) <| s)#s =s= s"; 
968
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   119
by (rtac (allI RS (subst_eq_iff RS iffD2)) 1);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   120
by (uterm_ind_tac "t" 1);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   121
by (REPEAT (etac rev_mp 3));
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   122
by (ALLGOALS (simp_tac (subst_ss addsimps[Var_subst]
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   123
                                 setloop (split_tac [expand_if]))));
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   124
qed "Cons_trivial";
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   125
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   126
val [prem] = goal Subst.thy "q <> r =s= s ==>  t <| q <| r = t <| s";
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   127
by (simp_tac (subst_ss addsimps [prem RS (subst_eq_iff RS iffD1),
1465
5d7a7e439cec expanded tabs
clasohm
parents: 1266
diff changeset
   128
                                subst_comp RS sym]) 1);
968
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   129
qed "comp_subst_subst";
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   130
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   131
(****  Domain and range of Substitutions ****)
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   132
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   133
goal Subst.thy  "(v : sdom(s)) = (~ Var(v) <| s = Var(v))";
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   134
by (alist_ind_tac "s" 1);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   135
by (ALLGOALS (asm_simp_tac (subst_ss addsimps [Var_subst]
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   136
                            setloop (split_tac[expand_if]))));
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   137
by (fast_tac HOL_cs 1);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   138
qed "sdom_iff";
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   139
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   140
goalw Subst.thy [srange_def]  
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   141
   "v : srange(s) = (? w.w : sdom(s) & v : vars_of(Var(w) <| s))";
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   142
by (fast_tac set_cs 1);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   143
qed "srange_iff";
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   144
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   145
goal Subst.thy  "(t <| s = t) = (sdom(s) Int vars_of(t) = {})";
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   146
by (uterm_ind_tac "t" 1);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   147
by (REPEAT (etac rev_mp 3));
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   148
by (ALLGOALS (simp_tac (subst_ss addsimps [sdom_iff,Var_subst])));
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   149
by (ALLGOALS (fast_tac set_cs));
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   150
qed "invariance";
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   151
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   152
goal Subst.thy  "v : sdom(s) -->  ~v : srange(s) --> ~v : vars_of(t <| s)";
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   153
by (uterm_ind_tac "t" 1);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   154
by (imp_excluded_middle_tac "x : sdom(s)" 1);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   155
by (ALLGOALS (asm_simp_tac (subst_ss addsimps [sdom_iff,srange_iff])));
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   156
by (ALLGOALS (fast_tac set_cs));
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   157
val Var_elim  = store_thm("Var_elim", result() RS mp RS mp);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   158
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   159
val asms = goal Subst.thy 
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   160
     "[| v : sdom(s); v : vars_of(t <| s) |] ==>  v : srange(s)";
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   161
by (REPEAT (ares_tac (asms @ [Var_elim RS swap RS classical]) 1));
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   162
qed "Var_elim2";
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   163
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   164
goal Subst.thy  "v : vars_of(t <| s) --> v : srange(s) | v : vars_of(t)";
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   165
by (uterm_ind_tac "t" 1);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   166
by (REPEAT_SOME (etac rev_mp ));
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   167
by (ALLGOALS (simp_tac (subst_ss addsimps [sdom_iff,srange_iff])));
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   168
by (REPEAT (step_tac (set_cs addIs [vars_var_iff RS iffD1 RS sym]) 1));
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   169
by (etac notE 1);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   170
by (etac subst 1);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   171
by (ALLGOALS (fast_tac set_cs));
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   172
val Var_intro  = store_thm("Var_intro", result() RS mp);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   173
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   174
goal Subst.thy
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   175
    "v : srange(s) --> (? w.w : sdom(s) & v : vars_of(Var(w) <| s))";
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   176
by (simp_tac (subst_ss addsimps [srange_iff]) 1);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   177
val srangeE  = store_thm("srangeE", make_elim (result() RS mp));
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   178
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   179
val asms = goal Subst.thy
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   180
   "sdom(s) Int srange(s) = {} = (! t.sdom(s) Int vars_of(t <| s) = {})";
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   181
by (simp_tac subst_ss 1);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   182
by (fast_tac (set_cs addIs [Var_elim2] addEs [srangeE]) 1);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   183
qed "dom_range_disjoint";
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   184
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   185
val asms = goal Subst.thy "~ u <| s = u --> (? x.x : sdom(s))";
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   186
by (simp_tac (subst_ss addsimps [invariance]) 1);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   187
by (fast_tac set_cs 1);
3cdaa8724175 converted Subst with curried function application
clasohm
parents:
diff changeset
   188
val subst_not_empty  = store_thm("subst_not_empty", result() RS mp);