Entanglement and the linearity of quantum mechanics