כִּ֣י יִפָּלֵא֩ מִמְּךָ֨ דָבָ֜ר לַמִּשְׁפָּ֗ט בֵּֽין־דָּ֨ם לְדָ֜ם בֵּֽין־דִּ֣ין לְדִ֗ין וּבֵ֥ין נֶ֙גַע֙ לָנֶ֔גַע דִּבְרֵ֥י רִיבֹ֖ת בִּשְׁעָרֶ֑יךָ וְקַמְתָּ֣ וְעָלִ֔יתָ אֶ֨ל־הַמָּק֔וֹם אֲשֶׁ֥ר יִבְחַ֛ר יְהֹוָ֥ה אֱלֹהֶ֖יךָ בּֽוֹ׃
If a case is too baffling for you to decide, be it a controversy over homicide, civil law, or assault—matters of dispute in your courts—you shall promptly repair to the place that the Eternal your God will have chosen,
Torah Temimah points to Sanhedrin on “divrei rivot bi-she’arekha.”
דברי ריבות בשעריך. מלמד שהולכין אחר הרוב שבשעריך.
English: “Matters of dispute in your gates” — this teaches that one follows the majority that is in your gates.
The phrase anchors the principle that the local majority (of the court or of the city’s sages) is followed until the case is taken higher.
Derash on the verse (Bavli / Sifrei) — not a formal named middah of the 13. The location “in your gates” is read as the locus of majority decision.
Local disputes are resolved by the majority of the local court; only when that court is baffled does the matter ascend.