It is hard, if not impossible to determine how deep the roots of belief in the tree of virtuality reach back in the history of the human race. Certainly we did not need our Oculus Rift VR headset to come up with this idea. When did man first started to doubt the reality of the solid world around him? When did we first start to think we might be living in an illusion?
The first written tradition is perhaps the allegory of the cave by Plato  in his treaty "The Republic" written around 380 B.C.
In this allegory prisoners are chained in a cave in such a way that they can only look at a wall in front of them. Behind them is a fire burning and between the fire and the prisoners is a low wall, behind which other people walk carrying objects or puppets "of men and other living things". These objects cast shadows on the wall in front of the prisoners. The sounds made by the walking people also echo from this wall, so that it seems that the shadows are making these noises. For the prisoners, who never experienced anything else these shadows are the only reality there is. In the story one man escapes. At first according to Plato he would not understand that what the prisoners see and hear are mere shadows and echoes. Only once the escaped prisoner would find out about sunlight outside the cave and get accustomed to it, he'd be able to learn about shadows. Thus he'd start to understand the real source of the images and sounds. Thereafter he'd consider this new reality superior and "he would bless himself for the change, and pity [the other prisoners]" and would want to bring his fellow cave dwellers out of the cave and into the sunlight". Unfortunately back in the cave his eyes would need to get accustomed to the dark again. His fellow prisoners would think he'd gone blind and conclude it's dangerous outside of the cave. They would not be willing to leave.
As the freed prisoner in this allegory represents the person who sees the world for the illusion it is, this is one of the first written proofs that humans were conscious of the possibility that our reality might not be the ultimate reality.
The Greek sophist, Gorgias (c. 483–375 BC)  is reputed as the father of Solipsism, the notion that we can only be sure of our mind to exist. Moreover he's quoted to have stated:
1. Nothing exists.
2. Even if something exists, nothing can be known about it.
3. Even if something could be known about it, knowledge about it can't be communicated to others.
With this reasoning the Sophists tried to show that "objective" knowledge was a literal impossibility. An extreme interpretation of Solipsism is to assume that only I exist and that everything else is a concoction of my mind. Or a simulation if you wish.
Another early text on this topic is from the Zhuangzi  by the eponymous author who lived between 369 and 286 B.C:
"Once upon a time, I, Chuang Chou, dreamt I was a butterfly, fluttering hither and thither, to all intents and purposes a butterfly. I was conscious only of my happiness as a butterfly, unaware that I was Chou. Soon I awaked, and there I was, veritably myself again. Now I do not know whether I was then a man dreaming I was a butterfly, or whether I am now a butterfly, dreaming I am a man. Between a man and a butterfly there is necessarily a distinction. The transition is called the transformation of material things."
Dreaming in fact is our most direct springboard to question whether our reality is an illusion.
Both Vedic and Buddhist traditions have spoken of the world as Maya, a magic or illusory veil. Maya has been said to be the reflection of something very real in a spiritual world. The powerful and colorful paintings the Tantric and Tibetan Buddhists have used were intended to help them visualise alternate realities. The so-called Avatamsaka Sutra from about 100 B.C. speaks of "infinite realities". In images we find an enlightened deity sitting calmly on a lotus flower often in the middle of raging fires. Worlds within creatures and worlds within circles representing the karmic cycle show how we are caught in the web of dependent arising. Fortunately, there seems to be a way out of this Maya. A little rainbow colored path leads the enlightened ones to the realms of the deities.
Even today certain schools of thought in Buddhism teach perceived reality literally as unreal. Chögyal Namkai Norbu considers all our sensory perceptions as a big dream.
From a neuroscience perspective he is actually right in a certain way: When you think you see the outside world, actually what you are experiencing is an image concocted by your brain. We constantly internally hallucinate a "supposed world out there". We strongly filter the overflow of data entering our senses and create a coherent picture therefrom, which may or may not have a certain degree of isomorphism to the ontic reality. This is especially evident when we are asked to focus on a particular activity. If you are asked to count the number of times on people throw a ball to each other, like most people you will totally miss the man in a Gorilla suit walking among the players, because this irrelevant information is filtered out by your brain. In other words, from the sensory data we receive our brains concoct a simulation which is as meaningful as possible under the given circumstances. In that sense our epistemic reality is almost certainly a simulation.
Similarly in Hinduism we find the notion that Vishnu, the all-pervading one, lies in a dream state on the serpent Adisehsa Ananta. Ananta is time and floats for eternity on the ocean of Cosmic Consciousness. Brahma is born out of the navel of Vishnu and begins the process of creation. Vishnu expands into everything thereby becoming everything. By the act of watching his dream, including the creation of the universe by Brahma, Vishnu sustains the Universe. Only when Vishnu wakes from his dream, the cycle of creation ends.
In the Hellenic world we find the notion of Hermes Trismegistos, the thrice great one. This Godhead seems to be a merger of the Greek God Hermes and the Egyptian God Thoth. The earliest texts mentioning this God go back as far as 172 B.C. Hermes Trismegistos is reputed to have written the so-called Tabula Smaragdina (which may have an origin much later. It's earliest written version is an 8th century Arabic text). This Tabula Smaragdina mentions the concept "As above, so below", which seems to be considered as an absolute truth among esoterically oriented people today.
"That which is Below corresponds to that which is Above, and that which is Above corresponds to that which is Below, to accomplish the miracle of the One Thing."
The concept "As above, So below" implies that our physical world is a reflection of a spiritual world. That the microcosm (oneself) is similar in structure to the macrocosm (the universe).
Around 200 A.D. we find the sect of the Gnostics. Gnosticism is a peculiar religion, which describes a dualistic cosmos. Spiritual sparks or souls have become trapped in matter but can be freed by saving knowledge or "Gnosis". The world is the creation of the Demiurge Yaldabaoth, which literally means "Child, come hither". However in another translation his name is translated as "Child of Chaos". The gnostic myth recounts that Sophia (literally "wisdom", the Demiurge's mother) desired to create something apart from the Father to which he did not consent. In this act of separation, she gave birth to the Demiurge. Being ashamed of her deed, she wrapped him in a cloud and created a throne for him within it.
As the Demiurge did not see Sophia or the Father, nor anyone else, he thus concluded that only he himself existed. In a quote from the Apocryphon of John he is reputed to have said: 'I am God and there is no other God beside me'.
However, he did not know the source of his power and did not know that there was someone above him.
The myth furthermore shows how this first separation later on resulted in the entrapment of the divine spark, Sophia, within the human form. This spark is latent until awakened by a call and knowing oneself as this divine spark is the beginning of restoration of Sophia as well as gnosis.
It gets a bit blurry when we see that in Gnosticism Yaldabaoth created the world together with six other so-called Archons. One of these is "Sophia" (Venus), whereas Yaldabaoth himself is indicated to be Saturn.
The internet is full with conspiracy theories that somehow link the Gnostic teachings to the notion that we live in a simulated virtual reality ruled by these evil Archons, who feed on our energies. Many of them claim that one of the Archons is called "Hal", which a Coptic word meaning "simulation" and that this is linked to the "Hal 9000" computer in Space Odyssey 2001. Neither Clarke nor Kubrick has confirmed this assertion. Rather Clarke indicated that this name derived from "Heuristic Algorithm". I have not been able to find this name Hal in the Apocryphon of John either or in any other texts of the Nag Hammadi English Library.
These theories rather feed on themselves, braiding an unintelligible and untangleable knot of nonsense. In my humble opinion it appears to be a 20th century myth invented by a self-educated and self-proclaimed scholar named John Lash who twisted facts to feed a hungry audience of conspiracy theory addicts.
In the middle ages we encounter a number of theories that reality is made for us as a kind of "cosmic intelligence test". In the book the "Assassins of Alamut" Anthony Campbell refers to the medieval Islamic Sect of the Ismailis". they believed the Koran contained an esoteric secret, to which they held the key. He claims that similar notions can be found in the Kabbalah, the teachings of the Cathars of the Languedoc and in the Gnostic texts, all relating to the theme of the world as an unreal simulation, veiling an unknown ultimate reality.
Kabbalists reveal in the book of Zohar , that what is revealed to us as matter is merely one thousandth of the total matter and that there is nothing real about it.
From the Renaissance until the 20th Century
In the 17th century René Descartes  came with his famous "dream argument". Dreaming according to Descartes is proof that we cannot fully rely on our senses to distinguish reality from illusion: "Whatever I have accepted until now as most true has come to me through my senses. But occasionally I have found that they have deceived me, and it is unwise to trust completely those who have deceived us even once."
His contemporaries Locke and Hobbes have tried to refute his argument by stating that in dreams there is no pain and that dreams are susceptible to absurdity unlike waking life. From my personal experience I disagree with this counterargument. As a child I have worn braces on my teeth and sometimes in my dreams I still feel the pain thereof, whereas in waking life I have been free of these braces for over 30 years now. In addition not every dream I have is necessarily absurd. Some dreams are eerily realistic.
Descartes even went so far to suggest that even his body (as well as everything else) perhaps only existed as an idea in his mind, thus venturing on the path traced by solipsism. Eventually he concludes a mind-body dualism, but at least he explored the possibility of ontic reality as a mind simulation.
Kant was also of the opinion that we could only know the appearance of things (phenomena), but not the things in themselves; the world as it actually is, which he called the noumenon. In other words our mental image of the world is a mere simulation.
In the 19th century the theosophy movement of H.P Blavatsky  introduced the notion of the so-called Akasha, borrowed from the Vedas, which she referred to as indestructible tablets of astral light. This notion was picked up by Alfred Percy Sinnett , who describes a Buddhist belief in a permanency of records of everything that has happened in the Akasha, as well as the ability of man to read the same. This notion has developed to the so-called "Akashic Records", very popular among the esoteric people. Interestingly, this concept of the Akasha has in the 20th century been equated with the so-called quantum vacuum, quantum foam or zero point-field, which according to certain adepts can function as a memory and a digital computer. The world we live in is then nothing else than ones and zeros on an Akashic switchboard, which can either be a simulation carried out by entities from a higher dimension or a kind of "self-simulation".
Most of these theories have a religious connotation. And this is not surprising. After all, every notion that a God or Gods created or designed the world can be considered as a simulation argument. God as the grand architect of the universe.
The 20th century is full of fictional literature, lecture and movies about dream and otherwise simulated realities. Most of these are of the cyberdystopian genre.
It would go beyond the scope of this chapter to give a comprehensive overview of these. I just picked a few author names for illustrative purposes.
An absolute master of science-fiction involving simulated realities is Philip K.Dick. There's even an annual Philp K.Dick prize for the best SF book. Robert Heinlein, Stanislaw Lem, Douglas Adams and William Gibson are other great authors if you wish to explore the VR-scape in literature. Most of these books were written in the second half of the 20th century.
The book "Neuromancer" (1984) by William Gibson deserves a special place in this row, as he's the first to use the terminology "the Matrix" to indicate the global computer network in cyberspace which is a virtual reality dataspace. Unlike in the movie "The Matrix", in Neuromancer people still also live in the "real" world and can access this cyberspace in a full immersive mode. The main character is unable to access this matrix, becuase his nervous system has been damaged by a mycotoxin, which had been administered to him as a punishment for a crime.
In the movie culture we can go back as far as 1973 where in Fassbinder's "Welt am Draht" (World on a wire) adds the theme of recursivity by having the very people who work on simulating a world find out that they actually live in a simulated world themselves.
The Matrix (1999) is probably the best known movie on theme of a computer simulated world. In the unlikely event you haven't seen it; I'm not going to give away the gist of the film.
This brings us to the 21st century where we have the formalisation of the simulation argument by the Swedish philosopher Nick Bostrom .
Bostrom's trilemma argument states that at least one of the three following propositions is almost certainly true:
(1) The fraction of human-level civilizations that reach a posthuman stage is very close to zero;
(2) The fraction of posthuman civilizations that are interested in running ancestor-simulations is very close to zero;
(3) The fraction of all people with our kind of experiences that are living in a simulation is very close to one.
If (1) is true, then we will almost certainly go extinct before reaching posthumanity.
If (2) is true, then there must be a strong convergence among the courses of advanced civilizations so that virtually none contains any relatively wealthy individuals who desire to run ancestor-simulations and are free to do so.
If (3) is true, then we almost certainly live in a simulation. In the dark forest of our current ignorance, it seems sensible to apportion one’s credence roughly evenly between (1), (2), and (3).
Unless we are now living in a simulation, our descendants will almost certainly never run an ancestor-simulation.
His trilemma reasoning departs from the concept that a technologically mature "posthuman" civilization would have enormous computing power. Even if only a tiny percentage of them were to run so-called "ancestor simulations" (i.e. "high-fidelity" simulations of prior ancestral life that would be indistinguishable from reality to the simulated ancestor), the total number of simulated ancestors, or "Sims", in the universe (or multiverse, if it exists) would greatly exceed the total number of actual ancestors.
Bostrom then uses a type of anthropic principle reasoning to claim that, if the third proposition is the one of those three that is true, and almost all people with our kind of experiences live in simulations, then we are almost certainly living in a simulation.
Most books about Simulation Hypotheses are endless repetitions of Bostrom's argument. This book is not one of them. It will argue in favour or against a simulation hypothesis starting from other axioms or observations.
Starting with Vernor Vinge idea's about the upcoming Technological Singularity (A point in human history beyond which our future predictions and speculations become pointless as this Technology explosion will transcend our way of living completely and dramatically beyond compare. Some suggest it may grant us immortality and other Godlike properties if we succeed in uploading ourselves to the singular Webmind, in which we can shape a simulated virtual reality (or a plurality thereof) as our “new reality”), the 21st century is arena of the Technopapes such as Ray Kurzweil, Peter Diamandis and Elon Musk.
Their visions consider that if we are not already living in a simulation, before 2045 we will be able to upload our minds to a computerised substrate which will run an infinity of computer simulations, which will appear as real as what we now consider to be ontic reality.
Interested in reading more of this subject? It will be published in my upcoming anthology on the question whether reality is a simulation. I will announce this on Steemit, once the book is published.
By Antonin Tuynman, author of the books "Is Intelligence an Algorithm?", "Transcendental Metaphysics" and "Technovedanta".
 Plato, The Republic, Penguin Classics, 2007.
 Bruce McComiskey, Gorgias on Non-Existence, Philosophy and Rhetoric, Vol.30. No.1, pp. 45-49, 1997.
 Watson, B. The Complete Works of Zhuangzi, Columbia University Press, 2013.
 Chogyal Namkhai Norbu, Dream Yoga and the Practice of Natural Light, Snow Lion, 2002.
 Fred S. Kleiner, Gardner's Art through the Ages: Non-Western Perspectives. Cengage Learning. p. 22, 2007.
 Papyrus Vindobonensis Graeca 29456.
 Anthony Campbell, Assassins of Alamut, Lulu Press, 2013.
 Matt, D.C., Zohar: Annotated & Explained, SkyLight Paths, 2002.
 Descartes, R. Meditations On First Philosophy, Watchmaker Publishing, 2010.
 H.P.Blavatsky, The Secret Doctrine, CreateSpace Independent Publishing Platform, 2011.
 Sinnet, A.P. Esoteric Buddhism, Loris Bagnara Editions,1883.
 https://www.simulation-argument.com/simulation.html and Bostrom N. Are You Living in a Simulation?, Philosophical Quarterly, Vol. 53, No.211, pp. 243-255, 2003.