And thus the sages taught (43b): "A corpse lying in the sun, two people come and sit by its side. If it is hot for them from below, this one brings a bed and sits on it and that one brings a bed and sits on it. If it is hot for them from above, they bring a mat and spread it over them. This one tilts up his bed and slips away and goes off, and that one tilts up his bed and slips away and goes off, and the partition is found to have been made on its own," see there, for the mat remains spread over the beds and it protects the corpse from the sun. And to do so initially for the sake of the corpse is forbidden, and even though a vessel may be moved for the sake of a thing that may not be moved, nevertheless there is the making of a tent here, and even for the sake of the living they did not permit it for the purpose of a partition and a tent; therefore they first bring beds for sitting. And as for that which they must wait until it is hot for them from below, when they could immediately bring beds for sitting, rather, in truth it is a stringency that they applied in this matter so that it should be very evident that this is for the sake of the living (Tosafot ibid. s.v. 'cham'). And so too specifically when they first spread the mat over their heads and afterwards when they slip away the mat remains on the beds, but to spread it initially over the beds is forbidden on account of a tent (ibid. s.v. 'uforsin' and in Rashi there). And since at the time of the making it was evident that it was for the sake of the living, they are then permitted to slip away from under the mat and it shall remain over the corpse (ibid. s.v. 'venishmat'). And this permission is in a place where there is no loaf of bread or child, or where there is no place of shade, or even if they desire not to move it from its place. For even though there is great exertion in this, nevertheless one may do so since at the time of the making he does it for the sake of the living as we have written. (See Turei Zahav subsection 6 for what he answered to the difficulty of the Beit Yosef, and this is the intent of the Magen Avraham subsection 17, and this is also the intent of the Tosafot ibid. s.v. 'cham' as we have explained. And nevertheless it is difficult, for if so, why did Rav Sheshet say: 'Go out and say to Rabbi Yehuda, who says a vessel is not moved except for a thing that may be moved, Rav Huna already interpreted it... from this law.' But in this law everyone agrees for the sake of a distinction as we have written, and we do not rule like Rabbi Yehuda, and this is the intent of the Beit Yosef in his difficulty. And it is a severe difficulty, unless we say that the intent of Rabbi Shimon is not exactly like Rabbi Yitzchak, and it is a forced explanation, and delve into it.)
וכך שנו חכמים (מ"ג:): "מת המוטל בחמה, באים שני בני אדם ויושבים בצדו. חם להם מלמטה, זה מביא מטה ויושב עליה וזה מביא מטה ויושב עליה. חם להם מלמעלה, מביאים מחצלת ופורסין עליהם. זה זוקף מטתו ונשמט והולך לו וזה זוקף מטתו ונשמט והולך לו, ונמצאת מחיצה עשויה מאליה" ע"ש, דהמחצלת נשארה פרוסה על המטות והיא מגינה על המת מפני החמה. ולעשות לכתחלה בשביל המת - אסור, ואף על גב דכלי ניטל לצורך דבר שאינו ניטל, מכל מקום הא יש בכאן עשיית אהל, ואפילו לצורך החיים לא התירו לשם מחיצה ואוהל, לכן מקודם מביאין מטות לישיבה. וזה שצריכים להמתין עד שיהא חם להם מלמטה, והרי תיכף יכולין להביא מטות לישיבה, אלא דבאמת חומרא היא שהחמירו בזה כדי שיהא ניכר הרבה שזהו לצורך החי (תוספות שם ד"ה 'חם'). וכן דווקא כשמקודם פורסים המחצלת על ראשם ואחר כך כשנשמטין נשאר המחצלת על המטות, אבל לפרוס לכתחלה על המטות - אסור משום אהל (שם בד"ה 'ופורסין' וברש"י שם). וכיון שבשעת עשייה היה ניכר שהוא בשביל החי, שוב רשאין להשמט מתחת המחצלת ותשאר על המת (שם בד"ה 'ונשמט'). והיתר זה הוא במקום שאין ככר או תינוק, או שאין מקום צל, או אפילו אם רוצים שלא להזיזו ממקומו. דאף על גב דיש בזה טירחא רבה, מכל מקום יכול לעשות כן כיון שבשעת עשייה עושה בשביל החיים כמ"ש. (עיין ט"ז סק"ו מה שתירץ על קושית הב"י, וזהו כוונת המג"א סקי"ז, וזהו גם כוונת התוספות שם בד"ה 'חם' וכמו שבארנו. ומכל מקום קשה, דאם כן מה אמר רב ששת: 'פוקו ואימרו ליה לרבי יהודה שאומר אין כלי ניטל אלא לדבר הניטל, כבר תרגמא רב הונא… מהך דינא'. והא בהך דינא הכל מודים בשביל היכר כמ"ש, וכרבי יהודה לא קיימא לן, וזהו כוונת הב"י בקושיתו. וקושיא חמורה היא, אם לא שנאמר דכוונת רבי שמעון לאו דווקא ממש כרבי יצחק, ודוחק ודו"ק)