Punto fijo, ¿qué significa en el mundo de la informática?

19

Sigo encontrando referencias a puntos fijos en preguntas y respuestas en stackexchange y busco el significado en la web, obviamente, encuentro referencias en sitios como Wikipedia. Sin embargo, ninguna de las referencias realmente responde a mi pregunta de qué es un punto fijo y qué significa en el mundo de la informática.

Guy Coder
fuente
1
Incluso si la noción de punto fijo generalmente se deriva de algún par tal que f ( x ) = x , hay muchos marcos diferentes donde el término se usa con diferentes significados y consecuencias. F,XF(X)=X
Raphael
Esto me ayudó. Tipos recursivos gratis!
Guy Coder

Respuestas:

17

En ciencias de la computación, el uso indiscutiblemente más destacado de los puntos fijos es en la teoría de redes ¹. Un enrejado es un conjunto parcialmente ordenado con la propiedad adicional de que dados dos elementos x , y S , el conjunto { x , y } tiene tanto un supremum como un infimum (en S ).(S,)X,yS{X,y}S

Ahora a menudo considera las funciones monótonas en esta red que "convergen", es decir, para algunos x S tiene f ( x ) = x . Resultados importantes en esta área son el teorema de punto fijo de Kleene y elFXSF(X)=X teorema de Knaster-Tarski .

Un ejemplo destacado es la red para un conjunto de A y f inducida por una definición inductiva. Por ejemplo, dejemos A = { a , b } y definimos un lenguaje L 2 { a , b } por(2UN,)UNFUN={a,b}L2{a,b}

wLε,aLawLbawLbwLabw,bbwL

Esta definición inductiva corresponde a la función monótona.

f(A)={ε,a}A{bawawL}{abw,bbwbwL}

By Knaster-Tarski theorem, we know f has a smallest fixpoint which is a supremum of all smaller "intermediate results" (which correspond to finitely often applying the constructors of the inductive definition), and that smallest fixpoint is indeed L.

By the way, the largest fixpoint also has uses; see here for an example.


In recursion theory, there is another fixed-point theorem, also due to Kleene. It says²,

Let φ a Gödel numbering³ and r:NN a total, computable function (intuition: a compiler). Then there is iN such that φr(i)=φi.

In fact, there are even infinitely many such i; if there where only finitely many, we could patch r (by table-lookup) to not have fixed-points, contradicting the theorem.


  1. Everybody uses it every day, even if you don't realise it.
  2. I don't like that Wikipedia article; you are probably better off checking a genre book.
  3. A special kind of function numbering. For intuition, think of it as a (Turing-complete) programming language.
Raphael
fuente
13

Let me elaborate a bit on meisterluk's answer: Imagine we are trying to define the factorial function: remember the definition of the factorial function:

fact 0     = 1
fact (n+1) = n*(fact n)

Now in some PL frameworks (namely the λ-calculus), it isn't immediately obvious how to define such a function. However, it may be easy to define the following higher-order function, so-called because it takes as input another function and a natural number

Fact f 0     = 1
Fact f (n+1) = n * (f n)

There is no use of recursion in this function definition. However, if there was some way of finding the fix-point of Fact, that is, a function ϕ such that

Fact ϕ n = ϕ n
for every n, then it is easy to check that ϕ is indeed an implementation of the factorial function.

Now in frameworks like the λ-calculus, one can show that all fixed-points of this nature do, in fact, exist, which makes it clear that you can use it as a general programing language.

There are many other uses to the notion of fixed-points in computer science, but most boil down to the one I showed above, i.e. prove that certain fixed-points exist to be able to show that certain functions or constructs are well-defined in your framework (here we have shown that the factorial function exists).

cody
fuente
9

A fixed point of a function f:AA is an element x for which f(x) is equal to x. For example, the function x2 has two fixed points, which are the values 0 and 1, and the function x3 has three fixed points. Mathematically that is the definition.

Now, depending on the mathematical structure you are dealing with, there are very many different reasons to be interested in fixed points. For example, if you consider a dynamic system that looks at the state of the world and changes it (like a thermostat) then a fixed point corresponds to a stable configuration. If you think of games in the mathematical sense of game theory, fixed points correspond to equillibria, if you think of the the behaviour of an optimization routine that iteratively improves its solution, a fixed point corresponds to an optimal solution. So the mathematical notion of a fixed point has a lot of applications in a lot of different contexts.

A very common, and fundamental application of fixed points in computer science is to mathematically model loops and recursive programs. If we try to model a program as a mathematical function, both loops and recursion are not obvious to model. This is because the body of a loop is a program and can be represented as a mathematical function. How do we derive the function representing the loop's behaviour? It corresponds to applying the loop body repeatedly, in conjunction with the loop guard, until no further change is possible. Similarly, if we model recursive programs mathematically, we need a mathematical notion of what it means for a function to apply itself. This answer is provided by fixed points.

Vijay D
fuente
7

A function in mathematics is a map between input and output values. Fixed points are input values (for a function) which map to output values satisfying equality with the input.

For the equality function f(x)=x the set of input value equals to the set of fixed points of the function. For a function f(x)=x2 the set of fixed points is limited to {0,1}.

As far as computer science is concerned, we are talking a lot about partial functions, but this does not change the definition of fixed points for us.

You might also be confused about a totally different topic: Fixed-point arithmetic is a concept how to represent real numbers in the memory. But the name "fixed points" does not reference to this topic in general (because there is only 1 point).

meisterluk
fuente