An inequality in four variables Let $f(x,y)=\frac{10xy-(x+y)+1}{8xy-2(x+y)+5}$ and $g(x,y)=\frac{1}{4}\left[1+\frac{1}{3}(4x-1)(4y-1)\right]$. I want to prove that for any $0.5\le a\le b\le 1$ and $0.7\le c\le d\le 1$, it holds that $g(f(a,b),f(c,d))>f(g(a,c),g(b,d))$. I have checked the result by programming a search algorithm that this seems to be true, but I am looking for a way to formally prove it.
 A: $\newcommand{\dif}{\text{dif}}\newcommand{\num}{\text{num}}\newcommand{\den}{\text{den}}\newcommand{\nnt}{\text{nn2}}$We want to show that
\begin{equation}
    \dif:=g(f(a,b),f(c,d))-f(g(a,c),g(b,d))>0 \tag{?}\label{?}
\end{equation}
given conditions
\begin{equation}
    \tfrac12\le a\le b\le 1,\quad \tfrac7{10}\le c\le d\le 1. \tag{C}\label{C}
\end{equation}
We have
\begin{equation}
    \dif=\frac23\,\frac\num\den,
\end{equation}
where $\num$ is a certain polynomial of degree $\le2$ in $a$, in $b$, in $c$, and in $d$, whereas
\begin{equation}
\begin{aligned}
    \den&:=a (8 b-2)-2 b+5) (c (8 d-2)-2 d+5) \\ 
    &\times (2 a (4 b-1) (4 c-1) (4 d-1)-2 b (4 c-1) (4 d-1)+8 c d-2 c-2 d+41). 
\end{aligned}
\end{equation}
Since each of factors in the latter expression is affine in $a$, in $b$, in $c$, and in $d$, it is straightforward to check that $\den>0$ given \eqref{C}.
So, it enough to show that
\begin{equation}
    \num>0 \tag{??}\label{??}
\end{equation}
given \eqref{C}.
Recall that $\num$ is a polynomial of degree $\le2$ (in $a$, in $b$, in $c$, and) in $d$. The coefficient of $d^2$ in $\num$ is
\begin{equation}
    2 (4 b-1) (4 c-1)\,\nnt, 
\end{equation}
where $\nnt$ is a polynomial in $a,b,c$ of degree $\le1$ in $c$, and the coefficient of $c$ in $\nnt$ is $16 (4 a-1) (-4 + a + b + 2 a b)\le0$ (given \eqref{C}).  So,
\begin{equation}
    \nnt\le\nnt|_{c=7/10}. 
\end{equation}
Next, $\nnt|_{c=7/10}$ is a polynomial in $a,b$ of degree $\le1$ in $b$, and the coefficient of $b$ in $\nnt|_{c=7/10}$ is $\frac35\, ( 4 a-1) (64 a-13)>0$ (given \eqref{C}).  So,
\begin{equation}
    \nnt|_{c=7/10}\le\nnt|_{c=7/10,\,b=a}=-\frac35\,(1-a) (7 + 178 a + 256 a^2)\le0. 
\end{equation}
So, $\nnt\le0$ and hence the coefficient of $d^2$ in $\num$ is $\le0$. So, $\num$ is concave in $d$. So, it is enough to prove \eqref{??} for $d\in\{1,c\}$.
This is done using similar concavity-cum-monotonicity reasoning, along with factoring polynomials. Here it will help to note that $\dfrac{\num|_{d=1}}{9(1-c)}$ is a polynomial of degree $\le1$ in $c$, whereas $\dfrac{\num|_{d=c}}{9(1-c)(4c-1)}$ is (a polynomial of degree $\le2$ in $b$ that is) concave in $b$.
