This depends on the ruling when two men know for certain that one of them has invalidated his ritual purity, or that one of them has divorced his wife. There are two views:
The first is that neither man is required to purify himself, nor is either subject to a ruling of divorce. This is the position of al-Shāfiʿī and others, and one of the two views within Ahmad’s school. The uncertainty concerns two men, not one, so each may presume that his own previous state continues.
The second is that the two are treated as a single person. This is the other view within Ahmad’s school, and it is stronger, because an obligation or prohibition certainly applies to one of them, and there is no justification for exempting them both.
The underlying reason for what we have said is that when the pure cannot be distinguished from the impure, both must be avoided. Using both entails committing a forbidden act, while either one must also be avoided because declaring it lawful rather than the other would be arbitrary. Accordingly, those who granted permission in certain cases supported that permission with the exercise of judgment, or with both that and the presumption of continued lawfulness.
But if something was certainly lawful and has not come into contact with anything judged impure, how could it become impure? Thus, if someone knows for certain that there is an impure spot in a mosque or elsewhere, but does not know precisely where it is, and then prays somewhere within that area without knowing that it is the contaminated spot, his prayer is valid. That place was certainly pure, and he does not know that it has become impure. Likewise, if some mud from the streets gets on him, it is not judged impure, even if he knows that some of the mud in the streets