In this work, we study the relative compactness of subsets of separable subspaces \(X_{s} \left( \Omega \right) \) of so-called additive Banach function spaces \(X \left( \Omega \right) \) , which include the rearrangement-invariant spaces defined on the bounded domain \(\Omega \subset R^{n}\) . We choose \(X_{s} \left( \Omega \right) \) such that the infinitely differentiable functions are dense in it. Moreover, we define the Banach–Sobolev spaces \(W_{X_{s} }^{m} \left( \Omega \right) \) generated by the above subspaces and we study the compactness of embedding between such spaces. The obtained results are used to establish the equivalent norms on these spaces. These results allow us to prove the Poincaré and Friedrichs-type inequalities for such Sobolev spaces.