# Help to find a factorization of a matrix into a product and sum of matrices

if $$\hspace{0.2cm}Z\in$$ R$$^{n\times n}$$ $$\hspace{0.2cm}$$is the down-shift matrix with ones on the first subdiagonal and zeros elsewhere, and $$L\in$$ R$$^{n\times n}$$ $$\hspace{0.2cm}$$ is the lower triangular matrix with $$1s$$ at the non-zero entries, then the matrix $$A=\left( \begin{array}{ccccc} w_1 & w_1 &\cdots & w_1 \\ w_1 & w_2 & \cdots& w_2 \\ \vdots & \vdots & \ddots& \vdots \\ w_1 & w_2 & \cdots & w_n\\ \end{array} \right)$$ can be written as $$\hspace{0.2cm}$$ $$A=L(D_w-ZD_wZ^T)L^T\hspace{0.2cm}$$ where $$\hspace{0.2cm}D_w=Diag[w_1,\cdots,w_n]$$

If I have the matrix $$B=\left( \begin{array}{ccccc} w_1 & w_2 &\cdots & w_n \\ w_2 & w_2 & \cdots& w_n \\ \vdots & \vdots & \ddots& \vdots \\ w_n & w_n & \cdots & w_n\\ \end{array} \right)$$ How can I to factorize it in a similar way to the previous matrix in terms of $$Z$$ and $$L$$ ?

Let $$K$$ denote the matrix with $$1$$s on the "antidiagonal", i.e. $$K = \pmatrix{&&1\\&\cdots\\1}$$ We note that "flipping" the matrix $$B$$ gives us $$KBK = \pmatrix{ w_n&w_n&\cdots&w_n\\ w_n&w_{n-1}&\cdots&w_{n-1}\\ \vdots & \vdots & \ddots & \vdots\\ w_n & w_{n-1} & \cdots & w_1}$$ Let $$D_\hat w$$ denote the matrix $$\operatorname{Diag}[w_n,w_{n-1},\dots,w_1]$$ (if you prefer, you could write $$D_{\hat w} = KD_wK$$). Using your decomposition, we have $$KBK = L(D_{\hat w}-ZD_{\hat w}Z^T)L^T \implies\\ B = KL(D_{\hat w}-ZD_{\hat w}Z^T)L^TK$$ Or if you prefer, $$B = (KL)(D_{\hat w}-ZD_{\hat w}Z^T)(KL)^T$$