the evidence cannot be used to establish either one of the two meanings in particular without further proof.
Thus, the stronger view is that prayer behind an openly sinful person is valid. If a man prays behind someone who shaves his beard, smokes, consumes usury, commits adultery, or steals, his prayer is valid. However, the less sinful of two openly sinful persons should be given precedence over the more sinful; thus, one who merely trims his beard should be preferred to one who shaves it.
His statement, “like a disbeliever,” means: just as prayer behind a disbeliever is invalid. Here, the author—may Allah have mercy on him—intends to draw an analogy between two things that do not share the same effective cause: he seeks to analogize the openly sinful person to the disbeliever. Yet, for an analogy to be valid, the original case and the analogous case must be equal in their effective cause, so that they may be equal in their ruling. If they differ in their effective cause, the analogy is invalid. Here, there is a vast difference between them: the disbeliever’s prayer is invalid, whereas the openly sinful person’s prayer is valid.
Thus, a man who follows a disbeliever in prayer is treating the matter lightly, for he knows that this disbeliever’s prayer is invalid. How could he follow in prayer someone whose prayer he knows to be invalid?!
As for an openly sinful person, his prayer is valid, because he has followed someone whose prayer is valid. The basic principle is that whoever’s prayer is valid may validly lead the prayer, because imamate is subsidiary to prayer.
It is also possible that the author—may Allah have mercy on him—means to compare a matter over which there is disagreement with one upon which there is agreement, not to establish the ruling by means of that comparison. That is, it is as though he is saying: Prayer behind an openly sinful person is invalid, just as it is invalid by consensus behind a disbeliever. But this too is open to question, for the opposing party may say: “I do not concede this. Rather, I maintain that prayer behind an openly sinful person is valid, while prayer behind a disbeliever is invalid, and I distinguish between the two.”