Creation of the text
According to Ban Gu, writing in the Book of Han, the Analects originated as individual records kept by Confucius's disciples of conversations between the Master and them, which were then collected and jointly edited by the disciples after Confucius's death in 479 BC. The work is therefore titled Lunyu meaning "edited conversations" or "selected speeches" (i.e. analects). This broadly forms the traditional account of the genesis of the work accepted by later generations of scholars, for example the Song dynasty neo-Confucian scholar Zhu Xi stated that Analects is the records of Confucius's first- and second-generation pupils. The view however was challenged by Qing dynasty philologist Cui Shu (崔述, 1740–1816) who argued on linguistic ground that the last five books are much later than the rest of the work. Many modern scholars now believe that the work was compiled over a period of around two hundred years, with some questioning the authenticity of some of the sayings. Because no texts of the Analects have been discovered earlier, and because the Analects was not referred to by name in any existing source before the early Han dynasty, some scholars have proposed dates as late as 140 BC for the text's compilation.
Regardless of how early the text of the Analects existed, most Analects scholars believe that, by the early Han dynasty (206 BC–220 AD) the book was widely known and transmitted throughout China in a mostly complete form, and the book acquired its final, complete form during Han dynasty. A Han dynasty writer Wang Chong however claimed that the Analects that existed during the Han dynasty was incomplete and formed only a part of a much larger work. A larger collection of Confucius's teachings existed in the Warring States period than has been preserved directly in the Analects: 75% of Confucius's sayings cited by his second-generation student, Mencius, do not exist in the received text of the Analects.
According to the Han dynasty scholar Liu Xiang, there were two versions of the Analects that existed at the beginning of the Han dynasty: the "Lu version" and the "Qi version". The Lu version contained twenty chapters, and the Qi version contained twenty-two chapters, including two chapters not found in the Lu version. Of the twenty chapters that both versions had in common, the Lu version had more passages. Each version had its own masters, schools, and transmitters. In the reign of Emperor Jing of Han (r. 157–141 BC), a third version (the "Old Text" version) was discovered hidden in a wall of the home then believed to be Confucius's when the home was in the process of being destroyed by King Gong of Lu (r. 153–128 BC) in order to expand the king's palace. The new version did not contain the two extra chapters found in the Qi version, but it split one chapter found in the Lu and Qi versions in two, so it had twenty-one chapters, and the order of the chapters was different. The old text version got its name because it was written in characters not used since the earlier Warring States period (i.e. before 221 BC), when it was assumed to have been hidden. According to the Han dynasty scholar Huan Tan, the old text version had four hundred characters different from the Lu version (from which the received text of the Analects is mostly based), and it seriously differed from the Lu version in twenty-seven places. Of these twenty-seven differences, the received text only agrees with the old text version in two places.
Over a century later, the tutor of the Analects to Emperor Cheng of Han, Zhang Yu (d. 5 BC), synthesized the Lu and Qi versions by taking the Lu version as authoritative and selectively adding sections from the Qi version, and produced a composite text of the Analects known as the "Zhang Hou Lun". This text was recognized by Zhang Yu's contemporaries and by subsequent Han scholars as superior to either individual version, and is the text that is recognized as the Analects today. The Qi version was lost for about 1800 years but re-found during the excavation of the tomb of Marquis of Haihun that was found 2011. No complete copies of either the Lu version or the old text version of the Analects exist today, though fragments of the old text version were discovered at Dunhuang.
Before the late twentieth century the oldest existing copy of the Analects known to scholars was found in the "Stone Classics of the Xinping Era", a copy of the Confucian classics written in stone in the old Eastern Han dynasty capital of Luoyang around 175 AD. Archaeologists have since discovered two handwritten copies of the Analects that were written around 50 BC, during the Western Han dynasty. They are known as the "Dingzhou Analects", and the "Pyongyang Analects", after the location of the tombs in which they were found. The Dingzhou Analects was discovered in 1973, but no transcription of its contents was published until 1997. The Pyongyang Analects was discovered in 1992. Academic access to the Pyongyang Analects has been highly restricted, and no academic study on it was published until 2009.
The Dingzhou Analects was damaged in a fire shortly after it was entombed in the Han dynasty. It was further damaged in an earthquake shortly after it was recovered, and the surviving text is just under half the size of the received text of the Analects. Of the sections that survive, the Dingzhou Analects is shorter than the received Analects, implying that the text of the Analects was still in the process of expansion when the Dingzhou Analects was entombed. There was evidence that "additions" may have been made to the manuscript after it had been completed, indicating that the writer may have become aware of at least one other version of the Analects and included "extra" material for the sake of completeness. The content of the Pyongyang Analects is similar to the Dingzhou Analects; but, because of the secrecy and isolationism of the North Korean government, only a very cursory study of it has been made available to international scholars, and its contents are not completely known outside of North Korea. Scholars do not agree about whether either the Dingzhou Analects or the Pyongyang Analects represent the Lu version, the Qi version, the old text version, or a different version that was independent of these three traditions.
Importance within Confucianism
During most of the Han period the Analects was not considered one of the principal texts of Confucianism. During the reign of Han Wudi (141–87 BC), when the Chinese government began promoting Confucian studies, only the Five Classics were considered by the government to be canonical (jing). They were considered Confucian because Confucius was assumed to have partially written, edited, and/or transmitted them. The Analects was considered secondary as it was thought to be merely a collection of Confucius's oral "commentary" (zhuan) on the Five Classics.
The political importance and popularity of Confucius and Confucianism grew throughout the Han dynasty, and by the Eastern Han the Analects was widely read by schoolchildren and anyone aspiring to literacy, and often read before the Five Classics themselves. During the Eastern Han, the heir apparent was provided a tutor specifically to teach him the Analects. The growing importance of the Analects was recognized when the Five Classics was expanded to the "Seven Classics": the Five Classics plus the Analects and the Classic of Filial Piety, and its status as one of the central texts of Confucianism continued to grow until the late Song dynasty (960–1279), when it was identified and promoted as one of the Four Books by Zhu Xi and generally accepted as being more insightful than the older Five Classics.
Since the Han dynasty, Chinese readers have interpreted the Analects by reading scholars' commentaries on the book. There have been many commentaries on the Analects since the Han dynasty, but the two which have been most influential have been the Collected Explanations of the Analects (Lunyu Jijie) by He Yan (c. 195–249) and several colleagues, and the Collected Commentaries of the Analects (Lunyu Jizhu) by Zhu Xi (1130–1200). In his work, He Yan collected, selected, summarized, and rationalized what he believed to be the most insightful of all preceding commentaries on the Analects which had been produced by earlier Han and Wei dynasty (220–265 AD) scholars. His personal interpretation of the Lunyu was guided by his belief that Daoism and Confucianism complemented each other, so that by studying both in a correct manner a scholar could arrive at a single, unified truth. Arguing for the ultimate compatibility of Daoist and Confucian teachings, he argued that "Laozi [in fact] was in agreement with the Sage" (sic). The Explanations was written in 248 AD, was quickly recognized as authoritative, and remained the standard guide to interpreting the Analects for nearly 1,000 years, until the early Yuan dynasty (1271–1368). It is the oldest complete commentary on the Analects that still exists.
He Yan's commentary was eventually displaced as the definitive, standard commentary by Zhu Xi's commentary. Zhu Xi's work also brought together the commentaries of earlier scholars (mostly from the Song dynasty), along with his own interpretations. Zhu's work took part in the context of a period of renewed interest in Confucian studies, in which Chinese scholars were interested in producing a single "correct" intellectual orthodoxy that would "save" Chinese traditions and protect them from foreign influences, and in which scholars were increasingly interested in metaphysical speculation.
In his commentary Zhu made a great effort to interpret the Analects by using theories elaborated in the other Four Books, something that He Yan had not done. Zhu attempted to give an added coherence and unity to the message of the Analects, demonstrating that the individual books of the Confucian canon gave meaning to the whole, just as the whole of the canon gave meaning to its parts. In his preface, Zhu Xi stated, "[T]he Analects and the Mencius are the most important works for students pursuing the Way [...] The words of the Analects are all inclusive; what they teach is nothing but the essentials of preserving the mind and cultivating [one's] nature." From the first publication of the Commentaries, Zhu continued to refine his interpretation for the last thirty years of his life. In the fourteenth century, the Chinese government endorsed Zhu's commentary, and until 1905 it was read and memorized along with the Analects by all Chinese aspiring to literacy and employment as government officials.