Penalty after Rel, Bin, but not Punct

Considering the inline math mode, is there a conceptual or typographical reason, why TeX automatically puts a penalty after atoms of type Rel and Bin, but not after type Punct?

One reason that comes to my mind is that it might allow you to somehow conveniently control the allowed line breaks. So, maybe you should write rather Let $a$, $b$ be numbers istead of Let $a,b$ be numbers since there is no reason to avoid the line break between the variables. On the other hand, you might want to write Let $a,b\in Z instead of Let$a$,$b\in Z$ since you might want to disallow line break between the variables here. But in my opinion, even in the second case, the line break between $a$ and $b$ would be still better than breaking the line after \in, so it would make more sense I guess to include some positive penalty lower than \relpenalty after the comma. Another example: I tend to define maps in mathematics as $f\colon A\to B$ (I think it is more appropriate to use the colon as a punctuation mark instead of relation in this context, that is, having a space only after the colon but not before). In this example, TeX allows line break after the \to, but not after \colon, where it is definitely more appropriate. The easiest solution for both issues is probably to use the punctuation marks only outside the math mode and maybe to redefine the macro \colon to include some penalty. (Additional possibilities were considered in another thread Allowing line break at ',' in inline math mode?) Nevertheless, I am quite interested to know the reason why TeX behaves like this since maybe I am overseeing something important. EDIT: @egreg in the comments had an interesting point about ordered pairs, which, however, illustrates even better how nonsensical the behaviour is in my opinion. So, if we have an ordered pair (a,b), we surely do not want to break it. This might be seen as an argument for disallowing breaks after the comma. But now consider having a pair (a+b,c). Here, TeX allows the break after the plus, but not after the comma. But breaking after plus makes even less sence than after comma. On the other hand, having more complicated tuple such as (a+b,a2+b2,a3+b3), I think it would not be bad at all to break it after comma, but definitely bad to break it after plus. Finally, note that if punctuation allowed to break lines, then a neat way how to disallow the line break in the simple pair (a,b), would be to write it in a group ${(a,b)}$, which somehow respects the inner logic of the formula. • You don't want a line break in the ordered pair (a, b), do you? Commented Mar 29, 2020 at 15:24 • First, I thought you have a good point, but then I changed my mind, see the edit. Commented Mar 29, 2020 at 17:43 1 Answer An answer, how this behaviour is meant is apparently provided in the TeXbook (p. 173) For example, if you type $f(x,y) = x^2-y^2 = (x+y)(x-y)$ in mid-paragraph, there’s a chance that TEX will break after either of the = signs (it prefers this) or after the - or + or - (in an emergency). But there won’t be a break after the comma in any case—commas after which breaks are desirable shouldn’t appear between$’s.
If you do want to permit a break at some point in the outer level of a formula, you can say \allowbreak. For example, if the formula
$(x_1,\ldots,x_m,\allowbreak y_1,\ldots,y_n)$
appears in the text of a a paragraph, TEX will allow it to be broken into the two pieces ‘(x1, ..., xm,’ and ‘y1, ..., yn)’.

I do not find it very fortunate, but I guess I'll have to deal with it.

EDIT: To conclude the topic somehow and make this an exhaustive answer to my own question, let me share my solution of this.

Regarding the line-break after comma, I define

\def\ppen{\penalty300 } %punctuation penalty
\let\col=\colon
\def\colon{\col\ppen}


That is, after every \colon, there is a penalty \ppen of magnitude 300. One can now use \ppen also in other places, such as (a,\ppen b+c) when typesetting ordered pairs.