DOFEN AKUMAH [Sukah:Dofen Akumah]
(Mishnah): If the Sechach was three Tefachim from the walls, it is Pasul.
If the roof caved in and one put Sechach in its place, if there are four Amos from the wall to the Sechach it is Pasul.
Gemara - Rabanan of Bei Rav: Air (a gap in the Sechach) of three Tefachim disqualifies a Sukah. Pasul Sechach of four Tefachim disqualifies.
Rabah: Surely, you learn that the Shi'ur for air is three Tefachim from the Reisha. You should learn from the Seifa that the Shi'ur for Pasul Sechach is four Amos!
Rabanan: Rav and Shmuel explained that the Seifa is due to Dofen Akumah (we view the wall as if it is bent and meets the Kosher Sechach).
Rif: The Halachah follows Shmuel, who says that the Shi'ur for Pasul Sechach is four Tefachim in the middle and four Amos from the side. This is because this is like Rav in the first version. This refers to a big Sukah. In a small Sukah the Shi'ur is three Tefachim in the middle or on the side.
Rosh (ibid.): If four Tefachim of Pasul Sechach goes (parallel to the opening) from one side wall to the other, if a Shi'ur Sukah remains between it and the middle wall, the inner part of the Sukah is Kosher. If all this Pasul Sechach is within four Amos of the middle wall, even the outer part of the Sukah is Kosher through Dofen Akumah...
Rambam (14): If the roof caved in and one put Sechach in its place, if there is four Amos from the wall to the Sechach it is Pasul. If there is less than four Amos we view the wall as if it is bent and the Pasul Sechach is part of the wall, and it is Kosher. This is a tradition from Sinai.
Shulchan Aruch (OC 632:1): Pasul Sechach from the side disqualifies only if it is four Amos. Less than this is Kosher, because of Dofen Akumah. I.e., we view the wall as if it was bent, and the Pasul Sechach was part of it. This is a tradition from Moshe from Sinai.
Beis Yosef (DH u'Mah she'Chosav Rabeinu and DH Aval): The Tur permits even if the wall is only 10 Tefachim tall and the roof is much higher. He learns from Rashi, who explains that the Mishnah disqualifies if the Sechach is three Tefachim horizontally from the walls, but we are not concerned for vertical distance. However, the Ran (2a DH Banah) says that we say Dofen Akumah only if the wall reaches to (the height of) the Sechach.
Question (Maharlach, in Chidushei Hagahos on the Tur): Rashi suggested that perhaps we view the wall as bending by itself to meet the Kosher Sechach. He rejected this, for if so we would allow up to four Amos of air on the side for the same reason. Rather, the Pasul Sechach is considered part of the wall, but air cannot be part of the wall. Similarly, if air vertically separate the walls from the Sechach we cannot apply Dofen Akumah (unlike the suggestion), just like the Ran!
Answer (Maharlach, ibid.): The Beis Yosef had a different source to say that Dofen Akumah applies even when the walls are lower than the Sechach. A platform can fix a Sukah above 20 Amos through Dofen Akumah (4a). Rabah holds that when the walls meet the Sechach we are not concerned for the height, so he must explain that this is when the walls are lower than the Sechach.
Question (Taz 1): The Beis Yosef says that the Tur learns from Rashi, that if Dofen Akumah would not apply when there is a vertical gap, it would not fix a horizontal gap. Just the contrary! Surely Dofen Akumah applies when the walls are below the Sechach and can 'receive' Pasul Sechach to become part of the wall. The Chidush is that it applies even when the walls reach the Sechach!
Note: Presumably, the Taz holds that the Tur says 'even if the wall is only 10 Tefachim tall and the roof is much higher' to permit even if the Sechach is more than four Amos above the wall. This is a Chidush, for Dofen Akumah does not bend a wall four Amos horizontally.
Magen Avraham (1): The Shulchan Aruch connotes that we say Dofen Akumah only if the wall reaches to (the height of) the Sechach.
Rebuttal (R. Akiva Eiger): The Ran says this because he holds that we may apply only one tradition from Sinai, not two (Gud Asik Mechitza to project the wall upward, and Dofen Akumah). The Shulchan Aruch rules unlike the Ran. It allows (630:9) walls that are within three of the ground (Lavud) and do not reach the Sechach (we apply Gud Asik), even if the Sechach is (horizontally) up to three Tefachim away (Lavud)!
Mishnah Berurah (4): If the Sechach is horizontally within three of the wall, all agree that we say Gud Asik and Lavud.
Rebuttal (Chazon Ish OC 77:7): The Ran says, according to the opinion that we never say Lavud in the middle, that we do not say Dofen Akumah and Lavud, i.e. even on the side.
Therefore, if the roof caved in in the middle and one put Sechach there, if there are less than four Amos from the Kosher Sechach to the wall it is Kosher. However, one may not sleep under it if there are at least four Tefachim.
Source (Beis Yosef ibid.): Rashi and the Ran say that Dofen Akumah views the Pasul Sechach to be part of the wall. Therefore, one may not sleep under it.
Shulchan Aruch (ibid.): This refers to a big Sukah with seven by seven Tefachim without the Pasul Sechach. In a small Sukah that is only seven by seven Tefachim, it is Kosher only if the Pasul Sechach is less than three Tefachim. One may sleep under it.