I'm having some problems with the b-reduction of the next two lambda expressions, somebody can explain me a little bit how to solve them:
(λ f . λ x . f (f x))
(λ x . x (λ x . λ y . x))
I'm having some problems with the b-reduction of the next two lambda expressions, somebody can explain me a little bit how to solve them:
(λ f . λ x . f (f x))
(λ x . x (λ x . λ y . x))
So, lambda calculus is a lot like using parameters in programming. The lambda marks a function and the name marks the parameter's name and what is is being passed to it. The rest of it is just the input to the code.
So, using your first example:
(λ f . λ x . f (f x))
(f x) is the input
λ f is the function, think of f as the parameter name
f is how it is being applied.
For now, λ x can be ignored.
So the first reduction would be taking (f x), realizing it is a parameter for f, then passing it to the f function to be applied at the second f. So after the first step, it would look something like
(λ f . λ x . f (f x))
(f x) passed to f
((f x) . λ x . f )
(f x) Being applied to the function
λ x . f x
There is one more step to do but I'll let you do it.
Also, when there are no parenthesis, treat the input as two different values. This guy is really helpful on explaining it. https://www.youtube.com/watch?v=S_WzF6BHadc He does have a lecture series up.