You can take a theory test as soon as you have a valid provisional licence, not as soon as you receive one. Which as Ethel stated can be three months before your birthday.
The earliest age a normal provisional licence for a car is valid is 17 unless you are receiving full disability allowance and in this instance it is 16.
Can I just point out that Ethel`s answer is perfectly correct.
Unfortunately dilligaf suffers from the common ABaffliction of jumping in to make a point without properly reading the the answers already given. It is usually the first to answer who suffers from this when they are in some an almighty rush to be first they give gobbledygook.
Just thought I`d make this point in the hope that members will take note and take time to digest before accusing someone of giving a wrong answer.