This operation was already defined, in general, as the "Union" derivative, but in this case we specify that the two parameters must be sets.
〈( (C∪D = {C↓ D↓}) ← ({C↓} = C) ← ({D↓} = D) )〉
This definition can be simplified by the generic expression
〈( C/conj =: {C↓} = C) )〉
which indicates the condition that C is a set. The new definition is:
〈( (C∪D = {C↓ D↓}) ← C/conj ← D/conj )&〉
Repeated items disappear automatically. Examples:
{a b c}∪{d c} // ev. {a b c d}
{1 2}∪{2 3}∪{3 4} // ev. {1 2 3 4}
{u v}∪{} // ev. {u v}
Properties:
〈( C∪C = C )〉
〈( C∪∅ = C )〉
Intersection of sets
It is also defined under the condition that the two parameters are sets:
〈( (C∩D = {[[C↓]⨂[D↓]]} ← C/conj ← D/conj )〉
Examples:
{a b c}∩{a b c} // ev. {a b c}
{a b c}∩{a b} // ev. {a b}
{a b c}∩{a} // ev. {a}
{a b c}∩{} // ev. {}
a∩{a b c} // ev. {a}
Properties:
〈( C∩C = C )〉
〈( C∩∅ = ∅ )〉
〈( (C∩D = D) ↔ C⊂D)〉
Difference between two sets
It is defined as the contravariant union. The contravariant union on the left and on the right are equivalent.
〈( (C ∪' D)) = {x ← x∈C ← x∉D} )〉
Here we do not use the symbol "−" because it already has an arithmetic meaning (subtraction). We thus avoid polymorphism with overloading [see MENTAL Language - Principles - Polymorphism].
Examples:
({a b c d} ∪' {c d}) // ev. {a b}
({a b c d} ∪' {u v}) // ev. {a b c d}
({a b c d} ∪' {}) // ev. {a b c d}
Universal and complementary set
The universal set U is a meta-set: the set of all possible sets but excluding itself.
The complementary set of a set C, denoted by CC, is defined as follows:
〈( (CC =: U ∪' C)) )〉
The properties are checked:
〈( (C ∪ CC) = U)) )〉
〈( (C ∪ U) = U) )〉
〈( (C ∩ U) = C) )〉
(U ⊂ Ω)
(∅C = U)
(UC = ∅)
Empty sets of higher order
{} // empty set
{{}} // empty set of order 2
{{{}}}} // empty set of order 3
(C =: {C})/(C := {}) // conjunto vacío de orden infinito, representa a {{{...}}}
Cartesian Product of Sets
Definition
The Cartesian product of n sets C1 ... Cn is the set of all possible sequences formed by the elements of the sets, such that the element i of each sequence is an element of the set Ci.
For two sets C1 and C2, the descriptive definition is:
〈( C1×C2 = {〈 (xy) ← (x∈C1 ∧ y∈C2) 〉} )〉
And the operational definition is:
〈( C1×C2 = { [([C1↓] [C2↓])] } )〉
For n sets C1, ... , Cn, the recursive definition is:
Here we use the operating range of the Cartesian product. Example:
C1={a b} C2={u v} C3={x y}
C1×C2×C3 = {[[[a b] ∪ [C2×C3↓]]} = =
{[[a b] ∪ [{u v}×{x y}↓]]} =
{[[a b] ∪ [(u x) (u y (v x) (v y)]]} =
{(a u x) (a u y) (a v x) (a v y)
(b u x) (b u y) (b v x) (b v y)}
(C1 = {a b})
(C2 = {u v})
(C3 = {w})
(C1 × C2 × C3) // ev. { [([a b] [u v] [w])] }] {(a u w) (a v w) (b u w) (b v w) }
Power Set
Definition
The power set of a set C is the set of all subsets that can be formed from that set. It is described as follows:
〈( Pot(C) = {〈 D ← D/conj ← D⊂C 〉} )〉
Operationally, the power set can be defined as follows:
〈( Pot(C) = { [ { [C↓]"(C#) } ] } )〉
That is, all permutations with repetition are generated, each within a set. The repeated elements disappear and at the end all subsets are obtained.
Examples
For C={a b c} we have:
{ { { a a a } { { a a b } { { a a c } { a b a } { a b b }
{ a b c } { a c a } { a c b } { a c c } { b a a a }
{ b a b } { b a c } { b b a } { b b b b } { b b b c }
{ b c a } { b c b } { b c c } { c a a a } { c a b }
{ c a c } { c b a } { c b b } { c b c } { c c a }
{ c c b } { { c c c c } } } ev.
{ { a } { a b } { a c } { a b } { a b } { a b c }
{ a c } { a c b } { a c }
{ b a } { b a } { b a c }
{ b a } { b } { b c } { b c a } { b c } { b c }
{ c a } { c a b } { c a } { c b a }
{ c b } { c b } { c a } { c b } { c } } ev.
{ { a } { a b } { a c } { a b c } { b } { b c } { c } }
Pot{a} // ev. {{a}}
Pot{a b} // ev. {{a} {b} {a b}}
Number of elements
Since by the definition the empty set is not included, the length of the power set is (2∧n - 1), where n is the length of the set:
〈( (Pot(C))# = (2∧(C# - 1) )〉
In particular, when C is the sequence of the n first natural numbers, the property is satisfied:
The expression x∈{a b c} indicates that x is an element of the set {a b c} and that it is therefore a, b or c.
The expression ∈{a b c} indicates an element of the set {a b c}, i.e., that is a, b or c. Not to be confused with a∨b∨c, which is an existential expression, the result of which is α or θ.
Declarative inclusion
The expression x⊂{a b c} indicates that x is a proper subset of {a b c}, i.e., that x is one of the following sets: {a}, {b}, {c}, {a b}, {a c}, {b c}. That is:
x∈{{a} {b} {c} {a b} {a c} {b c} {b c}}
The expression ⊂{a b c} indicates a proper subset of {a b c}, i.e., it is one of the following sets: {a}, {b}, {c}, {a b}, {a c}, {b c}. That is:
∈{{a} {b} {c} {a b} {a c} {b c} {b c}}
Operations with declarative expressions
It is possible to operate with declarative expressions. For example:
3*(∈{a b c}) = (∈{3*a 3*b 3*c})
(⊂{a b c})∪{u v} =.
∈{{a u v} {b u v} {c u v} {a b u v} {a c u v} {b c u v}} {b c u v}}