[Tex/LaTex] Brackets inside brackets with newline inside

arraysbracketsmatrices

My question is how to achieve this effect in LaTeX? I tried various combinations of \right and \left but it does not work.

enter image description here

EDIT

Adding the code:

    $[introduces]m$ = $\left[ 
    o_1 = \left\lbrack[o_1 
    \newline
    o_2
    o_3] \right\rbrack
    o_2 = \lbrack \rbrack
    \right]$

Best Answer

You could use array nested in array, but in this case I believe aligned is better:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{equation*}
\left[
\begin{aligned}
o_1 & \mapsto
  \left[
  \begin{aligned}
  o_1 & \mapsto 1 \\
  o_2 & \mapsto 0 \\
  o_3 & \mapsto 0
  \end{aligned}
  \right]
\\
o_2 & \mapsto
  \left[
  \begin{aligned}
  o_1 & \mapsto 1 \\
  o_2 & \mapsto 1 \\
  o_3 & \mapsto 0
  \end{aligned}
  \right]
\\
o_3 & \mapsto
  \left[
  \begin{aligned}
  o_1 & \mapsto 0 \\
  o_2 & \mapsto 0 \\
  o_3 & \mapsto 1
  \end{aligned}
  \right]
\end{aligned}
\right]
\end{equation*}

\end{document}

enter image description here

Without overshooting:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{equation*}
\begin{bmatrix}
\begin{aligned}
o_1 & \mapsto
  \begin{bmatrix}
  \begin{aligned}
  o_1 & \mapsto 1 \\
  o_2 & \mapsto 0 \\
  o_3 & \mapsto 0
  \end{aligned}
  \end{bmatrix}
\\
o_2 & \mapsto
  \begin{bmatrix}
  \begin{aligned}
  o_1 & \mapsto 1 \\
  o_2 & \mapsto 1 \\
  o_3 & \mapsto 0
  \end{aligned}
  \end{bmatrix}
\\
o_3 & \mapsto
  \begin{bmatrix}
  \begin{aligned}
  o_1 & \mapsto 0 \\
  o_2 & \mapsto 0 \\
  o_3 & \mapsto 1
  \end{aligned}
  \end{bmatrix}
\end{aligned}
\end{bmatrix}
\end{equation*}

\end{document}

enter image description here

Related Question