
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 $\overrightarrow{a}=(\cos x,\cos x)$ and $\overrightarrow{b}=(\sqrt{3}\cos x,\sin x)$, with $f(x)=\overrightarrow{a}\cdot \overrightarrow{b}$, where $x\in\mathbb{R}$.

$(1)$ Find the smallest positive period of the function $f(x)$ and the intervals where it is monotonically decreasing;

$(2)$ In $\triangle ABC$, the sides opposite angles $A$, $B$, and $C$ are $a$, $b$, and $c$ respectively. If $f\left(\frac{A}{2}-\frac{\pi}{6}\right)=\sqrt{3}$, $c=2$, and the area of $\triangle ABC$ is $2\sqrt{3}$, find $a$.

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