  We show that all the bands of the Hofstadter model on the torus have an
exactly flat dispersion and Berry curvature when a special system size is
chosen. This result holds for any hopping and Chern number. Our analysis
therefore provides a simple rule for choosing a particularly advantageous
system size when designing a Hofstadter system whose size is controllable, like
a qubit lattice or an optical cavity array. The density operators projected
onto the flat bands obey exactly the Girvin-MacDonald-Platzman algebra, like
for Landau levels in the continuum in the case of $C=1$, or obey its
straightforward generalization in the case of $C>1$. This allows a mapping
between density-density interaction Hamiltonians for particles in the
Hofstatder model and in a continuum Landau level. By using the well-known
pseudopotential construction in the latter case, we obtain fractional Chern
insulator phases, the lattice counterpart of fractional quantum Hall phases,
that are exact zero-energy ground states of the Hofstadter model with certain
interactions. Finally, the addition of a harmonic trapping potential is shown
to lead to an appealingly symmetric description in which a new Hofstadter model
appears in momentum space.
