This question is more or less a cross post of <https://math.stackexchange.com/questions/1218660/orthogonal-functions-with-shrinking-support>.


Let $X$ be a metric space (compact, if it helps) and let $Y$ be a closed subset of $X$. Fix a Borel measure $\mu$ on $X$. My question:



> 
> Is there an orthogonal set $\{u\_n\}$ of functions in $L^2(X,\mu)$ such that the support of $u\_n$ lies in a $2^{-n}$-neighborhood of $Y$?
> 
> 
> 


I can construct such a set in the case $X = \mathbb{R}$ and $Y = \{0\}$ as follows. Partition the interval $[-2^{-n},2^{-n}]$ into subintervals $I\_1, \ldots, I\_{2^n}$ of equal length and define 


$$u\_n(t) = \begin{cases} 1 & t \in I\_{2k+1} \\ -1 & t \in I\_{2k} \\ 0 & t \notin [-2^{-n},2^{-n}] \end{cases}$$


This construction does not obviously generalize to much more general metric spaces. My only other idea was to apply Gram-Schmidt to an arbitrary sequence of functions whose supports converge to $Y$, but it is not clear how to do this while maintaining control of the supports.



Orthogonal functions with shrinking support
As was pointed out by ifw, we should forbid $u\_n$ from being identically $0$ (a.e.), in order to make the question interesting. Also, addressing ifw's additional observation, if we let $Y\_n$ be the closed $2^{-n}$-neighborhood of $Y$, then we need to assume $L^2(Y\_n,\mu|\_{Y\_n})$ is infinite-dimensional. (If $X$ is compact, or even just complete and separable, and $\mu$ is $\sigma$-finite, this simply means that the restriction of $\mu$ to $Y\_n$ is not the sum of finitely many atoms.)


Under the above assumption on the dimension, it is easy to construct $\{u\_n\}$ by induction. For each $k < n$, the inner product with $u\_k$ defines a linear functional on $L^2(Y\_n,\mu|\_{Y\_n})$. Since there are only finitely many linear functionals, and $L^2(Y\_n,\mu|\_{Y\_n})$ is infinite-dimensional, there is some nonzero $u\_n$ that is in the kernel of all of them.


