Complete formalization of theorem 3