Taking an indicator function under the integral I am trying to follow the proof of a theorem here. My question is on the last step in Section 3.3, which comes down to the following equivalence (simplified from the original text):
$$\mathbb{1}_{\left(S>\kappa \right)} \int_{\kappa}^S \left( S-v \right) \, \mathrm{d}v = \int_{\kappa}^S \max \left( S-v, 0 \right) \, \mathrm{d}v.$$
I am familiar with the following equivalence:
$$\mathbb{1}_{\left(S>\kappa \right)} \, \left( S-\kappa \right) = \max \left( S-\kappa, 0 \right),$$
but my question is how does this translate to:
$$\mathbb{1}_{\left(S>\kappa \right)} \, \left( S-v \right) = \max \left( S-v, 0 \right)$$
when the indicator function is taken under the integral?
I'm guessing that it has something to do with the fact that $v$ is just a dummy variable which takes on values from the upper and lower limits of integration, but I do not quite follow the entire logic (or whether this is in fact the reason).
Any assistance would be much appreciated.
P.S. This is my first time posting a question, so please bear with any issues and feel free to let me know of any improvements I need to make when asking questions.
 A: I think when $S \leq k$ they are interpreting $\int_k^{S}$ as $0$. [This is not the usual convention. Without this convention the stated equality is false]. When $S>k$ the equality follows by just observing that for $k <v <S$ the maximum of $S-v$ and $0$ is nothing but $S-v$.
A: Your interpretation isn't quite right. What they're doing is actually a tiny bit sneaky. If we look at what the expression on the left side of that equation actually means:
$$\begin{eqnarray}1_{(S > \kappa)} \int_\kappa^S f(v)\ dv & = & \begin{cases}\int_\kappa^S f(v)\ dv & \mbox{if } S > \kappa \\
0 & \mbox{if } S \leq \kappa \end{cases} \\
& = & \int_\kappa^S 1_{(S > \kappa)} f(v)\ dv\end{eqnarray}$$
Now, if $S > \kappa$, then we're integrating over the interval $v \in (\kappa, S)$ and in that area $S > v$ will also be true, so in other words $1_{(S > \kappa)} = 1_{(S > v)} = 1$. Similarly, if $S \leq \kappa$, then on the interval $v \in (S, \kappa)$ we have $1_{(S > \kappa)} = 1_{(S > v)} = 0$. So we can therefore safely replace $1_{(S > \kappa)}$ in the integrand with $1_{(S > v)}$ and it won't change the integral, and we can then multiply that by the $S - v$ term in the actual equation to turn it into $(S - v)^+$.
