Need help to derive the conditional pdf I am fighting to understand a perhaps simple question, described below.
Let $X$ be a positive continuous random variable. Now, define another random variable
$$
Y = \begin{cases}
\text{undefined} & \text{ if } X \leq d \\
X - d & \text{ if } X > d
\end{cases} \> .
$$
Now my job is to calculate the pdf of $Y$. 
My friend calculates:
$$
\frac{f(y+d)}{1 - F(d)} ,\quad y > 0,
$$
where, $f$ and $F$ are the pdf and cdf of $X$, respectively.
What is bothering me is:
Should it not be, instead,
$$

\frac{f(y+d)}{1 - F(d)} ,\quad y > d \> ?
$$ 
What I am missing here? I would really appreciate if somebody explain me in some easy way.
 A: Stéphane is right to say that $Y$ cannot stay undefined, you have to give a value to $Y(\omega)$ for all $\omega\in\Omega$.
Stéphane’s choice of $Y = \infty$ when $X \le d$ is a bit difficult to handle even if it is natural. Let’s take $Y = y_0\in\mathbb R$ when $X \le d$. You have,
$$\begin{align*}
 \mathbb P( Y \le y ) &= \mathbb P( y_0 \le y \cap X \le d \cup X-d \le y \cap X > d ) \\
 &= \mathbb P( y_0 \le y \cap X \le d) + \mathbb P(d < X \le y+d) \\
 &= \mathbb P(X\le d) \cdot 1_{y_0\le y} + \left\{\begin{array}{l}
  0 \text{ if } y < 0 \\
  F(y+d)-F(d)  \text{ if } y \ge 0.
  \end{array}\right.
\end{align*}$$
This cdf has no derivative in $y = y_0$, hence strictly speaking no density. 
However defining $g(y)$ by
$$g_0(y) =\left\{\begin{array}{l}
  0 \text{ if } y < 0 \\
  f(y+d) \text{ if } y \ge 0,
  \end{array}\right. $$
(the derivative of the pdf "ignoring" the step in $y_0$) and $p = \mathbb P(X>d) = 1 - F(d)$, we can write the density of $Y$ by the mixture 
$$g(y) = g_0(y) + (1-p) \cdot \delta(y-y0)$$ 
where $\delta$ is the Dirac function. 
Note that the integral $\int_{-\infty}^\infty g_0(y) \mathrm dy$ is equal to $p$ and by convention the integral of the $\delta$ function is 1, so $\int_{-\infty}^\infty g(y) \mathrm dy = 1$.
Edit 1 you can chose $y_0 = +\infty$ is you wish, in that case there is a Dirac mass in $+\infty$. I don’t know if there is some standard notation for this.
Edit 2 I suspect that the original question was to give the density of $Y$ conditional to $X>d$.
In that case you don’t need bother with the values taken by $Y$ when this condition is not fulfilled. You can write
$$\begin{array}{rcl}
 \mathbb P( Y \le y | X > d) &=& { \mathbb P(X \le y+d \cap X > d) \over \mathbb P(X>d)} \\
 &=& \left\{\begin{array}{l}
  0 \text{ if } y < 0 \\
  {F(y+d)-F(d)\over 1 - F(d)}  \text{ if } y \ge 0,
  \end{array}\right.
\end{array}$$
and the density of $Y$ conditional to $X>d$ is 
$$g(y|X>d) = \left\{\begin{array}{l}
  0 \text{ if } y < 0 \\
  {1\over 1-p}f(y+d) \text{ if } y \ge 0.
  \end{array}\right. $$
As whuber pointed out in the comments, a natural interpretation of this is to change the sample space $\Omega$ to $\Omega' = \{ \omega \in \Omega \>:\> X(\omega) > d \}$. 
A: You also have to define $Y$ when $X\leq d$ otherwise $Y$ is not a well-defined random variable. For example set $Y=\infty$ when $X\leq d$. Whatever your choice is, $Y$ no longer has a density because it has an atom at $\infty$ (or at $a$ if you set $Y=a$ when $X\leq d$, whatever the choice of $a$).
You can write the distribution of $Y$ as a weighted sum of a Dirac distribution at $\infty$ and a continuous distribution on $[0, +\infty[$ : the distribution of $Y$ is $$p\delta_\infty + (1-p) g(y)dy$$ where $p=\Pr(X\leq d)=F(d)$, $\delta_\infty$ is the Dirac mass at $\infty$ and $g(y)dy=\Pr(Y \in dy \mid X>d)=\Pr(X-d \in dy)/\Pr(X>d)=\frac{f(y+d)}{1-F(d)}dy$. 
A: A simple explanation for why your friend is correct - $y > 0$ - is to see what happens to $y$ as $x \to d$ from above.  Since $y = x - d$, as $x \to d$, by subtracting $d$ from both sides of $x \to d$, we get $x - d \to 0$.  Since $y = x - d$, $y$ can get arbitrarily close to $0$, so the lower bound on $y$ is 0, not $d$.
