SUBST : (term,thm) subst -> term -> thm -> thm
A1 |- t1 = u1 , ... , An |- tn = un , A |- t[t1,...,tn]
-------------------------------------------------------------
A u A1 u ... u An |- t[u1,...,un]
SUBST [x1 |-> (A1 |- t1=u1) ,..., xn |-> (An |- tn=un)]
t[x1,...,xn]
(A |- t[t1,...,tn])
The assumptions of the returned theorem may not contain all the assumptions A1 u ... u An if some of them are not required. In particular, if the theorem Ak |- tk = uk is unnecessary because xk does not appear in the template, then Ak is not be added to the assumptions of the returned theorem.
- val x = “x:num”
and y = “y:num”
and th0 = SPEC “0” arithmeticTheory.ADD1
and th1 = SPEC “1” arithmeticTheory.ADD1;
(* x = `x`
y = `y`
th0 = |- SUC 0 = 0 + 1
th1 = |- SUC 1 = 1 + 1 *)
- SUBST [x |-> th0, y |-> th1]
“(x+y) > SUC 0”
(ASSUME “(SUC 0 + SUC 1) > SUC 0”);
> val it = [.] |- (0 + 1) + 1 + 1 > SUC 0 : thm
- SUBST [x |-> th0, y |-> th1]
“(SUC 0 + y) > SUC 0”
(ASSUME “(SUC 0 + SUC 1) > SUC 0”);
> val it = [.] |- SUC 0 + 1 + 1 > SUC 0 : thm
- SUBST [x |-> th0, y |-> th1]
“(x+y) > x”
(ASSUME “(SUC 0 + SUC 1) > SUC 0”);
> val it = [.] |- (0 + 1) + 1 + 1 > 0 + 1 : thm