Sets
Entry conditions
Use set-based structures only when you can:
- Identify a finite or well-defined collection of elements.
- Decide membership clearly (no ambiguous membership rules).
- Represent relations as explicit pairs of elements.
If membership is undefined or dynamic without rules, do not treat it as a set.
Definitions
- A set is a collection of elements with clear membership.
Vocabulary (plain language)
- Set: a named collection of distinct items.
- Element: one item that may belong to a set.
- Ordered pair: a two-item list where order matters, written .
- Membership: the rule that decides whether an element is in the set.
Symbols used
- : sets.
- : “ is an element of .”
Intuition
Think of a set as a named bucket of distinct items. What matters is whether an item is in the bucket or not.
If you cannot list or decide membership, you should not claim a set. If you cannot list or decide the pairs, you should not claim a relation. If one input can map to multiple outputs, you do not have a function.
Worked examples
Example 1: A set
Let . Membership is clear: “red in ” is true, “yellow in ” is false.
Example 2: A set of strings
Let . Then “cat” is in , and “bird” is not.
How to recognize the structure
- Set: you can answer “is in ?” for any candidate .
Common mistakes
- Treating vague groupings as sets when membership is not defined.
Minimal data
- A list of elements for .
Misuse warnings
- Do not treat “similarity” as a function unless it is single-valued.
- Do not infer relations from vague description without listing pairs.