RULING IN FRONT OF ONE'S REBBI [Hora'ah :Talmid]
Gemara
Before Rabah bar Chanah and Rav went to Bavel, Rebbi authorized them to teach Halachos. It was decreed to require Reshus (permission) after an episode in which a Chacham expounded, and the residents misunderstood him.
Tanchum brei d'R. Ami came to a place. He taught that on Pesach one may wet wheat just before grinding it. They told him that his Rebbi was there.
(Beraisa): A Talmid may not teach Halachos within three Parsa'os of his Rebbi, corresponding to the length of Machaneh Yisrael.
Tanchum: I was unaware.
Eruvin 62b - Question (Abaye): The rule is, the Halachah always follows R. Eliezer ben Yakov. In this case, also Rav Yehudah taught that the Halachah follows him. May one give such a simple ruling in front of his Rebbi?
Answer (Rav Yosef): No. It is also simple that one may eat eggs with milk, yet Rav Chisda would not rule about this in the life of his Rebbi Rav Huna!
Question (R. Yakov bar Aba): Megilas Ta'anis (days when one may not fast or eulogize) is written. May one rule about it in front of his Rebbi?
Answer (Abaye): No. Rav Yosef said that Rav Chisda refused to rule about eggs and milk while Rav Huna was alive.
Rav Chisda ruled in Kafri while Rav Huna was alive.
(It was enacted that a slaughterer must bring his knife to the local Chacham to inspect it, for the honor of the Chacham.) Ravina inspected a knife in Bavel. His Rebbi, Rav Ashi, asked why he did so.
Ravina: Rav Hamnuna gave rulings in Charta in Rav Chisda's life, for he was a Talmid Chaver. I am a Talmid Chaver to you!
(Rava): One may not rule in front of his Rebbi. One is Chayav Misah (b'Yedei Shomayim) for this. Not in front of his Rebbi it is forbidden, but one is not Chayav Misah.
(Beraisa - R. Eliezer): Aharon's sons were killed for (implicitly) ruling in front of Moshe (that it is a Mitzvah for people to bring fire to the Mizbe'ach.)
Rishonim
The Rif (Eruvin 19a) brings the Sugya in Eruvin (except for the episode of Ravina and Rav Ashi).
Rambam (Hilchos Talmud Torah 5:3): If one was three Parsa'os from his Rebbi and someone asked a Halachah, he may answer. One may rule to separate from Isur even in front of his Rebbi. If one saw someone transgressing because he does not know the Halachah, or due to his evil, he may stop him and say 'this is forbidden', even in front of his Rebbi without Reshus. We do not show honor to Rebbeyim if this will cause Chilul Hash-m. This refers to what happened by chance. One may not fix himself to rule for all who ask, even if he and his Rebbi are at opposite ends of the world, until his Rebbi dies or gives Reshus.
Rambam (9): ...This refers to Rabo Muvhak from whom he learned most of his Chachmah. If he did not learn most of his Chachmah from him, he is a Talmid Chaver.
Hagahos Maimoniyos (40): Rashi explains that Rav Chisda ruled in Kafri while Rav Huna was in Pumbadisa.
Rosh (Eruvin 6:2): Rav Chisda refused to rule about eggs and milk while Rav Huna was alive. Rav Chisda ruled in Kafri while Rav Huna was alive. Rav Hamnuna ruled in Charta while Rav Chisda was alive, but he did not rule in the life of his Rebbi, Rav Huna. All of these discuss not in the (Rebbi's) place, for Rav Huna was in Pumbadisa. A proper Talmid may not rule even not in front of his Rebbi, even outside of three Parsa'os, just then he is not Chayav Misah. Ravina checked a knife far from Rav Ashi, and it would have been forbidden had he been a proper Talmid. Within three Parsa'os is considered in front of him Presumably, Aharon's sons did not rule directly in front of Moshe, just they were in Machaneh Yisrael. This is the source for the Shi'ur of three Parsa'os. One may not rule about a case that occurred, but if he is asked 'whom does the Halachah follow?', he may give his opinion. This refers to something that is a Chidush to the questioner. The cases of eggs with milk and Megilas Ta'anis were Chidushim to the questioner. They teach that even though the Talmid is sure, he may not rule. One may rule if the questioner knows that it is a simple ruling, e.g. that we permit detrimental absorptions or an Isur mixed with 60 times as much Heter. Checking a knife is not Hora'ah (ruing). It is merely for the Chacham's honor. One should not assume authority without his Rebbi's Reshus. If a Talmid's family asked him about a ruling, I am unsure if it is permitted. Perhaps this is like the Heter for a Talmid to inspect his own knife. Or, perhaps that is different, for it is only for the Chacham's honor, and a Chacham pardons it to spare his Talmid the toil of coming to him. Regarding a ruling of Isur v'Heter, I lean to forbid.
Rashi (5b DH k'Neged): Even though Machaneh Yisrael was three Parsa'os, everyone came to Moshe with questions.
Poskim
Shulchan Aruch (YD 242:4): One may never rule in front of his Rebbi. One who does so is Chayav Misah.
Rema: This refers to Rabo Muvhak.
Shulchan Aruch (ibid.): Some say that a proper Talmid within three Parsa'os is Chayav Misah if he rules, and outside of three Parsa'os is forbidden, but he is exempt.
Rema: Some say that this is only if he regularly comes to the Talmid's city. If he comes only occasionally, everything is permitted outside of three Parsa'os.
Shach (8): Every week is regularly. Every year is not.
Beis Yosef (DH uv'Perek): The Gemara connotes that within three Parsa'os is considered in front of him, and outside of three Parsa'os is considered not in front of him. Even so, it is forbidden regarding Rabo Muvhak. It seems that Rav Huna was three Parsa'os away from Rav Hamnuna. A Beraisa permits when one is three Parsa'os away. The Rambam answers that outside three is forbidden when he fixed himself to rule, but permitted if someone happened to ask. The Gemara challenged Tanchum from the Beraisa that forbids within three, for he did not establish himself to rule, and outside of three it would be permitted. Tosfos and the Rosh answer that outside of three Parsa'os a proper Talmid is forbidden, and a Talmid Chaver is permitted. The Mordechai (Eruvin 510) says that outside of three Parsa'os is permitted only if his Rebbi does not regularly go there.
Shach (10): The Shulchan Aruch connotes that outside of three Parsa'os is permitted even without Reshus. We say that Rav Hamnuna did not rule in the life of Rav Huna, but he ruled in the life of Rav Chisda. This was without Reshus, and outside of three Parsa'os, for he was a Talmid Chaver. Hagahos Maimoniyos holds that he always needs Reshus.
Gra (10): The Mordechai does not answer why Rebbi needed to authorize Rabah bar Chanah and Rav (Rebbi did not regular go to Bavel)!
Question: Hagahos Maimoniyos holds that Rav Hamnuna asked Reshus to rule outside of three Parsa'os. If so, how did Ravina support himself from Rav Hamnuna? Ravina did not ask Reshus from Rav Ashi!
Answer (Maharik 169): One need not ask from all his Rebbeyim. It suffices to ask Reshus once, from Rabo Muvhak, like Rav and Rabah bar Chanah. This is so the Talmid will expound precisely, lest people err about his words. Ravina had Reshus from a different Rebbi. Rav Ashi held that this does not help for matters that are a Chidush to the questioner (according to R. Yitzchak), or in places where the Rebbi regularly comes (according to the Ritzva), for then it belittles his Rebbi's honor. Ravina answered that Reshus helps for a Talmid Chaver even for these. Rav Ashi was Rosh Yeshiva of Bavel, but perhaps Ravina had Reshus from a different Rebbi, for he was initially from Eretz Yisrael. Alternatively, Rav Ashi gave Reshus to him Stam, and he held that it does not help in these cases. R. Iserlin requires Reshus for outside of three Parsa'os from the Rebbi who gave to him Semichah, so he will have more fear, like Rashi says. Rashi did not mention fear, just precision! Also, even if one learned from and received Semichah from a Rebbi, if the Talmid grew in Chachmah, he may argue with him, and rule in practice in front of him. Reish Lakish did so in front of R. Yochanan, and even overturned rulings of R. Yochanan, even though according to Rashi he was a proper Talmid of R. Yochanan, and learned all his Chachmah and received Semichah from him.
Maharik (169): Rav Chisda refused to rule about eggs and milk while Rav Huna was alive. Surely, he had Reshus. If not, it makes no difference if the matter is easy. The decree to require Reshus was due to a Chacham's ruling that was misunderstood. One who has Reshus is careful to say things so no error can be made. This applies even to simple matters!
Maharik (169): The Gemara forbids Hora'ah within three Parsa'os, i.e. a proper ruling, but not a (simple) Heter of eggs with milk. The Rambam permits Hora'ah on occasion outside of three Parsa'os, but forbids in a fixed manner even at the other end of the world. This is why Rav Chisda did not fix himself to rule in Rav Huna's lifetime. I would say that they told R. Tanchum that his Rebbi was not in that city, rather, within three Parsa'os.