Β reduce a redex - Lambda Calculus.

  • Context: MHB 
  • Thread starter Thread starter JamesBwoii
  • Start date Start date
  • Tags Tags
    Calculus Lambda
Click For Summary
SUMMARY

The discussion focuses on the process of β-reduction in Lambda Calculus, specifically addressing the substitution of free variables. The formula for β-reduction is defined as $(\lambda x.M)N \to_{\beta} M[N\x]$, where every free instance of x in M is replaced by N. A key example discussed is $(\lambda x. \lambda y.yx)(\lambda x.xy)$, which correctly reduces to $\lambda z.z(\lambda x.xy)$ after renaming the bound variable y to z to avoid conflicts. The necessity of renaming bound variables during substitution is emphasized, with references to additional examples and the importance of using the correct notation for substitutions.

PREREQUISITES
  • Understanding of Lambda Calculus notation and concepts
  • Familiarity with variable binding and free variables
  • Knowledge of substitution rules in formal systems
  • Experience with mathematical notation in LaTeX
NEXT STEPS
  • Study the concept of variable renaming in Lambda Calculus
  • Learn about normal forms and reduction strategies in Lambda Calculus
  • Explore the implications of free and bound variables in functional programming
  • Review LaTeX commands for mathematical expressions and substitutions
USEFUL FOR

Students and educators in computer science, particularly those studying functional programming and formal methods, as well as anyone interested in the theoretical foundations of computation.

JamesBwoii
Messages
71
Reaction score
0
As far as I understand it to reduce the formula is:

$(\lambda x.M)N -> β M[N\x]$

Where:

$β M[N\x]$ means M with every free x replaced by N.

I'm stuck on this one though.

$(\lambda x. \lambda y.yx)(\lambda x.xy)$

I know that the answer should be $\lambda z.z(\lambda x.xy)$ but I can't get it.
 
Technology news on Phys.org
The substituted term $\lambda x.\,xy$ has a free variable $y$. If it is substituted into $\lambda y.\,yx$ instead of $x$, that free $y$ would become bound, which is wrong. Therefore, the bound $y$ in $\lambda y.\,yx$ has to be renamed first, say, to $z$; then $x$ can be replaced with $\lambda x.\,xy$.

See Wikipedia for the definition of substitution and an example where renaming is necessary. Here are two other examples (renaming is required at some point in finding the normal form, not necessarily during the first reduction).

\((\lambda x.xx)(\lambda yz.yz)\)
\(\lambda xy.(\lambda z.(\lambda x.zx)(\lambda y.zy))(xy)\)

Edit: Does your course really use backslash to denote substitutions? If so, use the [m]\backslash[/m] command in math mode, e.g., $(\lambda x.\,M)N\to_{\beta} M[N\backslash x]$.
 
Evgeny.Makarov said:
The substituted term $\lambda x.\,xy$ has a free variable $y$. If it is substituted into $\lambda y.\,yx$ instead of $x$, that free $y$ would become bound, which is wrong. Therefore, the bound $y$ in $\lambda y.\,yx$ has to be renamed first, say, to $z$; then $x$ can be replaced with $\lambda x.\,xy$.

See Wikipedia for the definition of substitution and an example where renaming is necessary. Here are two other examples (renaming is required at some point in finding the normal form, not necessarily during the first reduction).

\((\lambda x.xx)(\lambda yz.yz)\)
\(\lambda xy.(\lambda z.(\lambda x.zx)(\lambda y.zy))(xy)\)

Edit: Does your course really use backslash to denote substitutions? If so, use the [m]\backslash[/m] command in math mode, e.g., $(\lambda x.\,M)N\to_{\beta} M[N\backslash x]$.

Thank you, I understand it now. :)
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 6 ·
Replies
6
Views
3K
Replies
2
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
Replies
2
Views
5K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 0 ·
Replies
0
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 1 ·
Replies
1
Views
1K