The reasons why Zhang Liang and Gong Sheng are mentioned in the poem are as follows:
1. Zhang Liang and Gong Sheng are both famous figures in history. They are known for their noble qualities and behaviors. , so using the examples of Zhang Liang and Gong Sheng to compare Tao Yuanming can highlight Tao Yuanming's lofty character and firm belief.
2. Tao Yuanming lived in a different era from Zhang Liang and Gong Sheng. Therefore, using the examples of Zhang Liang and Gong Sheng to compare Tao Yuanming can show that Tao Yuanming can maintain his own integrity when facing challenges of different eras. Beliefs and principles are not affected by external circumstances.
3. Using examples of historical figures to compare Tao Yuanming can increase the implicitness and depth of the poem, allowing readers to have a deeper understanding of Tao Yuanming's personality and thoughts through the inspiration of historical figures.