The mahavakyas, the "great sayings", are four brief Upanishadic statements taken in Advaita Vedanta as expressing the identity of the individual self with Brahman. The selection of exactly four, one from each of the Vedas, is a later systematisation rather than an Upanishadic scheme, and it became standard in the Advaita tradition and in the initiation of renunciants in the Shankaracharya lineages, where a mahavakya is transmitted to the initiate.
Prajnanam Brahma, "consciousness is Brahman", from the Aitareya Upanishad (3.3) of the Rigveda. It is classified as the lakshana-vakya, the defining statement, since it says what the reality in question is.
Aham Brahmasmi, "I am Brahman", from the Brihadaranyaka Upanishad (1.4.10) of the Yajurveda. It is the anubhava-vakya, the statement of realisation, spoken in the first person by one who has understood.
Tat Tvam Asi, "you are that", from the Chandogya Upanishad (6.8.7 and repeated eight further times) of the Samaveda. It is the upadesha-vakya, the instruction given by teacher to pupil, and it occurs in the dialogue in which Uddalaka Aruni instructs his son Shvetaketu, driving the phrase home through a sequence of analogies: salt dissolved in water and still present throughout, the tiny seed from which the great banyan grows, rivers that lose their names in the sea.
Ayam Atma Brahma, "this self is Brahman", from the Mandukya Upanishad (2) of the Atharvaveda. It is the abhijna-vakya, the statement of recognition.
The four are read differently by the Vedanta schools, and those differences are the schools' whole disagreement in miniature. Advaita reads tat tvam asi as a straightforward identity, and Shankara devotes close analysis to explaining how two terms whose apparent references are incompatible can share a referent once the incompatible connotations are set aside, the individual's limitation and the supreme's remoteness both dropping away. Ramanuja reads the sentence as asserting that Brahman is the inner self of whatever "you" denotes, so that it states inseparability and dependence rather than identity. Madhva reads it on a different division of the Sanskrit as atat tvam asi, "you are not that", so that the sentence asserts difference. Whether that reading is grammatically defensible has been argued over ever since, and the exchange is one of the sharper examples of how much can turn on how a continuous Sanskrit text is divided.