I can not see the difference between beta reduction and substitution.
For example:
(+ x 1) [x -> 2]
Here I can do the substitution, replace the variable x through 2(lambda expression) and result is:
(+ 2 1)
An example of beta reduction:
(λ x. + x 1) 2
the result would be
+ 2 1
For me, there are no difference between them, but there is a rule, I can not substitute the lambda expression, when the metavariable is bound
(λ x. + x 1) [x -> 2] No possible to substitute it.
Only free variables can be substitute it.
What is the difference between the diction:
(λ x. + x 1) 2
and
(λ x. + x 1) [x -> 2]
1 Answer 1
The $\beta$ reduction is defined by using capture-avoidng substitution. That is,
$$ (\lambda x. M)N \longrightarrow_\beta M[x \mapsto N] $$
So it's the definition. Under the $\beta$-equivalence, $(\lambda x. M)N \equiv_\beta M[x \mapsto N],ドル but syntactically, $(\lambda x. M)N \neq M[x \mapsto N]$.
Note that substitution is a meta-operation on $\lambda$-calculus terms (normally). A $\lambda$-calculus term $M$ is whether a variable $x,ドル a lambda abstraction $(\lambda x. M'),ドル or an application $M_1 M_2$. That's it. There is no substitution. Substitution is a map on $\lambda$-calculus terms. Therefore, for example, a term $({+}~x~y)[x \mapsto z]$ is syntactically equal to $({+}~z~y)$. There is no reduction. In contrast to this, $(\lambda x. {+}~x~y)~z$ is not syntactically equal to $({+}~z~y),ドル although it can be reduced to $({+}~x~y)$.
Also, $(\lambda x. {+}~x~1)~2$ is different from $(\lambda x. {+}~x~1)[x \mapsto 2]$. The latter is equal to $(\lambda x. {+}~x~1)$.
-
$\begingroup$ I think @chi's comment is very nice! Please check it too :) $\endgroup$nekketsuuu– nekketsuuu2017年02月03日 12:15:26 +00:00Commented Feb 3, 2017 at 12:15
-
1$\begingroup$ Just to muddy the waters, there are lambda calculi with explicit substitutions for which substitution is an object language level operation (as opposed to a meta-operation). In those, a single step of $\beta$-reduction will produce an explicit substitution which is unequivocally distinct from the redex. (Note, it is not necessarily the case that $(\lambda x.M)N \neq M[x\mapsto N]$ in the normal (non-explicit substitution) lambda calculus, though it usually is.) $\endgroup$Derek Elkins left SE– Derek Elkins left SE2017年02月03日 23:54:48 +00:00Commented Feb 3, 2017 at 23:54
-
$\begingroup$ @DerekElkins Is there any variant of the λ-calculus without explicit substitution which treats $(\lambda x. M)N = M[x \mapsto N]$ (syntactically)? If so, I think β-reductions would be unnecessary in the calculus. $\endgroup$nekketsuuu– nekketsuuu2017年02月05日 00:33:40 +00:00Commented Feb 5, 2017 at 0:33
-
$\begingroup$ @nekketsuuu I'm not quite sure what you mean. It sounds like you want to consider two terms equal if they are $\beta$-equivalent. This would kind of defeat the point. Also as $\beta$-equivalence is undecidable, this would be awkward. But maybe Böhm trees would interest you(?) $\endgroup$Derek Elkins left SE– Derek Elkins left SE2017年02月07日 04:39:00 +00:00Commented Feb 7, 2017 at 4:39
-
$\begingroup$ @DerekElkins Oh I misunderstood about the last sentence of your comment. Thank you. $\endgroup$nekketsuuu– nekketsuuu2017年02月07日 10:12:11 +00:00Commented Feb 7, 2017 at 10:12
xa metavariable? $\endgroup$