ArticleslgStudy

mathematics

Fixed-point combinator

Fixed-point combinator is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Fixed-point combinator rather than just read about it. In short: In combinatory logic for computer science, a fixed-point combinator (or fixpoint combinator) is a higher-order function (i.e., a function that takes a function as argument) that returns some fixed point (a value that is mapped to itself) of its argument function, if one exists. Formally, if fix is a fixed-point combinator and the function f has one or more fixed points, then fix f is one of these fixed points, i.e…

Key takeaways

  • Fixed-point combinator belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Fixed-point combinator to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Fixed-point combinator from memory before moving on to harder problems.

Reference excerpt

In combinatory logic for computer science, a fixed-point combinator (or fixpoint combinator) is a higher-order function (i.e., a function that takes a function as argument) that returns some fixed point (a value that is mapped to itself) of its argument function, if one exists. Formally, if fix is a fixed-point combinator and the function f has one or more fixed points, then fix f is one of these fixed points, i.e.,

fix f =f (fix f). Fixed-point combinators can be defined in the lambda calculus and in functional programming languages, and provide a means to allow for recursive definitions.

Introduction Applied to a non-constant function of one variable that treats its argument as a piece of data (such as e.g. the sine function), the Y combinator usually does not terminate. Y really is meant to be used with codata, e.g. a colist constructor that places the first element there and expects "the rest of elements" as an argument, that will be fleshed out later; or a higher-order function that expects to be supplied as its first argument with a function "to compute the rest," which it might or might not call, as needed. Applied to such "one step functional," Y arranges for the creation of that "rest of computation" function, consisting of that same step it was given and the "rest of computation" again, which really means just the original step repeated as many times as needed, calling "the rest" function as and if needed, but not always. The resulting function behaves like a while or a for loop. Used in this way, the Y combinator implements general recursion. The lambda calculus does not have global names, for a function to refer to itself by name inside its own definition, as is possible in many programming languages. But it has local names, i.e. parameters in lambda abstractions. An abstraction term can receive another term as an argument, and refer to that argument by the parameter name inside the function's body. The Y combinator may also be used in implementing Curry's paradox. The heart of Curry's paradox is that untyped lambda calculus is unsound as a deductive system, and the Y combinator demonstrates this by allowing an anonymous expression to represent zero, or even many values. This is inconsistent in mathematical logic.

Y combinator in lambda calculus In the classical untyped lambda calculus, every function has a fixed point. A particular implementation of fix is Haskell Curry's paradoxical combinator Y, given by

Y=λf. (λx.f (x x)) (λx.f (x x)) (Here using the standard notations and conventions of lambda calculus: Y is a function that takes one argument f and returns the entire expression following the first period; the expression λx.f (x x) denotes a function that takes one argument x, thought of as a function, and returns the expression f (x x), where (x x) denotes x applied to itself. Juxtaposition of expressions denotes function application, is left-associative, and has higher precedence than the period.)

Verification The following calculation verifies that Yg is indeed a fixed point of the function g:

The lambda term g (Y g) may not, in general, β-reduce to the term Y g. However, both terms β-reduce to the same term, as shown.

Example implementations An example implementation of Y in the language R is presented below:This can then be used to implement factorial as follows:Y is only needed when function names are absent. Substituting all the definitions into one line so that function names are not required gives:This works because R uses lazy evaluation. Languages that use strict evaluation, such as Python, C++, and other strict programming languages, can often express Y; however, any implementation is useless in practice since it loops indefinitely until terminating via a stack overflow.

Fixed-point combinator The Y combinator is an implementation of a fixed-point combinator in lambda calculus. Fixed-point combinators may also be easily defined in other functional and imperative languages. The implementation in lambda calculus is more difficult due to limitations in lambda calculus. The fixed-point combinator may be used in a number of different areas:

General mathematics Untyped lambda calculus Typed lambda calculus Functional programming Imperative programming Fixed-point combinators may be applied to a range of different functions, but normally will not terminate unless there is an extra parameter. When the function to be fixed refers to its parameter, another call to the function is invoked, so the calculation never gets started. Instead, the extra parameter is used to trigger the start of the calculation. The type of the fixed point is the return type of the function being fixed. This may be a real or a function or any other type. In the untyped lambda calculus, the function to apply the fixed-point combinator to may be expressed using an encoding, like Church encoding. In this case particular lambda terms (which define functions) are considered as values. "Running" (beta reducing) the fixed-point combinator on the encoding gives a lambda term for the result, which may then be interpreted as fixed-point value. Alternately, a function may be considered as a lambda term defined purely in lambda calculus. These different approaches affect how a mathematician and a programmer may regard a fixed-point combinator. A mathematician may see the Y combinator applied to a function as being an expression satisfying the fixed-point equation, and therefore a solution. In contrast, a person only wanting to apply a fixed-point combinator to some general programming task may see it only as a means of implementing recursion.

Values and domains Many functions do not have any fixed points, for instance f:ℕ→ℕ with f(n)=n+1. Using Church encoding, natural numbers can be represented in lambda calculus, and this function f can be defined in lambda calculus. However, its domain will now contain all lambda expressions, not just those representing natural numbers. The Y combinator, applied to f, will yield a fixed-point for f, but this fixed-point won't represent a natural number. If trying to compute Y f in an actual programming language, an infinite loop will occur.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Fixed-point combinator

Start with the simplest possible case. Write down what Fixed-point combinator claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Fixed-point combinator before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Fixed-point combinator ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Fixed-point combinator

In research
Fixed-point combinator appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Fixed-point combinator in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Fixed-point combinator is common in secondary-school and first-year university syllabi. It links to neighbouring topics Combinatory logic, Fixed points (mathematics), Lambda calculus, so understanding it makes those chapters shorter.
In everyday life
Look for Fixed-point combinator outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Fixed-point combinator” →

How to study Fixed-point combinator in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Fixed-point combinator means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Fixed-point combinator out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Fixed-point combinator in simple terms?

In combinatory logic for computer science, a fixed-point combinator (or fixpoint combinator) is a higher-order function (i.e., a function that takes a function as argument) that returns some fixed point (a value that is mapped to itself) of its argument function, if one exists. Formally, if fix is…

Why does Fixed-point combinator matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Fixed-point combinator?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Fixed-point combinator.

Tags

  • Combinatory logic
  • Fixed points (mathematics)
  • Lambda calculus
  • Mathematics of computing
  • Programming language comparisons
  • Recursion

Keep exploring