Proof for horizontal lines calculation