This solution requires two steps: (1) the construction of the two matrices and (2) the layout of the matrices and the drawing of the lines.
For the first step I used the package nicematrix. For the second step a tikzpicture.
For convenience I defined two commands with the arrays to be able to change them without interfering with the tikz layout.

\documentclass[12pt,a4paper]{article}
\usepackage{nicematrix}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\newcommand{\matrixA}{%
$\begin{bNiceMatrix}
a_{11}^{1} &a_{12}^{1} & \Cdots &a_{1m}^{1}\
\Vdots &\Ddots & & \
& & &\
a_{nm}^{1} & & & a_{nm}^{1}\
\end{bNiceMatrix}$
}
\newcommand{\matrixB}{%
$\begin{bNiceMatrix}
a_{11}^{m} &a_{12}^{m} & \Cdots &a_{1m}^{m}\
\Vdots &\Ddots & & \
& & &\
a_{nm}^{m} & & & a_{nm}^{m}\
\end{bNiceMatrix}$
}
\begin{tikzpicture}
\node[inner sep=0pt] (matA) {\matrixA};
\node[inner sep=0pt, above right = 10pt and 10pt of matA, scale=0.8] (matB) {\matrixB};
\node[left= 0pt of matA] {$A=$};
\draw[blue,shorten >=3mm, shorten <=4mm, dotted] (matA.north west)-- (matB.north west);
\draw[blue,shorten >=3mm, shorten <=2mm, dotted] (matA.north east)-- (matB.north east);
\draw[blue,shorten >=3mm, shorten <=2mm, dotted] (matA.south east)-- (matB.south east);
\end{tikzpicture}
\end{document}
end{document}. Took me few minutes to notice ;) – Wallflower Aug 18 '22 at 09:04