For bounded domains Ω, we prove that the Lp-norm of a regular function with compact support is controlled by weighted Lp-norms of its gradient, where the weight belongs to a class of symmetric non-negative definite matrix-valued functions. The class of weights is defined by regularity assumptions and structural conditions on the degeneracy set, where the determinant vanishes. In particular, the weight A is assumed to have rank at least 1 when restricted to the normal bundle of the degeneracy set S. This generalization of the classical Poincaré inequality is then applied to develop a robust theory of first-order Lp-based Sobolev spaces with matrix-valued weight A. The Poincaré inequality and these Sobolev spaces are then applied to produce various results on existence, uniqueness and qualitative properties of weak solutions to boundary-value problems for degenerate elliptic, degenerate parabolic and degenerate hyperbolic partial differential equations (PDEs) of second order written in divergence form, where A is calibrated to the matrix of coefficients of the second-order spatial derivatives. The notion of weak solution is variational: the spatial states belong to the matrix-weighted Sobolev spaces with p = 2. For the degenerate elliptic PDEs, the Dirichlet problem is treated by the use of the Poincaré inequality and Lax–Milgram theorem, while the treatment of the Cauchy–Dirichlet problem for the degenerate evolution equations relies only on the Poincaré inequality and the parabolic and hyperbolic counterparts of the Lax–Milgram theorem.