In their Evolutionary Psychology Primer, Cosmides and Tooby give an example of a hypothesized adaptation that allows us to detect cheaters in a certain type of logical task (Wason) that we generally fail at. In the Wason selection task (both article and wiki give examples) you are presented a type of logic puzzle that people tend to do poorly at and even formal training in logic helps little, yet when the examples involve cheating (such as "If you are to eat those cookies, then you must first fix your bed" and the task would be to figure out if someone whose eating the cookies did indeed fix the bed) perform much better (25% right in the regular task, 65-80% in this version, according to the article).
In the show The Wire, in season one, episode eight, Wallace, a teen-age drug dealer is asked by a young child to help her with her math homework. It's an addition and subtraction word problem about passengers on a bus (can't remember the numbers, but along the lines of, if the bus has 10 people on it and at the next stop 3 get on and 4 leave, etc.). Wallace rephrases the word problem to be about drugs and the kid gets it right. Wallace frustrated asks why and the kid replies along the lines of: "They beat you if you get the count wrong." (Edit:simpleton gives the quote as "Count be wrong, they fuck you up.")
C&T conclude that there are evolved "algorithms" in our brains that deal with social contract processing that explain why people do better on certain Wason selection tasks. The Wire points out a simpler possible explanation that their experiments did not control for: people do better on tasks they care about, unless one would like to suppose there are special math circuits in the brain for certain "social contract" situations.
Of course, I am not saying a fictional anecdote disproves C&T's claim, but it does point to something they didn't test for, and something that I find rather plausible.
Possible tests: Look at emotionally-motivating things that vary across culture and develop Wason selection tasks to test for that; look at various types of emotionally-motivating things (which I do not presume all emotional responses will affect the test results), and obviously, test The Wire example itself.
This post is an example of the dangers both of fictional evidence and generational forgetting. Less than 100 years ago teachers did beat their pupils. Corporal punishment was an accepted part of educational practise. My parents are in their 80's and can remember this.
The script writers for The Wire are too young to have experienced this themselves, so they put a plausible line in their script: "They beat you if you get the count wrong." If they had been beaten themselves in their schools days they would know that it doesn't actually work. Worse they seem not to have realised that beating children to make them learn is only just dropping out of living memory. They could have asked around and realised just how ignorant the line is.
Being beaten into learning your sums is a perfectly plausible idea. Toddlers become competent at running about through a painful process of bumps and bruises administered by their environment. Perhaps an artificial environment with tawse administered by the dominie would work as well for sums?
Ofcourse it is no longer plausible once it has been tried and proved surprisingly useless. I'm disturbed to witness a dead educational idea coming back to life through a combination of fiction and forgetting.
(The point about toddlers may also be false. There is a rare genetic condition that results in pain receptors not working. The popular accounts I've read give the impression that sufferers run and play like normal children, with the exception that freed from the constraints of pain, they are more daring than normal children and do things such as breaking their legs by jumping off walls that are too high. So painful bumps and bruises may not be part of motor learning skills even when their presence is inevitable.)
I'm not positing that the beating helped the kid learn. See Kaj_Sotala's comment above for an example of how students perform math better when say, doing their job but they can't at school. I found the Wire anecdote plausible, but I didn't mean to suggest I accept the kid's understanding at face value: I generalized to the kid being motivated, which may've well been the case even if the kid hadn't been beaten but having been beaten, that's the explanation the kid looked to. Also, I think your historical evidence doesn't necessarily prove your point. My impression is that corporal punishment was often rather arbitrary and to enforce social norms more than teach math lessons (though that too), and I would guess that if kids are beaten for reasons they often can't understand (which is my impression from reading accounts), then being hurt for reasons they can understand (not memorizing their multiplication tables) has a diminished effect. I'm having trouble recalling any specifics, but I'm pretty sure I've read accounts from kids that suggest they saw the punishment as a motivating force for learning, whether it actually was or not. Just to be clear, even if corporal punishment were shown to be effective in certain ways if used in certain ways, I wouldn't be in favor of using it and would guess it would decrease self-motivated learning long term and there are hopefully more humane ideas to make learning motivating.