
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 functions $f(x)=x-(a+1)\ln x- \frac{a}{x}$ $(a\in\mathbb{R})$, $g(x)= \frac{1}{2}x^{2}+e^{x}-xe^{x}$.

$(1)$ When $x\in[1,e]$, find the minimum value of $f(x)$;

$(2)$ When $a < 1$, if there exists $x_{1}\in[e,e^{2}]$ such that for any $x_{2}\in[-2,0]$, $f(x_{1}) < g(x_{2})$ always holds, find the range of values for $a$.

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