Peaceful coexistence in gym towers
If you've done any introductory game theory courses, you'll know about games like prisoner's dilemma, coexistence games, hawk dove game, etc.
Pokemon go gym situation is a competition game (my win is your loss, 0 sum game)
Applied into this context of Pokemon go, one would see the dominant strategy (best response no matter what your rival is doing), and the nash equilibrium, is to attack the opposing team's gym, but the socially optimal strategy is just to sit back and do not attack each other.
Now consider this scenario: You have a mon in a Lvl 10 tower, it's not that strong (only 1 Blissey 1 Snorlax)
There's a rival Lvl 10 tower that's also similarly weak, within 300m of your the gym you hold
You know whoever is in that gym has the firepower just like in your squad and has the same amount of time to spare as you and can retaliate if you attack their gym.
Will you go ahead and attack it? Or will you seek peaceful coexistence?
Some more payoff analysis:
Illustrating with a payoff scenarios:
(Assume team blue vs team yellow only)
1. (B Attack, Y Attack) Gives payoff of 10 coins, 10 coins
2. (B Attack, Y not attack) Gives payoff of 20 coins, 0 coins
3. (B not attack, Y attack) Gives payoff of 0 coins, 20 coins
4. (Y and B both not attack) gives payoff of 10 coins, 10 coins
When you are at situation 4, both teams have an incentive to deviate at to situation 2 and 3, where they attack in order to get the extra 10 coins. However when they both wreck each others gyms, we go to situation1 where both get 10 coins. The payoff at situation 1 is not the same as 4, because you have both lost your time.
Answers
generally I leave well enough alone unless they attack and then I try and figure out who broke the truce (because it is usually an individual rather then a group) and then grind them out of every gym I see them in were ever I see them for the next month.
I only do gyms for coin and prefer a single no effort gym to 2 high effort gyms. Gym battles are just to dull for words. I rather walk around and hope for a nice surprise spawn or egg hatch while trying to get my flabby arse moving more often; hence the coins for incubators.
Just rather spend 30 minutes walking around then tap tap swipe tap tap swipe long press.
on top of that 10 coins is worth like 10 cents so you are working for like 30 cents an hour for something that is not that fun and is as sedentary as spending the time on a couch playing something more engaging (one reason I do not understand spoofing).
There are a few issues. First, the assumption that they have the same resources and time that you do. I know people around here use scanners, but you still need to get out there and grind pokestops to get the potions/revives. A player is going to have resources depending on how much they battle at other locations, and their battle strategy.
You also assume that retaliation is imminent. This may not be the case for a number of reason. You also assume the player is looking to get coins, or that every player is doing what is expected. I specifically leave gyms gray so that I do not get retaliation.
In addition to that, if we assume they do have potions/revives, how do they use them? I find it far more potion/revive intensive to prestige gyms than I do to tear them down. This would apply for them also. I will frequently take down opposing gyms (in their territory) just so that they spend resources building them up. If you never attack my gyms, all my ammo is going towards taking down other gyms. Taking down their gyms protects mine because they are focusing on rebuilding, rather than tearing down.
But to your main point, yes there is cooperation and territories. There are some areas/gyms that simply do not get touched because it is known territory.
That being said, I will take down gyms in other territory for the reason I described above, and another thing you are not taking into consideration...
You are assuming I am always trying to win. I actually play in a way that makes the gym scene healthier for ALL players. I take down long standing gyms so that new players can get in them. I allow other players to get into gyms before myself. I take into consideration who is in the gyms and where they are located. I collect from the max number of gyms, I am not trying to expand my territory.
Finally, as others have mentioned, not everyone is organized. Everyone on my team, from what I can tell, is a solo player, and many are quite selfish. I can't assume they will help me, my gym, or the team. In fact, shaving is a major issue within teams. I could leave that gym alone, for the reason you describe, only to have a teammate tear down their gym and lose mine in retaliation.
I think you just need to feel out your area and see what strategy works best.
I'm a big advocate for peaceful coexistence wherever there is stability.
I'm in an area where several players from several teams are each in several stable gyms. I figure: if I ever take down a Level 10 tower, I'm (1) joining a weak gym that probably won't last and (2) disrupting ten rival trainers in my area. One of those trainers will almost certainly retake the original gym, and other displaced trainers will have a new reason to attack an otherwise stable gym that I occupy elsewhere - whether it's for retaliation (which I haven't really noticed much of) or for regaining a certain level of earnings.
In the scenario you posit, where only two gyms are in play (perhaps in a small town), it's harder to say. An unspoken truce between two rival teams would let everyone collect without extra effort, but it would also cap everyone's earnings at 1 gym per day. My guess is that at least one player would disrupt the equilibrium sooner or later, and people would end up earning 20 or 0 coins per day, depending on whether they felt like battling that day.
Most of these things I said assume that people aren't particularly interested in battling for the sake of battling (which some are) and that spoofing/cheating isn't prevalent (which it is). So, any attempt at quantifying strategies for gym battling in the current environment will have many other variables to take into account.
My local area seems to have settled on the status quo.
I know if I attack certain gyms then there will be retribution, but if I leave them alone then my gyms get left alone.
Every now and then, someone will come in and upset the status quo - and then there is a period of back and forth.
For example, someone tried to 'expand' their area recently, and it resulted in me dropping 5 of their strongest towers throughout their protected area all within a day...leaving only Muk and Wobbuffet etc in their gyms.
It seems they understood, because they built them up again and left our gyms alone again.
Of course, there are contested gyms at the local shopping centre and a couple of other places, that change hands regularly - but then there are others that are 'claimed' and everyone who plays regularly knows that attacking them will result in retribution.
So yes, our neighbourhood has developed a peaceful coexistence. It can be disrupted...but it falls back to the status quo eventually.
LOL. I live in a small town with nine valor gyms, from level 6 to 10. I enjoy getting rid of my extra potions by attacking the bottom dwellers of the towers. The last two days, I've had two cars come by and peal out right next to me, squealing their tires. Talk about road, I mean pokemon go, rage. Poor valor. They've had the gyms since the game started, only losing them to me at Christmas when one by one I tore all their level 10 gyms down.
In a nearby park with like 5 red towers there's usually one blue gym. I dunno why. Sometimes things change but then get back to normal. I want to beat those red towers 'cos I see bot-like and cheater-like nicknames there and also some guy with 1488 and possibly his girlfriend, as they're always together in gyms. But beating towers eats my battery so fast. I only want to attack them because of my vigilantism, normally I'll just go and find a friendly gym to prestige, tons of them around, and if they're occupied I might just hop on a bus and prestige in another part of the city. The exception was that time when nearly all of my defenders were kicked out so I got angry and beat every gym I could reach.