I should start by providing some context. I want to understand the foundations of mathematics and in doing so have been looking at different texts involving ZF set theory and category theory. I understand that set theory takes the view that every mathematical object is to be described as a set. I don't have a problem with that, but I've seen in the past that when others (usually as new to the subject as me) try to ask questions on the foundations of set theory and look for alternatives to doing mathematics, the questions are often met with a response of the form 'why would one want to get rid of set theory?'. That's not my intention. I just want to see if there are precise descriptions of terms like 'object', 'rule' and 'equality' outside of it that one can talk about rigorously without using sets to define them.
I'm currently looking at the notions of equality in set theory. We define sets to be equal when they have the same elements.
Basically, we can say that $A = B$ if and only if for every $x \in A$ we have $x \in B$ and for every $x \in B$ we have $x \in A$.
Now we are using $x$ as a symbol representing arbitrary elements of $A$ and $B$, so suppose that the definition holds true and $A$ and $B$ are equal but using set notation we have $A = \{a, b, c\}$ and $B =\{d,e,f\}$. In order for you to be able to say that $A$ and $B$ are equal, you have to be able to provide some means through which you can say things like $a = d$. In other words, it seems to me that you need rules which say the objects themselves are equal prior to being able to define notions of set equality.
It seems to me that if you say, $a$ and $d$ are sets, then you can continue asking about how equality is defined for the elements of $a$ and $d$ indefinitely until you run into some kind of object that isn't a set or the empty set.
My question therefore is this: do we have a way of talking about mathematics that deals with 'rules' on 'mathematical objects' directly in order to define some form of equality? And can such a way of talking about mathematics be used at the foundations in a rigorous way alongside the notion of sets? For a simple example, maybe the rule is addition and the objects are numbers. Only in the context of such a rule can we say the set $\{2 + 2, 3 + 4\}$ is equal to the set $\{4,7\}$. However, without such a rule, they must be treated as different sets. The idea of numbers and addition being sets themselves doesn't have to be removed, but I would rather treat them as 'examples' of objects with a 'number-like' property and an 'addition-like' property that has been defined prior to constructing them with sets.
I don't quite understand the distinction between 'the same' and 'equal' in this case.
Edit: I would give everyone an upvote but can't at the moment.
– Daedalus May 05 '20 at 12:33