The whole "lean is hot" and "rich is cool" theory isn't always correct. Leaner than what? Richer than what? What engine?
There is a point, usually around stoichiomentric, that an engine will be more prone to detonation. The leaner you go past that point the cooler the burn and the less pinging you'll get.
Engines never have a completely homogenous air/fuel mix in the combustion chamber either. Even with port fuel injection there will always be lean and rich spots. How the head is designed can help move those spots into places they don't make as much of a problem, like keeping it rich over the hot exhaust valves instead of a lean pocket over them. So the average AFR point of detonation is different for each engine due to these variences.
__________________
|