Is compressing matrices to a single real number in a useful way possible?

114 Views Asked by At

I am still a newbie when it comes to stackexchange so please be indulgent with me !

TL;DR Can a bijective function $f : \mathbb{R}^n\to\mathbb{R} : \vec{x} \mapsto f(\vec{x})$ be constructed in such a way that I can always find the vector $\vec{x}$ if I know $f(\vec{x})$ ?

I am trying to find a way to store (sparse) matrices on my computer very efficiently. Which is why I am looking for such a function. This function of course has to be bijective.

If such a function exists and can be constructed, then that would mean that any matrix could be stored in a single number. Let me visualize for everyone :

Let $A$ be a $2\times 2$ matrix :

$$ A = \left(\begin{matrix} a_1 & a_2 \\ b_1 & b_2 \end{matrix}\right) $$

and let $A_i$ denote the $i$th row of $A$. Using the function I am looking for on the rows of $A$, I would get : $$ f(A_i) = \left(\begin{matrix} f(a_1,a_2) \\ f(b_1,b_2) \end{matrix}\right) $$

and applying $f$ once again to the remaining column, I would get the real number

$$ r = f(f(a_1,a_2),f(b_1,b_2))$$

So that would be the gist of how the function works. But to make it usable in my use case, I would need to be able to find the matrix $A$ back from $r$ which is why $f$ must be bijective.

I have not found litterature that talks about this so I was wondering if this community could enlighten me. Does such a function exist ? If yes, can it be constructed ? And if so, how ?

Thanks for reading !