The Mishna teaches that a person is allowed to set up his eiruv tehumin conditionally, so that depending on the way events unfold in the course of Shabbat, he can choose to take his additional 2,000 amot either to the east or to the west. The examples that appear in the Mishna are:
If non-Jews approach the city from the east, I can run away from them to the west (and vice versa)
If a scholar approaches the city from the east, I can go towards him in that direction; if he approaches from the west, I can go to greet him in that direction.
The Gemara records that Rabbi Yitzhak came from Israel with the opposite tradition:
If non-Jews approach the city from the east, I can go towards them in that direction; if they approach from the west, I can go to greet them in that direction.
If a scholar approaches the city from the east, I can run away from him to the west (and vice versa)
To explain the discrepancy, the Gemara argues that the two traditions must be referring to different cases.
This case in the mishna is referring to a tax collector [parhagabena], from whom one wishes to flee; whereas that case in the baraita is referring to the lord of the town, with whom he wishes to speak…This case in the mishna is referring to a scholar who sits and delivers public Torah lectures, and one wishes to come and learn Torah from him; whereas that case in the baraita is referring to one who teaches children how to recite the Shema, i.e., one who teaches young children how to pray, of whom he has no need.
While our Mishna can be understood intuitively, Rabbi Yitzhak’s tradition still demands some explanation. According to Rabbi Yaakov Emden, welcoming the non-Jewish leader will permit setting up an not only because of the potential mitzva involved with presenting the Jewish community’s position to him, but also because welcoming a king – even a non-Jewish king – is itself a mitzva. With regard to the teacher of children who is visiting the town, Rabbi Emden explains that we must be talking about a situation where the individual knows that the teacher expects to be hosted in his home, and he does not have the provisions and wherewithal to honor him appropriately during his visit. In order to avoid this embarrassment, the individual is permitted to travel away from the city on Shabbat.