Bava Basra, Chapter 2, Mishnah 12. This Mishnah also deals with trees that are too close to a neighbor's property, but here the problem does not stem from the roots. Here, the issue is the need for cultivation: one who plants a tree is required to plow the area around it, and this work requires space - four amos. From this it is obvious that one who plants his tree close to his neighbor's field will end up trampling the neighbor's crops while tending to the tree, and therefore this is forbidden.
The text of the Mishnah:
"Lo yita adam ilan samuch lesedeh chaveiro ela im kein hirchik mimenu arba amos" - A person may not plant a tree close to his neighbor's field, where the neighbor grows some crop, unless he distances it four amos from the property line, so that when he tends to his tree he will not trample his neighbor's produce.
"Echad gefen ve'echad kol ilan" - This law does not apply only to vines, for which it is universally known that one must leave these four amos, but to any tree, since every tree generally requires four amos around it.
The Gemara concludes that perhaps in Bavel they used narrower plows, and therefore two amos were sufficient. The rule that emerges from here is simple: whatever amount of space is customary in that place and time for tending to a tree - that is the distance the planter must distance his tree from his neighbor's field.
And Rabbi Yosi agrees with this law. There is no discussion here regarding the question of "girei dileih" (his own arrows), since we are dealing with a case where the assessment is that the planter will end up damaging his neighbor's property by trespassing and trampling, and for this reason he does not have the right to do so.
"Hayah gader beintayim":
If there is a fence separating the tree and the neighbor's field - "Zeh someich legader mikan vezeh someich legader mikan" - each one may plant whatever he wishes right up to the fence. The fence prevents a situation where a person would step into his neighbor's field while tending to his tree, since he will not walk around there when the fence blocks his path. And we are not concerned that he might climb over the fence and jump into his neighbor's property. Therefore, there is no problem with this.
Roots extending into a neighbor's field:
From here, the Mishnah returns to the subject of the previous Mishnah - roots invading a neighbor's field. This deals with one who planted permissibly, even according to Rabbi Yosi, who is allowed to plant wherever he wishes within his own property, at a distance of twenty-five amos as explained in the Talmud. The Mishnah says: "Hayu shorashav yotzin leitoch shel chaveiro" - The roots do not only cause damage to installations in the field, but they also interfere with the simple work of plowing, since these roots are very hard, and they damage the plow, breaking it or hindering its operation when the owner of the field wishes to plow in order to sow crops.
Therefore, the owner of the field may remove the roots: "Maamik sheloshah tefachim" - he digs to a depth of three tefachim, which is the depth the plow reached in the days of the Mishnah, where the interference occurs. Beyond this depth, he has no right to dig deeper, since it does not bother him; but in any place where the interference extends to a greater depth - he may dig deeper. As the Mishnah phrases it: "Kedei shelo ye'akeiv es hamachareishah" - so that the roots of the neighbor's tree will not hinder the plow from doing its work.
And if there is a water cistern in his field - a round pit, a long and narrow trench, or a square, roofed cave - roots that pierce the walls of the plastered cistern will inevitably cause cracks and the loss of water. In this case, the owner of the field may dig to whatever depth he desires, to the full depth of his cistern, and remove the roots, since his neighbor has no right for his roots to be in his property and cause him trouble. And even Rabbi Yosi agrees to this: he may plant his tree within his own property, but this does not grant permission for his roots to cause damage in his neighbor's field.
Ownership of the chopped wood:
May the neighbor who cuts them take the wood of the roots for himself? The Gemara says that this depends on their distance from the tree:
Roots located more than sixteen amos from the tree: These are not essential roots that the tree depends on, and therefore the one who cuts them may take them for himself.
Roots located within sixteen amos of the tree's trunk: These are considered an essential part of the tree, which it depends on to nourish itself, and therefore they are considered part of his fellow's tree. He is permitted to cut them, but he may not take the wood for himself; rather, he must return it to its owner.
Many struggle to understand why a person may not take for himself the roots found in his own property. What can this be compared to? To a soccer ball that flies over the fence into a neighbor's yard: it is clear that the yard owner may demand that the ball be removed from there and may even kick it back, but he is not permitted to keep it for himself. Similarly, regarding someone who parks his car in his fellow's private parking spot: the owner of the parking spot may tow the car away, since it has no right to be there, but he may not take the car for himself just because it was left on his property. The exact same law applies here: the neighbor may not take for himself the tree or its parts, meaning the roots, just because they entered his field, but he is certainly permitted to cut them. Beyond sixteen amos, the roots are no longer considered part of the tree, and therefore there he may even keep them for himself.
In summary: In this Mishnah we learned the obligation to distance when planting a tree near a fellow's field - four amos, as the measure required to cultivate the tree, and in Bavel only two amos, all according to local custom; that when there is a fence, the concern is nullified and everyone may plant right up to the fence on either side; that roots extending into a fellow's field are cut to a depth of three tefachim, and opposite a pit, ditch, or cave - to their full depth; and finally, that ownership of the cut wood is determined by the distance of sixteen amos from the tree.