2

I am reading Tao's Analysis I, and there are a number of passages which seem to suggest an object-oriented point of view of mathematics reminiscent of the object-oriented programming with which I, as a programmer, am familiar. For example:

How equality is defined depends on the class $T$ of objects under consideration. . . [however] we require that equality obeys the following four axioms of equality

This makes it sound like math deals with classes just like those which are dealt with in programming, and by defining equality for a class in mathematics it is just like we are defining the .equals() method for some sort of Java class. It also suggests that we are constantly 'considering' classes of objects- this suggests the mindset of Tao is to view perhaps everything as objects which are part of some class. Also:

For most applications in analysis, one should not need to compare objects of different types: for instance, if $x$ is a set, and $y$ is a number, then one should not need to consider the question of whether $x=y$ is true or false.

This makes it sound like sets are objects of the type Set, and natural numbers are objects of the type natural number- indeed, in Java terms, our number system $\{0,1,2,\ldots\}$ seems to be an implementation of the interface specified by the Peano axioms, and thus a class.

Tao mentions objects extensively, but seems to allow for the possibility of some things not being objects, as he feels the need to explicitly state that sets are objects (without defining what 'objects' are):

Axiom 3.1 (Sets are objects). If $A$ is a set, then $A$ is also an object. In particular, given two sets $A$ and $B$, it is meaningful to ask whether $A$ is also an element of $B$.

So my questions are the following:

  1. To what extent is the object-oriented perspective in programming analogous to the way 'objects' are viewed in mathematics (or at least the specific viewpoint of mathematics which Tao presents in Analysis I)- is it sound to view (all) mathematical objects through the hierarchical lens of classes, superclasses, interfaces, etc.?

  2. How should what an 'object' is be interpreted when Tao uses it- the same way it would be in programming?

Throughout Analysis I, Tao uses $n \mathord{+}\mathord{+} $ for the successor of $n$ where $n$ is a natural number, which he says is "in deference to modern computing languages"- so I think the viewpoint he may be trying to present here perhaps intentionally is similar to programming.

Princess Mia
  • 3,170
  • 1
    "Object" is a generic word for mathematical things. What do you think is the central property of OOP? Let's just focus on that instead of giving vague words. – Trebor Jun 01 '24 at 03:37
  • 1
    For example, interfaces are used in non-OOP languages too. So you need to provide a concrete verifiable criterion so that this question becomes answerable. – Trebor Jun 01 '24 at 03:39
  • @Princess there are different ways to give a general structure to math, but no one that I know fit something like the OOP structure of programming languages, and this makes sense because OOP defines properties of objects ad-hoc so it cannot fit at all in mathematics –  Jun 01 '24 at 03:53
  • 1
    You can certainly make the analogy that sets are objects and axioms are methods. Object oriented programming is a linguistic analogy to encapsulate nouns and verbs from the problem into code but I don't really think of it as being more than a metaphor. – CyclotomicField Jun 01 '24 at 04:22
  • If you squint hard enough Category Theory can be thought of in an OOP manner and conversely: https://cstheory.stackexchange.com/questions/21387/whats-the-relation-between-oop-and-category-theory – balddraz Jun 01 '24 at 04:40
  • 1
    It seems like Tao means by the statement "sets are objects" that sets themselves are capable of being elements of another set. Sets were defined as "a collection of objects" in the informal definition 3.1.1. As @balddraz states, category theory and OOP have some parallels. But they are independent and category theory has a purpose distinct from OOP. What they have in common is abstraction... – John Cavanaugh Jun 01 '24 at 09:37

2 Answers2

3

Disclaimer: I too am a computer science person with a side interest in pure mathematics. The following are statements that I'm fairly confident of, but I'd defer to actual research mathematicians on any points of disagreement

I think there are some legitimate analogies to object-oriented programming. For example:

  • An axiom system can be seen as analogous to an interface: the set of rational numbers, the set of real numbers, and the set of complex numbers could each be seen as a "class" which implements an "interface" (i.e. the field axioms). You can add an ordering axiom to "extend" that interface (now you have the axioms for an ordered field). And so on.
  • In many-sorted logic, you quantify over a domain of elements each of which has a "type", and variables are also typed, so a given variable can only refer to an element of the correct type.

But I think one should be careful not to stretch such analogies too far. For example:

  • In a pure set theory like $\mathsf{ZFC}$, everything is of the same type (a set). What distinguishes, say, a function from some other kind of set is that a function is a set with a particular "structure" (a set whose elements are all a particular kind of ordered pair, e.g. of the form $\{\{x\}, \{x, y\}\}$). But one can perfectly legitimately do equality comparison of a function and a non-function (of course, such a comparison of a function and a non-function will always compare as not equal)
  • In Java a double has a very specific, concrete representation, namely a big-endian sequence of 64 bits in IEEE 754 format. But pure mathematics is intentionally abstract (one might say "non-commital") about what a number "actually is". When doing math within a foundational system like $\mathsf{ZFC}$ set theory, we typically take the natural numbers to be the finite von Neumann ordinals, so 0, 1, 2, etc. are the sets $\{\}$, $\{\{\}\}$, $\{\{\}, \{\{\}\}\}$, etc. But that doesn't imply an absolute ontological commitment that those particular sets constitute the "true identity" of the non-negative integers. The non-negative integers are any structure that obeys the Peano axioms, and our ability to do arithmetic is independent of any philosophy about what the numbers "actually are". Thus when speaking about integers as mathematical "objects", this is a notion of "object" that's much more abstract (less concrete) than what "object" typically means in a programming context.
  • You mention the language in Tao's book about objects of different "types" potentially being considered "equal" to each other. I think in mathematics the scenarios in which such a thing happens are less common than in programming. In many programming languages we can very freely implement comparators which could quite plausibly consider, say, an integer and a function object to be equal. But in mathematics I think a scenario in which, say, an integer and a real-valued function of $\mathbb{R}^{3}$ are "equal" would be pretty unusual (theoretically possible in a carefully designed, restricted setup, but unusual).

Regarding Tao's Axiom 3.1, I think you are slightly misunderstanding what he's saying. To quote Zermelo's seminal 1908 paper on set theory (translation based on my very rudimentary German and checked against Google):

Set theory has to do with a "domain" $\mathfrak{B}$ of objects, which we simply call "things", amongst which are "sets"

So, the domain of "objects" which set theory describes includes sets, and potentially also non-sets (the latter are typically referred to as "atoms" or "urelements"); in "pure" set theory, there are no "atoms", everything is a set. The members of a set can be other sets and also atoms (if they exist). So Tao's Axiom 3.1 is just saying that the universe of possible "objects" includes sets (i.e. sets are one kind of "object"), and thus a set can be an element of another set.

NikS
  • 1,980
1

You may be making more of Tao's comments than what he meant. The problem seems to be the usual one with set-theoretic foundations, namely the following. In principle, in ZFC everything is a set. Thus, $0$ is $\{\}$, $1$ is $\{0\}$, $2$ is $\{0,1\}$, etc., a rational number is a pair etc., a real number is a Dedekind cut which is again a set, etc. But practically speaking, one wants to view real numbers as "urelements" rather than sets. Tao seems to prefer to avoid such technicalities by talking about "objects", which are apparently "things one is allowed to talk about" (as opposed to the set of all sets, for example).

Mikhail Katz
  • 47,573