Huizi 惠子 "Master Hui" was a philosophical treatise written by Hui Shi 惠施 (ca. 370-310), also written 慧施, who was a native from the state of Song 宋 during the Warring States period 戰國 (5th cent.-221 BCE). He is also called Hui Gong 惠公. According to Zheng Qiao's 鄭樵 (1104-1162) statecraft encyclopaedia Tongzhi 通志, Hui is not a family name, but the name of a grand family (shi 惠氏). Hui Shi's actual family name was Ji 姬, the family name of the Zhou dynasty 周 (11th cent.-221 BCE). To avoid the royal name, he was, therefore, given the surname Hui. Hui Shi was a counsellor of King Hui of Liang 梁惠王 (r. 371-335) but also served his successors, the kings Xiang 魏襄王 (335-319) and Ai 魏哀王 (319-296).
As a philosopher, Hui Shi was a dialectician who played with the identity and non-identity of designations and factual matters. He was acquainted with the Daoist philosopher Zhuang Zhou 莊周 (Zhuangzi 莊子; trad. 369-286 BCE) and undoubtedly influenced the latter's relativist worldview. Hui Shi believed that there existed two different dimensions of equality and non-equality (tong yi 同異): the first, small dimension being that of concrete objects in daily life, and the second, large dimension, that of all things on earth. There is no absolute "equal" and "different", but everything depends on the viewpoint of the speaker. The great unity (da yi 大一) of things was a room where nothing could be outside (i.e., the cosmos), and the small unity (xiao yi 小一) of objects was a space where nothing could be inside (analogous to the ancient Greek concept of atoms).
In the imperial bibliography Yiwen zhi 藝文志 in the official dynastic history Hanshu 漢書, the small book Huizi is listed among the dialecticians. It seems to have been lost before the Tang period 唐 (618-907).
The Qing-period 清 (1644-1911) scholar Ma Guohan 馬國翰 (1794-1857) collected surviving fragments of the Huizi and statements about Hui Shi and compiled 17 chapters that he published in his Yuhan shanfang yiji shu 玉函山房輯佚書. Yet Ma Guohan's arrangement of the Huizi contains some errors and unreliable assumptions. The Huizi is also included in the series Zhuzi huihan 諸子彙函 and the Puxuezhai congshu 朴學齋叢書, where it is enriched by a commentary written by the Republican scholar Hu Huaishen 胡懷深 (1886-1938).