# \DOC SUBST \SYNOPSIS

```\DOC SUBST
\TYPE {SUBST : (term,thm) subst -&gt; term -&gt; thm -&gt; thm}
\SYNOPSIS
Makes a set of parallel substitutions in a theorem.
\KEYWORDS
rule.
\DESCRIBE
Implements the following rule of simultaneous substitution
{
A1 |- t1 = u1 , ... , An |- tn = un ,
A |- t[t1,...,tn]
------------------------------------------------------------A u A1 u ... u An |- t[u1,...,un]
}
Evaluating
{
SUBST [x1 |-&gt; (A1 |- t1=u1) ,..., xn |-&gt; (An |- tn=un)]
t[x1,...,xn]
(A |- t[t1,...,tn])
}
returns the theorem {A1 u ... An |- t[u1,...,un]}. The term
argument {t[x1,...,xn]} is a template which should match the conclusion
of the theorem being substituted into, with the variables {x1}, ... ,
{xn} marking those places where occurrences of {t1}, ... , {tn} are to
be replaced by the terms {u1}, ... , {un}, respectively. The occurrence
of {ti} at the places marked by {xi} must be free (i.e. {ti} must not
contain any bound variables). {SUBST} automatically renames bound
variables to prevent free variables in {ui} becoming bound after
substitution.
\FAILURE
If the template does not match the conclusion of the hypothesis, or the
terms in the conclusion marked by the variables {x1}, ... , {xn} in the
template are not identical to the left hand sides of the supplied
equations (i.e. the terms {t1}, ... , {tn}).
\EXAMPLE
{
- val x =
and y =
and th0
and th1
(*
x
y
th0
th1
=
=
=
=
`x`
`y`
|- SUC 0 = 0 + 1
|- SUC 1 = 1 + 1
*)
- SUBST [x |-&gt; th0, y |-&gt; th1]
(--`(x+y) &gt; SUC 0`--)
(ASSUME (--`(SUC 0 + SUC 1) &gt; SUC 0`--));
&gt; val it = [.] |- (0 + 1) + 1 + 1 &gt; SUC 0 : thm
- SUBST [x |-&gt; th0, y |-&gt; th1]
(--`(SUC 0 + y) &gt; SUC 0`--)
(ASSUME (--`(SUC 0 + SUC 1) &gt; SUC 0`--));
&gt; val it = [.] |- SUC 0 + 1 + 1 &gt; SUC 0 : thm
- SUBST [x |-&gt; th0, y |-&gt; th1]
(--`(x+y) &gt; x`--)
(ASSUME (--`(SUC 0 + SUC 1) &gt; SUC 0`--));
&gt; val it = [.] |- (0 + 1) + 1 + 1 &gt; 0 + 1 : thm
}