Set Theory Questions - Member of vs. Subset of

Could be. I think we need to work on helping the OP clarify, in his own mind and with his customer, just exactly what the question(s) are, to-wit:

Once that’s done, THEN we can work on clarifying what data types and operations are available in the language to be used.

Gotta run out and do some errands now. Back later.

This thread may be getting hard to follow, but OP, if you tell me what programming language you like, I (or others) will make the distinction between ∈ and ⊂ clear to you in terms of code implementing each. This may or may not be relevant to your actual ultimate concern, but it’s still a distinction worth familiarizing you with, given that you apparently are from time to time confronted with such notation.

In the meanwhile, I’ll follow Chronos’s lead in marking all my posts which aren’t strictly OP-targeted with an initial “WARNING: Not of concern to the OP”

The thread is growing faster than I have the time to follow and digest right now. I’ll catch up and reply to any direct questions later tonight.

One quick direct question.

Is there a scenario where using ∈ gives you more information than using ⊂ when you disallow members from being sets (ignoring the nuance about empty sets, zero and whatnot)? I’m struggling to see a distinction in that case.

I’m not the developer, I’m trying to craft the requirements. How the actual code works is outside my scope. Understanding the current and future intended functionality is where I’m at. The code is proprietary and Java like.

In general, A∈SET and {A}⊂SET will always be equivalent statements, if that’s what you mean. If you only allow single-membered sets on the left hand side, and you exclude sets from being members of sets, then you wouldn’t lose anything by defining {A}∈SET and {A}⊂SET as the same thing, but I would avoid it since it could easily confuse people who want to maintain your code in the future since it’s not standard.

Warning: Not of concern to the OP.

I will differ from ultrafilter here, and note: The answers to all three questions are yes (taking “contain” in the ∈ sense).

First, note that X and Y are both sets (I will use this fact implicitly in the following).

The first question is the trickiest: Y ∈ Y ⇔ Y ⊆ X ⇔ each element of Y is an element of X ⇔ each subset of X is a set. But all subsets are trivially sets, so this is true.

(Note, also, that trivially, Y ⊆ Y)

The second question: X ∈ Y ⇔ X ⊆ X, which is trivially true.

(Note, however, that X ⊆ Y ⇔ each element of X is an element of Y ⇔ each set is a subset of X ⇔ each set has only sets as elements. This depends on the sense of the word “set” one uses. If one allows non-sets (ur-elements) in sets, this is false. Otherwise, this is true.)

The third question: Y ∈ X ⇔ Y is a set, which is even more trivially true.

(Note, also, that Y ⊆ X ⇔ each element of Y is an element of X ⇔ each subset of X is a set, which is trivially true)

Now, one may finally object “But there’s no such thing as the set of all sets”; this is true on some set theories, but not in keeping with the spirit of the question. We can perfectly well make a consistent theory in which there are objects called sets, a binary relation ∈ on them, a set is uniquely determined by what is ∈ it, and there are universal and power-sets. Most trivially, there is the model with just a single set which contains itself. Less trivially, we may take something like New Foundations (with or without urelements). The ZF-style sense of “set” as meaning specifically “well-founded extensional tree, bounded in branching width (equivalently, in rank) by some inaccessible cardinal” is just one among many.

I’m just trying to explain to you the difference between ∈ and ⊆.

Here’s a Java-style implementation of ∈, representing sets as arrays:



static boolean ∈(Object left, Object[] right)
{
     for(int i = 0; i < right.length; i++)
     {
          if(left.equals(right*))
               return true;
     }
     return false;
}


And here’s an implementation of ⊆, building off of that:



static boolean ⊆(Object[] left, Object[] right)
{
     for(int i = 0; i < left.length; i++)
     {
          if(!∈(left*, right))
               return false;
     }
     return true;
}


Actually, I’ll grant that you really lose nothing by using one operator for subset and member* operations of any cardinality if you disallow sets of sets. Like I said though, it would be confusing as hell for anybody you hire to maintain that code, even with heavy commenting, it would take a while for me to remember that you did that.

  • Meaning you define the left hand argument of the member operation as a list of elements to be tested, which evaluates to true iff all members of that list are also members of the set.

ETA: To the rest of you, to put it more formally, I think he’s trying to use an array and a set interchangeably, i.e. [a,b,c]∈{a,b,c} where ∈ distributes over the array vs {a,b,c}⊂{a,b,c}.

Omniscient, you need to explain very carefully and clearly just what you want your program to do. It appears that you don’t want it to handle general sets (where an element of a set could be a set itself with elements of its own). It appears that what you want to do is have the program handle just those sets where their elements are only taken from a given finite list of elements, none of which are themselves sets. Tell us precisely what you’re trying to do.

Reviewing some of the OP’s posts, I think he’s made it (somewhat) clear what he needs to do:

This is what I read into all this:[list=a]
[li] An “admin” pre-defines a set of valid input values. (Call this the “big” set.)[/li][li] An end-user inputs a set of one or more values. (Call this the “little” set. I take this to mean: An end-user enters one or more data values, perhaps not necessarily in any kind of “set notation”.)[/li][li] The program must determine if the “little” set entered by the user matches the “big” set pre-defined by the admin.[/li][li] But we don’t have a clear definition of the criterion for the little set matching the big set. This might mean:[/li][ul]
[li] ALL user-entered values must be found among the admin-defined values.[/li][li] At least ONE user-entered value must be found among the admin-defined values.[/li][/ul]
[li] OP has specified (twice) that the “big” (admin-defined) set must be on the left and the “little” (user-entered) set must be on the right. (ETA: But not clear if this refers to a syntax that only the programmer will see, or if this is something the admin or the end-user will have to deal with.)[/li][li] OP has not specified (much) what language will be used or how the data will be represented.[/li][li] We get the impression that the “comparator” functions will be programmed functions that look at the data items one at a time (as suggested in the code samples posted by Indistinguishable above), and NOT that the language has actual operators like ∈ or ⊂ or ⊃ to compare sets.[/li][li] Somebody has to be able to discuss/describe this to somebody in Plain English.[/li][/list]

As a seasonally-apropos aside: I once dressed up for Halloween as “The set containing Chronos”. I wore a couple of bent-wire {braces} around my body.

Were you a member of yourself or a subset of yourself? Did you contain yourself? Were you infinitely recursive?

BTW, it seems the OP hasn’t gotten back to this discussion today. Either he’s digested all that we’ve all written so far and now understands where he needs to go with his project, or else we’ve blown his mind out of the Universal Set with all the talk of powersets and such.

And we haven’t even mentioned (until now) what kind of user-interface his end-users will see. I’m picturing that it might be a form-based GUI where the only possible inputs are the valid inputs. This would greatly simplify the problem of validating the user input against the admin-defined valid inputs.

If the admin has defined a set of valid inputs and the user must enter one of those, then a listbox with a drop-down menu would force the user to chose one of those. Or, it could be a set of radio buttons.

But if the user is supposed to enter one or more of the defined valid inputs, then a set of checkboxes would work well.

Is the admin’s set fairly static or very dynamic? Are there additions, deletions, and changes being made all the time? Or is the list, once defined, fairly stable?

We don’t know the nature of the valid input that the admin might define. Are they simply several numbers? Or several short character strings (like brief product descriptions or part numbers)? How many valid inputs might be in the admin’s set? Are we talking about typically 5 or 10? Or 100? Or 25000?

(Example that I work with: A cash register in a supermarket has a list of valid inputs, namely the list of products in the store that the customer can buy. The end-user (cashier) input consists of one or more of those inputs, entered one at a time, as the cashier scans the items that the customer is buying. The admin’s list, commonly called the PLU file, is typically represented as a table in a relational datbase, and a typical supermarket will have 20000 to 40000 or so items.)

Apologies if this has been covered upthread, but I’m having problems conceiving of difference between a set being a member of another set (∈) versus a set being a subset of another set (⊂). Apparently a set can be a member of another set without being a sub-set of it.

Apostol in One-variable calculus with an introduction to linear algebra has this question (in part). Pages 15-16 if you want to consult the original:

Given:

A={1,2}
C={{1},{1,2}}

Is A ⊂ C true or false? The answer key (page 615 if you want to consult the original) says it is false. I don’t know why. I see A is curly-brackets embracing 1,2, and I see curly-brackets embracing 1,2 in C.

Then he asks is A∈C true or false? The answer key says it is true. That I have no problem understanding

So, apparently something can be a member of something without being a subset of it.

Anyone patient enough to take a stab at explaining it to me?

Think of a set, in this sense, as an SMDB post with links to other SMDB posts, as well as links to webpages.

To say that x ∈ y is to say that y links to x.

To say that x ⊂ y is to say that y links to everything x links to.

I will now illustrate the difference using actual posts:

This post is the set {1, 2}, which was also known as A in post 53.

It has two links.

The first link is to 1.

The second link is to 2.

This post is the set {1}.

It has one link, which is to 1.

This post is the set {{1}, {1, 2}}, which was also known as C in post 53.

It has two links.

The first link is to {1}.

The second link is to {1, 2}.

Nice!

But doesn’t C={{1},{1,2}}

Also link to everything A={1,2} links to?

But Apostol says this is false.

So, as a reminder:

Here is the set A = {1, 2}.

And here is the set C = {{1}, {1, 2}}.

The question of whether A ⊂ C is the question of whether every link in A is also a link in C. Is it the case that every link which is in A is also somewhere in C? Yes or no?

The question of whether A ∈ C is the question of whether there is a link to A in C. Is it the case that there is a link to A somewhere in C? Yes or no?

Note that A has a direct link to www.1.com and a direct link to www.2.com [my stand-ins for the primitive elements 1 and 2]. Does C have a direct link to either of these URLs?

(That is, can you get to each of www.1.com and www.2.com in one click from C, the way you can from A?)