# Approximate integral over a measurable set by integral over a set in generating algebra

Suppose $(\Omega, \mathcal{F}, P)$ is a probability space (or finite measure space, I doubt this matters) and that $\mathcal{F}$ is generated by the algebra $\mathcal{B}$.

It is well-known that for all $\epsilon > 0$ and all $A \in \mathcal{F}$, there exists $B \in \mathcal{B}$ such that $$P(A\Delta B) < \epsilon.$$

Note that this implies $|P(A) - P(B)| < \epsilon.$

Can this kind of approximation be extended to integrals?

Is it the case that for all $\epsilon > 0$, all bounded measurable $f$, and all $A \in \mathcal{F}$, there exists $B \in \mathcal{B}$ such that $$\Big |\int_A f dP - \int_B f dP \Big | < \epsilon?$$

It is clearly true for $f = 1$ in view of the approximation result mentioned above. It's also true for indicator functions $\mathbf{1}_F$, using the result above and the fact that $$P(A \Delta B) < \epsilon \implies |P(A \cap F) - P(B \cap F)| < \epsilon,$$ which in turn follows from $F \cap(A \Delta B) = (F \cap A) \Delta (F \cap B)$.

My idea now was to finish by using the monotone class theorem for functions. I need to show that the set of functions for which the desired property holds is a vector space and closed under monotone limits. I'm stuck here.

For instance, suppose $f$ and $g$ have the desired property. We want to show that $f+g$ has the desired property. By the triangle inequality, $$\Big|\int_A (f+g) dP - \int_B (f+g) dP \Big| \leq \Big| \int_A fdP - \int_B fdP \Big| + \Big| \int_A gdP - \int_B gdP \Big|.$$

So to conclude, I need a $B \in \mathcal{B}$ that works for both $f$ and $g$, and I can't convince myself that such a $B$ exists. I reckon I'll face the same sort of problem for the monotone limit case.

Does the result hold? If so, can the proof be completed along the lines I suggest? If not, does anyone know of a similar approximation result for integrals?

for all $\epsilon > 0$, all integrable function $f$, and all $A \in \mathcal{F}$, there exists $B \in \mathcal{B}$ such that $$\Big |\int_A f dP - \int_B f dP \Big | < \epsilon.$$
Indeed, for all integrable function $f$ and all $A \in \mathcal{F}$, $$\Big |\int_A f dP - \int_B f dP \Big | =\Big |\int f\left(\mathbf 1_A-\mathbf 1_B\right) dP \Big |\leqslant \int\left| f\right|\left|\mathbf 1_A-\mathbf 1_B\right| dP =\int_{A\Delta B}\left| f\right| \mathbb dP.$$
Now, we use the fact that for any integrable function $f$ and any $\varepsilon\gt 0$, there exists $\delta\gt 0$ such that if $C$ has a measure smaller than $\delta$, then $\int_C\left| f\right|\mathrm dP\lt\varepsilon$.