In the RB-DELETE, when y is black, the RB-DELETE-FIXUP function is called to adjust the color of the Red-black tree, which means that if y is red, there is no need to adjust it, next we will prove the correctness of this proposition.
First, the properties of the red and black trees 1) and 3) are obviously satisfied. For properties 2), 4) and 5) are discussed in three cases.
In case 1), the deleted node Z has only the black sentinel node. In this case, y = Z and Y will not affect the black height of the red/black tree, Y is red, it cannot be the root, and it cannot cause two red nodes to be adjacent. Therefore, the properties 2), 4), and 5 are satisfied.
In case 2), one of the subnodes of the deleted node Z is a black Sentinel, and the other is a common node with Y = Z. In fact, it is impossible for y to be a red node, because if the common node is black, it will make the black height of the red and black tree inconsistent, violating the nature 5). If it is red, it will violate the Nature 4 ).
In case 3), the deleted Z node has two normal sub-nodes. In this case, y = tree-successor (Z), If y is a red node, both children of Y must be nil [T]; otherwise, it will violate the nature of the red and black trees. Therefore, after deleting y, the remaining red and black trees, for properties 2), 4) and 5), both are satisfied.