How to prove/disprove monotonicity of this function?

58 Views Asked by At

Fix $N_a\in\mathbb{N}$ and $N_b\in\mathbb{N}$, and consider two non-decreasing sequences of non-negative integers $$(a_i)_{1\leq i\leq N_a}\quad\text{and}\quad(b_i)_{1\leq i\leq N_b}$$

the latter of which contains all elements of the former with at least the same multiplicity.

The function $Q:[1,N_a-1]\to\mathbb{Z}\ $ is given by

$Q(x)=\underset{1\ \large\leq\normalsize\ i\ \large\leq\normalsize\ N_a\large-\normalsize x}{\max}(c_{i+x}+e_{i+x}-x-d_i+f_i)$

where

$c_i=\min\{k\in\mathbb{N}:a_i=b_k\}$
$d_i=\max\{k\in\mathbb{N}:a_i=b_k\}$
$e_i=i-\min\{j\in\mathbb{N}:a_i=a_j\}$
$f_i=\max\{j\in\mathbb{N}:a_i=a_j\}-i$

I can't see how to prove that $Q$ is monotone, I searched extensively for a counterexample but I couldn't find one. Do you have any hints?$\ $ Thanks in advance