function is_in(e : TObject; X : Objects) : boolean;It can also be mapped upon our bitmapped and integer mapped arrays in a well defined manner. Calling sequences are defined by:
function is_in(e : integer; X : bitmap) : boolean; function is_in(e : integer; X : integers) : boolean;Programming such calling sequences for a strings implementation is a bit less trivial, because it would require a parsing mechanism. Therefore any strings implementation will be postponed until we bounce against limitations of the others.
function SubSet(A,B : Objects) : boolean; function SubSet(A,B : bitmap) : boolean; function SubSet(A,B : integers) : boolean;The Axiom of Extension states that two sets are equal if and only if they have the same elements. If $A$ is equal to $B$ then we write: $$ A = B $$ And the fact that $A$ and $B$ are not equal is expressed by writing: $$ A \neq B $$ Equality of sets $A = B$ can be conveniently defined as: A is a subset of B and B is a subset of A. Formally: $$ (A = B) \qquad \equiv \qquad ((A \subseteq B) \quad \mbox{and} \quad (A \supseteq B)) $$ This too can be easily implemented in software. Calling sequences defined by:
function Equal(A,B : Objects) : boolean; function Equal(A,B : bitmap) : boolean; function Equal(A,B : integers) : boolean;We conclude that the Axiom of Extension is piece of an implementable set theory. And three implementations have been provided already.
In case our sets have become equivalent with bitmaps and natural numbers - which is
the case to be preferred - then it's important to establish some other equivalencies.
The one for equality ($A = B$) is more than trivial. However ..
Theorem.
\begin{eqnarray*}
A \subseteq B \quad \Longrightarrow \quad A \le B\\
A \supseteq B \quad \Longrightarrow \quad A \ge B
\end{eqnarray*}
It may be not a coincidence that $\le$ and $\ge$ are used with Object Pascal
set implementations as a substitute for $\subseteq$ and $\supseteq$.
The reverse is not true, though: $7 < 8$ but $7 \not\subset 8$:
$$
\require{cancel}
\cancel{A \le B \quad \Longrightarrow \quad A \subseteq B} \\
\cancel{A \ge B \quad \Longrightarrow \quad A \supseteq B}
$$
Herewith, chapter 1 of Halmos' book is covered a great deal. The reader is encouraged to look up there any details of common naive set theory which might be missing in our treatment. We are not going to repeat all of the well known stuff that is common to traditional and implementable set theory.
The chapter 'Aviom of Specification' will be skipped altogether for the moment being. The reason is that logic and predicates have not been done yet as an implementable theory, at least not by this author.