Add varargs methods of `any`, `all`, and `count`

(On-topic:)

This unified algebra has some major differences from Julia’s semantics, that I don’t see a way to resolve anytime soon. For example, his notion of a function involves tightly packaging the domain with the expression that operates on it—in some ways it’s conceptually closer to a Julia Generator than a Function, a fact which he leverages aggressively. He also expresses multiple-argument functions as currying. Both of these are difficult to fit into Julia’s multiple-dispatch paradigm, and currying is incompatible with vararg functions altogether.

That said, even though he uses \uparrow (max) and \downarrow (min) for \wedge (&) and \vee (|), I still see the OP proposal as not opposed to his algebra (aside from the currying thing, of course).

Instead of writing \sum_{x\in D}f(x) and \forall x\in D, p(x), he promotes overloading binary operators such that when taking a function as their argument they mapreduce over its domain—so we would instead write +\langle x : D\rightarrow f\,x\rangle and \downarrow\langle x : D \rightarrow p \, x\rangle. In-so-doing, by ejecting the former notations from algebra, he relegates them to informal (or at least, less-formal) uses such as common language—where we are free to do as we wish.

In other words, because instead of sum(f, D) and all(p, D) he promotes something more akin to mapreduce(f, +, D) and mapreduce(p, min, D), by his proposal the former functions become somewhat untethered from the rigors of algebraic discipline and are free to take on common-language behaviors outside of algebraists’ jurisdiction. So he should likely offer no objection to vararg methods of any and all—he shouldn’t care.

(Off-topic rant:)

Wow, I wish I had seen these essays years ago; thanks for introducing me to them! This is a refreshing take on how algebra should be formulated, especially (for me) Boolean algebra. From the start, I disliked Boolean algebra—learning it in college was a chore because it felt unintuitive and clumsy; somehow it felt like the professor must be doing something wrong. Since then I learned to accept and embrace it, but that’s likely just a symptom of learned helplessness and Stockholm syndrome.

The proposed binary algebra, using \top for \infty and truth, \bot for -\infty and falsity, and \uparrow and \downarrow for \vee and \wedge, is much more intuitive (and the operator precedences make more sense, considering their distributivity). To an analog circuit designer, it’s basic knowledge that making a binary signal out of a continuous one requires infinite gain, so it should’ve been obvious. And for anyone who’s uncomfortable with infinities, it should also cause discomfort with the idea of attainability of certain truth—a development which I think is a net positive. I also find myself attracted to the idea of obsoleting Kleene algebra, and a unified syntax for sets, unions, intersections, and the like.

I would like to learn more about this algebra. For example: How does he propose to write integrals? How shall I visualize a binary probability mass function? What all has been reimagined from this perspective in the world of probability? It’s almost a complete rewrite of mathematics from the ground up, so there’s a lot to think about. I want to see some familiar derivations (of, say, some Fourier transforms) rewritten with its syntax.

Can I entice you to start a thread imagining a future Julia that incorporates some of these ideas? Perhaps a Julia 2.0 could throw InexactErrors when attempting to convert an Int to a Bool, and have Base.isless(::Integer, b::Bool) = b ? true : false? Treating true as numerical 1 does feel like a C-ism that maybe should be a relic of a distant past when compilers weren’t as smart, same as 0-based indexing (:wink:). And reducing functions like Base.:+(g::Generator) and Base.:↑(g::Generator) are pretty easy to do.

Also: I have a newborn daughter. Do you know how to find schools that teach this algebra, so that by the time she reaches puberty she’s well-versed in Hehner’s binary algebra? She shouldn’t have to suffer through the insults of Boole.

3 Likes