# CDF of $-\ln X$ where $X$ is uniform on $(0,1)$

I'm having difficulty studying this part of the subject, because i can't get through this first example, can anyone help?

Let $$X: U(0,1)$$ Find the distribution function of the following random variable:$$Z=-lnX;$$ Answer:

$F_z(z)=P\{Z<z\}=P\{-lnX<z\}=P\{lnX>-z\}=P\{X>e^{-z}\}= \begin{cases} 1-e^{-z} ; e^{-z}\leq 1 \\ 0 ; e^{-z}>1 \end{cases}=\begin{cases} 1-e^{-z} ; z\geq 0 \\ 0 ; z < 0 \end{cases}$

What I don't understand is this last step, could anyone clarify what i'm not seeing ? How is this deducted ?

The PDF $p_X(x)$ of your uniform $X$ is $p_X(x) = 1$ for $x \in [0,1]$ and $p_X(x) = 0$ otherwise. The probability of $X$ being greater than $e^{-z}$ is thus $$P\{X > e^{-z}\} = \int_{e^{-z}}^\infty p_X(x) dx = \int_{e^{-z}}^1 1 dx + \int_1^\infty 0 dx = \int_{e^{-z}}^1 1 dx = 1- e^{-z}$$ if $e^{-z}$ does not exceed the interval $[0,1]$ by being greater than $1$ (trivial answer otherwise, see your case-by-case stuff). On the other hand, $e^{-z} > 0$ is always true.
We know that $P(X>e^{-z})=1-P(X\leq e^{-z})$ and $P(X\leq a)=\begin{cases}0,&a<0\\a,& 0\leq a\leq 1\\1,&a>1\end{cases}$ by definition of uniform distribution. When you substitute $a=e^{-z}$ you get the conclusion.