1. The forest architecture hypothesis of tree species coexistence proposed here was developed from a general model of size-structured tree populations in gap-dynamic rain forest. The model consists of a submodel describing the dynamics of the age distribution of local stands, which reflects gap-dynamic processes in a whole forest, and another describing the change in size distribution of trees in stands of each age. The model expresses the dynamics of both species-averaged systems and multi-species systems. 2. In the model, the intensity of suppression of tree size growth, survival and seedling recruitment is a function of local crowding. Crowding is measured in each stand in terms of the cumulative basal area of trees of all species that are larger than the subject individual, while the potential rate of seedling recruitment is proportional to the basal area of mother trees in a whole forest. Tree mortality results either from thinning due to local crowding or from gap formation. Trees surviving gap formation contribute to regeneration in a newborn gap. 3. Simulation was carried out using permanent plot data from a warm-temperate rain forest. The simulation for a whole tree population converged to a unique equilibrium state with a stationary stand age distribution and a stationary size distribution in each stand. Simulated size distributions matched observed distributions in gaps and closed stands. 4. The dynamics of a multi-species system composed of representative canopy, subcanopy and understorey species (all non-pioneer but with different tolerance levels) was also simulated. Results showed convergence to a stable equilibrium coexistence within a limited range of species parameters. Although stable coexistence also resulted from the model without stand mosaic by means of the trade-off between potential maximum size and potential recruitment rate, inclusion of gap dynamics in the model widened the range of coexistence in this trade-off space and reduced the time for convergence to equilibrium. Gap dynamics provided further possibilities for coexistence by various trade-offs, e.g. between potential size growth rate and susceptibility to suppression of size growth rate. Results suggested the importance of vertical and horizontal structure of forest in maintaining tree species diversity.