Logistic Regression Cost Function Proof