Proof for dot function