the opening takbir (takbīrat al-iḥrām). He may even frame the intention a brief moment before the takbir, so long as this occurs within the time of the prayer. If, once the prayer has begun, he breaks that intention or becomes doubtful about it, the prayer is rendered invalid.¹
If a person praying alone changes his obligatory prayer into a voluntary one while there is still ample time, it is permissible; but if, by intention, he moves from one obligatory prayer to another, both prayers are invalid.²
The intention to lead (imāmah) and the intention to follow (iqtidāʾ) are both required. Should someone who began the prayer alone decide to become a follower, the prayer is not valid—whether it is obligatory or voluntary—just as it is not valid for him to switch and become an imam in an obligatory prayer. If a follower separates from the imam without a legitimate excuse, his prayer becomes invalid.
A follower’s prayer is also nullified if the imam’s prayer is nullified, and no deputy imam may be appointed in that situation. However, if the resident imam arrives, commences the prayer with the same congregation that his deputy had already led, and the deputy then steps back and joins as a follower, the prayer remains valid.