I need to simplify this expression.
$(\lambda y. z)((\lambda x. x x)(\lambda x. x x))$
However, what's interesting to me are two things:
Should I start simplifying $((\lambda x. x x)(\lambda x. x x))$ first because they fall under the same pair of brackets? This sort of reminds me of $2+(3+4)$ but of course we know that addition is associative
What do I do with $((\lambda x. x x)(\lambda x. x x))$? This is an irreducible form using alpha, beta and eta reductions.
What I tried doing is first simplifying $(\lambda x.xx)(\lambda x.xx)$, but I just get the same expression all over again. This is because this is irreducible using alpha, beta and eta rules. Right now, I am not sure if I should already call this simplified as much as possible, or is there something else I am not aware of.
You are right. The expression $(\lambda x.xx)(\lambda x.xx)$ can't be reduced any more. It is a famous example of a lambda expression that doesn't have a normal form.
In the untyped lambda calculus we can do beta reduction on any redex. By Church-Rosser theorem order of beta reductions is not important.
Therefore, it is better to do a beta reduction of outer redex $(\lambda y.z) M \rightarrow_\beta z$. Result is, of course, in a normal form.
But as you can see, you would get the same result even if you did $n$ reductions of inner redex and then do a reduction of outer redex. This is a demonstration of Church-Rosser theorem.