There has to have been a book in the attic. There have to have been books in the attic. There had to have been books in the attic. There had to have been a book in the attic.
a book ~ 1 books ~ more than 1
has to have been ~ The only logical conclusion (now) is that there was/were ... had to have been ~ The only logical conclusion (at that time)