Dirichlet Boundary Conditions and Stone-Weierstrass I'm trying to appreciate the importance of boundary conditions when using Green functions.
Start with a linear pde $L(u) = f$ imposing no boundary conditions.
Assume we can turn the operator into self-adjoint form so that $L* = L^{-1} = L$ so that 
$$L(u) = f \rightarrow u = L^{-1}(f) = \int G(x,x')fdx'$$
Form an eigenfunction expansion for $G$ to calculate $u$ explicitly.
I know the boundary conditions set the limits of integration however do the boundary conditions also justify the eigenfunction expansion?
What I mean is, is it only that certain boundary conditions justify the completeness of the basis functions in the eigenfunction expansion, certain boundary conditions mean the space of continuous functions will not be compact meaning we can't use the Stone-Weierstrass theorem?
Is this the mathematical reason why Dirichlet & Neumann boundary conditions have solutions 
for basic problems in electrostatics, because they are a way to ensure the Stone-Weierstrass theorem holds?
 A: The proof I know of uses the theory of compact operators. From Evan's PDE book (see section 6.5 and appendix D.6):

Let $H$ be a separable Hilbert space, and suppose $S: H \to H$ is a compact and symmetric operator. Then there exists a countable orthonormal basis of $H$ consisting of eigenvectors of $S$.

Then the Fredholm alternative tells us, possibly apart from $0$, that the spectrum of $S$ consists entirely of eigenvalues, and that the corresponding eigenspaces are all finite dimensional. (we used the compactness of $S$ here) Further, if the operator is elliptic, then $0$ is not in the spectrum, and we are in even better shape.
Next, the symmetry allows us to deduce that the eigenspaces are orthogonal.
The next step is harder to briefly summarize, but we look at the collection of all the eigenspaces $\tilde H$ and show that it is dense in $H$ (by showing that $\tilde H^\perp = \emptyset$, which relies on something like the Raleigh quotient for symmetric operators). 
Finally, we have our orthogonal eigenspaces for all the non-zero elements of the spectrum, and for the "eigenspace" corresponding to $0$ (i.e. the null-space of $S$), we appeal to the separability of $H$ to get a basis for that space, and we are done. (Though really, most of the time, you have an elliptic operator, so you can avoid this last part entirely).
Now, if you start without boundary conditions, this is equivalent to choosing a different Hilbert space $H$ (e.g. going from $H = \{f \in L^2(\Omega) : f|_{\partial \Omega} = 0\}$ to $H = L^2(\Omega)$). Remember that the question of whether an operator is bounded (let alone compact) depends not only on the operator, but on the domain as well. So, if we switch from one Hilbert space to the next, we might end up with an unbounded operator; in fact this is easy to demonstrate for examples like $H = L^2([0,1])$, $S = i\frac{d}{dx}$.
So, while there might be a (obvious) way to relate this to Stone-Weierstrass, I see this primarily as a failure of the Fredholm alternative; i.e. changing the boundary condition can lead to an unbounded (hence non-compact) operator, and so Fredholm fails.
