Is there like a procedure/recipe to construct dense spaces (of functions) in other spaces (of functions)?

67 Views Asked by At

I am going back and forth in Rudin's Real and complex analysis. One thing that I wonder is if there's like a general way to construct dense spaces in other spaces.

For example there're a lot of approximations theorems in the book, like any measurable function can be arbitrarily approximated by a continuous function with compact support or functions with compact supports are dense in $L^p(X)$.

I was however wondering if it is possible to do similar things for differentiable functions. Like is there any function space of differentiable functions dense in $L^p$ maybe?

A related question is this one I think : Boundedness of smooth functions approximating an Lp function

I think however I wonder : 1) where is that result coming from and 2) can I fix say $C^k$ ($k < \infty$) rather than $C^{\infty}$