  We propose a simple cognitive model where qualitative and quantitative com-
parisons enable animals to identify objects, associate them with their
properties held in memory and make naive inference. Simple notions like
equivalence re- lations, order relations are used. We then show that such
processes are at the root of human mathematical reasoning by showing that the
elements of totally ordered sets satisfy the Peano axioms. The process through
which children learn counting is then formalized. Finally association is
modeled as a Markov process leading to a stationary distribution.
