Let $X,Y \overset{\text{iid}}{\sim} \operatorname{Unif}(0,1)$. Let $$M = \min\{X,Y,1-Y,1-X,|X-Y|,1-|X-Y|\}.$$ Supposedly $\operatorname{image}(M) \subseteq (0,\frac13)$ and distribution of $M$ is $$F_M(m)= (3m(2-3m))1_{(0,\frac13)}(m) + 1_{(\frac13,\infty)}(m).$$ See here.
Question: How do I compute the distribution of $M$? I wonder if there's a clever way of doing this like with $W$ here. Below is what I've tried so far.
Well $|X-Y| \ge m$ and $1-|X-Y| \ge m$ tell me $m \le |X-Y| \le 1-m$. So it looks like I have 4 cases
$x+(m-1) \le y \le x-m$
$x+m \le y$
$y \le x-m$
$x-(m-1) \le y \le x+m$ (but I think I rule out this last case because here I have $m \ge \frac12$.
Then $X,Y,1-Y,1-X \ge m$ tell me $m \le X \le 1-m$ and $m \le Y \le 1-m$. So I guess the 3 cases become
$x+m-1 = \max\{m,x+m-1\} \le y \le \min\{x-m,1-m\} = x-m$
$x+m = \max\{m,x+m\} \le y \le 1-m$
$m \le y \le \min\{x-m,1-m\} = x-m$
But it seems if I do $\int_0^1 \int_{\cdot}^{\cdot} 1\, dy \,dx$ for each case and then add them up I get only $2-6m$.


For any $m\in[0,1]$,
\begin{align} F_M(m)&=1-\mathbb{P}\{M>m\} \\ &= 1-\mathbb{P}\{X\in (m,1],Y\in (m,1],1-Y\in (m,1],1-X\in (m,1],\\ &\hspace{7cm}|X-Y|\in (m,1],1-|X-Y|\in (m,1]\}\\ \\ &= 1- \mathbb{P}\{X\in(m,1-m),Y\in(m,1-m),|X-Y|\in(m,1-m)\}\\ \\ &= 1- \mathbb{P}\{X\in(m,1-m),Y\in(m,1-m),X-Y\in(m,1-m),X\geq Y\}\\ &\hspace{2cm}- \mathbb{P}\{X\in(m,1-m),Y\in(m,1-m),Y-X\in(m,1-m),X < Y\}\\ \\ &= 1-2\mathbb{P}\{X\in(m,1-m),Y\in(m,1-m),X-Y\in(m,1-m),X\geq Y\}\\ \\ &= 1-\begin{cases} 2\mathbb{P}\{Y\in(m,1-2m),X\in(m+Y,1-m)\} & \text{ if } m<1-2m \\ 0 & \text{ if } m\geq 1-2m \end{cases}\\ \\ &= \begin{cases} 1-2\int_{y=m}^{1-2m}\int_{x=m+y}^{1-m} 1\cdot dxdy=6m-9m^2 & \text{ if } 0\leq m<1/3 \\ 1 & \text{ if } m\geq 1/3. \end{cases}\\ &= 3m(2-3m)\mathbb{1}_{\left(0,\frac13\right)}(m) + \mathbb{1}_{\left(\frac13,\infty\right)}(m). \end{align}