
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
In the plane rectangular coordinate system $xOy$, the quadratic function is $y=a\left(x-h\right)^{2}+k$, where $a\neq 0$.  
$(1)$ If the graph of the function passes through the points $A\left(1,3\right)$ and $B\left(3,3\right)$, and the minimum value of the function is $-1$, find the expression of the function.  
$(2)$ If the function has a maximum value $m$ and a minimum value $n$ in the interval $1\leqslant x\leqslant 2$, express the range of $m-n$ in terms of $a$ and $h$.

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