Poincaré and Friedrichs inequalities in abstract Sobolev spaces