
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 functions $f(x)=x-m\ln x- \frac{m-1}{x}$ $(m\in\mathbb{R})$, and $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 $m \leqslant 2$, if there exists $x_1 \in [e,e^2]$ such that for any $x_2 \in [-2,0]$, the inequality $f(x_1) \leqslant g(x_2)$ holds true, find the range of the real number $m$.

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