I just learned a Gemara (Taanit 30a) that seems to pretty clearly state that the mourning for tisha b'av starts the beginning of the week that Tisha B'av falls out on, and ends with Tisha B'av itself.
Even the braitot after that discuss how much meat and wine one may have at the seudah ha'mafseket (it seems to state the for the rest of the day there are no restrictions regarding meat and wine).
So where does the idea of the nine days come from (I understand that it is an opinion in the Gemara, but it seems to explicitly conclude that that is not the halacha)?
Note: I am aware (thanks to DoubleAA) that this extension is a later minhag. The question remains then, if the gemara considered this as a possibility and explicitly rejected it, why was it later instituted?
Clarification: It seems from the Gemara that there are two different periods where there are restrictions. The first concerns laundry (where one opinion says 9 days), and the second concerns meat and wine (where there is no opinion that says that it lasts nine days, the most machmir opinion says that for the whole day one should not have either of these items (and two cooked foods) and the most makil opinion says that one can have these foods, even at the seudah ha'mafseket, but less than normal).
It therefore seems that there are really three related questions:
- Why did the laundry mourning period get extended to 9 days
- Why was the meat and wine restriction extended to 9 days
- Why (to the best of my knowledge) was the "two cooked foods" restriction not extended to the nine days (the gemara seems to lump meat wine and cooked foods together)