In the construction taught here, غَيْرُ is mudaf to a definite noun but remains indefinite:
جَاءَ رَجُلٌ غَيْرُ الْمُعَلِّمِ — a man other than the teacher came.
مَرَرْتُ بِرَجُلٍ غَيْرِ الْمُعَلِّمِ — I passed by a man other than the teacher.
Contrast an ordinary idafah: كِتَابُ الطَّالِبِ is definite through its definite mudaf-ilayh. Do not transfer that result mechanically to غَيْرُ الْمُعَلِّمِ.