Stanley Kubrick’s The Shining has been the subject of countless theories and interpretations given its ambiguous moments, many of the hotel’s details, and more, and one theory claims that the whole movie was just a nightmare Jack Torrance (Jack Nicholson) was having. In 1977, Stephen King’s novel The Shining was published, establishing him as a preeminent author in the horror genre and quickly gaining the attention of readers and other artists. Three years later, The Shining was adapted to the big screen by Stanley Kubrick, but he made major changes to the story and characters.
https://screenrant.com/shining-jack-torrance-nightmare-hotel-theory-explained/