This proof was put forward by Liu Hui, a mathematician of Wei State in the Three Kingdoms period. In the fourth year of Wei Jingyuan (AD 263), Liu Hui annotated the ancient book Nine Chapters Arithmetic. In the annotation, he drew a picture to prove Pythagorean theorem. Because he used "green out" and "Zhu out" to represent yellow, purple and green, and "green in" and "Zhu in" to explain how to fill the blank part of the hypotenuse square, later mathematicians called this figure "green in and out". Others use the word "complementarity" to express the principle of this proof.
In history, Liu Hui is not the only one who proved Pythagorean theorem with the principle of "complementary entry and exit". For example, in India, in the Arab world and even in Europe, there have been similar proofs, but the pictures they drew may be somewhat different in appearance from those of Liu Hui.