Each person prays according to his own state with God. This is why the Law only commands a follower to follow his prayer leader in what he sees him do, such as rising and lowering himself.
(Knowing the Prayer Leader’s Condition)
If the prayer leader’s condition is unveiled to the follower, his ruling accords with what has been unveiled to him. If he knows that the prayer leader is without ritual purity, he may no longer follow him from the time he comes to know it. What has passed of his prayer with the leader before he knew remains valid. In this respect, whether the leader has forgotten or acts deliberately is immaterial. From the time the follower comes to know, the leader is legally outside prayer from his standpoint, and God has commanded him to attach himself, meaning to follow, only someone engaged in prayer.
If the prayer leader has forgotten his major ritual impurity or what invalidated his ritual purity, he is legally engaged in prayer, the follower’s prayer is legally valid, and he is following someone legally engaged in prayer. If the follower knows that the leader is without ritual purity and can inform him during the prayer itself of what invalidated his ritual purity, he should inform him in a way that leaves his own prayer valid. For God says, “Do not invalidate your deeds” [Muhammad 47:33].
If he is unable to do this, he prays on his own. When he has finished his prayer, he informs the leader of what invalidated his ritual purity, whether or not the leader has finished. If the leader remembers or takes the follower’s word for it, he purifies himself.[93] If he neither remembers nor takes the follower’s word for it, he acts according to what his knowledge and legal position require in the matter. The follower’s prayer is valid.
Notes
Translator’s note TN1889-1: The text first gives the follower’s ruling from the moment he learns of the leader’s lack of ritual purity, then separately describes the legal standing of a leader who has forgotten. It states both rulings without further reconciling them.