Multiple dispatch in mathematical writing

The notion of clarity is strongly dependent on the beholder. I often get into arguments with co-authors about making explicit the dependence of quantities on various parameters. I once lost the argument and ended up with quantities that had two parameters in subscripts and three in superscripts. They thought it much more clear, I thought it made the formulas unreadable. At the other extreme take a look at eg the Feynman lectures on physics, which are thought to be a model of pedagogy (not the only one certainly, but at least a model): thereā€™s barely any function, just quantities that may or may not depend on other quantities.

2 Likes

May I suggest <f>_mu for int of f dmu? Thatā€™s quite common in probability (although it suggests mu is normalized, which might not be your case).

I will do it the other way around. The f letter was just to make my point and is really a \tau is my writtings. I therefore kept \tau(\nu) and \hat{\tau}(\mathbf x) as the only two notations, and no dispatch problems: \tau(\delta_{s}) is just a particular case of \tau(\nu) that replace \tau(s), and the hat denotes an estimator based on the data.

IMHO the problem in math is trying to make everything a single letterā€¦ Why not fun and invfun for example, or Operator(Fun)(arg) or etc. Mathematicians need to get with the program(ming)

:slight_smile:

I know of no discipline in STEM that works that way. Math journals are happy as long as your notation is clear, consistent, and as easy to understand as possible.

Finnegans Wake is not a good template for scientific writing.

I think overloading mathematical operators is very normal and common. Just like in programming though, one should be careful about whatā€™s called ā€œpunningā€.

i.e. it would be bad julia style to write

f(x::Number) = x + 1
f(x::String) = println("hello, world! $x")

Likewise, the function f , when used in a given context (i.e. namespace) should have a consistent meaning, even if the details of that meaning differ depending on the types of its input. As was mentioned above, addition and multiplication are heavily overloaded, but those overloads typically all preserve some core intuitions.

In the case you present here, I think the way you conflate the evaluation of a function at a point with itā€™s integral over a measure is maybe not ideal.

6 Likes