1. One may not have more than three Tefachim of empty space between the Sechach and a (critical) wall of the Sukah.
2. One may have up to four Amos of invalid Sechach between a wall and the Sechach and still consider the wall as part of the Sukah.
3. The Mishnah gives examples where this rule is applied (#2).
4. One must have at least over four Tefachim of valid Sechach on a Sukah of seven by seven Tefachim.
5. There is a dispute about how much invalid Sechach in the middle of the Sukah disqualifies the Sukah.
A BIT MORE
1. This amount of space (three Tefachim) separating between the entire length of the top of the wall and the Sechach causes the wall to be considered disconnected from the Sukah. It does not qualify as a wall of the Sukah.
2. This is due to the Halachah of Dofen Akumah ("a crooked wall") which causes the wall to extend and be connected to the Sukah when it is connected with invalid Sechach (as opposed to empty space).
3. For example, if a person had a house and he put Sechach in the middle of the roof, as long as there is less than four Amos from the walls to the Sechach on all sides, the Sukah is valid.
4. This is because the Sukah must have a minimum amount of valid Sechach. If there is less than three Tefachim of invalid Sechach next to a wall, it is still valid because overall there is a majority of valid Sechach.
5. Shmuel: Four Tefachim of invalid Sechach placed along the entire length or width of the Sukah disqualifies the Sukah. Rav: Just as the minimum amount of invalid Sechach that disqualifies a Sukah from the side is four Amos (as stated in the Mishnah), when placed in the middle of the Sukah it also disqualifies the Sukah only when it is at least four Amos wide.