My brother asked me what the definition of mod was, and I gave him the usual spiel about it being the "remainder" of division. However, he wanted a definition of mod based on functions he understood.
He's told me that he has an inherent sense of most basic operators (+, -, /, *, ^, log), but not the sorts of ones that I brought up at first when trying to define mod (ceil, floor, integer division). However, he also feels like he has a good understanding of trig as well, so basic trig functions are generally permitted (sin, cos, tan, arcsin, arccos, arctan) alongside usage of $\pi$.
Is it possible to define $a \pmod b$ in terms of these more elementary operators?
(Again, the list is: +, -, /, *, ^, log, sin, cos, tan, arcsin, arccos, arctan, $\pi$.)
I believe I have a solution using tan and arctan which I will post as an answer, so I'm especially curious about solutions that don't use trig functions, or a proof that it's impossible to do without the trig functions.
From a mathematics perspective, I'm particularly curious about answers to this question because each one of these definitions will likely have an extension into negatives or imaginary numbers that will give interesting extrapolations that our usual definition of "remainder" is difficult to bring to bear in those situations.
(As an additional note, the solution shouldn't just define mod as an "infinite piecewise function." In other words, the solution can be piecewise, it just can't have infinite pieces.)
EDIT: As mentioned in the comments under my answer, I should also allow piecewise functions that check for domain and range. As L.F. put it, functions in the form "$f(x)$ if $x \in \mathrm{dom}(f)$, or $g(x)$ otherwise" are also permitted. (My brother does have an inherent understanding of domains and ranges.)
%modulo operator or a//integer division symbol. He's mathematically inclined and so was curious about finding solutions only using operators he'd encountered. It's not the concepts that are tricky, he's just curious! (And this proved to be an interesting challenge that I wanted to share and offer up to members of the site as well.) – Pro Q Jul 28 '22 at 09:07