It says in SA OC Siman 309 Sif 3 that on Shabbos if one wants to carry a basket that has in it fruits for the purpose of the fruits themselves if there is a rock inside of the basket as well one must shake out the rock from the basket (in order that it shouldn't be a problem carrying a muktzeh item together with the fruit.) This is however only in a case where the fruits will not be damaged in the process (if they will be one doesn't have to shake out the rock.)
Why is this not a problem of borer when one shakes the basket with the intention and purpose of removing only the rock from the basket that is mixed together with the fruits? It could be however that the wording of the poskim (Shulchan Aruch itself as well as the SA HaRav in Siman 309 Sif 5 and M"B in Siman 309 Sif-Katan 11) that one is shaking out the fruit together with the rock therefore not a problem of borer. However from M"B Sif-Katan 10 we see that if there is a possibility to take out the rock itself then that should be done. So my question again is removing the rock from the basket by way of shaking it, why is this not considered to be a problem of borer?
Yehoshua, Yerushalayim, Eretz Yisrael
The key reference for us in this discussion is a Teshuvah of the Terumas ha'Deshen (#57) (quoted by the Rema in OC 319:3) who says that it is counter-intuitive to say that if you have a mixture of large distinct objects (his example: two kinds of fish, with big pieces of both kinds mixed together on a serving board) that sorting them out would be Borer. Nonetheless, he says, since Borer is an Isur d'Oraisa and we are not sure exactly how small and indistinguishable the pieces have to be to be considered Borer, we are careful unless we have a clear proof that it is permitted.
In our case of the basket of fruit and the stone, we have a clear proof that it is permitted to remove the stone: the Gemara in Shabbos which is the source for this Halachah! The Gemara says that if the fruit in the basket would be spoiled by dumping it on the floor along with the rock, then at least one should swirl the fruit around to the sides and dump out just the rock. So the Gemara itself says that one may remove just the rock, and thus it must not be Borer. In other words, we might not be sure what Borer is, but Chazal were and they said that it is okay to remove the stone.
What is interesting, though, is that that line in the Gemara that says that one should dump out just the rock was apparently not in the Rambam's Gemara (see the Beis Yosef on this Halachah for a discussion). According to the Rambam, there is no source to justify dumping out just the rock. According to the Rambam, the Gemara says only that one should dump out all of the contents of the basket and then put the fruit back in. That is not necessarily an act of Borer. When he dumps the contents out, the fruit and the rock might be sufficiently dispersed from each other so that when he puts the fruit back in it is not considered an act of Borer (see Shabbos 74a about dumping out a Ta'aroves in order to sort it).
Kol Tuv,
Yonasan Sigler
This is not a Psak Halachah