0
$\begingroup$

I'm looking for a function $f:[0,1] \times [0,1] \to [0,1]$ with the following properties:

  1. $f(x,x) = x$

  2. $f$ is differentiable everywhere and has bounded derivative on its entire domain

  3. $f(x,y) \le (1+\epsilon_1) \min(x,y) + \epsilon_2$ for some small values $\epsilon_1,\epsilon_2 \ll 1$ (that don't depend on $x,y$)

Basically, I'm looking for a function that behaves similar to $\min(x,y)$, but is differentiable everywhere -- so it is a "softened" version of the minimum. $\min(x,y)$ fails condition 2, as it is not differentiable at points $(x,y)$ where $x=y$.

Does such a function exist? If yes, can you suggest an example $f$ where $f$ and its derivative have an expression that is "not too messy"?

  • 0
    http://www.johndcook.com/blog/2010/01/13/soft-maximum/2017-01-19

2 Answers 2

1

Does this work? $-a|x-y|^b +(x+y)/2$ where $a>0$ $b>1$?

  • 0
    Looks like it! Computing $\epsilon_1,\epsilon_2$ explicitly looks a bit messy...2017-01-19
  • 0
    For $a=1/2$, $b=2$, we have $\epsilon_1 = 0$, $\epsilon_2 = 1/8$, i.e., $f(x,y) = (x+y)/2 - (x-y)^2/2 \le \min(x,y) + 1/8$. Nice solution!2017-01-19
  • 0
    Looks like in general we should always choose $a=1/2$ (since we want the function to map to $[0,1]$) and we can always take $\epsilon_1=0$. For $b=1.1$, we obtain $\epsilon_2 \approx 0.0175$, and smaller values of $b$ yield better values of $\epsilon$.2017-01-20
  • 0
    That makes a lot of sense. So it has really only one degree of freedom in a sense2017-01-20
0

Based on @avs's suggestion (thank you!), we can define a slight variant of the "softmin":

$$f(x,y) = - \log((e^{-x} + e^{-y})/2),$$

based on this blog post. This has the following properties:

  1. $f(x,x) = x$

  2. ${\partial f \over \partial x}(x,y) = e^{-x}/(e^{-x} + e^{-y})$, so $f$ is differentiable everywhere and its partial derivatives are bounded from above by $e/(e+1) \approx 0.73$.

  3. $f(x,y) \le \min(x,y) + \epsilon_2$ where $\epsilon_2=\log 2 \approx 0.69$. Notice that we achieve $\epsilon_1=0$, though unfortunately $\epsilon_2$ is non-negligible.

  4. $0 \le f(x,y) \le 1$