Theoremcore
Kleene fixed-point theorem
Also called Kleene iteration theorem.
A continuous function on a complete partial order with a bottom has a least fixed point, the limit of the iterates from bottom.
The Kleene fixed-point theorem says how to compute a least fixed point. Start from the least element , apply the function again and again, and take the limit of the values. If the order is a complete partial order and the function is continuous, the limit is the least fixed point. This is the reason that iterative solvers for dataflow analysis and abstract interpretation give the right answer, and the reason that a recursive definition has a meaning. It is not the Kleene recursion theorem of computability, which is a different result about programs that can refer to their own code.
Statement
Orders. A partial order is a set with a reflexive, antisymmetric and transitive relation. A chain is a sequence . The least upper bound , when it exists, is an element above every and below every other element above every . is a complete partial order, or cpo, if it has a least element and every chain has a least upper bound.
Functions. is monotone if implies . It is continuous, in the sense of Scott, if it keeps the least upper bounds of chains: for every chain. A fixed point is an with , and a pre-fixed point is an with .
Theorem. Let be a cpo and continuous. Then:
- is monotone, and the iterates form a chain.
- is a fixed point of .
- for every pre-fixed point . So is the least pre-fixed point and the least fixed point of .
The dual. Turn the order upside down. If has a greatest element , every chain has a greatest lower bound, and keeps these bounds, then is the greatest fixed point and the greatest post-fixed point, that is the greatest with . Dataflow analysis in the meet convention of Kildall uses this form: the maximal fixed-point solution is the limit of the iterates from .
In plain words
Start with no knowledge at all. Apply one step of the definition and you know a little more. Apply it again and you know more again. The knowledge only grows, so the steps settle down to a limit.
The theorem says the limit is a solution, and that it is the smallest solution: it contains only what the definition forces and nothing else. This needs one condition. The function must not jump at the limit. Whatever it does to the limit must be the limit of what it does to the steps. When the set of possible values is finite, the condition always holds, and the steps stop after a finite number of rounds.
Proof
Part 1. Continuous implies monotone. Let . The sequence is a chain with least upper bound . Continuity gives , the least upper bound of . So is above . The iterates form a chain. because is least. If , monotonicity gives . By induction the sequence is a chain, and since is a cpo, exists.
Part 2. By continuity, applied to the chain of part 1,
The last chain is the first one without its first element . Adding to a set does not change its upper bounds, because every element is above . So the two chains have the same least upper bound, and .
Part 3. Let . We show for every by induction. For , . If , monotonicity gives . So is an upper bound of the chain, and because is the least upper bound. Every fixed point is a pre-fixed point, and is itself a fixed point by part 2, so it is the least fixed point and the least pre-fixed point.
The dual. Apply the theorem to with the order reversed. Its least element is , its chains are the decreasing chains of , and their least upper bounds are the greatest lower bounds in .
A worked example. Take the recursive definition fact(n) = if n == 0 then 1 else n * fact(n - 1) on the natural numbers. Let be the set of partial functions from to , ordered by inclusion of their graphs, so when agrees with wherever is defined. The least element is the empty function. A chain of partial functions agrees wherever two of them are defined, so the union of their graphs is a partial function, and it is the least upper bound. So is a cpo. The definition gives the function
reads only one value of , so is continuous: that value is already in some element of a chain. The iterates are , defined nowhere, , and . By induction, is the factorial function restricted to . Their union is the factorial function on all of , which is . Each iterate is what a program can compute with at most nested recursive calls.
Consequences
- Finite height makes every monotone function continuous. If every chain in is eventually constant, its least upper bound is its last value, and a monotone maps it to the last value of the image chain. So the iteration stops after at most steps on a lattice of height . This is the case of the fixed point page and of the classic dataflow problems. On a CFG with blocks, the product lattice has height , which bounds the number of rounds of the maximal fixed-point solution.
- Dataflow analysis. In the dual form, the maximal fixed-point solution is , and the MOP-MFP coincidence theorem describes each iterate exactly. Any fair order of updates, such as the worklist dataflow algorithm, reaches the same fixed point, because every value it computes stays above the greatest fixed point and it stops only at a fixed point.
- Abstract interpretation. An abstract interpreter computes the least fixed point of an abstract transformer. On a lattice with infinite chains, such as the interval domain, the iteration from may not stop, and a widening operator jumps ahead to a pre-fixed point. By part 3, any pre-fixed point is above the least fixed point, so the result is safe.
- Recursion and loops. In denotational semantics, the meaning of a recursive function or a
whileloop is the least fixed point of a continuous function on partial functions, as in the factorial example. Recursion in the lambda calculus gets its meaning the same way. - Datalog. The least model of a Datalog program is the least fixed point of its immediate-consequence function on sets of facts, which keeps unions of chains. Semi-naive evaluation computes the Kleene iterates with less repeated work.
- Process networks. The output of a Kahn process network is the least fixed point of the continuous function that the processes define on the histories of the channels.
- Proof by fixed-point induction. Part 3 gives a proof rule: to show , show . Dataflow and abstract interpretation use it to check that a candidate result is safe without running the solver.
Tightness
Continuity is needed for the limit at . Let with the usual order, so is above every number and is above . Every chain has a least upper bound: an eventually constant chain has its last value, and a chain that grows without bound in has . Let , and . Then is monotone, and the iterates are with least upper bound . But , so the limit is not a fixed point. The least fixed point is . Here is not continuous: but . For monotone functions in general, the iteration must go on through the ordinals; Cousot and Cousot (1979) gave this construction.
A least element is needed. Let be the integers with the usual order. Every chain is bounded by 0 and has a least upper bound, but there is no least element. The identity function is continuous, every element is a fixed point, and there is no least fixed point.
Completeness is needed. Let with , and . The function keeps every least upper bound that exists, but the chain has none, and has no fixed point at all.
The iteration need not stop. Let , the real numbers between 0 and 1, and . is a cpo, is continuous, and the iterates never reach the least fixed point 1. They reach it only at the limit. The bound of steps needs finite height.
Knaster-Tarski is a different trade. The Knaster-Tarski theorem needs only monotonicity, but it needs a complete lattice and it gives the least fixed point as the meet of all pre-fixed points, a formula that does not suggest a computation. The Kleene theorem asks for more of the function and less of the order, and it gives a computation in steps.
History
The theorem is named after Kleene because of his first recursion theorem (1952), which says that a recursive definition of a partial function has a least solution, the union of finite approximations. Tarski (1955) proved the existence of fixed points of monotone functions on complete lattices. In the 1970s, Scott made continuous functions on complete partial orders the basis of denotational semantics, and the iteration from became a standard tool, both there and in the dataflow analysis of Kildall. Lassez, Nguyen and Sonenberg (1982) wrote a short history of these fixed-point theorems and of how they came to carry their usual names. Cousot and Cousot (1979) extended the iteration to monotone functions with ordinal steps.
References
- Jean-Louis Lassez, V. L. Nguyen and Elizabeth A. Sonenberg, Fixed point theorems and semantics: a folk tale, Information Processing Letters 14(3), 1982, 112-116, the whole note (the history of the fixed-point theorems used in semantics, and how the iteration theorem came to carry the names of Kleene and Tarski)
- Alfred Tarski, A lattice-theoretical fixpoint theorem and its applications, Pacific Journal of Mathematics 5(2), 1955, 285-309, Theorem 1 (fixed points of a monotone function on a complete lattice, the version without continuity)
- Patrick Cousot and Radhia Cousot, Constructive versions of Tarski's fixed point theorems, Pacific Journal of Mathematics 82(1), 1979, 43-57, the least fixed point of a monotone function as the limit of an iteration from the bottom element through the ordinals
- B. A. Davey and H. A. Priestley, Introduction to Lattices and Order, second edition, Cambridge University Press, 2002, Chapter 8 (fixpoint theorems, complete partial orders and continuous maps, and the iteration of a continuous map from the bottom element)
Where this leads
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W4 complete |
|
Tag XVZ2Y8 Edit this page History Report an error Markdown