Questions! Yay, I love questions :D
1: In the gym how do battles proceed, sometimes in the anime there is restrictions like you can only use 2 or 3 pokemons or so? Yes, there are restrictions on most of the gyms to make you think more strategically. For example, there's one gym that is similar to the Cerulean Gym in the anime - just a pool of water - so if you send out a Bulbasaur, unless it can swim I think you'd have some problems That said, you're not necessarily restricted to water Pokemon, flying Pokemon could work too - Gym Leader will also not be restricted to water either.
2: If the Question#1 will be inputted to the game will all the gymleaders have 6 pokemon and they will randomly choose some of them (or the best fitted) pokemon to fight you? Most of them will have a few more than 6 (they have PCs too ), and that's always constantly changing too as they catch new Pokemon, evolve them, trade them, etc. And usually they'll pick at random which ones to fight you with (as neither of you know the other person's Pokemon before the battle anyways).
3: Are gym matches re-matchable? All of them are rematchable, but generally speaking, your Reputation will take a big knock after losing to a Gym Leader, and sometimes they may not want to battle you straight away after losing that Rep.
Comments in bold. If you have any more questions, feel free to ask :D