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:
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.?
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.