
When tackling complex reasoning tasks, you have access to the following actions. Use them as needed to progress through your thought process.

[ASSESS]

[ADVANCE]

[VERIFY]

[SIMPLIFY]

[SYNTHESIZE]

[PIVOT]

[OUTPUT]

You should strictly follow the format below:

[ACTION NAME]

# Your action step 1

# Your action step 2

# Your action step 3

...

Next action: [NEXT ACTION NAME]


system
Given vectors $\overrightarrow{a}=({\cos{x}, \cos^2x})$, $\overrightarrow{b}=({\sin{(x+\frac{\pi}{6})}, -1})$. Let $f(x)=2\overrightarrow{a} \cdot \overrightarrow{b}+\frac{1}{2}$, $x \in \mathbb{R}$.  
$(1)$ Find the analytical expression of $f(x)$ and its interval of monotonicity.  
$(2)$ Let $g(x)=f(x+\frac{\pi}{4})$. If the equation $2g(x)-m=1$ has two distinct solutions $x_{1}$, $x_{2}$ for $x \in [0,\frac{\pi}{2}]$, find the range of real number $m$ and the value of $\tan(x_{1}+x_{2})$.  
$(3)$ If all points on the graph of $y=f(x)$ are shifted to the left by $\frac{\pi}{4}$ units and then the abscissa of all points obtained is stretched by a factor of $2$ (the ordinate remains unchanged), the graph of the function $h(x)$ is obtained. When $x \in [m, m+\frac{\pi}{2}]$ (where $m \in [0,\pi]$), let the maximum and minimum values of the function $h(x)$ be denoted as $h(x)_{\max}$ and $h(x)_{\min}$, respectively. Define $\varphi(m)=h(x)_{\max}-h(x)_{\min}$, find the analytical expression of the function $\varphi(m)$.

Present the answer in LaTex format: \boxed{Your answer}
user