
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(2x+\varphi)$ $(A > 0, 0 < \varphi < \pi)$, it reaches its minimum value of $-4$ when $x=-\frac{\pi}{3}$.

$(1)$ Find the expression for the function $f(x)$;

$(2)$ If the sum of the first $n$ terms of the arithmetic sequence $\{a_n\}$ is $S_n$, and $a_2=f(0)$, $a_4=f\left(\frac{\pi}{6}\right)$, find the sum of the first $n$ terms of the sequence $\left\{\frac{1}{S_n}\right\}$, denoted as $T_n$.

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