Food, Shelter, Education, and Medicine all fall under the heading of welfare. A well funded library system is often the first piece of a welfare state. Like health care education can be a great boon to society in moderation or a great drag in excess, but just because it can be useful does not mean it's not welfare.
I'd suggest education would be a preferable alternative to either of those.