# Mathematics before mathematical notions

I would like to know where to start, i.e papers/books/video conferences and conceptions/misconceptions, with the history of mathematics before it was really considered mathematics. I'm talking about very primitive notions or tricks that would have a mathematical meaning/explanation today. For example:

1. A sheep keeper makes a mark in his cane, or adds a pebble to a pile for each sheep that enters the stables. When taking them out, he/she crosses the mark or removes the pebbles one by one. In this way, the sheep keeper doesn't need to know how many sheep he/she has, or even to count how many enter/get out of the stable. If at the end one or more marks/pebbles remain, then there are missing sheep.
2. Almost any somewhat "developed" animal has at least a vague sense of "few vs lots" of things. A mother knows if one of its cubs is missing without having to count them or using marks/pebbles. I'm talking about notions that go further than basic perception: a bird knows its altitude "instinctively" and not because it has a notion of "my distance to the ground is greater here than there".
3. Humans always have had a sense of causality. A thunder must be caused by something (be it the rage of some god, or a modern explanation). We have this intrinsic notion of logical implication

Would you say that there are some necessary requirements that make mathematics and logic "developable" in a mind? For example, vague notions of missing/not missing, bigger/smaller, similar/not similar could evolve into a basic arithmetic and then into more advanced maths