A NIDAH IS RETROACTIVELY TEME'AH
(Once blood leaves a woman's Makor, i.e. her source of menstrual blood, and enters the Beis ha'Chitzon (outside the Makor, but still inside her body), she is Teme'ah.)
(Mishnah - Shamai): If any woman sees that she became a Nidah (Rashi - through a Bedikah; Me'iri - blood left her body), Dayah Sha'atah. (She is Teme'ah from now and onwards, but not retroactively);
Hillel says, she is retroactively Teme'ah from her last Bedikah (when she checked her Beis ha'Chitzon and did not find blood).
Chachamim say, retroactive Tum'ah is at most 24 hours. If her last Bedikah was in the last 24 hours, she is retroactively Teme'ah from then.
This applies to a woman without a Veses (regular period when she becomes a Nidah);
If she has a Veses, Dayah Sha'atah.
If a woman checked herself before and after relations, this (the latter checking) is like a Bedikah. It limits retroactive Tum'ah.
When Dayah Sha'atah applies, if she was sitting on a bed and dealing with Taharos, and got up from them and discovered that she is Teme'ah, the bed and Taharos remain Tehorim.
Even when she is retroactively Teme'ah, she counts (seven days of Nidah before immersing) from the time she saw blood.
(Gemara) Question: What is Shamai's reason?
Answer: She retains her Chazakah of being Tehorah. We assume this did not change (until now, when we know that she surely changed).
Hillel says that something retains its Chazakah when it itself has no Re'usa (reason to suspect that the Chazakah changed);
Here, since she is prone to become Teme'ah by herself, she does not retain her Chazakah.
IMMERSION IN A SAFEK MIKVEH
Question: Why is a Nidah different than something immersed in a (possibly deficient) Mikveh?
(Mishnah): If "A" (a person or Kli) was (Tamei, and) able to be Metamei "B," and 'A' was immersed in a Mikveh (which used to be full, i.e. it had 40 Se'ah) that was later measured and found to be deficient:
Whether "A" (later) touched "B" in a Reshus ha'Rabim or Reshus ha'Yachid (public or private domain), "B" is Tamei.
According to Shamai, "B" should be Tahor! (We should say that the Mikveh was full until right now);
According to Hillel (and Chachamim), we should say that it was a Safek immersion (perhaps the Mikveh was full. We should Metaher in Reshus ha'Rabim), just like the retroactive Tum'ah of a Nidah is Safek. If she had touched Taharos, we are Toleh. I.e. we do not eat them, nor burn them (until they become definitely Tamei or Nosar)!
Answer #1: "A" is (considered) Vadai (definitely) Tamei because it retains its Chazakah (it was Tamei). Perhaps the immersion was invalid.
Question: Just the contrary! The Mikveh should retain its Chazakah. We should say that it was full (at the time of immersion, so the immersion was valid)!
Answer: We do not say this because we see that the Mikveh is deficient now.
Question: Likewise, the Nidah sees blood now (yet she retains her Chazakah)!
Answer: We assume that the blood came just a moment ago.
Question: Likewise, we should assume that the Mikveh became deficient just a moment ago!
Answer: No. It is normal for a Mikveh to steadily lose water;
Dam Nidah does not come steadily.
Question: Indeed, perhaps blood was steadily accumulating in the Makor. What exceeds the capacity of the Makor flows out!
Answer #2: A Nidah has only one Re'usa (she sees blood now). Regarding the Mikveh there are two (the Chezkas Tum'ah of what was immersed, and the Mikveh is deficient now).
THE DIFFERENCE BETWEEN NIDAH AND MIKVEH
Question (against Shamai): Why is Nidah different from the case of a barrel? (We assume that Shamai agrees with the following Beraisa.)
(Beraisa): Reuven had a barrel of wine, from which he would often take Terumah. (He would declare that a certain volume of the contents is Terumah to fix (permit) his Tevel.) Once, he tasted it and discovered that it had turned to vinegar. Three days are Vadai, and past that is Safek. (R. Yochanan explains that for 72 hours after the previous tasting (before it soured), surely it was still wine. After that, perhaps it was vinegar, and any Tevel fixed from then is Safek Tevel, for perhaps the Terumah was invalid. R. Yehoshua ben Levi explains, (since it is strong vinegar now), for 72 hours before the last tasting it was surely vinegar. Any Tevel fixed in this period is Vadai Tevel. Before this, perhaps it was wine. If Tevel was fixed, it is Safek Tevel).
Shamai assumes that nothing changed until the last possible moment!
Answer: We consider it Safek Tevel because it was Muchzak to be Tevel. Perhaps it was not fixed.
Question: Just the contrary! The wine retains its Chazakah. It was still wine (when Terumah was taken, so the Tevel was fixed)!
Answer: We do not say this because we see that it is vinegar now.
Question: Likewise, the Nidah sees blood now!
Answer: We assume that the blood came just a moment ago.
Question: Likewise, we should assume that the wine became vinegar just a moment ago (according to R. Yochanan; according to R. Yehoshua ben Levi, 72 hours ago, the latest possible time)!
Answer: No. It is possible that the wine was steadily souring, but Dam Nidah does not come steadily.
Question: Indeed, perhaps blood was steadily accumulating in the Makor, and the excess over its capacity flows out!
Answer: A Nidah has only one Re'usa. Regarding the barrel, there are two. (There is Chezkas Tevel, and the barrel is now vinegar.)
Question: Why do we consider the wine to be Safek Tevel, but the Taharos (in the Mishnah of the Mikveh) are considered Vadai Tamei?
Answer (R. Chanina of Sura): R. Shimon taught the Beraisa of the barrels. He holds that also Taharos are Safek Tamei.
(Beraisa): If a Mikveh (which once was full) was measured and found to be deficient, anything that touched something immersed in the Mikveh, whether it touched in a Reshus ha'Rabim or Reshus ha'Yachid, is Tamei;
R. Shimon says, (if it touched) in a Reshus ha'Rabim it is Tahor. (If it touched) in a Reshus ha'Yachid, Tolin.