LaTeX defines \frac as
\DeclareRobustCommand\frac[2]{{\begingroup#1\endgroup\over#2}}
i.e. the fraction is created using \over surrounded by a brace group to contain its effect.
The TeXbook states on page 155
There’s also an eighth classification,
\mathinner, which is not normally used for individual symbols; fractions and\left...\rightconstructions are treated as “inner” subformulas, which means that they will be surrounded by additional space in certain circumstances.
This leads me to expect that the result of \frac{1}{2} would be a \mathinner atom. However, the following MWE shows that it's not.
\documentclass{article}
\begin{document}
(\frac{1}{2} (3 + 4 + 5))
(\mathord\frac{1}{2} (3 + 4 + 5))
(\mathinner\frac{1}{2} (3 + 4 + 5))
\end{document}
So it seems that the brace group inserted by \frac does not create a \mathinner atom but rather a \mathord one, like any other subformula.
- Seeing as
\overneeds to be enclosed in a brace group to limit its effect, when does a fraction ever create an "inner" subformula? What are the "certain circumstances" the TeXbook refers to? - Is there any harm in prepending
\mathinnerto the definition of\frac, making it actually produce\mathinneratoms?

\overwithdelimsmight work more like\left\rightbut I couldn't make an example, and I got lost reading the web code, it does use ainner_noadat one point (fraction_noad: begin t:=inner_noad; s:=fraction_noad_size;) but after that I got lost following the logic. For the second bullet point https://tex.stackexchange.com/a/173740/1090 – David Carlisle Nov 14 '20 at 11:23\fracs into\mathinner: https://www.ctan.org/pkg/mathfixs – Daniel Diniz Nov 22 '22 at 23:59