In Deathly Hallows, Neville confronted Voldemort when the sorting hat came crashing through a window and landed next to Neville, who or what threw it? Here is my theory,
Snape survived Nagini's attack and apparated to the castle and upon seeing Neville confront Voldemort, went to the headmaster's office, got the hat and threw it out to Neville.
What do you think of this theory and what are your theories?