
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
(1) Determine the maximum and minimum values of the function $y = 1 - 2\sin\left(x + \frac{\pi}{6}\right)$ and the corresponding values of $x$.
(2) Given that the function $y = a\cos\left(2x + \frac{\pi}{3}\right) + 3$ has a maximum value of 4 for $x \in \left[0, \frac{\pi}{2}\right]$, find the value of the real number $a$.

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