Kelim, Chapter Nineteen, Mishnah Three
1) If a part of a mattress hangs over, it is unclean whatever its length, the words of Rabbi Meir.
a) Rabbi Yose says: only that which is shorter than ten handbreadths.
2) The remnant of a mattress remains unclean if the length is at least seven handbreadths from which a donkey’s covering can be made.
Section one: It seems that during the time of the Mishnah, not all beds were used with mattresses. The Geonim (rabbis in Babylonia in the 8-11th centuries) defined the word that I have translated as “mattress” in the following way: “a wool garment which rich people put on their beds underneath the regular bedding. And they put it on the edge of the bed frame.”
If the mattress hangs over the bed, according to Rabbi Meir no matter how long the part that hangs over is, it is all considered to be connected to the bed and if the bed is impure, all of the mattress is impure.
Rabbi Yose says that only that which is shorter than ten handbreadths (this is quite long). Anything longer is already far enough away from the bed that it has an independent status of impurity.
Section two: The remnant of a mattress can remain unclean if it is at least seven handbreadths long, because this is the measure that could be used to make a donkey’s covering. This goes according to the general principle that as long as something can still be used as a vessel it retains its impurity.