If a person does this, their fast remains valid, as it is confirmed that they ate during the night. Similarly, if someone eats while uncertain and remains unsure whether they ate before or after dawn, their fast is still valid. This is based on the maxim of Sharia Law, which states: "Certainty is not removed by doubt." Certainty, here, is the presence of night, and the doubt concerns the arrival of dawn. Therefore, one relies on certainty and disregards doubt.