The Māṇḍūkya Upaniṣad teaches that all is Oṃ and that the self has four quarters: the waking, the dreaming, the deep sleep, and the fourth, which is beyond them all. Gauḍapāda’s verse commentary, the Māṇḍūkya Kārikā, developed from it a radical nondualism that shaped Śaṅkara’s Advaita.
Māṇḍūkya Upaniṣad
The shortest principal Upaniṣad: twelve verses on the syllable Oṃ and the four states of the self.
Also: Mandukya Upanishad