Lambda Reduction

Lambda reduction is an umbrella term for all these transformations ā€” that is, alpha-, beta-, and eta-conversion. With these, we can step-by-step transform lambda expressions into simpler, equivalent forms.

Ī±- Conversion

This is essentially the renaming of variables. A lambda expression remains the same as long as we consistently rename the bound variables.

1šœ†š‘„.š‘„+1 is the same as šœ†š‘¦.š‘¦+1

Ī²- Reduction

Beta reduction is the actual execution of a function. That is applying a lambda expression to an argument.

1(šœ†š‘„.š‘„+1) 5 ā‡’ 5 + 1 ā‡’ 6

Ī·- Conversion

Eta conversion describes that two functions are considered equal if they produce the same result for all arguments.

1šœ†š‘„.š‘“ š‘„ is the same as š‘“

f: is a function

x: does not occur freely in f

This means that a function which does nothing but call another function is identical to that function.


Examples

Alpha-Conversion (Renaming Variables)

Question:

Perform an alpha-conversion on the following lambda expression:

1šœ†š‘„.š‘„Ā² + 2š‘„ + 1

Rename x to another variable ā€” but ensure that the meaning remains the same.

Solution:

1šœ†š‘„.š‘„Ā² + 2š‘„ + 1 ā†’ šœ†š‘¦.š‘¦Ā² + 2š‘¦ + 1

Following is valid, in the sence of an algebraic simplification, but its not an alpha conversion.

1š‘„Ā² + 2š‘„ + 1 = (š‘„ + 1)Ā²
2šœ†š‘„.(š‘„ + 1)Ā²


Question:

Which of the following expressions is an alpha-variant of šœ†š‘Ž.š‘Ž + 3 ?

a) šœ†š‘.š‘ + 3
b) šœ†š‘„.š‘„ + 3
c) šœ†š‘Ž.3 + š‘Ž

Solution: a and b are valid alpha variants for šœ†š‘Ž.š‘Ž + 3