Here is the essay "Total Library" by Borges:
https://www.gwern.net/docs/borges/1939-borges-thetotallibrar... (PDF)
It mentions "abnormal transfinite numbers (whose parts are no smaller than the whole)". This seems to be a reference to Russell's Paradox:
https://en.wikipedia.org/wiki/Russell's_paradox
> Let us call a set "normal" if it is not a member of itself, and "abnormal" if it is a member of itself.
> Now we consider the set of all normal sets, R, and try to determine whether R is normal or abnormal. If R were normal, it would be contained in the set of all normal sets (itself), and therefore be abnormal; on the other hand if R were abnormal, it would not be contained in the set of all normal sets (itself), and therefore be normal.
> This leads to the conclusion that R is neither normal nor abnormal: Russell's paradox.
That proves your point, that it's a mathematical impossibility.
Borges calls it "the vast, contradictory Library", so clearly he was aware of this fact.
His Book of Sand would, however, appear to be vulnerable to diagonalization.
That's the best thing I've read today. I've often heard the monkeys-on-typewriters imagery, but never related it to an idea of a "total library" which contains everything that can ever be written, probably even itself. I suppose the digits of Pi may be considered such a "library".
"Strictly speaking, one immortal monkey would suffice."