Machine summary:
Here, the Holy Prophet (pbuh)'s fourth duty entrusted to him by God is execution of rules and establishment of a State.
No one has cast doubt in the fact that the Holy Prophet (pbuh) had established a State in his own era, during which he led Muslims and appointed some persons for certain positions.
In other words, in the same way that the Holy Prophet (pbuh) took religious sciences from an infallible source and communicated them to people, and declared commandments which had not been apparently described in the Holy Quran for them, after him the aforementioned persons are of the same office, free of mistakes in commenting upon the religion, and infallible.
Contrary to Sunnis, these great Sufis believe that God’s religion is not only the Scripture and the Holy Prophet (pbuh)’s tradition so that it may come to an end upon his death; but rather there should be Imam and an authority along with the Scripture to comment upon the latter; and this office came to Ali (a) and his successors.
According to Shi‘i jurisprudence, a religious jurist whom they follow should be alive so that he may recognize requirements and needs of the age and deduce pertaining Islamic rulings from the holy Quran and sunnah.
In the eras of the Holy Prophet (pbuh) and Imams, they were responsible to do their best for establishing a sociopolitical system in which Islamic rulings could be practiced and human happiness could be secured.