Ohalos1: 6
אָדָם אֵינוֹ מְטַמֵּא עַד שֶׁתֵּצֵא נַפְשׁוֹ, וַאֲפִילּוּ מְגֻיָּד וַאֲפִילּוּ גוֹסֵס. זוֹקֵק לַיִּבּוּם, וּפוֹטֵר מִן הַיִּבּוּם, מַאֲכִיל בַּתְּרוּמָה, וּפוֹסֵל בַּתְּרוּמָה. וְכֵן בְּהֵמָה וְחַיָּה אֵינָן מְטַמְּאִין עַד שֶׁתֵּצֵא נַפְשָׁם. הֻתְּזוּ רָאשֵׁיהֶם, אַף עַל פִּי שֶׁמְּפַרְכְּסִין, טְמֵאִין, כְּגוֹן זָנָב שֶׁל הַלְּטָאָה שֶׁהִיא מְפַרְכָּסֶת:
A person does not convey [corpse-] tumah until his soul departs, even if he is fatally wounded or even if he is moribund. [Similarly,] he [still] binds [his dead brother’s wife] for yibum, releases [her] from yibum, entitles [his wife] to eat terumah, and disqualifies [her] from [eating] te-rumah. Similarly, domesticated and wild animals do not convey tumah until they have died. [If] their heads were severed, they are tamei, even if they are [still] moving convulsively; [the movements are] like the [severed] tail of a lizard that is moving convulsively.