Re: 'the' used before some places
With a number of places, we sometimes view the activity as more important than the place. Thus 'I'm going to the pub' may simply mean 'I am going out for a drink'. Although the speaker almost certainly knows which pub they will be drinking in, that is not of any significance, and they do not expect the listener to know which pub it is. Of course, if this is said in a small village where there is only one pub, then both people do know exactly which pub it is.
'A pub' is fairly unnatural in this sense, and, in my opinion, 'I am going to the library' would be more natural than 'I am going to a library'. The speaker is normally indicating that they are going to borrow, take back or read a book, not that they are heading towards a particular building.
Words which are used with 'the' in a similar way include library, bank, post office, theatre, cinema, opera , ballet, gym.
Please do not edit your question after it has received a response. Such editing can make the response hard for others to understand.