Here is a solution with nicematrix
. Note the use of \cdots
and \vdots
. Also the O
in the bottom right quadrant is centered in the block, not in its own column.

\documentclass{article}
\usepackage{nicematrix}
\begin{document}
\[R =
\begin{bNiceArray}{ccc|cccc}[first-col, margin]
\Block{3-1}{\scriptstyle {r\hspace{2mm}}} & 1 & & & b_{1, r + 1} & b_{1, r + 2} & \cdots & b_{1n}\\
& & \ddots & & \vdots & \vdots & \ddots & \vdots \\
& & & 1 & b_{r, r + 1} & b_{r, r + 2} & \cdots & b_{rn} \\ \hline
\scriptstyle {m-r\hspace{2mm}} & & O & & \Block{1-4}{O} & & &
\CodeAfter
\SubMatrix\{{1-1}{3-7}.[left-xshift=3mm]
\SubMatrix\{{4-1}{4-7}.[left-xshift=3mm]
\end{bNiceArray}.
\]
\end{document}
As an alternative, you can use the tikz
libraries decorations.pathreplacing
and calligraphy
together with nicematrix
to draw the braces. This has the advantage of giving the braces the same thickness regardless of their length, but nicematrix
ignores the braces and their labels when creating space for the matrix, so additional space must be placed manually. I used \hspace{7mm}
in the code below.
Also (optional), shorten <=
does not work with the calligraphic brace, so the endpoints should use yshift
to shorten the braces.

\documentclass{article}
\usepackage{nicematrix, tikz}
\usetikzlibrary{decorations.pathreplacing, calligraphy}
\tikzset{mybrace/.style={thick, decorate, decoration={calligraphic brace, amplitude=2pt, raise=2mm}}}
\begin{document}
\[R = \hspace{7mm}
\begin{bNiceArray}{ccc|cccc}[margin]
1 & & & b_{1, r + 1} & b_{1, r + 2} & \cdots & b_{1n}\\
& \ddots & & \vdots & \vdots & \ddots & \vdots \\
& & 1 & b_{r, r + 1} & b_{r, r + 2} & \cdots & b_{rn} \\ \hline
& O & & \Block{1-4}{O} & & &
\CodeAfter
\tikz{
\draw[mybrace]([yshift=1pt]4-|1)--node[left=2mm]{$\scriptstyle r$}([yshift=-1pt]1-|1);
\draw[mybrace]([yshift=1pt]5-|1)--node[left=2mm]{$\scriptstyle m-r$}([yshift=-1pt]4-|1);
}
\end{bNiceArray}.
\]
\end{document}
nicematrix
may complete your expectation