Ironically, this post is an abuse of the concept of "weak typing". There's nothing "weakly typed" about, say, the plus sign being used to add both numbers and sets, or a dot being used for both multiplication of numbers and the dot product of vectors. It just means those symbols dispatch based on the types of their arguments, which is perfectly consistent with strong typing (cf. the Julia language).
The situation that leads to weak typing in computer algorithms -- when you get data from a file or another process and don't know in advance what type it's going to be -- is basically non-existent in blackboard mathematics. Rigorous mathematical papers always tell you what set a variable belongs to when it is introduced, as well as the domain and co-domain of any functions that are defined. This is the blackboard equivalent of strong typing.
That's 100% fair, but while I could have made my point using more rigorous language, I think it's still valid. I'm not talking about multiple dispatch based on type which is fine, I'm talking about actual abuse like using fractions to mean derivatives, omiting non obvious parameters, confusing function and value of function at a point, etc. I could go on. Physics notation is an even worse offender btw.
Take for example the law of total expectation, usually written as E( E(X|Y) ) = E(X). It's totally non obvious (so much that it's harmful IMO) that the outer E is a function of Y. Hiding the summation parameter of E does nothing but hurt math learners here.
That's interesting. I'm not quite sure what I would call those issues, but I agree they can be tricky.
Many of those abuses are for a very good cause. Leibniz notation is very powerful, for example, but it's hard to master and physicists really go nuts with it.
For E[X|Y], all you have to remember is that conditional expectation yields a function f(Y) of the thing you conditioned on, and f(Y) is itself a random variable that you can take the expectation of. This property is canonical and baked into the formal definitions. It's not an abuse.
However, I do fault some machine learning types a bit for abusing probability and statistical notation. For example, the Elements of Statistical Learning book extensively overloads E[], P(), and other symbols and operators in ways that it doesn't even bother to define. They randomly throw subscripts and decorations onto all sorts of symbols and don't even bother to tell you if those decorations mean they're marginalizing, conditioning, or something else. The book has no glossary of symbols and operators and no preliminary chapter setting out notation, which is unusual for such an enormous book full of hundreds of equations. It would be impossible because the book is a hodge-podge of symbols that change from paragraph to paragraph.
That is statistics, not pure maths. But yeah, statisticians abuse a lot of notations like that, just like physicists. I haven't seen pure mathematicians make such unclear notation.
(Statistics is as much maths as theoretical physics is, both are technically mathematics but in practice the field is handled in a very different manner since they are applied and intended to solve a specific set of real world problems and hence not pure)
Probability theory is not math? (But sure, the same formula can be written in a more explicit way using subscripts and distinguishing random variables from their values.)
The situation that leads to weak typing in computer algorithms -- when you get data from a file or another process and don't know in advance what type it's going to be -- is basically non-existent in blackboard mathematics. Rigorous mathematical papers always tell you what set a variable belongs to when it is introduced, as well as the domain and co-domain of any functions that are defined. This is the blackboard equivalent of strong typing.