A Theory of Multi-Agent Generative Flow Networks