Find the matrix $B$ that minimizes
$$ |A-B|_F$$
for $A$ and $B$ $n\times n$ matrices, $B$ symmetric
What I did:
$$f(b_{11}, b_{21}, \cdots, b_{n1}) = |A-B|_F^2 = \sum_i^n\sum_j^n (a_{ij}-b_{ij})^2$$
so we have a function that has the 'lower diagonal triangle' of $B$ as its variables, since the upper diagonal is automatically determined because $B$ is symmetric.
$$\frac{\partial f}{\partial b_{ij}} = -2(a_{ij}-b_{ij}) = 0 \implies b_{ij} = a_{ij}$$
so the solution is a matrix $B$ where the lower diagonal is identical to $A$ and the upper diagonal is determined by the lower one.
Is it this simple?
Recall that the second derivatives are all $+2$ so a point where $\nabla f = 0$ would indeed be a minimum
Given $i \ne j$, we want to minimize
$$(b_{ij}-a_{ij})^2 + (b_{ij}-a_{ji})^2$$
Differentiate wrt $b_{ij}$,
$$2(b_{ij}-a_{ij})+2(b_{ij}-a_{ij})=0$$
Hence $$b_{ij}=\frac{a_{ij}+a_{ji}}{2}$$
That is $$B=\frac12 (A+A^T)$$