The Monge–Ampère constraint: Matching of isometries, density and regularity, and elastic theories of shallow shells