Could data be described by a straight line when Pearson Correlation Coefficient has the highest absolute values? Suppose that there is a dataset of 2D points $(x_i, y_i)$, consider the following statement:
"When the Pearson Correlation Coefficient(PCC) between $x$ and $y$ is equal to -1 or 1 (highest absolute values), data could be described by a straight line". That is, there are constants $a$ and $b$ such that:
$y_i = ax_i+b \;\;\: \forall i$
Now, I have two questions:
1) Is the above statement true?
2) More importantly, if the statement is true, please give a mathematical proof.
I have visually seen that a line can be fitted perfectly on such a dataset, but I am not sure this is always true, so I need a mathematical proof.
 A: For the answer 1), I just invite you to read the comment by @user2974951 which in a couple of words says exactly what is worth. I cite it "a value of 1 implies that a linear equation describes the relationship between X and Y perfectly, with all data points lying on a line". I stress the importance of linear, as the correlation is a measure for the linear interaction between variables.
Now for the point 2), I apologize if I only sketch a proof due to serious time constraints and very busy days on my side. But it will be enough. Consider that in a univariate regression with a single independent variable like $y_{i}=a+\beta x_{i}+ \epsilon_{i}$ with $i=1,...,n$, the $R^{2}$ of the regression can be retrieved as the square of the correlation coefficient between the two variable. Therefore setting the corr equal to 1 implies $R^{2}=1$. Take the formula for $R^{2}$ (here we take the one assuming there is an intercept as you hinted) given by:
$$R^2=1-\frac{\sum_{i=1}^{n}e_i^2}{\sum_{i=1}^{n}(y_i-\bar{y})^2}$$
Then set it to 1 and solve for the sum of squared errors at the numerator, then evaluate the implications for each observation residual. You get:
$$R^2=1 \rightarrow 1-\frac{\sum_{i=1}^{n}e_i^2}{\sum_{i=1}^{n}(y_i-\bar{y})^2} = 1 \rightarrow \frac{\sum_{i=1}^{n}e_i^2}{\sum_{i=1}^{n}(y_i-\bar{y})^2} = 0 \rightarrow \sum_{i=1}^{n}e_i^{2} = 0 \rightarrow e_i^{2}=0 \text{  for each i} \rightarrow e_i=0 \text{  for each i} \rightarrow y_{i}=a+\beta x_{i} \text{ 
 for each i}$$
