Prologue

The Pre-Qin Era

Just at the time that the civilizations of Egypt and Babylon were developing in the borderlands of the three continents of Asia, Africa, and Europe, another very different civilization was emerging in the far east and spreading out along the river basins of the Yellow River and the Yangtze River: the Chinese civilization. Scholars generally believe today that in ancient times migration between the Tarim Basin in modern-day Xinjiang and the Euphrates riverlands was impossible on account of a forbidding series of mountain ranges, harsh deserts, and the ferocity of the nomadic tribes of the region. Sometime between the years 2700 BCE and 2300 BCE, the Five Emperors of legend emerged in ancient northern China and after them a series of dynasties one after another.Footnote 1 Although the bamboo boards which were traditionally used for the inscription of Chinese characters are not so durable as clay tablets or papyrus books, nevertheless the science historian Joseph Needham has pointed out that a great wealth of ancient texts have survived intact in China due to the diligent record keeping of the Chinese people (Fig. 3.1).

Fig. 3.1
A dataset of nine symbols in vertical and horizontal notations for numbers 1 to 9 represents the arithmetical notation of ancient China.

Arithmetical notation of ancient China

Like both Babylon and Egypt, China in ancient times had grasped already the mathematical seeds of number and shape. Although the Shang oracle bones have been only incompletely deciphered, they have been found to contain a complete decimal system; strict calculations and counting appeared at the latest in the spring and autumn period and the Warring States period. This notational system consisted of vertical and horizontal counting rods, representing even and odd digits, with a blank space where zero would go. The first century BCE Chinese historian Sima Qian (ca. 145 BCE–ca. 90 BCE) writes in his Records of the Grand Historian, Annals of the Xia Dynasty (史记 \(\cdot \) 夏本 纪 ); “[Xia Yu] surveyed the nine mountains, with a water level and chalk line in his left hand, a compass and carpenter’s square in his right….Footnote 2” This can be regarded as an early application of geometry.

It is perhaps more noteworthy that, just at the time when the Athenian school in Greece was overflowing with discourse on philosophy and theoretical mathematics, the Warring States period in China (475 BCE–221 BCE) too was teeming with all manner of scholars, belonging to what has been called the Hundred Schools of Thought. This was the time in world history when philosophers were springing up across the globe, sometimes called the axial age, a term coined by the German philosopher Karl Jaspers (1883–1969). Among the works of this period, the Mojing (墨经 ) is representative of the Mohist philosophy of logic and rational thought; in it appear certain laws for formal logic, and built atop them a series of abstract mathematical definitions, even involving the concept of infinity. The logicians of the Ming school (or Mingjia, 名家 ), known for their eloquence, expressed a deeper understanding of the infinite. The landmark book Zhuangzi (庄子 ) of the Taoist philosophical tradition records the proposition of the representative of the Ming school Hui Shi: “The largest thing has nothing beyond it; it is called the One of largeness. The smallest thing has nothing within it; it is called the One of smallness.” The largest thing here indicates the infinite universe; the smallest thing can be considered equivalent to the atoms of Democritus.

Hui Shi (ca. 370 BCE–ca. 310 BCE) was a philosopher of the Song state under the Zhou Dynasty in modern-day Henan Province, and his reputation in his time was second only to Confucius and Mozi. He served for 15 years as chief minister of the Wei state and advocated for the unification with the Qi and Chu states against the Qin with considerable political success. Hui Shi and his contemporary Zhuang Zhou, author of the Zhuangzi, were at once friends and rivals. The Debate on the Joy of Fish between the two of them is among the famous dialogues in Chinese philosophy. After the death of Hui Shi, Zhuang Zhou is said to have remarked that there was no one left to talk to anymore. Hui Shi and the Ming school with which he was associated are remembered for many wonderful and paradoxical statements involving mathematical concepts:

The carpenter’s square is not square, compasses cannot make circles;

The shadow of the flying bird never moves;

No matter how swift the barbed arrow, there are times when it is neither moving nor at rest;

Take a pole one foot long, cut away half of it every day, and at the end of ten thousand generations, there will still be some left;Footnote 3

and so on. It is easy to see the resemblance to the paradoxes invented by Zeno in Greece about a century earlier. The immediate successor to Hui Shi was Gongsun Long (325 BCE–250 BCE), who was famous for the aphorism “white horses are not horses.” This paradox is generally interpreted as pointing toward the distinction between the general and the particular, but inevitably it has also given rise to accusations of shallow sophistry.

Regrettably, the Ming school and Moist philosophical traditions were exceptions among pre-Qin thought. The more socially influential works in the Confucian, Taoist, and Legalist traditions paid little heed to mathematics and abstract topics, but rather were focused exclusively on the successful governance of the state and the world, social ethics, and the sound cultivation of body and mind, markedly at odds with the austere rationalism of ancient Greek philosophy. After Qin Shi Huang, the first emperor of Qin, unified China, he put a decisive stop to the contention of the Hundred Schools of Thought and burned the history books and folk collections of various states. By the time of Emperor Wu of the Han dynasty (around 140 BCE), the only female emperor in the history of China, Confucianism had monopolized the intellectual landscape, and the mathematical disputations of the Ming school and the Moists had no opportunity for further development. On the other hand, due to a long period of social stability and increased exposure to the outside world, the economy had blossomed to an unprecedented level of prosperity, driving the development of mathematics along practical and computational lines, with greater success.

Zhoubi Suanjing

In the year 47 BCE, the Library of Alexandria was partially burned by the Roman army under the command of Julius Caesar in the course of military operations intended to assist his lover Cleopatra in the seizure of Egyptian power. Cleopatra was the second daughter of Ptolemy XII Auletes, and she ruled alongside her two younger brothers Ptolemy XIII and Ptolemy XIV and her son with Caesar, Caesarion. At this time, China was under the rule of the Western Han dynasty and experiencing its first period of ascendance in mathematical achievement. It is generally believed the greatest masterpiece of classical Chinese mathematics, the Nine Chapters on the Mathematical Art, was written during this era (around the first century BCE). The oldest Chinese mathematical classic, the Zhoubi Suanjing,Footnote 4 presumably came a bit earlier (Fig. 3.2).

Fig. 3.2
A photo of nine scrolls with Chinese script on them.

The earliest known mathematical work in China, the Book of Numbers and Computations

It is worth mentioning here, however, that although Needham agrees that the mathematical level of Nine Chapters on the Mathematical Art is more advanced than that of the Zhoubi Suanjing, nevertheless the earliest date we can assign to the latter according to the archaeological evidence is in fact two centuries later than the former. This lacuna is a source of some disappointment to archaeologists and historians of mathematics. Needham himself remarks in his landmark Science and Civilization in China that some of the results in the Zhoubi Suanjing are so early that it seems impossible not to believe that its composition dates back to the Warring States period.

In addition to the uncertain provenance of the Zhoubi Suanjing, its author is also completely unknown, a situation very different from the fate of Euclid’s Elements in Greece. There are two most interesting mathematical results in this book. One of these is the Gougu theorem, as the Pythagorean theorem concerning right triangles is known in China. This was derived earlier than Pythagoras, but there is no detailed proof of this result like that of Proposition 47 Book 1 of the Elements. Rather this proposition is recorded in the form of a dialogue between the Duke of Zhou and his astronomer and mathematician Shang Gao in the early years of the Western Zhou dynasty (eleventh century BCE). This marks these two out as the earliest characters in the history of Chinese mathematics.

The Duke of Zhou, whose personal name was Dan (旦 ), was the fourth son of King Wen of Zhou and the younger brother of King Wu. After King Wu died and left the kingdom to his son, the Duke of Zhou became regent and oversaw the administration of the kingdom, provoking revolts, which he successfully put down, before dutifully acquiescing to a peaceful transfer of power when King Cheng came of age after 7 years had passed. As regent, the Duke of Zhou is also credited with formalizing the legal and ritual basis of the feudal system of ancient China, the foundations atop which the Zhou dynasty endured for a further 800 years. Confucius revered him as a model of the ideal.

Returning to the Zhoubi Suanjing, Shang Gao answers the question posed to him by the Duke of Zhou with the remarks:

…a base of three in breadth, the altitude makes four, and the diameter is five diagonally.

This is a special case of the Pythagorean theorem, which for this reason is also referred to as the Shang Gao theorem in China. Shang Gao also outlined a proof of the theorem. Its other name in Chinese uses the characters 勾 (gou) and 股 (gu), meaning hook and thigh (or thigh bone), respectively, but which were understood in ancient Chinese to refer to the shorter and longer sides about the right angle of a right triangle, that is, its base and altitude (Fig. 3.3).

Fig. 3.3
A square diagram has a side c. It has a titled square labeled b minus a at the center, surrounded by 4 right triangles.

Graphical proof of the Pythagorean theorem by Zhao Shuang

The Zhoubi Suanjing also records a dialogue between the two figures Chen Zi and Rong Fang who are presumed to be later descendants of the Duke of Zhou (sixth and seventh centuries BCE) which includes the general form of the Pythagorean theorem:

Take the point beneath the sun as the base, and the height of the sun as altitude, square both the base and the altitude and add them, and take the square root to get the oblique distance to the sun.

It is easy to see that this rule was obtained as part of the study of astronomical measurements. Another important mathematical result contained in the Zhoubi Suanjing is solar height formula, which was widely used in early astronomy and calendrical calculation. For a long time, it was not known how this formula came about, until 1975 when the contemporary Chinese mathematician Wu Wenjun (1919–2017) restored its proof.

In addition, there appear also the use of fractions, a discussion of multiplication, and a method for finding greatest common denominators, indicating that the concept of square roots was already in use. It is also worth mentioning that the dialogue in the Zhoubi Suanjing touches also upon the rules and regulations of the three mythological figures Yu the Great, who was said to have controlled the waters, Fu Xi, and Nüwa. The discussion reveals an early familiarity with surveying methodology and applied mathematics. There are also sporadic bits of geometry, arising as questions of measurement. Needham argues that this seems to indicate that the Chinese people have exhibited arithmetical and mercantile acumen since a very early date. On the other hand, there does not seem to have been much interest in abstract geometry made up of general theorems and propositions atop axiomatic foundations, without specific numerical motivation.

It is gratifying, however, that the Eastern Wu mathematician Zhao Shuang, a third-century commentator on the Zhoubi Suanjing, independently proved the Pythagorean theorem in a very beautiful way, by a method of complementary areas. Let the lengths of the two sides about the right angle of a right triangle be a and b as in the figure, with \(b > a\). Then the square with hypotenuse c as its sidelength can be decomposed into five areas consisting of a square with sidelength \(b-a\) and four triangles congruent to the original right triangle. After some simplification, this gives again \(a^2+b^2=c^2\). This is similar in favor to the proof we have encountered already in our discussion of Pythagoras above, but whereas that proof is attributed to him only by way of later speculation, the proof presented by Zhao Shuang is authoritatively documented, and moreover he included with his annotations a very beautiful diagram.

Nine Chapters on the Mathematical Art

Unlike the Zhoubi Suanjing, somewhat more is known about the authorship and year of composition of the classic Nine Chapters on the Mathematical Art. This book was almost certainly developed from the Nine Arithematical Arts, one of six compulsory courses (the six arts) taught to the sons of Western Zhou nobles; later it was compiled and supplemented by two mathematicians during the Western Han dynasty, under the leadership of Zhang Cang, a famous politician and thinker who had personally contributed to the formulation of laws, measures, and weights as prime minister under Emperor Wen of Han. In general, the Nine Chapters on the Mathematical Art seems to be the product of a continual process of synthesis and revision lasting from the pre-Qin era through to the middle of the Western Han dynasty (Fig. 3.4).

Fig. 3.4
A snipped page is written in a foreign language.

The Nine Chapters on the Mathematical Art, Qing dynasty engraving

The book takes the form of a problem set, containing 246 problems divided across its 9 chapters, which are as follows: \((1)\)Fangtian (方田 ) – Bounding Fields, \((2)\)Sumi (粟米 ) – Millet and Rice, \((3)\)Cuifen (衰分 ) – Proportional Distribution, \((4)\)Shaoguang (少廢 ) – Dimension Reduction, \((5)\)Shanggong (商功 ) – Figure Construction, \((6)\)Junshu (均8 ) – Equitable Taxation, \((7)\)Yingbuzu (盈不足 ) – Excess and Deficit, \((8)\)Fangcheng (方程 ) – Equations, and \((9)\)Gougu (勾股 ) – Right Triangles. It can be seen from the chapter titles alone that the primary focus of the book is calculation and mathematical applications. The only materials related to geometry concern primarily the calculation of areas and volumes.

The chapters entitled Millet and Rice, Proportional Distribution, and Equitable Taxation deal with proportions of numbers in a way that contrast sharply with the geometric theory of proportions developed by the Greeks via line segments. The topic of Proportional Distribution is concerned with distribution of wealth and commodities according to fixed proportional rates, Equitable Taxation addresses more advanced problems of proportion, and Millet and Rice concerns the solution to even distribution of the burden of grain transportation.

The most academically valuable arithmetic problem in the book is the method of excess and deficit, which concerns the solution of equations using the principle known later as the rule of false position. Consider an equation \(f(x)=0\), and suppose the two values \(f(x_1)=y_1\) and \(f(x_2)=-y_2\) are known. Then the root is given by

$$\displaystyle \begin{aligned} x = \frac{x_1y_2+x_2y_1}{y_1+y_2}=\frac{x_1f(x_2)-x_2f(x_1)}{f(x_1)-f(x_2)}. \end{aligned}$$

If f is linear, then this solution is exact, whereas for nonlinear f, it provides only an approximation. From the modern perspective, this technique is equivalent to the method of linear interpolation.

In the thirteenth century, the Italian mathematician Fibonacci included in his treatise the Liber Abaci a chapter devoted to the method of excess and deficit, which he called the Method Elchataym, transliterating an Arabic word which has been conjectured to refer to the archaic designation Khitan or Cathai for China, although it also translates directly as the two errors. It is all the same by no means inconceivable that this method was spread to Arabic countries through Central Asia by way of the Silk Road and later transmitted to the western world via Arabic sources.

The Nine Chapters on the Mathematical Art presents more substantial results in the field of algebra. In the chapter Fangcheng dealing with equations, there appear already solutions to linear systems of equations, for example,

$$\displaystyle \begin{aligned} \begin{cases} x + 2y +3z &= 26 \\ 2x+3y+z &= 34 \\ 3x + 2y +z &= 39 \end{cases}. \end{aligned}$$

Such systems are presented without the use of any symbol for unknown or indeterminate quantities. Rather, the coefficients and constants are presented as an array or matrix, as in

Then by a method referred to as multiply and directly divide, this system is transformed so that there are zeros everywhere except along the antidiagonal:

from which the solution can be obtained. This method is equivalent to that known in western countries as Gaussian elimination, and this art of equation solving is considered a jewel in the history of Chinese mathematics (Fig. 3.5).

Fig. 3.5
A dataset has vertical and horizontal arithmetic notations for simultaneous equations by counting rods.

Representation of simultaneous equations by counting-rods

There are two more very notable features of the Nine Chapters on the Mathematical Art. The first is the inclusion of both positive and negative numbers and the rules for the addition and subtraction of both. The other concerns the root extraction method, about which it is stated, “if the root extraction method continues without end, then it is impossible to extract the root.” The former shows that Chinese mathematicians were comfortable with negative quantities very early on, in contrast with Indian mathematicians, who introduced negative numbers in the seventh century, and western mathematicians, who accepted them only much later. The latter shows that Chinese mathematicians were aware already of the existence of irrational numbers, although they did not pay it serious heed on account of its inclusion as a curiosity in the process of solving equations. The Greeks, who prized rigorous deduction above all things, took more notice; they were not ones to easily abandon an opportunity worth pursuing.

It is in the treatment of geometrical problems in the Nine Chapters on the Mathematical Art that the deficiencies of ancient Chinese mathematicians become apparent. For example, the formula for the approximation of the area of a circle in the Bounding Fields chapter makes use of the approximate value \(\pi \approx 3\), identical to the value used by the ancient Babylonians. The formula given for the volume of a sphere is only half the exact value obtained in Greece by Archimedes, and incorporating into this formula the very imprecise approximation for \(\pi \), the error is even worse. On the other hand, there are basically correct formulas for the areas and volumes of linear geometric figures. One way to summarize the situation is that the Nine Chapters on the Mathematical Art arithmetizes or algebraizes geometric problems, just as Euclid’s Elements geometrizes algebraic problems. Unfortunately, no derivation is given for the algorithmic treatment of geometric problems in the text, so it can be considered really only as a practical geometrical toolkit.

From Circle Divisions to the Method of Four Unknowns

Liu Hui’s \(\pi \) Algorithm

In the year 391 CE, after years of conflict both within the Christian church and between the local church and the Holy See in Rome, Emperor Theodosius I, who abolished the Olympic games and divided Rome in two, sanctioned or at least failed to prevent the destruction of the Temple of Serapis at Alexandria, and with it the treasures and Greek manuscripts Cleopatra had earlier ordered to be rescued from the old Library. In China at that time, the Eastern Han dynasty, which had produced Cai Lun, who had improved the science of papermaking, and Zhang Heng,Footnote 5 a remarkable scientist and polymath, had already split apart, and the Sui dynasty had not yet risen to power. This was the turbulent period of the Wei, Jin, and Southern and Northern dynasties. After a long period in which Confucianism was the dominant trend in intellectual life, this period saw a newfound spirit of speculative thought, producing the Wei-Jin philosophy and the Seven Sages of the Bamboo Grove, remembered still today.

The Wei-Jin style refers to the habits and demeanor of the leading figures of the period; it has sometimes also been called Wei-Jin romanticism. The central principles of this style were its admiration for nature, detachment, directness, and magnanimity. Its adherents admired refined eloquence, enjoyed alcohol, and cared little for worldly affairs, preferring instead an aesthetic seclusion. The Wei-Jin thinkers referred to the seminal texts the I Ching (or Book of Changes), the Zhuangzi, and the Laozi as The Three Xuan (三 玄 , meaning three profound studies), and qingtan ((清谈 ,idle conversation) or xuantan (玄谈 , profound conversation) came to refer to the doctrine of pure conversation in metaphysics and philosophy. At the end of the Wei dynasty and the beginning of the Jin dynasty, the representatives of the Wei-Jin school were the Seven Sages of the Bamboo Grove, a collective of scholars, writers, and musicians headed by the poets Ruan Ji and Ji Kang. In later times, the Wei-Jin style became a popular aesthetic ideal for the demeanor and self-expression of the scholar-official (Fig. 3.6).

Fig. 3.6
A portrait of Liu Hui.

Liu Hui, a mathematician of the Wei and Jin period

In the atmosphere of this social and humanistic environment, Chinese mathematics also experienced a new flourishing. Several academic works appeared in the form of commentaries on the Zhoubi Suanjing or the Nine Chapters on the Mathematical Art, in particular providing proofs for some of the important conclusions in these books. One of the pioneers of this practice was Zhao Shuang (from the Eastern Wu state of the Three Kingdoms period), whom we have already encountered, and its most accomplished practitioner was Liu Hui. Like Zhao Shuang, we do not know the dates of his birth or death, only that he lived sometime in the third century and that he wrote his Notes on the Nine Chapters on the Mathematical Art in the year 263, before the collapse of the Wei and Wu states. It is difficult to determine whether Zhao Shuang or Liu Hui was the earlier mathematician; both are recognized as the earliest Chinese mathematicians to have made major individual contributions to mathematics (Fig. 3.7).

Fig. 3.7
An illustration. A hexagon's six corners are placed on the outer ring of the circle. The origin is marked as O, and three lines connected to the circle outline are labeled A, D, and B. The distance between A D, and D B are l 2 n and l n, respectively.

Calculation of \(\pi \)

Liu Hui was able to verify and justify various geometrical calculations in the Nine Chapters on the Mathematical Art by a method of subdivision and complementary areas identical to the method used by Zhao Shuang in his proof of the Pythagorean theorem, inaugurating a standard of logical proof for mathematical propositions in ancient Chinese mathematics. Liu Hui also noticed an important limitation of this method: it cannot be extended to three-dimensional figures, since it is not possible in three dimensions as it is in two to transform any figure into another of identical volume by a process of planar cuts and rearrangements. In order to circumvent this obstacle to the determination of volume formulas, Liu Hui resorted to infinitesimal methods, just as Archimedes had. He used two such methods, a method of limits and a method of indivisibles, and he determined in this way that the formula for the volume of a sphere in the Nine Chapters on the Mathematical Art was incorrect.

In more detail, Liu Hui considered two cylinders inscribed in a cube with perpendicular axes, such that their intersection just touches the sphere inscribed in the cube. He called this figure a box-lid (牟合方盖 ) and determined that the ratio of the volume of the sphere to the volume of the box-lid should be as \(\frac {\pi }{4}\). His innovations in this argument come very close to Cavalieri’s principle, developed many centuries later by an Italian mathematician who played an important role in the development of integral calculus. Liu Hui did not however take the further step of calculating its general form and was not able to determine the volume of his box-lid or correspondingly the volume of the sphere. On the other hand, his methods paved the way for Zu Chongzhi and his son Zu Geng to complete this work some two centuries later.

In addition to his annotations to Nine Chapters on the Mathematical Art, Liu Hui added as a tenth chapter to this book an essay of his own composition, later published separately as The Sea Island Mathematical Manual (海岛算 经 ). In this book, Liu Hui develops his double-difference-algorithm (重差 术 ), an important tool in ancient astronomy, and The Sea Island Mathematical Manual became a classic in the field of surveying. But Liu Hui’s most famous and valuable work is the technique of circle division he introduces in his commentary on the first chapter of the Nine Chapters on the Mathematical Art for the determination of the circumference and area of a circle and an approximation algorithm for \(\pi \). The basic idea is to approximate a circle by an inscribed regular polygon. Liu Hui writes:

If the division is fine, then the deficit is less, and if the process of division is continued and continued until the point of indivisibility, then it will become as one with the circle without any deficit whatsoever.

He also noticed that the sidelength \(l_{2n}\) of a regular 2n-gon can be easily obtained from the sidelength \(l_n\) of a regular n-gon by a double application of the Pythagorean theorem. In the figure, if the radius of the circle is r, then

$$\displaystyle \begin{aligned} \begin{array}{rcl} l_{2n} & =&\displaystyle AD = \sqrt{AC^2+CD^2} \\ & =&\displaystyle \sqrt{\left(\frac{1}{2}l_n \right)^2+\left(r-\sqrt{r^2- \left(\frac{1}{2}l_n \right)^2} \right)^2}. \end{array} \end{aligned} $$

If we put \(r=1\) and start from the regular hexagon and double the number of sides five times, we obtain from the regular 192-gon (\(192=6 \times 2^5\)) an approximation

$$\displaystyle \begin{aligned} \pi \approx \frac{157}{50}=3.14, \end{aligned}$$

which Liu Hui argued was a fine enough approximation for practical purposes. This is all basically consistent with the results and methods employed by Archimedes in the third century BCE, except that Archimedes made use of both inscribed and circumscribed polygons and was able therefore to obtain the same value from polygons with only \(96=6 \times 2^4\) sides. In a note that cannot definitely be attributed to Liu Hui, this computation is carried out as far as a polygon with \(3072=6 \times 2^9\) sides to obtain the approximation

$$\displaystyle \begin{aligned} \pi \approx \frac{3927}{1250}=3.1416. \end{aligned}$$

In light of his extraordinary achievements in mathematics, Emperor Huizong of Song honored him as a noble man of Zi (淄乡男 ) in the year 1109. Since this honorific was customarily designated after the hometown of its recipient at that time, we can infer from this that Liu Hui was from either Linzi or Zibo in Shandong Province. As the birthplace of Confucius and Confucianism in the time of the Qi and Lu states in the spring and autumn period, the academic atmosphere of this region was refined from throughout the Han dynasty up to the Wei and Jin period, a rich cultural environment in which Liu Hui would have had exposure to extensive scholarly debate and history. It can be seen in his writings that he was indeed familiar with a wide range of earlier thought and worked from within the position of freedom from ideology in his time. This no doubt contributed to his ability to achieve such remarkable results in mathematics.

Three years after Liu Hui completed his annotations to Nine Chapters on the Mathematical Art, China experienced its second reunification (the first being the establishment of the Qin dynasty), when Sima Yan, a general of the Wei state, established the Jin dynasty (Western Jin) as its first emperor, Emperor Wu of Jin. Increased economic development and interregional exchange during this period stimulated the emergence of geography as an intellectual discipline, culminating in the works of the cartographer Pei Xiu, who proposed six principles for cartography, including consistent scaling, and standards for orientation and distance, setting down the theoretical framework for the future of Chinese cartography. New customs and habits also sprang up during this period, including the consumption of tea, and several new tools were invented in order to save labor, including the wheelbarrow and the water mill. In the year 283, the Daoist naturalist and alchemist Ge Hong was born.

The northern regions however still suffered under constant threat of foreign invasion. In the year 317, the Jin family was forced to relocate to the south of the Yangtze River and set up the capital of their empire in Jiankang (now Nanjing). This became the Eastern Jin dynasty, which lasted for just over a century, during which time the north split up into 16 small countries. Subsequently the Jin dynasty in the south was destroyed, and four military figures in succession took power by force and changed the name of the regime: first the Liu Song dynasty and then in order the Southern Qi dynasty, the Liang dynasty, and the Chen dynasty, collectively referred to as the Southern dynasties. This period lasted about 170 years, with the capital still at Jiankang throughout. In the year 429, 10 years into the Liu Song dynasty, Zu Chongzhi was born into an erudite and respected family of calendarists in the capital city. Although his professional achievements consist of minor official posts in Zhenjiang (Southern Xuzhou), Suzhou, and other places, his central achievement was in mathematics, for which he earned a place in history as the first mathematician in China to be listed in the official dynastic histories (FIg. 3.8).

Fig. 3.8
A portrait of Zu Chongzhi.

Zu Chongzhi, a mathematician of the Liu Song and Southern Qi dynasties

In the Book of Sui, the official history of the Sui dynasty, Zu Chongzhi is credited with the lower and upper bounds

$$\displaystyle \begin{aligned} 3.1415926 < \pi < 3.1415927 \end{aligned}$$

for the value of \(\pi \), which is accurate to the seventh decimal place. This is his most important mathematical achievement, and this level of accuracy was not surpassed until the year 1424, when the Persian mathematician Jamshı̄d al-Kāshı̄ obtained an approximation valid up to the 17th decimal digit. Consensus opinion is that Zu Chongzhi achieved this approximation via Liu Hui’s method of circle division, a feat of incredible perseverance: by this method, it is necessary to carry out the computation up to a polygon with 24576 sides to arrive at the data above.

In the same book, there appears another result due to Zu Chonghi’s calculations with \(\pi \): the fraction approximations \(\pi \approx \frac {22}{7}\) and \(\pi \approx \frac {355}{113}\). The former is consistent with approximations by Archimedes and valid to two decimal places; the latter is accurate to six decimal places. In modern mathematics these fractions appear as the first few convergents in the continued fraction presentation of \(\pi \)

$$\displaystyle \begin{aligned} \frac{3}{1}, \frac{22}{7}, \frac{333}{106}, \frac{355}{113}, \frac{103993}{33102}, \frac{104348}{33215}, \dots . \end{aligned}$$

The first term is of course the approximation used by the Babylonians and in the Nine Chapters on the Mathematical Art; we can call it the ancient approximation. The second and fourth terms are known as the approximate ratio (约 率 ) and close ratio (密率 ) in China due to Zu Chongzhi. The latter is the best rational approximation for \(\pi \) with numerator and denominator not exceeding 1000.

In 1913, the Japanese mathematician and historian of mathematics Yoshio Mikami advocated in his influential book The Development of Mathematics in China and Japan that the rational approximation \(\frac {355}{113}\) for \(\pi \) be designated as Zu’s ratio in honor of Zu Chongzhi. In Europe, this result was not recapitulated until 1573, when it was rediscovered by the German mathematician Valentinus Otho. Unfortunately, we do not know even to this day how Zu Chongzhi arrived at this approximation. It cannot be reached directly by the method of circle division, and there is no evidence that ancient Chinese mathematicians had any concept of or practical experience with continued fractions. Some historians have speculated that he used a fractional interpolation method known as harmonization of the divisor of the day (调日 法 ) developed by He Chengtian, a mathematician and calendarist contemporary to Zu Chongzhi.

Briefly stated, this method consists of updating lower and upper rational approximations \(\frac {a}{b}\) and \(\frac {c}{d}\), respectively, to a better approximation \(\frac {ma+nc}{mb+nd}\) by a suitable selection of weights m and n. If you take \(m=1\), \(n=9\) with known upper and lower approximations \(\frac {157}{50}\) and \(\frac {22}{7}\) or, alternatively \(m=1\), \(n=16\) with known upper and lower approximations \(\frac {3}{1}\) and \(\frac {22}{7}\), in either case you obtain the close ratio \(\frac {355}{113}\). We can speculate that after Zu Chongzhi obtained his rational approximations by this method, he used the method of circle division to verify their validity, much as Archimedes verified his results obtained by arguments from equilibrium by proofs using the method of exhaustion.

Like Liu Hui, another mathematical achievement of Zu Chongzhi is in the calculation of the volume of a sphere. This result appeared in a chapter on calendrics in a political work entitled Song Shu and was mostly likely also included in his mathematical treatise Methods for Interpolation or Zhui Shu (缀 术 ), which has unfortunately been lost since the Song dynasty. Intriguingly, the Tang dynasty mathematician Li Chunfeng referred to this result in yet another annotation of the Nine Chapters on the Mathematical Art as Zu Geng’s cube root extraction technique. Zu Geng was Zu Chongzhi’s son and also an accomplished mathematician. Modern historians generally attribute the derivation in China of the correct formula for the volume of a sphere to the Zu family, father and son together (Fig. 3.9).

Fig. 3.9
A diagram of the one-eighth of the box lid. The base is a square shape and the corners are extended upwards to meet at a point.

One eighth of the box-lid

According to Li Chunfeng’s description, they calculated the volume of Liu Hui’s box-lid as follows. Take first a cube with sidelength given by the radius r of a circle. Fix one vertex as the center of a circle with radius r, and remove the cross-section of the cube cut out by this circle. Carrying out this process both horizontally and vertically produces a truncated cube obtained as the intersection of two cylinders with perpendicular axes. In total, the cube is subdivided into four volumes: the intersection of two cylinders is one (the interior, covered by \(\frac {1}{8}\) of the box-lid), and there are three exterior volumes. The key to the problem was the calculation of the volume of the outer three components. Zu Geng found that the sum of the cross-sectional area of these three parts at any given height is equal to that of an inverted square cone with volume equal to \(\frac {1}{3}\) the volume of the cube. It follows that the volume of the inner component is \(\frac {2}{3}\) the volume of the cube, and therefore the volume of the box-lid is given by \(\frac {16}{3}r^2\). Finally, from Liu Hui’s calculation that the ratio of the volume of the sphere to the volume of the box-lid is \(\frac {4}{\pi }\), we get Archimedes’s formula for the volume of a sphere:

$$\displaystyle \begin{aligned} V=\frac{4}{3}\pi r^3. \end{aligned}$$

The contemporary Chinese historian of mathematics Li Wenlin has observed:

The work of Liu Hui and the father and son Zu Chongzhi and Zu Geng is very profound. It reflects the tendency towards disputation and rigor that appeared in Chinese classical mathematics throughout the Wei, Jin, and Southern and Northern dynasties, and marks the culmination of this tendency. But what is puzzling is that this tendency came to a very abrupt end with the end of this period.

The text Zhui Shu in which Zu Chongzhi compiled his mathematical results was listed alongside the Nine Chapters on the Mathematical Art as an official textbook in both the Sui and Tang dynasties, and the School of Mathematics at the Imperial Academy (Guozijian, 国子监 ) included it as required reading with a recommended period of study lasting as long as 4 years. The influence of this book spread even as far as Korea and Japan, but it disappeared completely after the tenth century.

The Sun Zi-Qin Jiushao Theorem

In the year 639, Arabic forces invaded Egypt on a large scale. At this time, the Romans had long since withdrawn, and Egypt was under the administrative control of Byzantium. After 3 years of fighting, the Byzantine army was forced to withdraw. The last few scraps of the former academic treasure trove that was Alexandria were burned, and ancient Greek civilization came to its decisive end. After that, Cairo came into being, and the Egyptian people took up the Arabic language and embraced the Muslim religion. At the same time in China, the Tang dynasty was seeing its golden age under the rule of Emperor Taizong (Li Shimin). This was the most prosperous era in the history of feudal China, a period of continuous territorial expansion. The capital city Chang’an, known today as Xi’an, was a gathering place for merchants and luminaries from various countries, and China was in frequent contact with western regions and other lands (Fig. 3.10).

Fig. 3.10
The plan of Chang-an City is drawn with squares and rectangles. The labels are in a foreign language.

Plan of Chang-an city during the Tang dynasty, featuring rectangles arranged in squares

Although the Tang dynasty did not produce any mathematicians comparable in achievement to those of the previous Wei, Jin, Southern, and Northern dynasties, or the later Song and Yuan dynasties, nevertheless this period saw substantial achievements in the establishment of systematic mathematical education and the compilation of earlier mathematical classics. The Tang dynasty extended the “School of Computation” initiated during the Northern and Sui dynasties and established Doctor of ArithmeticFootnote 6 as an official title. Mathematics was also added during this time to the imperial examinations, and anyone who could successfully pass the mathematical examination would be awarded an official title, although this title was the lowest ranking among all official titles and it was abolished in the late Tang dynasty. But in general, the predominant strains in the intellectual atmosphere of the Tang dynasty were humanistic, without much concern for science and technology, somewhat similar in favor to the Italian renaissance. The most significant mathematical event of the Tang dynasty, which lasted for nearly 300 years, was the compilation and publication of the Ten Computational Canons by Li Chunfeng under the rule of Emperor Gaozong (Li Zhi) (Fig. 3.11).

Fig. 3.11
A photograph of a Chunfeng temple. It exhibits a pathway to the temple and a tree behind the roof of the temple.

Chunfeng temple; photograph by the author in Langzhong, Sichuan province

Li Chunfeng (602–670) was known also for his astronomical work and the composition of a remarkable fortunetelling book entitled Massage-Chart Prophecies (推背图 ). In his Yisizhan, one of the earliest monographs on meteorology in world history, Li Chunfeng classified wind strength into 8 levels, or rather 10 if no wind and a light breeze are included, a system that was echoed in 1805 when a British hydrographer introduced a scale from 0 to 12 for wind speed that remains in use today.

In addition to the Zhoubi Suanjing, the Nine Chapters on the Mathematical Art, the Sea Island Mathematical Manual, and the Zhui Shu, there are three more books in the Ten Computational Canons worth mentioning. These are the Sunzi Suanjing (孙子算经 ), or The Mathematical Classic of Sun Zi; the Zhang Qiujian Suanjing (张丘建算 经 ), or The Mathematical Classic of Zhang Qiujian; and the Jigu Suanjing (缉古算 经 ), or The Continuation of Ancient Mathematics Classic. Each of these books raises some very valuable question to pass down to the world (Fig. 3.12).

Fig. 3.12
A snipped image has 10 columns with texts written in a foreign language.

Qing dynasty edition of the Jigu Suanjing

The author of the Sunzi Suanjing is not known today, although presumably his surname was Sun; this book is generally believed to have been written sometime in the fourth century. The best known feature of the Sunzi Suanjing is the problem of the unknown number, which is stated as:

Now there are unknown number of things; if we count by threes there is a remainder of two, if we count by fives a remainder of three, and if we count by sevens a remainder of two. What is the number?

This is equivalent to the system of congruences

$$\displaystyle \begin{aligned} \begin{cases} n &\equiv 2 \pmod{3} \\ n &\equiv 3 \pmod{5} \\ n &\equiv 2 \pmod{7} \\ \end{cases}. \end{aligned}$$

The given answer is \(n=23\), which is the smallest positive integer simultaneously satisfying these three congruences. The book also discusses the method for solving this problem, where the remainders 2, 3, and 2 can be replaced by any numbers, a special case of the Chinese remainder theorem. For this reason this theorem is also known as Sun Zi’s theorem, although a fully general method was not given until the Song dynasty when Qin Jiushao presented it. In the eighth century, the Tang dynasty monk and astronomer Yi Xing (673–727) used this result to formulate the calendar.

The Zhang Qiujian Suanjing was written in the fifth century, and its author was a native of the Northern Wei dynasty. The highlight of this book is its last topic, generally known as the Hundred Fowls Problem. The problem statement is as follows:

Now one cock is worth 5 qian, one hen 3 qian and 3 chicks 1 qian. It is required to buy 100 fowls with 100 qian. In each case, find the number of cocks, hens and chicks bought.Footnote 7

If we label the number of cocks, hens, and chicks x, y, z, respectively, then in modern notation, this problem asks for solutions in positive integers of the system of indefinite equations

$$\displaystyle \begin{aligned} \begin{cases} x+y+z &= 100 \\ 5x+3y+\frac{z}{3} &= 100 \end{cases}. \end{aligned}$$

Zhang Qiujian gives all of the three possible solutions with each of x, y, z nonzero:

$$\displaystyle \begin{aligned} \begin{cases} x = 4,~ y = 18,~ z = 78 \\ x = 8,~ y = 11,~ z = 81 \\ x = 12,~ y = 4,~ z = 84 \\ \end{cases}. \end{aligned}$$

These can be obtained by transforming the two linear equations in three variables into equations for y and z in terms of a parameter \(x=4t\) and solving for positive values of y. In modern times, we know that a linear equation in several variables can give rise to general solutions. But issues along these lines were not explored until much later, when Fibonacci investigated similar problems in thirteenth-century Italy, as did Jamshı̄d al-Kāshı̄ in fifteenth-century Iran. Unlike Sun Zi, whose work was extended by Qin Jiushao, Zhang Qiujian did not follow up his computational achievement with any efforts toward a more general result, and nobody seems to have looked more deeply into it (Fig. 3.13).

Fig. 3.13
A photograph of a statue of the Tang dynasty monk in a lawn.

Statue of the Tang dynasty monk and mathematician Yi Xing; photograph by the author in Xi’an

The Jigu Suanjing is the most recent of the books in the Ten Computational Canons, written in the seventh century by Wang Xiaotong, a Doctor of Mathematics of the early Tang dynasty and probably the most accomplished among all the mathematicians to hold this title. This book is yet again a collection of practical problems, but people found it very difficult at the time. Most of the problems concern astronomical calendry, civil engineering, warehouse and storage cellar sizes, and Pythagorean problems, and most require biquadratic or higher-order polynomials. The books lists 28 equations of the form

$$\displaystyle \begin{aligned} x^3+px^2+qx=c \end{aligned}$$

in positive coefficients and provides annotations detailing the origins of each coefficient. The author supplies the positive rational roots, but no general solution method. Nevertheless, this is the oldest document in the history of world mathematics concerning the numerical solution of cubic equations and their applications.

It is worth a mention that the oldest surviving paper book in the world, the Chinese edition of the Indian Buddhist classic The Diamond Sutra, was printed during the Tang dynasty, in the year 868. A copy of this book was found among the Dunhuang (敦煌 ) manuscripts in 1900 and purchased by the British archaeologist Sir Marc Aurel Stein (1862–1943). It was displayed at one point at the British Museum in London and is now housed at the British Library. In any case, the much earlier Ten Computational Canons certainly has not survived in any original edition. When the Italian missionary Matteo Ricci spent time in China much later during the Ming dynasty, China had extremely large volumes of books in circulation available at very low prices.

In spite of the economic and cultural prosperity of the Tang dynasty, in later periods after the end of the ninth century, many semiautonomous governments of hereditary rule began to spring up around the borderlands, and the bureaucratic central government was no longer able to restrain them. Increasing levels of taxation and the participation of these chieftans in the suppression of the Huang Chao peasant uprising expanded their power significantly, and by the year 907, the Tang dynasty had come to an end, and China was once again a state divided. This was the beginning of the Five Dynasties period, which saw the quick succession of five separate dynasties in the span of only half a century: the Later Liang, Later Tang, Later Jin, Later Han, and Later Zhou dynasties. The capital was moved to Kaifeng or Luoyang, two cities nearby to one another in the heart of Henan Province. The aftermath of all this unrest caused the loss of many classics, including Zu Chongzhi’s Zhui Shu. During this time there separately appeared also ten small countries in the south, including the Southern Tang kingdom with its capital at Jinling, another name for Nanjing. The last ruler Li Yu of Southern Tang became a great lyric poet following the destruction of his country.

But “the empire long divided must unite, long united must divide,Footnote 8” as goes the famous opening line of the Romance of the Three Kingdoms by Luo Guanzhong. In the year 960, a soldier from Henan Province named Zhao Kuazngyin took power at the urging of his soldiers and became the first emperor Emperor Taizu of the Song dynasty in a bloodless coup, after which he “dissolved the military power over a glass of wine” and released many of his generals into retirement to return to their hometowns with a general prohibition against looting and violence. Following this reunification, there were developments in Chinese society that were altogether conducive to cultural and scientific undertakings. A special form of prose poetry known as Songci (宋 词 ) brought literary culture to its highest peak since the Tang dynasty. Commerce and craft saw a period of great prosperity and produced a flurry of technological advancements, including three of the four great inventions of ancient China: printing, gunpowder, and the compass. All this injected a new vitality into the cultivation of mathematics. In particular, the invention of movable type printing technology facilitated the convenient preservation and dissemination of mathematical texts. The first known mathematical book to be printed was Liu Hui’s Sea Island Mathematical Manual.

Needham remarks in his Science and Civilization in China that Sun Zi’s result is not of sufficient generality to quite be considered a theorem; but he also points out that the four greatest mathematicians in the history of ancient Chinese mathematics appeared in the (Southern) Song dynasty, around the thirteenth century, coincidentally the last days of the European Middle Ages. These were Yang Hui, Qin Jiushao, Li Ye, and Zhu Shijie, known as the four great masters of the Song and Yuan dynasties. In addition to these four mathematicians, there were also two significant mathematicians of the Northern Song dynasty: Shen Kuo and Jia Xian. Of the six of them, Qin Jiushao is the most legendary and best-known; he is perhaps the most accomplished mathematician of ancient China (Fig. 3.14).

Fig. 3.14
A photograph of a statue of Qin Jiushao.

Statue of Qin Jiushao; photograph by the author in Nanjing

Qin Jiushao (1202 or 1208–1261) is known to us on the basis of a relatively short academic career. His ancestors came from what is now Fan County, in Henan Province, though sometimes this territory has also fallen under the administrative control of Shandong Province, and Qin Jiushao himself was born in Anyue, in Sichuan. His hometown was a tumultuous place for many years, and he and his family spent part of his youth living in the capital city Lin’an. As an adult he left Sichuan again, passed the imperial examinations, and served as an administrator in Hubei, Anhui, Jiangsu, Fujian, and other places. During his tenure in Nanjing, his mother passed away, and Qin Jiushao left his post to return to Huzhou in Zhejian province. It was during a period of 3 years in mourning in Huzhou that he took up seriously the study of mathematics and wrote his treatise Mathematical Treatise in Nine Sections (数书九 章 ), a work completely surpassing its predecessor the Nine Chapters on the Mathematical Art.

The two most important achievements in the Mathematical Treatise in Nine Sections are the “positive and negative evolution method” and the “Da Yan Shu” (大衍总数术 ). The positive and negative evolution method, known also as Qin Jiushao’s algorithm, is an algorithm for the numerical solution of algebraic equations of any degree, that is, polynomial equations of the form

$$\displaystyle \begin{aligned} a_0x^n+a_1x^{n-1}+\cdots+a_{n-1}x+a_n=0 \end{aligned}$$

with positive or negative coefficients. Ordinarily, the solution of such an equation requires an iterative method in which the value of the polynomial is repeatedly evaluated, with each evaluation in turn requiring \(\frac {n(n+1)}{2}\) multiplications and n additions, but Qin Jiushao converts the problem into a system of n linear equations, requiring only n multiplications and n additions to solve. Even through to the present day, Qin Jiushao’s method has important applications in the age of computer algorithms (Fig. 3.15).

Fig. 3.15
An illustration of a multi-story Japanese building. A rope is tied from the top end of the building to the ground on the right side. Another rope is tied just below the first position and ends at the same position on the ground. The dimensions and other labels are given in a foreign language.

Illustration from a Japanese edition of the Mathematical Treatise in Nine Sections

The Da Yan Shu is a mathematically precise generalization and statement of Sun Zi’s theorem. In modern notation and terminology, suppose \(m_1, \dots , m_k\) are pairwise relatively prime integers larger than 1. Then for any integers \(a_1, \dots , a_k\), the system of simultaneous congruences

$$\displaystyle \begin{aligned} \begin{cases} x &\equiv a_1 \pmod{m_1} \\ & \vdots \\ x &\equiv a_k \pmod{m_k} \end{cases} \end{aligned}$$

has a unique solution modulo \(m_1 \cdots m_k\). Qiu Jinshao further discusses the detailed method for determining this solution, for which purpose he introduces the linear congruence

$$\displaystyle \begin{aligned} ax \equiv 1 \pmod{m}\end{aligned}$$

where a and m are relatively prime integers. He makes use of the algorithm known in modern elementary number theory as the division algorithm, or the Euclidean algorithm, which he calls in particular the Da Yan Qiu Yi Shu. His method is completely correct and rigorous, with important modern applications in cryptography, in particular the RSA key algorithm.

Sun Zi’s theorem is the most perfect and beautiful result in the history of ancient Chinese mathematics. It appears in every modern textbook on number theory, and in western textbooks it is known as the Chinese remainder theorem, perhaps due to a general parcity of well-known results with origins in China. The author of this book feels it should rather be known as the Sun Zi-Qin Jiushao Theorem, or simply the Qin Jiushao Theorem, and refers to it in this way in his own textbook on number theory, A Modern Introduction to Classical Number Theory (经典数论的现代导 引 ). Like other ancient Chinese mathematicians, who rarely entered into theoretical abstractions and viewed mathematics primarily from the perspective of applications to calendry, engineering, taxation, and military purposes, Qin Jiushao did not provide a proof of his theorem, although his solution falls really only a single step short of a proof. He did however consider the case in which the moduli are not pairwise relatively prime and provided a computational method to reduce this to the relatively prime case.

In Europe, questions of divisibility and congruence were studied systematically by Euler in the eighteenth century and Gauss in the nineteenth, and they obtained results identical to Qin Jiushao’s theorem, including rigorous proofs. After the British missionary and sinologist Alexander Wiley published his Jottings on the science of the Chinese in 1853, European academic circles became aware of the pioneering work of Chinese mathematicians and Qin Jiushao in particular in this area, and the Chinese remainder theorem took the name by which it is known today. This result has a generalization in the field of modern algebra, and its scope today extends to branches of mathematics other than number theory. The German historian of mathematics Moritz Cantor referred to Qin Jiushao as the luckiest genius, and the Belgian-born American chemist and historian of science George Sarton wrote that he was “…one of the greatest mathematicians of his race, of his time, and indeed of all times.”

Other Mathematicians

Traveling backward now some 170 years, we arrive at Shen Kuo (1031–1095), who was born in Qiantang (modern-day Hangzhou) and wrote one of the wonderful works in the history of Chinese science, entitled Dream Pool Essays (or Mengxi Bitan, 梦溪笔谈 ) in 1086. In his later years, Shenkuo settled on the outskirts of modern-day Zhenjiang, in Jiangsu Province, and purchased there a lavish garden which he named Dream Brook Estate, perhaps in honor of the Dongtiao river flowing through his hometown (Fig. 3.16).

Fig. 3.16
A painting of Shen Kuo.

Shen Kuo, a naturalist of the Northern Song dynasty

Shen Kuo was a successful candidate in the Jinshi (进士 ) system of imperial examination; he participated in the reforms initiated by the writer Wang Anshi (1021–1086) and came also into contact with the poet Su Shi (1037–1101). Later, he was sent as an envoy to the Khitan Liao Dynasty, and upon his return he served as a member of the Hanlin Imperial Academy as an imperial secretary, with outstanding political achievements. In the course of any and all of his travels, in addition to fulfilling his official obligations, Shen Kuo would diligently record whatever materials of scientific or technological significance he encountered (Fig. 3.17).

Fig. 3.17
A photograph of the tomb of Shen Kuo.

Tomb of Shen Kuo; photograph by the author, in Yuhang, Hangzhou

He can also be regarded as the greatest naturalist of ancient China, and the Dream Pool Essays includes a survey of all the known natural and social sciences of his time. As an example, it was Shen Kuo who identified and measured the inconsistency in the length of the days throughout the year, with the summer solstice as the longest day and the winter solstice the shortest, and he introduced a bold calendar reform consisting of 12 solar months with longer months of 31 days and shorter months of 30 days. In physics, he performed experiments with concave mirror imaging and sound resonance. In geography and geology, Shen Kuo successfully explained the origins of strange landforms as due to the intrusion of flowing water, inferred the evolution of geological features from the presence of fossils, and so on.

We turn now to the mathematical achievements recorded in Shen Kuo’s writings. In geometry, Shen Kuo rose to the challenge of measuring the lengths of circular arcs and developed a technique for substituted straight lengths for curved ones, later the basis for spherical trigonometry in China. In algebra, he gave a formula for the sum of squares of consecutive adjacent integers as part of the solution to the problem of finding the number of wine barrels that fit in a shape like the frustum of a square pyramid. This is the first example in Chinese mathematics of a sum of higher-order arithmetic series. As a mathematician, Shen Kuo was introspective and considered the essence of mathematics to lie in simplicity. He observed that everything has its own fixed shape, and every shape has its own true number, a mathematical philosophy not far removed from the perspective of Pythagoras.

In contrast, very little is known about the life of Jia Xian (ca. 1010–ca. 1070), a mathematician who was contemporary to Shen Kuo. He wrote a book entitled The Detailed Solutions of the Yellow Emperor to the Nine Chapters on the Mathematical Art, which has since been lost. Fortunately, the main content of this book appeared in excerpts some 200 years later in the book Xiangjie Jiuzhang Suanfa (祥解九章算法 , A Detailed Analysis of the Nine Chapters on the Mathematical Art, 1261) by the Southern Song mathematician Yang Hui. This book records Jia Xian’s method for the expansion of higher-order binomials according to a source map, which is simply a table of the coefficients in the expansion of \((x+a)^n\) for \(0 \leq n \leq 6\):

This triangle is of course known as Pascal’s triangle in western countries, after a French mathematician who discussed it more than 600 years later. In China, it is known as the Jia Xian triangle or the Yang Hui triangle. Jia Xian used this table to compute square roots and achieved unexpected results in this direction, known as the additive-multiplicative method.

As early as the Five Dynasties period, there existed in the northeastern dynasties and in Mongolia a dynasty known as the Liao dynasty or the Khitan Empire, under the rule of the Khitan people and established just at the tail end of the Tang dynasty. At the start of the Song dynasty, Emperor Taizong personally led or sent troops to attack the Liao dynasty, but he quickly found himself on the defensive, and in the end the Song dynasty was compelled to pay a tribute to the Liao and set up a precedent for the regular delivery of property. We have seen in the previous section that Shen Kuo once acted as an envoy to the Liao dynasty. During the same period, there was also a group tribe living in the Heilongjiang river basin in the northeastern part of China, later known as Mongolia, called the Jurchen people (女 真 ), renowned for their skill at horseback riding. The Jurchen people had suffered as vassals of the Khitan rulers of the Liao dynasty, and when the winds of fortune shifted in their favor, they established the Jin dynasty and sent troops to bring about the destruction of the Liao dynasty. They went on to attack the heart of the Northern Song dynasty in Bianjing (Kaifeng), and they captured the father and son Emperors Huizong and Qinzong. The youngest brother of Qinzong took rule as Emperor Gaozong of Song and moved the capital to Hangzhou (at that time called Lin’an) in 1127. This was the beginning of the Southern Song dynasty (Fig. 3.18).

Fig. 3.18
An illustration depicts a vertical rectangular pattern with texts in a foreign language.

Korean edition of the Yang Hui Suanfa (1433)

Although the northern threat was ever present, the people of the Southern Song dynasty lived happily through a time of even greater prosperity and cultural development. The mathematician Yang Hui, like Shen Kuo before him, was from the capital city Lin’an. Although we do not have the dates of his birth or death, it is known that Yang Hui lived in the thirteenth century; served as a local official in Taizhou, Suzhou, and elsewhere; and studied mathematics in his spare time. In the space of 15 years spanning 1261 to 1275, Yang Hui completed five substantial mathematical works, including that Xiangjie Jiuzhang Suanfa discussed above. His writing is simple and profound, and he developed such a reputation as a mathematician and mathematics educator that people would ask his advice wherever he went.

Following up upon Jia Xian’s additive-multiplicative method, Yang Hui presented an example of its use to solve quartic equations. This is a highly mechanical computation that can be applied to solve polynomial equations of any degree, essentially identical to Horner’s method, developed in 1819 a widely used thereafter in the western world. Yang Hui also used his method of multiplicative piles to calculate the volume of a square prism, and in order to facilitate a fast algorithmic implementation, he introduced for the first time in China the concept of prime numbers, presenting all of the 16 prime numbers between 200 and 300. His research into this topic was of course less sophisticated than what is in Euclid, both in scope and rigor (Fig. 3.19).

Fig. 3.19
An illustration of the magic squares has vertical and horizontal figures.

The Luo Shu magic square

His most interesting mathematical contribution however was in the study of magic squares, which at that time were known as vertical-horizontal figures (纵横 图 ). Magic squares first appeared in the Classic of Changes or I Ching (易 经 ), the oldest classical text in Chinese culture, with provenance stretching as far back as the eleventh century BCE. In this book there appear two cosmological diagrams of numbers called the Yellow River Map (He Tu, 河 图 ) and Inscription of the River Luo (Luo Shu, 洛书 ). According to the legend, Emperor Yu who controlled the waters (other legends say it was Fuxi) appeared on the banks of the Yellow River riding a dragon horse sometime around the year 2200 BCE during a time of deluge and flooding, and there emerged from the waters a magical turtle with the Luo Shu pattern on its shell. The Yellow River Map is a figure consisting of five elements arranged in a cross, with two numbers corresponding to each element, one even, one odd, and at the center the number five. The Luo Shu is as follows, represented here in Arabic numerals:

The sum along any vertical, horizontal, or diagonal line is in every case 15.

Prior to the thirteenth century, Chinese mathematicians viewed such systems as mere number games, perhaps shrouded in a certain aura of mystery, but not to be taken seriously. Yang Hui however devoted considerable effort to the nature of magic squares and discovered that such systems are governed by rules and regularity. In particular, he used the summation formula for arithmetic series to cleverly construct magic squares of orders three and four. For magic squares of orders five and higher, he gave only examples without indicating any method, but his examples for orders five, six, and even ten were all correct, showing that he had mastered the rules of their composition. Yang Hui called his magic square of order ten, with row and column sums given by the number 505, the hundred numbers figure. He also invented and investigated magic circles. As seen in the diagram, the sum of the eight numbers on any of the four circles or four diameters is 138, except one of each given by 140. It seems likely that he was inspired in this research by the Luo Shu (Fig. 3.20).

Fig. 3.20
An illustration of the circular magic square. The circle consists of 4 layers and 8 orbits. It is numbered from 1 to 33.

Yang Hui’s circular magic square

There were at the same time other mathematicians in Persia, Arabia, and India carrying out research into magic squares. In Europe, magic squares came under scrutiny much later, but there is one especially famous example in the engraving Melencolia I by the German painter and printmaker Albrecht Dürer, which we shall discuss later. It is not difficult to see that any magic square remains a magic square if subject to rotation or reflection about an axis. Without counting more than once the eight squares that are equivalent to one another under these operations, there is only a single magic square of order three, while there are 880 magic squares of order four, and \(275,305,224\) of order five.

Yang Hui like Qin Jiushao spent his life and career based in the south; we consider next two other great mathematicians of the Song dynasty, Li Ye and Zhu Shijie, both of whom were based in the north. Li Ye (1192–1279) was born in Daxing (now the outskirts of Beijing), under the rule of the Jin dynasty. His name at birth was Li Zhi, but since it was later noticed that this is the same as the name of Emperor Gaozong of the Tang dynasty, he changed his name by the removal of a single stroke (so that instead his name was the same as that of one of the four great female poets of the Tang dynasty). Li Ye’s father was a respected local official and erudite scholar, and Li Ye was influenced from childhood to value knowledge more than wealth. He took an early interest in literature, history, and mathematics, and he was admitted to the imperial academy where he earned praise for his intellectual talents. After the Mongol invasion under Ögedei Khan, he did not go to Shaanxi as planned but rather took up an administrative post in Henan.

In the year 1232, the Mongols invaded the Central Plains. Li Ye, who was 40 years old at the time, took up civilian attire and began a long and arduous journey into exile. Two years later, the Jin dynasty came to end. Li Ye did not however escape to the Southern Song dynastic territory, but rather remained in the north under the Mongolian rule of the Yuan dynasty. He had his reasons: the Jin dynasty and the Southern Song dynasty had always been at odds, and Kublai Khan, who established the Yuan dynasty, extended his courtesy to the intellectuals of the Jin dynasty and even to Li Ye personally, whom he had summoned on three occasions to provide scientific counsel. On one of these occasions, Li Ye persuaded Kublai Khan to reduce the severity of his penal measures and put an end to his conquest.

This was the turning point in his life, and Li Ye embarked upon an academic career lasting nearly half a century (he 3 years longer even than Diophantus). He returned to his hometown in Hebei and spent his final years teaching near Fenglong Mountain in the southwestern suburbs of modern Shijiazhuang. He wrote books and various essays recording his thoughts on all manner of topic.

The book of which Li Ye was most proud was his Sea mirror of circle measurements (测圆海镜 , 1248), which laid the foundations for the Tian Yuan Shu system of algebraic notation for polynomial equations. In the Nine Chapters on the Mathematical Art, quadratic equations occur only in narrative form, and there was no notion of indeterminate quantities. In the Tang dynasty, although mathematicians had begun to work with cubic equations, these were presented geometrically, requiring skill and cleverness, and not suitable to easy generalization. For a long time afterward, algebra was tied to geometric thinking, prohibiting nonpositive constant terms, and avoiding polynomials of degree higher than three. It was only during the time of the Northern Song dynasty that Jia Xian and others were able to find positive roots for equations of higher degree (Fig. 3.21).

Fig. 3.21
A snipped page consists of a sea mirror of the circle. The marked measurements, and labels are in a foreign language.

Illustration from Sea mirror of circle measurements by Li Ye

More complex problems, however, generated an urgent need for a more general method for handling polynomials of arbitrarily large degree, and the Tian Yuan Shu system met this need. Li Ye recognized that it was necessary to abandon geometric thinking altogether and establish universal procedures that do not rely on the specific details of the problem to be solved. The Tian Yuan (or heavenly variable) played the same role as symbols x, y, etc. in modern algebra: “let the heavenly element be such and such” in place of “let x be such and such.” The word yuan (元 ) was to be placed adjacent to the coefficient of the term in the first degree, with coefficients of all the terms arranged vertically with the degrees of the terms increasing from top to bottom. Moreover, its meaning was purely algebraic, and there was no requirement that the square term represents an area or the cubic term a volume. The constant term could be either positive or negative. With this system, it became trivial to represent polynomials of any degree, a challenge that had troubled Chinese mathematicians for more than a thousand years (Fig. 3.22).

Fig. 3.22
An illustration displays solving the arithmetic negative equation using symbols. The text is in a foreign language.

Li Ye introduced the use of slashes through numbers to indicate negative quantities

Li Ye also used the symbol ○ in place of the empty space previously in use in decimal notation. The Mathematical Treatise in Nine Sections, which had come out 1 year earlier in the south, adopts the same notation, and the number zero quickly gained popularity throughout China. Finally, Li Ye introduced a notation for negative numbers (a slash drawn through the numeral), filling out a very simple and practical system of decimal notation. These two notational innovations appeared in China two and four centuries earlier than in Europe, respectively. At this point, Chinese algebra was in a semisymbolic state: there were still no operational symbols or relational symbols such as an equal sign. It seems that Li Ye was of a philosophical bent and believed that for all their infinite mystery, numbers can be simply understood (Fig. 3.23).

Fig. 3.23
A tree diagram of the symbols arranged in a triangular shape. The text around the diagram is in a foreign language.

Korean reprint of the Introduction to Computational Studies by Zhu Shijie

In the same year that Li Ye died, the Southern Song dynasty fell to the Yuan dynasty. Before this, there had been very little intellectual exchange, mathematical or otherwise, between the north and the south. Zhu Shijie (1249–1314) was the last of the four great masters of the Song and Yuan dynasties, and he was born late enough to enjoy the best mathematical offerings of both north and south. Since Zhu Shijie never embarked upon any official career, we do not know his family history. Whatever information we have about his life is drawn from prefatory material to his two books Introduction to Computational Studies (Suanxue Qimeng, 算学启蒙 , 1299) and Jade Mirror of the Four Unknowns (四元玉鉴 , 1303). Zhu Shijie like Li Ye was born near modern Beijing, but at that time the Jin dynasty had already been destroyed by the Yuan dynasty, and Beijing (or Yanjing) had become an important political and cultural center.

After more than 20 years of travel and study, Zhu Shijie settled in Yangzhou, where he published the two books just mentioned. The Introduction to Computational Studies begins from the four basic arithmetical operations and discusses all the important mathematical achievements of the time, including the extraction of higher-order roots, the Tian Yuan Shu system, achieving a very thorough synthesis of extant materials to serve as an excellent pedagogical text for the development of mathematics. Perhaps due to the influence of the practical and mercantile use of mathematics in the Southern Song dynasty, Zhu Shijie includes in a frontispiece the nine-nine multiplication song, the nine-nine division song, and other such formulas to entice a broader readership.

According to historical records, the Jiajing Emperor of the Ming dynasty (1507–1566) studied from the Introduction to Computational Studies and discussed it with his ministers, but this book was lost in China by the end of the Ming dynasty. Fortunately, it had spread to Korea and Japan shortly after its publication, where it was frequently annotated and exerted a special influence on Japanese wasan mathematics. It was not until the reign of the Daoguang Emperor of the Qing Dynasty (1839) that this book was republished in Yangzhou, its birthplace, on the basis of a Korean version.

In comparison with the populist aims of the Introduction to Computational Studies, the Jade Mirror of the Four Unknowns is a crystallization of years of personal research. Its most important contribution is an extension of the Tian Yuan Shu system to systems of indeterminate equations in two, three, or four variables, the four unknowns of the title.

In the method of four unknowns, the constant term appears in the center, and the indeterminate quantities which today we would write as x, y, z, w are labelled as the heavenly element on the bottom, the earthly element on the left, the human element on the right, and the material element on top. For example, the equation

$$\displaystyle \begin{aligned} x+2y+3z+4w+5xy+6zw=A \end{aligned}$$

would be written as

In addition to developing this notation for indeterminate equations in four variables, Zhu Shijie also invented the elimination method for reducing the number of unknowns in a system of polynomial equations to a single variable. In Europe, it was not until the nineteenth century that Sylvester, Cayley, and others carried out a more comprehensive analysis using matrix methods. Zhu Shijie also presents a detailed treatment of the summation higher-order arithmetic series and continues the work of Shen Kuo and Yang Hui with more complex calculations of triangular piles. Finally, he anticipates the interpolation formulas later rediscovered by Isaac Newton in 1676 (Fig. 3.24).

Fig. 3.24
An abacus. It consists of 11 wires with beads.

The abacus might not have been invented in China but enjoyed its widest use there

Sarton praised the Jade Mirror of the Four Unknowns as the most important work of Chinese mathematics and one of the most outstanding mathematical works of the middle ages. George Sarton (1884–1956) is remembered today as the father of the history of science in recognition of his role as the founder of this discipline. He was proficient in 14 languages, including Chinese and Arabic, and taught the Chinese linguist Zhao Yuanren (1892–1982) during his time at Harvard University. The George Sarton Medal is the most prestigious prize given by the History of Science Society, and its recipients include Sarton himself in 1955, Joseph Needham in 1968; Thomas S. Kuhn, author of the influential book The Structure of Scientific Revolutions, in 1982; and Richard Westfall, author of a biography of Newton, in 1985.

Conclusion

After the Jade Mirror of the Four Unknowns, the Yuan dynasty produced no further mathematical works of note. In the Ming dynasty, agricultural, commercial, and industrial development continued apace, and Western classics such as Euclid’s Elements were introduced in China; the rigid ideology of neo-Confucianism, the selection of scholars by overly standardized criteria, harsh penalties including imprisonment for impolitic speech and writing, all conspired to stifle the free creation of open thought. The mathematical level of the Ming dynasty fell far short of that of the Song and Yuan dynasties, and mathematicians could no longer understand the additive-multiplicative method, the Tian Yuan Shu, and the method of four unknowns. The mathematical works of the Han, Tang, Song, and Yuan dynasties not only went out of print, but many of them were even lost. It was not until the late Qing dynasty that Li Shanlan emerged as a new pioneer and propagator of modern science. He also introduced translations for many mathematical terms, which remain in use today. But by that time, Chinese mathematics had fallen far behind the mathematics of the west, and Li Shanlan alone could not catch up (Fig. 3.25).

Fig. 3.25
A portrait of Li Shanlan.

Qing dynasty mathematician Li Shanlan

I would like to also say a few words here about Japanese mathematics, which was influenced deeply by Chinese culture. While Chinese mathematics stagnated in the late Ming and early Qing dynasties, the mathematical prodigy Seki Takakazu (1642–1708) was born in Edo (now Tokyo). He was just a few months older than Newton and has since been recognized as the founder of Japanese mathematics. His foster father had been a samurai, and he himself served as a samurai under the shōgun before he became involved with a surveying project. Takakazu improved upon Zhu Shijie’s Tian Yuan Shu system and established a theory of determinants both earlier and in a more extensive than what Leibniz achieved. He is also credited with early contributions to calculus, but due to the humility of the samurai tradition and the secrecy between competing schools of the time, these cannot be attributed to him with certainty. The body of work produced by Takakazu and his successors who formed the dominant school in Japanese mathematics during the Edo period is the most substantial body of wasan mathematics, and he is remembered today as the mathematical sage of Japan (Fig. 3.26).

Fig. 3.26
A potrait of Seki Takakazu.

Seki Takakazu, the mathematical sage of Japan

Looking over the history of Chinese mathematics through the Middle Ages, most mathematicians pursued attractive research programs only after achieving a certain degree of renown in the composition of formulaic essays. There were no institutions for group research or large-scale data centers like the Library of Alexandria or the Academy in Greece, and as a result it was difficult to devote professional efforts entirely to research. In the Song dynasty, for example, when mathematics developed rapidly, most of the significant mathematicians were minor officials who focused their attention primarily on issues important to the daily lives of ordinary people and technicians. They could not attend to theoretical work, and their writings came mainly in the form of annotations of classics.

Nevertheless, in comparison with the mathematical development of other ancient peoples, such as the Egyptians, the Babylonians, the Indians, the Arabic peoples, and even the Europeans of the middle ages, the Chinese people have much to be proud of. In terms of rigor and systematic abstraction, Greek mathematics as represented by Euclid’s Elements represents an absolute peak, but in the field of algebra, it cannot be said that the Chinese mathematicians were inferior, and in some ways they may have achieved even better results. The biggest defect of Chinese mathematics is that there never developed in ancient China the notion of rigorous verification and proof, and mathematics for its own sake was a very rare phenomenon (one prominent example is the difference between ruler drawing and Euclidean diagrams). The situation is like that of the literary luminaries who chase after fame; altogether it is a kind of utilitarianism.

This attitude of course has firm social roots: it is natural that scholars work first toward the solution of problems required by the ruling classes. In ancient China, mathematics came to prominence mainly by way of its relation to the calendar. After Zhao Shuang proved the Pythagorean theorem, his first application of it was to find the roots of quadratic equations that came up in calendry. Zu Chongzhi obtained very fine rational approximations for \(\pi \), which were used to calculate the leap year cycle. Qin Jiushao’s Da Yan Shu, or the Chinese remainder theorem, was used mainly to calculate the years of the superior epoch, from which were determined certain astronomical constants such as tropical years and synodic moons (Fig. 3.27).

Fig. 3.27
A photograph of a new Daogu bridge. A water stream is flowing below the bridge. There are trees on both sides of the bridge.

The new Daogu Bridge; photograph by the author, in Hangzhou

In ancient China, whenever the harvest were bad for several years running and the population gave way to famine, the rulers would begin to worry about rebellions and peasant uprisings. Certainly one good excuse was to lay the blame at the feet of an insufficiently accurate calendar. At such times, the imperial court would issue an edict calling upon the scholars to undertake calendar reform, and the result of all this is that the greatest mathematical minds of ancient times were always drawn back again and again into ancient calculations. There were few opportunities and little courage to strike out for new mathematical worlds. But in modern times, contemporary Chinese mathematicians such as Wu Wenjun have taken inspiration from ancient Chinese algorithmic ideas. He developed an algorithmic method for solving multivariate polynomial equations with powerful applications for mechanical theorem proving in elementary geometry.

Finally, a few stories are connecting ancient Chinese mathematicians with modern China, and especially the city of Hangzhou, home of Chen Jiangong (1893–1971) and Su Buqing (1902–2003), two Zhejiang natives who earned doctoral degrees in mathematics in Japan. They established the Chen-Su School of Mathematics at Zhejiang University. Among the ancient mathematicians we have discussed in this chapter, two of them were born in Hangzhou: Shen Kuo and Yang Hui. Qin Jiushao, whose courtesy name was Daohu, also remarked that he lived in Hangzhou for some years with his family when he was young. There is a stone bridge near the Xixi Campus of Zhejiang University called Daogu Bridge; tradition has it that this bridge was initiated, designed, and built by Qin Jiushao. It was built across the Xixi River and originally called Xixi Bridge; its change of name was proposed by Zhu Shijie.

In his later years and after his death, two literary rivals wrote articles alleging that Qin Jiushao was corrupt and immoral, severely damaging his reputation. His name and the name of his bridge seem to be flickering out of sight, and it was not until the Qing dynasty that some sympathetic admirers defended him and denounced this slander. Sadly, in the twenty-first century, a municipal project caused the bridge to be destroyed and the river filled in so that the only remnant of it to remain was the Daogu Bridge Bus Station. In 2012, at the author’s suggestion, the city authorities agreed to name a new bridge Daogu Bridge in honor of Qin Jiushao and about a hundred meters away from its original location.

In comparison with Zu Chongzhi’s approximations of \(\pi \) and formula for the volume of a sphere, Qin Jiushao’s algorithm and the Chinese remainder theorem are the more substantial achievements. But stories related to \(\pi \) are more easily digested by the public and more in line with the heroic imagination of the Chinese people.