I have two sets, A and B, both containing the elements 1, 2, and 3. Since they are identical, does this mean they are actually the same single set, just represented twice?

Thinking of sets as boxes, are A and B separate boxes with the same contents, or just two ways of describing the same box?

If there are truly two separate boxes, does that imply there can be identical elements across all levels of analysis, yet remain distinct and independent? For example, shouldn't any object only be identical to itself? If two things are identical, shouldn't they point to the same thing, not separate identical things?

Therefore, when we say set A is identical to set B, are we essentially saying they are both just labels for the same single set containing the elements 1, 2, and 3?

  • 6
    They're just like two different reference name variables both of which refer to the same object in memory heap in most object oriented programming languages... Commented Feb 4 at 5:27
  • 13
    You says: "Thinking at sets as boxes..." can you imagine two different boxes located in different places with inide the very same eggs? Commented Feb 4 at 8:43
  • 1
    We have different ways to define sets and ways to compare whether sets so defined are or are not identical. Define set A as the set of all positive integers with integer value less than 4. Define set B as the set of three unique positive integers whose sum equals 6. The elements of set A are 1, 2, 3. The elements of set B are 1, 2, 3. The elements of set A are identical to the elements of set B. Set A is not identical to set B in terms of their respective definition! Commented Feb 4 at 21:48
  • 2
    A lot of answers focus on the definitions of objects and distinct-ness. It might also be instructive to think about what you definition of "Identical" and "the same" is? What does it mean, to you, for A and B to be the same set? If you didn't check their contents, how would you know if they are the same? how would you know if they aren't the same? How would you prove it to someone who wished to contest it?
    – Brondahl
    Commented Feb 5 at 13:33
  • 2
    Is this 3 ← the same as this one → 3? Commented Feb 6 at 22:39

11 Answers 11


In math we've decided that if two sets have exactly the same elements then they are the same set. This is taken to be one of the fundamental properties of the mathematical conception of sets, and it is formalized as the axiom of extensionality.

  • 1
    What if we had two identical distinct objects? Imagine someone says, "There are only three zombies." Based on that statement, could we conclude there's a set of zombies, Z, containing just three unique individuals, say a, b, and c? So, Z would be {a, b, c}. However, someone else might argue that this set is identical to {a, a, b, c}. They might reason that order and repetition don't matter in sets, so a set with two "a"s is the same as one with just one. But wouldn't this imply there are actually four zombies, with two being identical? Commented Feb 4 at 6:18
  • While both the sets share the same cardinality (3 unique elements), the second set ({a, a, b, c}) implies the existence of two distinct individuals with the same characteristics as "a," essentially suggesting four total zombies Commented Feb 4 at 6:18
  • 8
    As sets, {a,a,b,c} = {a,b,c}. There are things called "multi-sets", which let you have elements "occur more than once" in them, but a multi-set is not a set, and they behave differently. But be warned that the notation for multi-sets is really poorly developed and implemented (probably because mathematicians don't use them that often), and this makes is really easy to make the mistake of thinking that you are dealing with sets when you are actually dealing with multi-sets.
    – JonathanZ
    Commented Feb 4 at 6:46
  • 1
    You could also go and read about "equivalence relations", if you want to have a possible mathematization of your idea that those two "a"s have the same characteristics, and you might define that as an equivalence. But when it comes to sets, the only characteristics they have are "contains / does not contain certain other elements", and, as we have axiomatized sets, two of 'em that contain the exact same elements are the same set.
    – JonathanZ
    Commented Feb 4 at 6:52
  • 11
    @أحمد الدسوقي, in mathematics, the same name in the same context refers to the same thing, so in {a, a, b, c} there aren't two a's, there is just one listed twice. And when you list one thing twice in set notation, it's no different from listing it once. Commented Feb 4 at 7:03

If two things are identical, shouldn't they point to the same thing, not separate identical things?

This sounds like a computer science question, not a philosophy question. In math and philosophy, it is not typical to speak of what an object "points to." Mathematical objects do not have memory addresses, and may not even be possible to represent as a value in memory.

(Several people have objected in the comments that this is indeed a philosophy question, and I agree, hence the rest of this answer. The phrase "sounds like" should not be mistaken for "is.")

It may be the case that you are confusing "things" and "names." It is reasonable to ask whether two names may refer to the same object, or to two separate identical objects. But here we run into another terminology snag. Philosophers usually use the word "identical" to mean that two objects are the same object (i.e. "A is identical to B" has the same meaning as "A and B are the same object"). Objects which have no distinctions between them, but are not (necessarily) identical, would instead be called "indiscernible."

The traditional answer to this question is that indiscernible objects are identical. As JonathanZ's answer explains, this is also the approach taken by modern axiomatic set theory (and indeed most of mathematics in general). Some philosophers have criticized this idea or called for modifications. The most common adjustment is to require that an object's place and time be counted among its properties, so that objects which are not in the same place at the same time can never be considered indiscernible. This adjustment does not make a difference in the mathematical context, where place and time are inapplicable.

In the case of computer science, non-identical objects are sometimes treated as if they are indiscernible, but this is merely an example of abstraction. In software, every object has a unique memory address, and we can always distinguish between non-identical objects by comparing their addresses, so no two objects can ever be fully indiscernible. Some programming languages are designed to hide this information from the programmer, but that makes no difference, because the objects can still ultimately be discerned "from the outside" of the programming language.

More recently, there have been problems with applying this principle to the field of quantum mechanics. The rule appears to apply to fermions, but not to bosons, which is problematic if you conceptualize bosons as discrete objects. Another possibility is to conceptualize bosons as discrete levels of excitation that a quantum field may occupy, and not as "proper" objects in their own right, but our current understanding of quantum mechanics is too poor to determine whether this is a satisfactory interpretation.

  • 1
    The word "point" may connote pointer as it is understood in programming, however that may not be the intended meaning of the OP here.
    – Galen
    Commented Feb 4 at 20:30
  • 2
    One metaphor I often use is the map-territory relation. I often think about the representation of a thing as different from the thing itself.
    – Galen
    Commented Feb 4 at 20:31
  • For what it's worth, I think bosons are quite a lot like points in basketball, say. If I start playing a game of basketball and I successfully make a basket, I now have 2 points. However, there is no meaningful distinction I can draw between one of the points I have and the other one. Given that the two points that I have are indiscernible, applying the principle of identity of indiscernibles seems to lead to the conclusion that I actually have only one point! Commented Feb 4 at 20:34
  • 1
    There are a few satisfactory ways of resolving the "point paradox," I think. One is to make an arbitrary and meaningless distinction between the two points I have, and simply declare one of them to be first and the other one to be second. Another is to say that the sentence "I have two points" doesn't literally mean that there are two things that I have, each of which is a point; it's merely a metaphorical way of saying that my score is 2. I think that both of these resolutions of the paradox work equally well for bosons, too. Commented Feb 4 at 20:37
  • 1
    If the programming language doesn't expose addresses, implementations may be allowed to move objects in memory, merge equivalent objects (perhaps using a copy-on-write mechanism if it's modified through one of the pointers), etc. So the CS considerations can be very implementation-dependent.
    – Barmar
    Commented Feb 4 at 22:48

It depends what foundational system you are using. For example, in conventional set theory, two sets are considered the same thing if they are structurally identical. In homotopy type theory, which I do not understand well, the univalence axiom says that “equivalence is equality”, meaning something similar - that isomorphic objects are identifiable with each other. (Now I wish I understood how univalence is different from extensionality).

  1. Basic notions

Objects and collections

In most foundations of mathematics, there are basic notions of objects and collections of objects.

Note that in certain foundations, the objects, collections, and membership are derived notions from some other notion. Collections are referred to a number of names, such as set, class, type, et cetera. Objects could be referred to as element or term.

For example, in pure set theories like ZFC and Mostowski set theory, elements and sets are the same notion, and thus elements could be considered to be a derived notion from set, or sets could be considered to be a derived notion from element. In material set theory with urelements, such as ZFA, elements are the basic notion and sets are derived from elements. In ETCS, while sets are basic, elements are derived from a basic notion of function, and in fully formal ETCS, both sets and elements are derived notions from a basic notion of function. In SEAR and structural ZFC, sets and elements are both basic distinct notions.

Something similar occurs with class theories, such as Morse-Kelley class theory and the framework of algebraic set theory, where classes play the role of sets.

In type theory, there are also a distinction to be made. In most type theories, both terms and types are basic foundational notions. However, in book HoTT, terms are the basic notion, and types are derived from terms.

In higher-order logic, the domain of discourse and higher-order predicates play the role of collections, while the objects in the domain of discourse play the role of the elements.

You could also use multisets as a kind of primitive notion and generate a cumulative hierarchy from them.

I do not fully understand this yet, but “down at the bottom” - when you try to define the most basic elements of some rule-based system (such as mathematics) - there is this weird thing that one category theorist called “the primordial ooze”, where very often it turns out that you could start with primitive notion A and use it in some deductive system to derive some concept or structure B; or, vice versa, you can start with a version of B as a primitive notion, and use it to construct a concept of A.

These questions fascinate me, and it is why I turned from computational linguistics to mathematical logic. I am happy to discuss this further with you.


I find it amusing that almost all the answers — Kevin an exception — take the math pov as the default or even the only one even though the number of people today playing around with programming is probably orders of magnitude greater than trained mathematicians!

So here's a take on the complementary computer science view.

Mathematics vs Computer Science

CS and (usual) math are at odds with each other in how they address this question.

Since you describe yourself as a Python beginner here is a small illustrative Python script.

x = (1,2,3)  # a tuple
y = (1,2,3)  # another tuple?
print (x is y)
a = {1,2,3} # a set
b = {1,2,3} # another set???
print (a is b)

You will see the first print gives True, whereas the second gives False.

What gives?

The short answer is that in Python tuples are math-respecting, whereas sets are not math-respecting.

CS Lingo

The terminology you're more likely to find in CS circles is Python tuples are value types, sets are reference types.

Python tuples are functional whereas sets are imperative/object oriented.

The more academic CS-ist would use the term referential transparency.

Direction to Longer answer

The point more relevant to this philosophy forum is that math is inherently Platonic. CS needs to be much more circumspect in being math-respecting while not losing sight of being 'empirically reasonable': Real computers (unlike say Turing machines) need to sit on desks/in our pockets and so cannot fly into mathematical abstractions unrestrictedly. In particular, computers are necessarily finite. Math abstractions have no such restriction.

A still more detailed answer would go too far into CS details eg. intricacies of the design choices that programming languages need to make for discussion here. I'll just say, if you're interested, start with the seminal Functional Programming material like John Backus and John Hughes for delving into why mainstream programming languages (so-called imperative and object oriented) are not math-respecting and why that's a big problem.

Philosophical issues with CS pov

As discussed above, the CS pov markedly differs from the traditional math one.

The Python behavior above is just one possibility. Languages like Haskell go to great pains to not have this programming-math gap. But then these are more fringe languages whereas Python is typical mainstream.

In short, the choices above are just that — choices. Far from being universal or necessary, the choices are ad hoc, arbitrary, happenstance.

Some other pointers

  • Some interesting takes on math-CS similarities and differences)
  • Some more on the unsavory results of programming languages like Python not being math respecting. Here and here
  • Platonism vs constructivism an amusing yet poignant story of how Platonism needs to be inculturated into kids:

    We need to learn the attitude of Platonism...
    A: I remember, in a geometry class, my teacher wanted to prove the congruence of two triangles. Let’s take a third triangle, she said, and I asked where do triangles come from. I worried that there may be no more triangles there. Those were hard times in Russia, and we were accustomed to shortages.
    Q: What did she say?
    A: She looked at me for a while and then said: “Shut up”. But eventually I got the idea that you don’t have to build a triangle when you need one; all possible triangles exist ahead of time.

  • Theset datatype of Python is so egregiously unmathematical that the most basic set theory construction — a set may contain another set — is disallowed with some obscure error message. You can get around this by using the frozenset type

Not all that one might naively categorize as identical is philosophically identical, and I do not mean that it's because of small differences.

A set of indexed locations in RAM is not a different set of the same number of indexed locations in RAM initialized with the same values, and neither are the same as their counterparts on a whole different computer. They're easy to tell apart, either by asking the computer to tell you where the values are indexed, or by looking across the room and noticing that the computer over there is not the computer over here.

An electron is an electron is an electron, but this electron is in New York being part of a bit of lead, and that electron is on the moon being part of a bit of oxygen. They're easy to tell apart.

This event happened ten seconds ago and that event happened last week. It's very easy to tell them apart.

Entities are indiscernible if they are identical, and identical if they are indiscernible. That is, they are the same entity, and you can't tell something apart from itself. Try to mean this in only the most boring way possible and you won't be far wrong.


Sets are uniquely determined by their elements.

  1. If you have only one thing no. 1, one thing no. 2 and one thing no. 3, then you have only one set

A = B

  1. But if you have three things no 1,2,3 and three other things 1',2',3' and if the latter three are not just the first three numbered in different order, then

    A != B,

    i.e. the sets A and B bot are different. But both sets are isomorphic:
    Isomorphic means that there is map f from A to B, which maps each element of A to exactly one element of B such that

    • no two elements of A are mapped to the same element of B (injective)
    • and all elements of B are hit by an element from A (surjective).

    Because the situation is symmetric, one obtains at once a map g from B to A with analogous properties.

Note. A similar concept like set, but where repetition plays a role, is named multiset.


Thinking of sets as boxes, are A and B separate boxes with the same contents, or just two ways of describing the same box?

Sets are not boxes. They are collections.

The collection itself is only theoretical. I can talk about set S, the set of all former students of Jules Verne University, even though the former students of Jules Verne University are currently traveling all around the world and it's impossible or impractical to fit a cardboard box that would surround all these former students while avoiding all other people.

If you talk about the set of all former students of Jules Verne University, then you are talking about the same set S as I am, regardless of how you name or describe this set and regardless of the fact that in your head, you are imagining a giant ghost cardboard box linking all these students around the world.

If you want, you can define a new kind of mathematical objects: set-with-box. A set-with-box is a pair (S, B) where S is a set, and B is a box. Two sets-with-boxes are identical if and only if both their sets and their boxes are identical. So now it's possible to have two sets-with-boxes that have the same set, but a different box, and these two sets-with-boxes are not identical, although we will probably invent a new term to describe the relation "have the same set but maybe not the same box". Throughout the fields of mathematics we have made up lots of terms like equivalent, similar, homomorphic, homologous, isomorphic, homeomorphic, diffeomorphic, homotopic, and lots more, to describe all the different kinds of equivalent-in-a-precisely-defined-sense-but-not-necessarily-equal that we needed.

For instance, a doughnut is homeomorphic and homotopic to a coffee mug, but a doughnut is certainly not identical to a coffee mug, and if the coffee mug has sharp edges, then the doughnut is not even diffeomorphic to the coffee mug.


It depends if we are speaking in the instantaneous abstract present, or whether they have external, ongoing, or variable contextual meaning.

Generally, if A is the set [1, 2, 3], then that's it and it never changes, so we can take its instantaneous value, compare it to the instantaneous value of B, and say "they are the same thing" or not.

But if we might add or remove values to a set at some point, then this is not true.

For example, given:

  • set X
  • set A = [all positive members of X]
  • set B = [all even members of X],

... then we can obviously make assumptions about A that we can't make about B (it will not contain -2), and about B that we can't make about A (it will not contain 3). The values A and B have contextual meaning.

Let's now say we consider that setup over a variety of values of X.

If one of the values of X that we try is [-3, -1, 2, 4, 6] then A and B will both be [2, 4, 6]. In that case, we can say A = B, and all assumptions we can make about one, can be made of the other... but only for that value of X.

So A and B are instantaneously equivalent to the set [2, 4, 6], and from a programming PoV we could for that instant consider them "references" to the same set, but if you were programming using objects, it'd be messy pain in the ass to write X.setValue().

But, frame challenge. I think your question is not about any of that. Or indeed about sets. It's about when things should be considered identical.

If there are truly two separate boxes, does that imply there can be identical elements across all levels of analysis, yet remain distinct and independent? For example, shouldn't any object only be identical to itself? If two things are identical, shouldn't they point to the same thing, not separate identical things?

So what does "identical" mean, here?

Other answerers have pointed out that there are many terms for this, used with varying levels of specificity, and often in very woolly ways: equality (being the same in some nebulous way), identicality (sharing the same identity), indiscernability (could share the same identity), equivalence (having the same values), similar (being samey-enough), morphic/homeomorphic/homomorphic/diffeomorphic/isomorphic (types of similarities between maps), homology (same holes), homotopy (same boundaries), etc.

The various names generally translate to "same X" where they're saying what is the same.

Even in computers, the behavior of "Object A.equals(B)" is something that you can override, because it really depends. Are two string variables "equal" if they are stored in the same memory position? Separate positions, but contain the same characters? The same characters, but in different encodings? Are the strings "Null" and "false" equal? Are... you get the idea. It's squishy. Context dependent.

So whether you can consider a grouping of things to have the same identity as another grouping of things is context dependent, too.

I suspect that in philosophy, more than in abstract math, the answer will often be "not identical", since the context matters, even if the items in the groups happen to be the same.

What it means for two things to share an identity is a whole philosophical topic in itself. "Ceci nes pas un pipe", "map/territory", etc. A and B are representations of collections. Are they representations of the same collection? That depends not just what the collection contains, but also on what the collection is a representation of.

If A = [2,4,6] as miles to the nearest towns, and B=[2,4,6] as minutes to cook an egg to soft, medium, and hard, then these aren't representations of the same thing: the sets do not share an identity. They have different units.

But can "[2,4,6]" in itself be considered an indivisible thing with an identity, like "2", or like the concept of "Wednesday"? "Ash Wednesday, March 2nd" and "A couple of Hump Days ago" are not identical sentences, but they both refer to the concept of "2" and to the concept of "Wednesday".

Sure it can. I suspect this is true of all concepts. But again, context matters. Is it useful to consider it a single thing? Does it gain you any additional knowledge about A or B? In the case where A is positive, and B is even, then treating them as equivalent lets you apply both properties to both variables; but treating them as identical adds nothing to that over equivalence.

One of the things that makes identicality important is if you modify one, and the other should change too. If you change A to be "all positive numbers, plus -3", does B also change to be "all even nubers, plus -3"? If so then they are identical, or at least linked in some way to maintain equivalence, making them indistinguishable.

Another is counting. Do they contain countable things? If so, and you have both A and B, do you have one set of things, or two? If you're counting the set of things they include, do you have three things, or six? In the former case, considering the sets as having the same identity might make sense. In the latter case, they are "the same but distinct".

  • Mathematical objects have "no hair", no identifying properties besides the ones that are specifically given (a name, relations to other mathematical entities).
  • Every time a name for such an object is written (say, "2") or imagined, it denotes the same object. There is only one number 2. Similarly, there is only one set containing the number 2, no matter how often I write {2}. There are real-world examples for such concepts, for example the constitution. There is only one constitution and only one Section 3 of the 14th Amendment, notwithstanding the large number of printed copies.
  • This distinguishes mathematical objects from real-world macroscopic objects. There is no pair of identical apples. Consequently, each basket containing one apple is different from any other basket containing one apple.
  • Interestingly, quantum objects also have no hair: Two elementary "particles" which come close enough to each other become indistinguishable. When they separate again, one cannot say which one was which.

Two boxes containing the same number of eggs are not identical. They are equivalent and based on the definition of "egg". No two eggs are identical (same for snowflakes) so two boxes with the same number of eggs will never be identical.

In the world of physical objects, nearly all set comparisons are based on equivalence rather than whether they are identical.

Whether the comparison is between identical objects or equivalent objects:

Two sets containing N identical/equivalent objects can always be considered as one set containing 2N identical/equivalent objects


Two identical sets–or two identical of anything if we really want to get philosophical–can either be two distinct objects if they are two instantiations of the same blueprint, or one object if they are two representations of the same instantiation. The real question, as I see it, is not a philosophical one, but, rather, which one is being used in a particular use case, instantiation or representation?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .