How is (52000 / 50000) gym prestige possible?
Solution 1:
Because to put the tenth pokemon into the gym a gym needs to have 50k/50k prestige. At this point you can no longer train the gym to increase the prestige level.
However a gym will still gain the 2k prestige bonus from placing pokemon into the gym. This means that the gym will go to 52k total prestige.
Although I've never seen it, it should also imply that placing multiple pokemon into a gym with 50k prestige will increase the prestige by 2k*number of pokemon. Assuming this is true and a gym is trained to 50k prestige with only one defender, you will be able to increase the prestige to 68k prestige (50k + 2k*9).