Before us is the first Mishnah of Maseches Eruvin, which deals with the question: how is a shituf - a partnership - made for an eruv techumin? Suppose several people wish to travel to a certain place, and they can only reach it by making an eruv techumin, at a distance of two thousand cubits or close to two thousand cubits from their homes or from the city. How is this process carried out?
How the eruv is made:
The Mishnah explains that the one making the eruv places a barrel of drink or of food at the spot where he wants the eruv to be, and declares: "zeh bishvil kol benei iri, u'meihem" - "this is on behalf of all the people of my city, and for any of them." This does not necessarily refer to every single resident of the city, but rather to anyone who falls into the following categories:
Anyone who wants to go to the home of a person who has suffered a death in the family (a house of mourning).
Anyone who wants to go to a celebration, a wedding, or another meal that is a seudas mitzvah and is bound up with a mitzvah.
The condition of a matter of mitzvah:
These two examples were brought because the halachah is that an eruv techumin is not made for just any purpose, but only for a matter of mitzvah, for something bound up with a mitzvah. It is enough that there be a minimal mitzvah involved - even merely attending a wedding - and that is sufficient reason to make an eruv techumin and travel to another city, so that participation in those mitzvos becomes possible.
Until when one may join the eruv:
Once the one making the eruv has set down the eruv on behalf of anyone who will wish to go to the place the townspeople want to reach, the laws divide:
One who accepts it upon himself before Shabbos - he is permitted to travel on the strength of the eruv.
One who accepts it upon himself after dark - once Shabbos has begun, it is forbidden to him and the eruv does not help him. A person cannot make an eruv after dark; this is something that must take place before Shabbos comes in.
The Gemara's explanation - "lav davka":
The Gemara explains that the wording of the Mishnah, that one accepts it upon himself before Shabbos, is not precise but rather "lav davka" - not to be taken literally. The Mishnah's intent is that anyone who was informed about the eruv before Shabbos is included; that is, it is the knowledge that the eruv exists that must be in place before Shabbos. The decision itself, however, whether he wishes to take part in the eruv or not, may be made even after Shabbos has already begun.
The principle of "bereirah":
Seemingly, since the eruv takes effect at the start of Shabbos, and at that moment it enters into force, it should have been necessary to have clear knowledge at the time Shabbos begins as to whether the person wants to be part of the eruv. But in the law of eruv techumin we say "bereirah": when a person makes a decision retroactively, we say that the decision takes effect from the outset. As long as he knew beforehand that the option was available and simply had not yet decided, then once he does decide in the end, his choice takes effect from the outset.
It is worth noting that generally we do not apply "bereirah" in a matter of Torah law. This fits, then, with the assumption that techumin are rabbinic, and therefore we are lenient and apply "bereirah" to them. It emerges that as long as the person knew that the eruv had been placed before Shabbos, he can make the decision afterward to be a partner in the eruv.
In summary: In this Mishnah we learned how an eruv techumin is made - placing a barrel of food or drink at the site of the eruv together with a declaration on behalf of anyone who will wish to go to a house of mourning or to a seudas mitzvah; the condition that an eruv techumin is made only for a matter of mitzvah; and the parameters of timing - the knowledge of the eruv must be in place before Shabbos, whereas the decision to participate may be made even after Shabbos has begun, by force of the principle of "bereirah" which is applied to eruv techumin because techumin are rabbinic.