Alpha Equivalence
Renaming bound variables preserves meaning. Lambda x.x = lambda y.y.
Lambda calculus has infinitely many ways to write the same function.
λx.x, λy.y, λz.z -- all describe the identity. We need a formal
way to say "these are the same term." That is alpha equivalence.
What Is Alpha Equivalence?
Two lambda terms are alpha-equivalent (written =α) if one can
be obtained from the other by consistently renaming bound variables.
λx.x =α λy.y =α λz.z
All three are the identity function. The name of the bound variable
does not affect what the term does -- only the binding structure
matters. Think of the variable name as a label connecting a λ to
the positions it controls.
Renaming Bound Variables
An $\alpha$-rename changes a bound variable name. To rename x to z
in λx.x:
- Change the binder:
λxbecomesλz - Change every occurrence that
λxbinds:xbecomesz - Result:
λz.z
Both the binder and its bound occurrences must change together.
Changing only one would break the connection between the λ and
the positions it controls.
Are These Alpha-Equivalent?
Two terms are alpha-equivalent when they have the same binding
structure -- the same pattern of which λ controls which
positions. The variable names are interchangeable labels.
λx.x =α λy.y -- same structure (binder controls one position)
λx.x y ≠α λx.x z -- different free variables (y vs z)
Only bound variable names can differ between alpha-equivalent terms. Free variables must match exactly.
Free Variables Cannot Be Renamed
$\alpha$-renaming applies only to bound variables. Free variables cannot be renamed because they refer to something outside the term.
λx.x y -- x is bound, y is free.
- Rename
xtoz:λz.z y-- valid $\alpha$-rename, same term - Rename
ytoz:λx.x z-- not an $\alpha$-rename, different term
Changing a free variable changes what the term depends on. y and
z are different external references.
The Capture Trap
You cannot alpha-rename a bound variable to a name that already appears free in the body. This would capture the free variable.
Consider λx.x y:
xis bound,yis free- Rename
xtoz:λz.z y-- safe,yis still free - Rename
xtoy:λy.y y-- wrong! The freeyis now bound byλy. The term's meaning has changed.
λx.x y applies its argument to y. But λy.y y applies its
argument to itself. These are completely different functions.
Why Alpha Equivalence Matters
$\alpha$-equivalence is practically useful because it lets us choose convenient names for bound variables.
Suppose we want to apply λx.λy.x to y. Naive substitution
would give λy.y -- but that captures the free y! Because of
$\alpha$-equivalence, we can first rename the inner bound variable:
λx.λy.x =α λx.λw.x. Now substitution gives λw.y, which is
correct.
Without $\alpha$-equivalence, substitution would be broken. With it, we can always rename to avoid collisions.
Structure, Not Names
What matters for alpha equivalence is the binding structure --
which λ controls which variable positions.
λx.λy.x and λa.λb.a are alpha-equivalent:
- Both have an outer binder controlling the body variable
- Both have an inner binder that binds nothing in the body
- The names
x/aandy/bare different, but the structure is the same
λx.λy.x and λa.λb.b are not alpha-equivalent:
- In the first, the outer binder controls the body variable
- In the second, the inner binder controls the body variable
- Different structure, different meaning
Renaming One Binder at a Time
In a term with multiple λs, each binder is independent. You can
$\alpha$-rename one without touching the others.
Consider λx.λy.x y:
- Rename
xtoz:λz.λy.z y-- onlyxand its binder change - Rename
ytow:λx.λw.x w-- onlyyand its binder change
Each λ controls its own set of occurrences. Renaming one binder
affects only the variables it binds, leaving everything else
untouched.
Alpha Equivalence Check
To check alpha equivalence, compare the binding structure: which binder (by position, not name) controls which body variable (by position, not name).
λx.λy.y and λa.λb.b:
- In both, the inner binder controls the body variable
- Alpha-equivalent: same structure, different labels
λx.λy.y and λa.λb.a:
- First: inner binder controls the body variable
- Second: outer binder controls the body variable
- Not alpha-equivalent: different structure
Perform an Alpha-Rename
To alpha-rename a bound variable, change the binder and every occurrence it binds to the new name. The result is alpha-equivalent to the original.
Example: rename x to w in λx.x y
- Change
λxtoλw - Change the bound
xtow - Result:
λw.w y
The free variable y is untouched -- it is not controlled by λx.
Ready to test your understanding?
Bitwit uses spaced repetition to help you truly master concepts like this—not just read about them. Each card generates with different values, so you can't just memorize answers.
Practice Alpha Equivalence →