The gemara says that if there are 2 partners in an animal, one partner belongs to an ir hanidachas and the other one does not, the entire animal is assur. But, if they are partners in dough, it is mutar. The gemara explains that an animal is not כמאן דפליגא דמי whereas the dough is as if it is divided. R. Akiva Eiger is metzayen the Sha'agas Aryeh (89) who assumes that the gemara is saying that the portion of the dough that is divided and distributed to the partner who isn't part of the ir hanidachas, is permitted based on breira. The Sha'agas Aryeh asks that since the heter to the non-ir hanidachas portion of the dough is based on breira, how can the Rambam pasken this din. The Rambam (Hilchos Shemita 11:20) holds that we don't allow breira to be used by something which is d'oraysa, so why does the Rambam (hilchos akum 4:11) pasken that the dough is mutar since it can be divided?
The maharatz chiyus says to look at the mekor chaim on hilchos pesach siman 448 for an answer to this question. I have to wait until I get home to look at it. To add to the question of the sha'gas aryeh, the language of both the gemara and the Rambam read simply, implies that the entire dough is permitted, not just the portion owned by the non-ir hanidachas partner. If this is correct, the question of the Sha'agas Aryeh would be answered since we wouldn't require breira, but what would the rationale be? Why would the entire dough be mutar?
It seems that the Rambam and gemara are saying that since the dough is as if it were already divided, it is not considered "shalal" of the Ir Hanidachas. What is the sevara for this?
Just found the Me'kor Chaim (448:1) - he writes based on the Ran in Nedarim 46 who says that we don't say breira by d'oraysa, yet when one partner makes a neder of issur hana'ah on another, even a courtyard that is not large enough to be divided (so it was never meant to be divided) can be divided and is mutar. The rationale is that there is an assumption that people join a partnership with the understanding that his friend will not be able to impose an issur that will last through a division of the property. Similarly here, since it was the actions of the person belonging to the ir hanidachas that created this issur, it is assumed that the entire partnership was conditional and that the part of the dough taken by the non-ir hanidachas partner will be mutar.
Based on this approach it should follow that if it was not the actions of the ir hanidachas partner that created the issur, for example he never committed avoda zara but his items become assur because they are in the ir hanidachas, then the splitting should not work to permit the portion of the other partner - v'dok.