Let $\Omega\subset\mathbb R^d$ be bounded. Let $S$ be the set of simple functions defined on $\Omega$, and let $M\subset S$ be the set of simple functions whose defining sets can be written as finite unions of rectangles in $\Omega$. The question: Is $M$ dense in $S$ in the $L^2(\Omega)$ sense?
If this is not true, let $L\subset S$ be the set of simple functions whose defining sets $E_j$ satisfy $m(\partial E_j)=0$ ($m$ here the Lebesgue measure). Is $L$ dense in $S$ in the $L^2(\Omega)$ sense?
Thanks for your input!
EDIT: Here's what I've been trying to do, for what it's worth: Fix a simple function $s\in S$, with defining sets $E_1,\ldots,E_m$ and written as $$ s(x)=\sum\limits_{j=1}^ma_j\chi_{E_j}(x). $$ Each of these sets is Lebesgue measurable, so for each $j=1,\ldots,m$ and $n\in\mathbb N$ you can find a set $A_j^n\subset\Omega$ which is a finite union of rectangles in $\Omega$ and satisfies $$ m(E_j\Delta A_j^n)<2^{-n}. $$ For fixed $n$ now, construct a simple function $s_n$ in the following way: For each $j=1,\ldots,m$, let $E_j^n=A_j^n\backslash\bigcup_{\ell\neq j}A_{\ell}^n$; and $E_{m+1}^n=\Omega\backslash\bigcup_{j}E_j^n$. Let $a_{m+1}=0$. Then write $$ s_n(x)=\sum\limits_{j=1}^{m+1}a_j\chi_{E_j^n}(x). $$ We have $s_n\in M$ for each $n$. After an elementary calculation it is seen that $$ \Vert s-s_n\Vert_{L_2(\Omega)}^2\leq C\sum\limits_{j=1}^mm(E_j\Delta E_j^n) $$ where $C$ is a constant depending on $D$ and $s$. What I'm trying to prove will be given as soon as I can replace $E_j^n$ with $A_j^n$ in the above inequality. This, in turn, is done "if and only if" I can suitably estimate the measure of the "intersections" between the $A_{\ell}^n$, but it's not clear to me how to do this.
Here is a rather tedious solution:
Suppose $S \subset L^2(\Omega)$. The set $\Omega$ is bounded.
Let $s \in S$, then we can write $s = \sum_k \alpha_k 1_{A_k}$.
Note that any open set $U$ can be written as the countable union of disjoint rectangles $U = \cup_k R_k$. We see that $m({\cup_{i=0}^n R_i}) \to m U$.
For any $\epsilon>0 $ there is an open set $U_k$ containing $A_k$ such that $m(U_k \setminus A_k) < \epsilon$ (outer regularity).
It follows that for any $\epsilon>0 $ there is a finite collection of rectangles $B_k = \cup_{i=0}^{n_k} R_{i,k}$ such that $m(B_k \triangle A_k) < \epsilon$. Note that $\|1_{B_k} - 1_{A_k}\| \le \sqrt{\epsilon}$.
Then $\|s-\sum_k \alpha_k 1_{B_k} \| \le \sum_k |\alpha_k| \sqrt{\epsilon}$.