A constructive formalization of the weak perfect graph theorem