proof for second theorem