The foundations of quantum theory