I am reading *Fluctuations of Levy Processes with Applications* by A.E. Kyprianou and I am having struggles understanding a part in the proof of theorem 5.6. Let $Y$ be a subordinator and $\mathbf{e}$ an independent exponential random variable with parameter $\eta$. Let $X$ be the killed subordinator associated with $Y$ and $\mathbf{e}$, i.e., the stochastic process defined by
$$
X\_t =
\begin{cases}
Y\_{t}, & \text{if } t<\mathbf{e}\\
\partial & \text{if } \mathbf{e}\geq t,
\end{cases}
$$
where $\partial$ is a cemetery point. Let $\tau\_x^+$ be the first-passage time at $x$, that is,
$$
\tau\_x^+ = \inf\{t>0: X\_t>x\}.
$$
In the proof of the aforementioned theorem, the following equality is stated without any explanation:
$$
\mathbb{E}\left[f(X\_{\tau\_x^+}-x)g(x-X\_{\tau\_x^+-})\right]=\mathbb{E}\left[\int\_{[0,\infty)}\int\_{(0,\infty)}e^{-\eta t}\phi(t,\theta)N(dt\times d\theta)\right] 
$$
where $f$ and $g$ are two continuous functions vanishing at infinite with $f(0)=g(0)=0$, $N$ is the Poisson random measure associated with $Y$ and $\phi$ is defined by
$$
\phi(t,\theta)= 1\_{(Y\_{t-}\leq x)}1\_{(Y\_{t-}+\theta> x)}f(Y\_{t-}+\theta- x)g(x-Y\_{t-}).
$$
I would like to ask if anyone would have a bit of insight into why this is true.


I have found the proof of the same theorem in other resources (for example, in Bertoin's *Levy Processes*), but they all use the same equality without any argumentation so as to why it is true. I can see why the equality is true in the case when $Y$ is a compound Poisson process with drift, and I feel like I could get the result by a limiting argument, but I feel like there should be a more direct way of seeing this.


Thank you for any kind of help you might provide.



Expectation of killed subordinator at first-passage time
Because $f(0)=g(0)=0$, the passage over $x$ is being counted in $\Bbb E[f(X\_{\tau\_x^+}-x)g(x-X\_{\tau\_x^+-})]$ iff $X$ jumps at the crossing time. And
$$
\eqalign{
1\_{\{\Delta X\_{\tau\_x^+}>0\}}f(X\_{\tau\_x^+}-x)g(x-X\_{\tau\_x^+-})
&=\sum\_{t\in J}1\_{\{t<\mathbf{e}\}}1\_{\{X\_{t-}\le x, X\_t>x\}}f(X\_{t}-x)g(x-X\_{t-})\cr
&=\sum\_{t\in J}1\_{\{t<\mathbf{e}\}}1\_{\{X\_{t-}\le x, X\_t>x\}}f(X\_{t-}+\Delta X\_t-x)g(x-X\_{t-})\cr
&=\sum\_{t\in J}\phi(t, \Delta X\_t).
\cr
}
$$
Here $J:=\{t>0: X\_{t-}\not= X\_t\}$. In effect, on $\{\Delta X\_{\tau\_x^+}>0\}$, the time $\tau\_x^+$ is the unique element $t$ of $J$, before $\mathbf{e}$, with $Y\_{t-}\le x$ and $Y\_{t}>x$.


