
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)=\ln x-ax(a\in \mathbb{R})$.

$(1)$ If the curve $y=f(x)$ is tangent to the line $x-y-1-\ln 2=0$, find the value of the real number $a$;

$(2)$ If the inequality $(x+1)f(x)\leqslant \ln x-\frac{x}{e}$ always holds within its domain, find the range of the real number $a$.

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