I think you misunderstood my remark. I don't sleep in the library. I get most of my work done at a library. I am medically handicapped and this substantially interferes with my ability to be productive. But finding a place to work mostly boils down to making sure I have access to a decent public library.
I think you misunderstood the original comment, not the other way around. It's about a place to "rest your mind," not exercise it. The comment is about how it'd be hard to be productive without consistent sleep.
It is difficult to be productive when you aren't sleeping well, regardless of your socioeconomic status. There are homeless people who typically sleep well. I am far from the only one.