# For two square matrices $A$ and $B$, if $\left | A - B \right |^2_F$ is a small scalar number then can we assume $A \approx B$?

When researching a way to evaluate if two square matrices are equal or (very close to being equal) for a computer vision localization problem, I came across this Math Exchange post

Minimize the Frobenius norm of the difference of two matrices with respect to matrix: $\underset{B} {\mathrm{argmin}} \left\| A- B \right\|_F$

Following the accepted answer in that post, is it "mathematically" sound to conclude that $$A \approx B$$ if $$\left | A - B \right |^2_F$$ is a very small scalar number?

With best

• How do you define $A \approx B$? What does that mean? Jan 2 at 1:05
• @DanielP, consider $A$ is a 4x4 Transformation matrix and $B$ is also another 4x4 Transformation matrix that defines the "pose" of a 3d object with respect to world coordinate frame at times $t_0$ and $t_1$ respectively. Say at time $t_1$, the camera has physically return to a position where previously, it recorded its pose as $A$. So by $A \approx B$ I was asking the question, whether the pose at $t_1$ is exactly (or very close to) "same" as that of the pose from time $t_0$ Jan 2 at 17:39

This depends on what properties of the matrices are under consideration. E.g. invertibility is not stable under the Frobenius norm. Set $$A=\begin{bmatrix} \varepsilon &0\\0&\varepsilon \end{bmatrix}\text{ and }B=\begin{bmatrix} 0&0\\0&0 \end{bmatrix}$$ then $$|A-B|_F=\sqrt{\sum_{i=1}^n\sum_{j=1}^n |a_{ij}|^2}=\sqrt{2}\,\varepsilon .$$ The matrices are close by that measure for positive and small $$\varepsilon$$ but have fundamentally different properties; one is regular, and the other one eliminates all. If you are depending on algebraic properties as invertibility, then matrix norms aren't suited to measure a distance. However, they represent a good measure in case you are interested in whether $$A$$ and $$B$$ are topologically, or geometrically close.
• @Mauris S.L, thank you very much for the detailed follow up response. Apologies for the confusion. By "this" I was referring to the formula for $|A - B|_F$ that you presented. But I got the jist of the heuristic method shown and will try it out in my algorithm. Jan 2 at 17:42
• I simply looked up the formula on Wikipedia. The main issue here is: matrices (and their usual norms) form something like our three-dimensional space. We have no problems measuring our rooms or adding distances. Now, if we demand that a certain property of matrices is preserved, then this property comes into focus. I have chosen invertibility as an example. Invertibility is not linear, will say $A^{-1}+B^{-1}\neq (A+B)^{-1}.$ Hence, addition is destroyed. But if your property is linear, i.e. respects addition and stretching then probably can use norms to define "close to". Jan 2 at 17:49