Somewhat surprisingly, E. M. Forster, the author of A Passage to India, wrote a science fiction short story, The Machine Stops, that was published in 1909.
Many works, both fiction and non-fiction, have been noted as influences and sources for The Matrix. While clearly not identical by any means, there are parts of The Machine Stops that bear a close enough resemblance to the film to make me wonder if it could be yet another inspiration.
The story, set in a post-apocalyptic world where humanity lives underground and relies on a giant machine to provide their needs, predicted new technologies such as instant messaging, and the Internet.
[It] describes a world in which most of the human population has lost the ability to live on the surface of the Earth. Each individual now lives in isolation below ground in a standard 'cell', with all bodily and spiritual needs met by the omnipotent, global Machine.
Communication is made via a kind of instant messaging/video conferencing machine with which people conduct their only activity: the sharing of ideas and what passes for knowledge.
[Kuno] confides to [his mother, Vashti] that he has visited the surface of the Earth without permission and that he saw other humans living outside the world of the Machine. However, the Machine recaptured him, and he has been threatened with 'Homelessness', that is, expulsion from the underground environment and presumed death . . . . — Wikipedia
The story was first published in The Oxford and Cambridge Review, and later included in Forster's collection, The Eternal Moment and Other Stories, in 1928. It was reprinted in 1965, in the anthology Modern Short Stories, and once again in 1973's The Science Fiction Hall of Fame, Volume Two. A quick search will reveal a number of other editions.
In 1966 Philip Saville directed a TV adaptation that was shown on the British science fiction anthology Out of the Unknown.
George Lucas's film THX 1138, released in 1971 and the original novel Logan's Run, from 1967 and written by William F. Nolan and George Clayton Johnson, are both reported to have significant similarities to the story.
The story was out there, in some form or another, so the Wachowski brothers could have known of it. But I'm not an expert in subjects Forster or Matrix, and so I can't be certain.
The best possible answer would be a source that proves a direct link between the two works, but that might not exist. It might also be possible to connect the two between an intermediary, as long as the connection could be proved. Finally, I have to accept that there may be no connection. That's obviously hard to prove, negatives always are. But if no evidence surfaces, then I'll have to accept that at some point.
The full text to The Machine Stops can be found here.