# Multiple dispatch in mathematical writing

**URL:** <https://discourse.julialang.org/t/multiple-dispatch-in-mathematical-writing/75959>\
**Category:** Offtopic\
**Tags:** math\
**Created:** [February 7, 2022, 5:43pm UTC](https://discourse.julialang.org/t/multiple-dispatch-in-mathematical-writing/75959 "2022-02-07T17:43:47Z")\
**Posts on this page:** 6\
**Page:** 2

<div class="post-metadata">

**Author:** ![antoine-levitt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/antoine-levitt/32/4008_2.png) [@antoine-levitt](https://discourse.julialang.org/u/antoine-levitt)\
**Post date:** [February 8, 2022, 11:33am UTC](https://discourse.julialang.org/t/multiple-dispatch-in-mathematical-writing/75959/21 "2022-02-08T11:33:03Z")

</div>

> [@DNF](#):
>
> But most of all, I think it reduces clarity, and makes it really hard to keep track of what is going on, so I think this is even worse for educational purposes than for publishing.

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.

---

<div class="post-metadata">

**Author:** ![antoine-levitt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/antoine-levitt/32/4008_2.png) [@antoine-levitt](https://discourse.julialang.org/u/antoine-levitt)\
**Post date:** [February 8, 2022, 11:51am UTC](https://discourse.julialang.org/t/multiple-dispatch-in-mathematical-writing/75959/22 "2022-02-08T11:51:27Z")

</div>

> [@lrnv](#):
>
> There were a lot of interesting arguments here on both sides of the argument. I am trying to find a cleverer notation than the one I had, disambiguating these things.

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).

---

<div class="post-metadata">

**Author:** ![lrnv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lrnv/32/19373_2.png) [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Post date:** [February 8, 2022, 11:59am UTC](https://discourse.julialang.org/t/multiple-dispatch-in-mathematical-writing/75959/23 "2022-02-08T11:59:02Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dlakelan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlakelan/32/8491_2.png) [@dlakelan](https://discourse.julialang.org/u/dlakelan)\
**Post date:** [February 8, 2022, 6:54pm UTC](https://discourse.julialang.org/t/multiple-dispatch-in-mathematical-writing/75959/24 "2022-02-08T18:54:52Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![ctkelley](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ctkelley/32/10684_2.png) [@ctkelley](https://discourse.julialang.org/u/ctkelley)\
**Post date:** [February 8, 2022, 7:05pm UTC](https://discourse.julialang.org/t/multiple-dispatch-in-mathematical-writing/75959/25 "2022-02-08T19:05:47Z")

</div>

> [@dlakelan](#):
>
> Mathematicians need to get with the program(ming)

🙂

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.

---

<div class="post-metadata">

**Author:** ![Mason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mason/32/2423_2.png) [@Mason](https://discourse.julialang.org/u/Mason)\
**Post date:** [February 8, 2022, 8:00pm UTC](https://discourse.julialang.org/t/multiple-dispatch-in-mathematical-writing/75959/26 "2022-02-08T20:00:31Z")

</div>

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

```julia
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.

[Previous page](https://discourse.julialang.org/t/multiple-dispatch-in-mathematical-writing/75959.md?page=1)
