The Beatles' song was written in what psychologists refer to as the "hypnagogic state". This is the twilight zone between sleep and wakefulness, when we drowsily linger in a semi-conscious state, experiencing vivid mental images and sounds.
Waking up one morning in early 1965, Paul McCartney became aware of a long complex melody playing inside his head. He jumped straight out of bed, sat down at his piano and picked out the melody on the keys.
He quickly found the chords to go with the melody and created some holding phrases (as songwriters call them, before they write proper lyrics) to fit the melody.
Finding it difficult to believe that such a beautiful melody could emerge
spontaneously, McCartney suspected that he was subconsciously plagiarising another composition.
As he recalle

ScienceAlert en Español

ABC News
Associated Press US News
CBS News
Raw Story
Reuters US Domestic
Crooks and Liars
People Crime