If1 the imam makes a mistake, the follower must join him in the prostration of forgetfulness; but if the imam does not prostrate, the obligation falls on the follower alone.
Should someone rise for an extra rakʿah, he is to sit as soon as he realizes his error.
If he stands up, having forgotten the first2 tashahhud, he must return to sit for it; doing so is merely disliked once he has come fully upright. The follower3 is required to follow the imam, and the imam should not return once he has begun the recitation.
Whoever, while still praying, becomes uncertain about a pillar or the number of rakʿahs performed must act on certainty—that is, the lesser number—and then prostrate4 for forgetfulness. After the prayer has been completed5, such doubts carry no legal consequence.