1) "CHAVOT RAMI"
OPINIONS: The Gemara discusses the case of a Sukah which has two layers of Sechach, a lower level and an upper level, and the boards of each level cover alternating areas. Abaye says that the Sukah is valid only when the lower and upper boards are less than three Tefachim away from each other; the principle of "Lavud" transforms them into one complete, flat roof. When the boards are more than three Tefachim away from each other, the Sukah is invalid.
Rava disagrees with Abaye and says that the Sukah is valid because of the principle of "Chavot Rami" -- the upper boards are considered to descend to the space between the lower boards, and they thereby complete the roof of the Sukah. The Halachah follows the opinion of Rava.
The Gemara qualifies the principle of "Chavot Rami." The Gemara says that "Chavot Rami" works only when the width of each board on the upper level is at least one Tefach. The Rishonim argue whether this is the only requirement, or whether there are other conditions that must be fulfilled in order to apply the principle of "Chavot Rami."
(a) RASHI (end of DH v'Tani Alah) and TOSFOS (DH Koros) imply that this is the only requirement; as long as each of the upper boards has a width of one Tefach, they are viewed as though they fill-in the spaces below and form a complete roof. The width of the spaces below, between the lower boards, is immaterial. (See CHIDUSHEI ANSHEI SHEM on the Rif, and BACH OC 631.)
(b) The RAN and RITVA add a second requirement. The space between the lower boards must also be at least one Tefach wide. If the spaces between the boards below are less than one Tefach wide, "Chavot Rami" does not apply.
This requirement is derived from the Mishnah in Ohalos (12:5) cited by the Gemara here, which says that between the lower boards there must be at least one Tefach of space in order for "Chavot Rami" to work.
(Rashi and Tosfos understand that the reason why the Mishnah in Ohalos says that there must be a Tefach between the lower boards is merely because it already stated that the width of the upper boards must be equal to the space below them. Since the upper boards must be one Tefach wide, the Mishnah expresses this requirement by saying that the space below them is one Tefach wide. However, even if the upper boards are one Tefach wide and the spaces below are not, "Chavot Rami" still applies.)
(c) The RITVA cites a third opinion that maintains that the spaces between the boards on the bottom row must not only be one Tefach wide, but they must be wide enough to contain the boards on top (that is, if the boards on top are two Tefachim, the spaces below must also be two Tefachim). Although the Ritva rejects this opinion, the PISKEI RID rules like this opinion, and this is also the ruling of the RAMBAM (Hilchos Sukah 5:21) according to the KESEF MISHNEH.
HALACHAH: The SHULCHAN ARUCH (OC 631:5) rules like the Rambam (c). The REMA rules like the Ran (b).

22b----------------------------------------22b

2) MEASURING THE SHADE OF A SUKAH
QUESTION: The Gemara asks that the Mishnah here (22a) and the first Mishnah in the Maseches (2a) contradict each other. The Mishnah here states that when the amount of shade in the Sukah is more than the amount of sunlight, the Sukah is valid. This implies that when there is an equal amount of shade as sunlight, the Sukah is invalid. The Mishnah earlier, however, states that when the sunlight in the Sukah is more than the shade, the Sukah is invalid, which implies that when they are equal, the Sukah is valid.
The Gemara answers that one Mishnah refers to "on top" and the other refers to "on bottom." RASHI explains the Gemara's answer as follows: Sunlight spreads in the Sukah as it moves farther away from the Sechach. The Mishnah here, which implies that a Sukah with equal amounts of shade and sunlight is invalid, refers to the amount of shade and sunlight at the level of the Sechach itself. When there is an equal amount of Sechach as there is open space, the Sukah is invalid. The reason it is invalid is because when the sunlight reaches the floor of the Sukah, there is more sunlight than shade.
Rashi's words are difficult to understand. Why does Rashi say that the Sukah is invalid because there is more sunlight than shade at the floor of the Sukah? He should say that it is invalid simply because at the top of the Sukah, there is not more Sechach than open space, and thus the open space is not Batel to the Sechach (see Rashi, beginning of 2a). Why does Rashi say that the validity of the Sukah depends on how much light there is at the floor of the Sukah, and not on how much Sechach and open space there is on the roof?
It must be that Rashi's words here are based on the opinion of Rav Papa (15a) who maintains that Sechach that is Parutz k'Omed (it has equal amounts of Sechach and open space) is valid. Therefore, Rashi needs to give another reason for why a Sukah with equal amounts of Sechach and open space is invalid, and thus he says that it is because there is more sunlight than shade at the bottom of the Sukah.
Two points are clear from the words of Rashi. First, when the shade and sunlight are equal, the Sukah is valid. Second, the amount of shade and sunlight that the Sechach produces is measured by how much shade appears on the floor of the Sukah.
Rashi, however, contradicts these points in his following comment. Rashi explains that the Mishnah at the beginning of the Maseches, which implies that the Sukah is valid when there are equal amounts of shade and sunlight, refers to when the shade and sunlight are equal on the floor of the Sukah, because that indicates that there is more shade than sunlight at the top of the Sukah, at the level of the Sechach. Rashi now says that it depends how much shade is created at the top of the Sukah! Rashi should say instead that the Sukah is valid because the amount of shade is measured at the floor of the Sukah, and since the Halachah is that Parutz k'Omed is valid, the Sukah is valid because there is an equal amount of shade as sunlight. Rashi, though, implies that the shade is measured at the top of the Sukah. Moreover, Rashi implies that there must be a majority of shade (on top), and not equal amounts of shade and sunlight. Rashi contradicts himself in two regards.
How are the words of Rashi to be reconciled?
ANSWERS:
(a) The RASHASH, based on the RAN, answers that Rashi purposely contradicts himself. Rashi's explanation of the two Mishnayos is based on two different opinions. First, Rashi explains that even according to Rav Papa, who says that Parutz k'Omed is valid, a Sukah that has equal amounts of Sechach and open space on top will be invalid because the amount of shade is measured at the floor of the Sukah, and at the floor there is less shade than sunlight. According to Rav Papa's opinion, it is obvious why the Sukah is valid when there is an equal amount of shade and sunlight on bottom, for Parutz k'Omed is valid.
Next, Rashi explains that the implication of the first Mishnah -- that the Sukah is valid when there are equal amounts of shade and sunlight on the bottom -- is true even according to Rav Huna brei d'Rav Yehoshua, who says that Parutz k'Omed is not valid. According to his opinion, it must be that the shade is measured at the top of the Sukah, and not on the floor. The reason why the Sukah is valid even when there is an equal amount of shade and sunlight on the floor is because we may assume that there is more shade than sunlight at the level of the Sechach. Thus, Rashi's first comment explains the Mishnah here according to Rav Papa, and his second comment explains the first Mishnah according to Rav Huna brei d'Rav Yehoshua.
However, the TUR (OC 631) makes a statement similar to Rashi's second comment. The Tur's objective, however, is to teach the Halachah, and not merely to explain the meaning of the Gemara's answer. Why does the Tur need to mention the opinion of Rav Huna brei d'Rav Yehoshua? Since the Tur rules like Rav Papa that Parutz k'Omed is valid (OC 628 and 631), he should explain the Halachah only according to Rav Papa!
(b) It appears that Rashi and the Tur understand the Gemara like the ROSH. The Rosh (2:3) writes that the argument of Parutz k'Omed applies only in a case in which half of the Sechach on the Sukah is valid and half of the Sechach is invalid. In contrast, the allowance of Parutz k'Omed does not apply in a case in which half of the Sechach is valid and the other half of the roof is open space. In that case, a Halachah l'Moshe mi'Sinai requires that there be a majority of shade in the Sukah. (Similarly, the principle of "Lavud," which serves to close an open space, does not validate the Sukah when there is more sunlight than shade.) What, then, does Rashi mean when he says that a Sukah that has equal amounts of Sechach and open space is invalid because it has more sunlight on the bottom? He should say that it is invalid because the shade and sunlight are equal on top!
The answer is that when the amount of shade in the Sukah is measured, the total amount of shade that is cast from the top of the Sukah until the floor is assessed. Therefore, it does not suffice to measure only the amount of shade at the level of the Sechach, or the amount of shade only on the floor. Rashi says that if, at the level of the Sechach, the shade and sunlight are equal, then it may be assumed that by the time the sunlight reaches the floor of the Sukah, there is more sunlight than shade, and thus the entire Sukah (from top to bottom) has more sunlight than shade (and is invalid). On the other hand, if, at the floor of the Sukah, the shade and sunlight are equal, then it may be assumed that at the top of the Sukah, there is more shade than sunlight. Although the light spreads and the shade diminishes as the sunlight approaches the floor, the entire amount of shade throughout the height of the Sukah may be assumed to be more than the sunlight, because at the floor they are equal. (M. Kornfeld)

OTHER D.A.F. RESOURCES
ON THIS DAF