Confucius and Sun Tzu' writings are not written in Mandarin. Stop confusing writing system with language.
Confucius, Sun Tzu and all ancient texts are written in Classical Chinese (文言文
. Its not a spoken language but written only. It can be recited in any dialect whether its Mandarin or Cantonese.
Modern day China uses Mandarin written standard (Baihua 白話
.
From Confucius time to the 1920s, the official written language was Classical Chinese. All government texts and documents were written in it. Only vulgar novels and plays were written in the spoken language (Baihua). Then in the 1920s the May Fourth Movement, which was against traditional Chinese culture and wanted to trash it (some people even wanted to change China's official language to Esperanto) caused the government to change the official language to Baihua.
However Classical Chinese is still taught in schools in Taiwan and I heard its taught in mainland schools too, so all Chinese are able to read classical Chinese along with Mandarin and at least write some of it.