  We prove the existence, uniqueness, and $W^{1,2}$-regularity for the solution
to the Pfaff system with antisymmetric $L^2$-coefficient matrix in arbitrary
dimensions. Hence, we establish the equivalence between the existence of
$W^{2,2}$-isometric immersions and the weak solubility of the
Gauss--Codazzi--Ricci equations on simply-connected domains. The regularity
assumptions of these results are sharp. As an application, we deduce a weak
compactness theorem for $W^{2,2}_{\rm loc}$-immersions.
