Elementary theory of heterojunctions