Given $f \in L^2([0,1])$, $f \neq 0$, we can consider the orthogonal complement $f^\perp$ . The smooth functions $C^\infty([0,1])$ are dense in $L^2([0,1])$. Is the intersection $f^\perp \cap C^\infty([0,1])$ dense in $f^\perp$? If not, can we find a counterexample, and find conditions on $f$ such that the statement is true?


The following [question and answer](https://math.stackexchange.com/questions/108496/dense-subset-of-l2-mathbb-r) generalizes to show that the statement holds for any smooth, strictly positive function. 


In general the problem amounts to showing that for any $g \in f^\perp$ there exists a sequence of smooth functions $g\_n \in f^\perp$ such that $||g-g\_n|| \to 0$. I've tried using the Fourier basis, to move the problem into $\ell^2$, and construct $g\_n$ as a finite sequence (to guarantee smoothness) with the proposed properties. My attempts so far:


Let $\{ \phi\_k \}$ denote the Fourier basis of $L^2([0,1])$, such that $f = \sum\_{k} c\_k \phi\_k$, and $g = \sum\_k d\_k \phi\_k$, where $g \in f^\perp$. Define $g\_n = \sum\_{k = - n}^n d\_k^n \phi\_k$ for some coefficients $d\_k^n$, then $g\_n$ is smooth. Choose the coeffients as
$$
d\_k^n = \begin{cases}
0, & |k| > n \\
d\_k, & c\_k = 0, |k| \leq n \\
d\_k - \frac{\sum\_{|j| \leq n} c\_j d\_j}{(2n+1) c\_k},& c\_k \neq 0, |k| \leq n
\end{cases}
$$


A direct calculation show that $g\_n \in f^\perp$. Showing that $g\_n \to g$ amounts to show that the fraction in the definition of the coefficients goes to zero as $n \to \infty$. The numerator goes to zero since $\langle g,f \rangle = 0$. The problem is that $c\_k \to 0$, so I have to estimate the fraction by something which goes to zero, and for this I have been unsuccesful. Could the approach be modified to work?



For which $f \in L^2([0,1])$ is $f^\perp \cap C^\infty$ dense in $f^\perp$?
$f^\perp\cap C^\infty([0,1])$ is dense in $f^\perp$. 


Indeed, given a closed finite codimensional subspace $M$ of a normed space $X$ and a dense subspace $V$ of $X$, the intersection $V\cap M$ is dense in $M$. 
See IV.2.8 Lemma in S. Goldberg "Unbounded linear operators". McGraw-Hill, 1966. 


