-So here is a general method for taking an arbitrary h-style recursive function

+So here is a general method for taking an arbitrary `h`-style recursive function

and returning a fixed point for that function:

Y ≡ \h. (\u. h (u u)) (\u. h (u u))

@@ -386,12+390,11 @@ ignores its second argument. That means that no matter what we give

if `KX <~~> X`, `X` had also better ignore its first argument. But we

also have `KX ≡ (\xy.x)X ~~> \y.X`. This means that if `X` ignores

its first argument, then `\y.X` will ignore its first two arguments.

-So once again, if `KX <~~> X`, `X` also had better ignore at least its

+So once again, if `KX <~~> X`, `X` also had better ignore (at least) its

first two arguments. Repeating this reasoning, we realize that `X`

-must be a function that ignores an infinite series of arguments.

+must be a function that ignores as many arguments as you give it.

Our expectation, then, is that our recipe for finding fixed points

-will build us a function that somehow manages to ignore an infinite

-series of arguments.

+will build us a term that somehow manages to ignore arbitrarily many arguments.

h ≡ \xy.x

H ≡ \u.h(uu) ≡ \u.(\xy.x)(uu) ~~> \uy.uu

@@ -446,15+449,15 @@ Yes! That's exactly right. And which formula this is will depend on the particul

One (by now obvious) upshot is that the recipes that enable us to name

fixed points for any given formula aren't *guaranteed* to give us

-*terminating* fixed points. They might give us formulas X such that

-neither `X` nor `f X` have normal forms. (Indeed, what they give us

-for the square function isn't any of the Church numerals, but is

+*terminating* fixed points. They might give us formulas `ξ` such that

+neither `ξ` nor `f ξ` have normal forms. (Indeed, what they give us

+for the `square` function isn't any of the Church numerals, but is

rather an expression with no normal form.) However, if we take care we

can ensure that we *do* get terminating fixed points. And this gives

us a principled, fully general strategy for doing recursion. It lets

us define even functions like the Ackermann function, which were until

-now out of our reach. It would also let us define arithmetic and list

-functions on the "version 1" and "version 2" encodings, where it

+now out of our reach. It would also let us define list

+functions on [[the encodings we discussed last week|week3_lists#other-lists]], where it

wasn't always clear how to force the computation to "keep going."

###Varieties of fixed-point combinators###

@@ -503,19+506,19 @@ However, when we evaluate the application of our:

Ψ (\self (\xs. (empty? xs) 0 (succ (self (tail xs))) ))

-to some list `L`, we're not going to go into an infinite evaluation loop of that sort. At each cycle, we're going to be evaluating the application of:

+to some list, we're not going to go into an infinite evaluation loop of that sort. At each cycle, we're going to be evaluating the application of:

\xs. (empty? xs) 0 (succ (self (tail xs)))

-to *the tail* of the list we were evaluating its application to at the previous stage. Assuming our lists are finite (and the encodings we're using don't permit otherwise), at some point one will get a list whose tail is empty, and then the evaluation of that formula to that tail will return `0`. So the recursion eventually bottoms out in a base value.

+to *the tail* of the list we were evaluating its application to at the previous stage. Assuming our lists are finite (and the encodings we've been using so far don't permit otherwise), at some point one will get a list whose tail is empty, and then the evaluation of that formula to that tail will return `0`. So the recursion eventually bottoms out in a base value.

##Fixed-point Combinators Are a Bit Intoxicating##

-![tatoo](/y-combinator-fixed.jpg)

+[[tatto|/images/y-combinator-fixed.jpg]]

There's a tendency for people to say "Y-combinator" to refer to fixed-point combinators generally. We'll probably fall into that usage ourselves. Speaking correctly, though, the Y-combinator is only one of many fixed-point combinators.

-I used `Ψ` above to stand in for an arbitrary fixed-point combinator. I don't know of any broad conventions for this. But this seems a useful one.

+We used `Ψ` above to stand in for an arbitrary fixed-point combinator. We don't know of any broad conventions for this. But this seems a useful one.

As we said, there are many other fixed-point combinators as well. For example, Jan Willem Klop pointed out that if we define `L` to be: