# Checking $f(x_1,y_1)f(x_2,y_2)-f(x_1,y_2)f(x_2,y_1) \ge 0$

I am working in data science and I have to deal with the following problem for which I would like to find a simplification:

We call a function almost positive if $f(x_1,y_1)f(x_2,y_2)-f(x_1,y_2)f(x_2,y_1) \ge 0$ for all $0< x_1\le x_2 < \infty$ and $0 < y_1\le y_2 < \infty.$

I would like to know: Are there any sufficient and necessary criteria for a function $f$ to be almost positive?

Background: The problem is that I often have a positive smooth function $f$ which I need to check for almost positivity. Those functions $f$ are usually cumbersome expressions such that checking

$f(x_1,y_1)f(x_2,y_2)-f(x_1,y_2)f(x_2,y_1) \ge 0$ is almost impossible analytically, because one has to compare infinitely many variables which each other and unless one can simplify the expression in a clever way, checking this condition is hopeless.

I am therefore asking whether there is an equivalent criterion to the almost positivity condition which I can check in a more direct way? Ideally there would exist an "intrinsic" criterion for functions $f$ which implies this property.

If there is nothing equivalent to almost positivity, perhaps there exist rather general sufficient conditions which imply almost positivity?

• What is an example of such a function? Have you computed the local conditions? – Igor Rivin Sep 1 '18 at 22:44
• Also, can you compute some level sets, especially where the function f has value zero? Gerhard "Maybe Special Cases Can Help" Paseman, 2018.09.01. – Gerhard Paseman Sep 1 '18 at 22:49

You say your function is smooth, so letting $x_1 = x, y_1 = y, x_2 = x + \Delta x, y_2 = y+\Delta y,$ we get in the limit as the deltas go to zero, if we ignore the second order terms, then
$$\dfrac{\partial f}{\partial x} \dfrac{\partial f} {\partial x} d x d y < 0.$$ This indicates that we cannot ignore the second order terms, and when the smoke clears, we seem to get
$$f\dfrac{\partial^2 f}{\partial x \partial y} - \dfrac{\partial f}{\partial x} \dfrac{\partial f} {\partial x} \geq 0,$$ which is nonlinear and hyperbolic. Changing it to an equation may or may not be enlightening.
To follow up @igor answer, the equation can be written as: $$\dfrac{\partial^2 \ln f}{\partial x \partial y} \geq 0.$$ Moreover, the inequality is not only necessary, bu sufficient, since: $$\ln \left( \frac{f(x_2,y_2)f(x_1,y_1)}{f(x_2,y_1)f(x_1,y_2)} \right) = \int_{x_1}^{x_2} \int_{y_1}^{y_2} \dfrac{\partial^2 \ln f}{\partial x \partial y} dy \ dx.$$
• The logarithm of a positive expression $$\frac{f(x_2,y_2)f(x_1,y_1)}{f(x_2,y_1)f(x_1,y_2)}$$ may be negative, is not so? – user64494 Sep 2 '18 at 9:20