P^T = (AT A)^-1 AT^T A^T = (AT A)^-1 AT^T A = (AT A)^-1 A^T AT A = P
Next, we show that P is idempotent:
P^2 = A(AT A)^-1 AT A = A(AT A)^-1 A(AT A)^-1 AT A = A(AT A)^-1 A = P
Since P^2 = P, we have shown that P is idempotent.
Finally, we show that P is orthogonal:
To show that P is orthogonal, we need to show that P is symmetric and has eigenvalues of 1 or 0.
Since P is symmetric (since P^T = P), it remains to show that P has eigenvalues of 1 or 0.
Since A^T A is invertible, it follows that A is a full rank matrix, and hence its columns are linearly independent. Therefore, P has rank n, and hence its null space has dimension m - n.
Let v be an eigenvector of P with eigenvalue 1. Then, we have:
Pv = v
Multiplying both sides by AT A, we get:
AT A Pv = AT A v
Since AT A is invertible, we have:
v = AT A v
Therefore, v is an eigenvector of AT A with eigenvalue 1. Since AT A is symmetric, it follows that all its eigenvalues are real. Therefore, the only possible eigenvalue of AT A is 1. Hence, the only possible eigenvalue of P is 1.
Similarly, let v be an eigenvector of P with eigenvalue 0. Then, we have:
Pv = 0
Multiplying both sides by AT A, we get:
AT A Pv = 0
Since AT A is invertible, we have:
v = 0
Therefore, v is an eigenvector of P with eigenvalue 0. Hence, the only possible eigenvalue of P is 0.
Since P has only eigenvalues of 1 and 0, it follows that P is an orthogonal projector.