מתני׳ מרחיקין את האילן מן הבור עשרים וחמש אמה ובחרוב ובשקמה חמשים אמה בין מלמעלה בין מן הצד אם הבור קדמה קוצץ ונותן דמים ואם אילן קדם לא יקוץ ספק זה קדם וספק זה קדם לא יקוץ ר' יוסי אומר אע"פ שהבור קודמת לאילן לא יקוץ שזה חופר בתוך שלו וזה נוטע בתוך שלו:
MISHNA: One must distance a tree twenty-five cubits from a cistern, and in the case of a carob and of a sycamore tree, whose roots extend farther, one must distance the tree fifty cubits. This is the halakha whether the cistern or tree is located above or to the side of the other. If the digging of the cistern preceded the tree, the owner of the tree cuts down the tree and the owner of the cistern pays him money. And if the tree preceded the cistern the owner of the tree need not cut down the tree. If it is uncertain whether this came first or that came first, the owner of the tree need not cut down the tree. Rabbi Yosei says: Even if the cistern preceded the tree, the owner of the tree need not cut down the tree. This is due to the fact that this one digs in his own property, and that one plants in his own property.
איתמר הבא לסמוך בצד המצר אביי אמר סומך ורבא אמר אינו סומך בשדה העשויה לבורות דברי הכל אינו סומך כי פליגי בשדה שאינה עשויה לבורות אביי אמר סומך דהא אינה עשויה לבורות רבא אמר אינו סומך דאמר ליה כי היכי דאת אימלכת וחפרת אנא נמי ממלכנא וחפרנא איכא דאמרי בשדה שאינה עשויה לבורות דברי הכל סומך כי פליגי בשדה העשויה לבורות אביי אמר סומך אפילו לרבנן דאמרי מרחיקין את האילן מן הבור עשרים וחמש אמה התם הוא דבעידנא דקא נטע איתא לבור אבל הכא בעידנא דקא חפר ליתא לבור ורבא אמר אינו סומך ואפילו לרבי יוסי דאמר זה חופר בתוך שלו וזה נוטע בתוך שלו הני מילי התם דבעידנא דקא נטע ליתנהו לשרשיו דמזקי לה לבור אבל הכא אמר ליה כל מרא ומרא דקא מחיית קא מרפית לה לארעאי
§ It was stated: With regard to one who comes to dig any of these excavations or place any of the items listed in the mishna close to the boundary of his field, where his neighbor currently has no pit, Abaye says: He may dig or place them close to the boundary; and Rava says: He may not dig or place them close to the boundary. The Gemara explains: All agree that he may not dig or place them close to a field of his neighbor if that field is designated for digging pits, as he will thereby restrict his neighbor from using his field in the manner it is expected to be used. When they disagree it is with regard to a field that is not designated for digging pits. The Gemara elaborates: Abaye says: He may dig these excavations or place these items close to the boundary, as the neighbor’s field is not designated for pits, so he is not causing any damage by doing so. Rava says: He may not dig these excavations or place these items close to the boundary, as the neighbor can say to him: Just as you changed your mind and dug a pit, I too might change my mind and dig a pit, and I will no longer be able to dig near my border if you dig your pit close to the boundary. There are those who say a different version of this discussion: All agree that one may dig these excavations or place these items close to the boundary of a field that is not designated for digging pits. When they disagree it is with regard to a field that is designated for digging pits. Abaye says: One may dig these excavations or place these items close to the boundary; and this is the halakha even according to the opinion of the Rabbis, who say in the mishna (25b): One must distance a tree twenty-five cubits from a cistern, lest the roots of the tree grow and damage a neighbor’s cistern in his field. The difference is that there it is prohibited, as when he plants the tree there is already a cistern. But here, at the time when he digs his cistern, there is as yet no cistern in his neighbor’s field. And Rava says: One may not dig these excavations or place these items close to the boundary; and this is the halakha even according to the opinion of Rabbi Yosei, who says in that same mishna: This one may dig in his field and that one may plant in his field, i.e., one need not distance his tree for fear of damaging his neighbor’s field through expanding roots. The reason that Rava maintains that his ruling is correct even according to the opinion of Rabbi Yosei is that this matter applies only there, as when he plants the tree, its roots, which might damage the cistern, are not yet present. Consequently, when he plants he does not cause any damage. But here, the neighbor can say to him: Each and every strike of yours with the hoe loosens my earth, and therefore you are already causing damage as you dig your cistern.
Nesivos HaMishpat 155:18