The 176th mitzvah is that we are commanded to appoint judges1 to implement the Torah's commands; to force those who have turned away from the path of truth to return to it; to command the performance of good and the avoidance of bad; and to carry out the punishment of transgressors, so that the positive commandments of the Torah and their prohibitions should not be dependent on the desire of every individual.
Included in this mitzvah is that these judges be appointed in a hierarchy. In an appropriate2 city, 23 judges are appointed who meet together by the gate to the city. This is a "small Sanhedrin." In Jerusalem, the High Court of 70 judges is appointed. One — the Rosh Yeshivah, also called the Nasi by the Sages — is appointed over these 70. They gathered together in the place singled out for them.3 In a place where the population is too small for a "small Sanhedrin," three judges are nevertheless appointed to carry out minor judgments, and to pass along more major cases to the next highest court.
In addition, inspectors are appointed to visit the markets and inspect peoples' business practices, in order to insure that even the slightest injustice does not occur.
The source of this mitzvah is G‑d's statement,4 "Appoint yourselves judges and police for all your settlements [that G‑d your L‑rd is giving you for your tribes, and they shall judge the people...]."
In the words of the Sifri: "What is the source for the law that one court is appointed over the entire Jewish people? From the verse, 'Appoint yourselves judges and police.' How do we know that one is appointed over everyone? From the phrase, 'Appoint yourselves.' How do we know that a court must be appointed for each tribe? From the phrase, 'for all your settlements.' Rabbi Shimon ben Gamliel said, 'The phrase "for your tribes, and they shall judge [the people]" indicates that each tribe has the responsibility to judge the members of its tribe. The phrase, "and they shall judge the people," implies that they should do so even against their will.' "
The commandment to appoint 70 judges is repeated elsewhere in the Torah, in G‑d's statement5 (exalted be He), to Moshe, "Assemble 70 men for Me from the elder of Israel." Our Sages explained,6 "Anytime the phrase 'for Me' is used, it implies that it will last forever, such as,7 'Sanctify them to Me as priests.' " This means that this commandment was not just temporary but eternal for all generations.
You should be aware that all these appointments, i.e. the great Sanhedrin, the small Sanhedrin, the court of three, and all other appointments, only take place in Israel. There is no ordination outside of Israel. But when ordination is in effect in Israel, those who were already ordained are allowed to judge both in Israel and outside of Israel.
However, cases involving capital punishment may not be judged — neither inside nor outside Israel — unless the Holy Temple is standing, as we explained in the Introduction to this work.
On G‑d's statement8 (exalted be He) regarding a person who killed accidentally, "They shall be for you as an eternal law for all your generations, wherever you may live," the Sifri said, "The phrase, 'wherever you may live,' means both inside Israel and outside of Israel. One might think that there should be cities of refuge outside of Israel; the verse therefore says, 'these' — these laws9 are in effect both inside Israel and outside of Israel, but the cities of refuge are only inside Israel."
All the details of this mitzvah are explained in tractate Sanhedrin.