# One-way function definition

I cannot understand why a one-way function $f$ is defined in this way

$\text{Pr}(f(A(f(x))) = f(x)) < \frac{1}{p(n)}$

and not

$\text{Pr}(A(f(x)) = x) < \frac{1}{p(n)}$

where $A$ is a randomized algorithm.

Where is the difference? Is the second one weaker? Thank you!

-

The two conditions indeed represent different things. Consider the function that, given an $n$-bit input, returns $n$ zeroes. This clearly meets the second definition (if you have $n$ zeroes, a randomized algorithm has just a $1/2^n$ chance of guessing the input, because any $n$-bit input returns that output), but it also clearly fails the first ($A$ is just "return $0^n$"). So the first condition is not weaker than the second; in fact, anything failing the second clearly fails the first (you just use the same algorithm $A$, and use $A(f(x))=x$ and so $f(A(f(x)))=f(x)$). So the first is in fact stronger than the second.
The difference is that one of them is useful, and the other is trivial to achieve. $\:$ The second one is weaker because all constant functions with super-polynomially growing domains satisfy it.