# Why is this integral not Lebesgue measurable? (and how to rectify)

Suppose I have the Bernoulli random variables $$S_t$$ for $$t=1,\cdots, T$$ and for an issue related to my problem, I want to express $$P[S_t=s_t\mid S_{t-1} = s_{t-1}]$$, by using the law of total probability $$$$P[S_t=s_t\mid S_{t-1}=s_{t-1}]=\int_{\mathbb{R}}P[S_t=s_t\mid S_{t-1}=s_{t-1},x_{t-1}]f(x_{t-1}\mid s_{t-1})dx_{t-1}$$$$ where $$X\in\mathbb{R}$$ and continuous. I then used the Bayes rule to obtain, $$$$P[S_t=s_t\mid S_{t-1}=s_{t-1}]=\int_{\mathbb{R}}P[S_t=s_t\mid S_{t-1}=s_{t-1},x_{t-1}]\frac{P[S_{t-1}=s_{t-1}\mid x_{t-1}]f(x_{t-1})}{P[S_{t-1}=s_{t-1}]}dx_{t-1}$$$$

Please note that I am not a mathematician and while I have some familiarity with measure theory (basic Shiryaev probability theory book level), I lack the necessary rigour. A very internationally renowned Professor that I presented this derivation to, mentioned that with $$x$$ being on the real line and $$S_t$$ being a counting process, the last integral is not Lebesgue measurable and he can't see the last line of the derivation. Can someone please highlight my mistake and how this can be rectified?

The problem as stated is not clearly defined since the connection between the sequence $$(S_t)_t$$ and the sequence $$(X_t)_t$$ is not spelled out. If we assume a joint (hidden) Markov process $$(X_t,S_t)_t$$ such that $$X_t|X_{t-1},S_{t-1},S_t\sim f(x_t|S_t)\quad\forall\, t$$ wrt the Lebesgue measure, then $$\mathbb P(S_t=s_t|S_{t-1}=s_{t-1})=\int \mathbb P[S_t=s_t\mid S_{t-1}=s_{t-1},x_{t-1}]f(x_{t-1}\mid s_{t-1})\,\text dx_{t-1}$$ is correct. Considering the pair $$(S_{t-1},X_{t-1})$$, there is no reason its marginal joint distribution is stationary, i.e. the same for all $$t$$'s. One should thus write $$(S_{t-1},X_{t-1})\sim \mathbb P^{t-1}(S_{t-1}=s_{t-1})f(x_{t-1}|S_{t-1}=s_{t-1})$$ to stress a possible time dependence of the Markov chain $$(S_t)_t$$. But it still can be decomposed as $$\mathbb P^{t-1}(S_{t-1}=s_{t-1})f(x_{t-1}|S_{t-1}=s_{t-1})=\dfrac{\mathbb P^{t-1}(S_{t-1}=s_{t-1}|X_{t-1}=x_{t-1})f_{t-1}(x_{t-1})}{\mathbb P^{t-1}(S_{t-1}=s_{t-1})}$$ and $$X_{t-1}$$ remains marginally absolutely continuous wrt the Lebesgue measure.