I am not sure whether this bug is a reLyX or mathed bug (argiably both
I guess). mathed segfaults in mathed_parse when attempting t o cope
with
\begin_inset Formula \[ T'=\left(
\vcenter{\hbox{
\valign{\vfil\hbox{\(\bsn#\)}\vfil&\vfil\hbox{\(\bsn#\)}&\vfil\hbox{\(\bsn#\)}\vfil\cr
I_{k'} & M' & \boldsymbol 0 \cr
\noalign{\hskip0.5ex}
\omit\span\omit\vfil\hbox to \wd0{\hfil\Large \(\boldsymbol 0\)\hfil}\vfil &
I_{n-p-s}\cr }
}}\right )\]
\end_inset
which is what reLyX genmerates from
$$T'=\left(
\vcenter{\hbox{
\valign{\vfil\hbox{$\bsn#$}\vfil&\vfil\hbox{$\bsn#$}&\vfil\hbox{$\bsn#$}\vfil\cr
I_{k'} & M' & \boldsymbol 0 \cr
\noalign{\hskip0.5ex}
\omit\span\omit\vfil\hbox to \wd0{\hfil\Large $\boldsymbol 0$\hfil}\vfil &
I_{n-p-s}\cr }
}}\right )$$
granted this is not the sort of thing most formulae feature but it is a valid
combination of plain TeX and LaTeX (the \Large, etc are I think LaTeX and
valign is definately plain TeX). I guess mathed should know that halign,
valign and stuff like that should be left alone for the forseeable future.
reLyX also tends to make a big mess of multiple line amcros
defined using \def (like \newcommand but potentially *much* hairer and
a lot less typing). Putting gratitous blank lines in the way the
TeX to LyX to TeX process breaks these badly. A particular sample is
\def\sgp{\vcenter{\hbox{
\valign{\vfil\hbox{$\bsn##$}\vfil&\vfil\hbox{$\bsn##$}\cr
I_{k'} & M' \cr
\noalign{\hskip0.5ex}
\omit\span\omit\vfil\hbox{\Large $\boldsymbol 0$}\vfil\cr }
}}}
(from the same document, just in case you were wondering). [T' above
is this matrix with an extra row added, before you ask.] This particular
matrix uses valign to generate a picture of a matrix with a big 0 spanninh
2 rows of the rest of the matrix.