  This paper gives a classification of classes of discrete dynamical systems (a
set equipped with an endofunction) closed under finite limits and small
colimits. The conclusion is simple: they bijectively correspond to the ideals
of the product poset $\mathbb{N} \times \mathbb{N}$, where the first
$\mathbb{N}$ is ordered by the usual order and the second is by the
divisibility.
  Our method is based on a detailed analysis of the behaviors of states,
especially non-periodic behaviors, in discrete dynamical systems. Specifically,
extending the fundamental quantity, time until entering a loop, to even those
states that do not enter a loop plays a crucial role.
  Our classification is closely related to epimorphisms from $\mathbb{N}$ in
the category of monoids. There are countably many injective epimorphisms from
$\mathbb{N}$, including $\mathbb{N} \to \mathbb{Z}$. Those injective
epimorphisms correspond to the non-periodic behaviors of states of discrete
dynamical systems. We discuss this point at the end of the paper.
  This fun puzzle is motivated by an open problem in topos theory. Lawvere left
open problems in topos theory on his webpage, and the first problem is called
quotient toposes. The main theorem of this paper provides a non-trivial example
of this problem, which is not implied by any known results.
  This paper also provides a theoretical framework to address the open problem.
We define a preorder among the objects of a Grothendieck topos (which we have
named generative order), which enables us to reduce calculations of quotient
toposes to calculations of objects. Our method is its application to the topos
of discrete dynamical systems.
