
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 the function $f(x) = A\sin(\omega x + \phi)$ (where $A > 0$, $\omega > 0$, $0 < \phi < \frac{\pi}{2})$, $x \in \mathbb{R}$, the minimum value of $f(x)$ is -4, $f(0) = 2\sqrt{2}$, and the distance between two adjacent axes of symmetry is $\pi$.

(I) When $x \in \left[-\frac{\pi}{2}, \frac{\pi}{2}\right]$, find the maximum and minimum values of the function $f(x)$.

(II) If $x \in \left(\frac{\pi}{2}, \pi\right)$, and $f(x) = 1$, find the value of $\cos\left(x + \frac{5\pi}{12}\right)$.

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