Approximations of differentiable functions in locally convex spaces