Pesachim, Chapter 6, Mishnah 5. This mishnah is difficult to understand, so we will take up its main ideas one at a time.
The mishnah opens: "HaPesach sheshechato shelo lishmo baShabbos - chayav alav chatas" - one who slaughtered the Pesach offering not for its own sake on Shabbos is liable to bring a sin offering. If a person slaughters the Pesach offering not for its own sake, for example he slaughtered it as a peace offering, the slaughter is invalid. Therefore, if he did this on Shabbos, he must bring a sin offering for desecrating Shabbos, since he slaughtered with no purpose at all - just like someone who slaughters an ordinary animal on Shabbos.
Other offerings slaughtered for the sake of the Pesach:
The mishnah continues: "Ushe'ar kol hazevachim sheshechatan leshem Pesach" - and all other offerings that he slaughtered for the sake of the Pesach. This refers to someone who takes an offering of a different type, such as a peace offering, and slaughters it for the sake of the Pesach. Here the mishnah distinguishes between two cases:
"Im einan re'uyin" - if they are not fit. This is where the animal is not at all fit to be a Pesach offering, such as a cow that was consecrated as a peace offering. Everyone knows that a cow is never brought as a Pesach offering, and there is no way to make such a mistake. Necessarily, then, he either thought the act was permitted or failed to realize that it was Shabbos, and therefore he is liable to a sin offering.
"Ve'im re'uyin hen" - and if they are fit. This is where we are dealing with a fine lamb less than a year old, entirely fit to be a Pesach offering, only that the person did not know it had been consecrated as a peace offering; he thought it was a Pesach offering and slaughtered it for the sake of the Pesach. Here there is room to discuss: a peace offering slaughtered not for its own sake remains valid, so it turns out that he did fulfill a mitzvah with this slaughter. Is he therefore considered "one who errs in a matter of mitzvah" and exempt, or is he liable to a sin offering for Shabbos?
The Tannaim disagree about this question:
Rabbi Eliezer holds he is liable to a sin offering - even though his error was a legitimate one and he genuinely thought this was the Pesach offering, and even though in practice he fulfilled the mitzvah of a valid peace offering, he is still liable to a sin offering. One who errs in a matter of mitzvah is liable, even though a mitzvah was fulfilled.
Rabbi Yehoshua exempts him - even though he desecrated Shabbos, he was occupied with a mitzvah, his error came about through an attempt to fulfill a mitzvah, and he even fulfilled it in practice, since the offering is valid. Therefore he is not liable to a sin offering.
Rabbi Eliezer's kal vachomer:
To strengthen his position, Rabbi Eliezer argues: "Mah im haPesach, shehu mutar lishmo" - the Pesach offering itself may be slaughtered on Shabbos when it is done properly, and nevertheless, "keshishinah es shemo" - when he changed its designation and slaughtered it as a peace offering, so that he did not fulfill his obligation, he is liable for Shabbos. If so, other offerings, such as peace offerings, "she'einan mutarin lishman" - which may not be brought on Shabbos even for their own sake - "keshishinah es sheman, eino din sheyehei chayav" - when he changed their designation, is it not logical that he should be liable? Surely he should be held liable.
Rabbi Yehoshua's answer:
Rabbi Yehoshua answered him: "Lo, im amarta baPesach, sheshinahu ledavar assur" - in the case of the Pesach he changed the offering to a peace offering, which is something forbidden on Shabbos, unlike the Pesach offering which is permitted on Shabbos, and therefore it is understandable that he is liable. "Tomar bazevachim, sheshinan ledavar hamutar" - but with other offerings he changed them to the sake of the Pesach, which is something permitted on Shabbos. One who slaughters a peace offering for the sake of the Pesach has in mind something that, had it really been a Pesach offering, would have been permitted to be brought on Shabbos, and therefore he should not be liable to a sin offering.
Rabbi Eliezer's proof from the public offerings:
Rabbi Eliezer seeks to refute Rabbi Yehoshua's distinction, and brings a proof from the public offerings that are permitted on Shabbos - the daily offerings and the additional offerings. They too are permitted on Shabbos when they are brought properly, and nevertheless, if a person slaughters other offerings, such as peace offerings, for the sake of the daily offering or the additional offering on Shabbos, everyone agrees that he is liable, even though he had in mind something permitted on Shabbos. From here we see that the claim that he intended something permitted is no claim at all.
Rabbi Yehoshua's answer - a fixed number as opposed to a multitude:
Rabbi Yehoshua answered: one cannot learn from the daily offerings and the additional offerings that are brought on Shabbos, since they have a fixed number. There are only two daily offerings, and likewise a defined number of additional offerings that are brought. With such a counted set of offerings there is no room for error, since everyone knows how many there are, and this does not fall under the category of "one who errs in a matter of mitzvah": the person should have realized that the peace offering in front of him was not the additional offering.
This is not so with the Pesach offering, which has no fixed number - thousands upon thousands of Pesach offerings are brought, and everyone is busy and preoccupied making sure that all the Pesach offerings are slaughtered. In such a situation it is reasonable and expected that a person will err and think that the animal before him, which is really a peace offering, is one of the Pesach offerings. This is "one who is preoccupied with a matter of mitzvah," and therefore he is exempt.
The view of Rabbi Meir:
Finally, the mishnah comments on Rabbi Eliezer's words, in which he assumed that when a person slaughters other offerings for the sake of the public offerings - the daily and additional offerings brought on Shabbos - everyone agrees that he is liable. Rabbi Meir disagrees and says: "Af hashochet leshem imurei tzibbur patur" - even one who slaughters for the sake of the public offerings is exempt. Even one who slaughters a peace offering for the sake of public offerings, which are things permitted on Shabbos, is considered one who errs in a matter of mitzvah; he is exempt from liability for desecrating Shabbos and does not bring a sin offering, since he slaughtered for the sake of something permitted on Shabbos.
In summary: in this mishnah we learned that one who slaughtered the Pesach offering not for its own sake on Shabbos is liable to a sin offering, while other offerings slaughtered for the sake of the Pesach depend on the question of fitness: where they are unfit, everyone agrees he is liable, and where they are fit, Rabbi Eliezer holds him liable while Rabbi Yehoshua exempts him as one who errs and is preoccupied with a matter of mitzvah. We examined Rabbi Eliezer's kal vachomer and Rabbi Yehoshua's distinction between changing an offering to something forbidden and changing it to something permitted, the proof from the public offerings and its rejection based on the fixed number of the daily and additional offerings as opposed to the multitude of Pesach offerings, and finally the view of Rabbi Meir, who exempts even one who slaughters for the sake of the public offerings.