Substitution
Let
- x, y be instances of Symbol,
- i an instance of Integer,
and
-
a, b, c, d be instances of
Math.
Substitution of a for x in b is denoted
by b[x:=a].
We assume that the symbols used as locals in b do not
occur in a.
-
y[x:=a] = if x == y then a else y
-
i[x:=a] = i
-
Application( function=b, argument=c)[x:=a] =
Application( function=b[x:=a], argument=c[x:=a])
-
Abstraction( local=y, domain=b, body=c)[x:=a] =
if x == y then
Abstraction( local=y, domain=b[x:=a], body=c)
else
Abstraction( local=y, domain=b[x:=a], body=c[x:=a])
-
PiType( local=y, domain=b, range=c)[x:=a] =
if x == y then
PiType( local=y, domain=b[x:=a], range=c)
else
PiType( local=y, domain=b[x:=a], range=c[x:=a])
-
Fst( pair=b)[x:=a] = Fst( pair=b[x:=a])
-
Snd( pair=b)[x:=a] = Snd( pair=b[x:=a])
-
Pair( local=y, fst=b, snd=c, sndtype=d)[x:=a] =
if x == y then
Pair( local=y, fst=b[x:=a], snd=c[x:=a], sndtype=d)
else
Pair( local=y, fst=b[x:=a], snd=c[x:=a], sndtype=d[x:=a])
-
SigmaType( local=y, fsttype=b, sndtype=c)[x:=a] =
if x == y then
SigmaType( local=y, fsttype=b[x:=a], sndtype=c)
else
SigmaType( local=y,
fsttype=b[x:=a], sndtype=c[x:=a])