Actually, Rowling stated that in one of the later novels. The Trace just enables the Ministry to know when and where the witch or wizard casts the spell, not the exact person, though. That is why Harry was blamed for the Levitation spell that Dobby used in the second book, because he was the only wizard in the residence. Because there would be many witches and wizards in Diagon Alley, the Ministry would be unable to accuse anyone of anything. They rely on the parents of the students to ensure their responsability.
This is why Hermione wasn't in trouble for using magic before school resumed, although it bemuses me to why she would break the rules, being Hermione.
also i reckon that magic is allowed in Diagon Alley for under-age wizards and witches.