The mathematical structure of theories of semigeostrophic type