Skip to main content

Set Theory Ontology

Set Theory
Authors: MArk Anthony Higgins - Sky Recursive Ai
© Mark Anthony Higgins 11 October 2025
Revised Date: 17 September 2026
Audio Overview
KIRETH RESEARCH — SEMANTIC LIBRARY
AI CORE → ONTOLOGIES → MATHEMATICAL ONTOLOGIES → MATHEMATICAL LOGIC ONTOLOGIES
SET THEORY → SET THEORY ONTOLOGY

Canonical URL:
https://kirethresearch.org/booksai-core/ontologies/mathematical-ontologies/mathematical-logic-ontologies/set-theory/set-theory-ontology.html

FLOW_ALGEBRA SetTheoryOntology_v1.0

BEGIN_FLOW

DEFINE DOMAIN SetTheoryOntology := {
    SetTheory,
    Set,
    Element,
    Membership,
    NonMembership,
    EmptySet,
    Singleton,
    PairSet,
    FiniteSet,
    InfiniteSet,
    UniversalSet,
    Subset,
    ProperSubset,
    Superset,
    ProperSuperset,
    Equality,
    Extensionality,
    PowerSet,
    Union,
    Intersection,
    Difference,
    SymmetricDifference,
    Complement,
    CartesianProduct,
    OrderedPair,
    Relation,
    BinaryRelation,
    Function,
    Injection,
    Surjection,
    Bijection,
    Domain,
    Codomain,
    Range,
    Cardinality,
    Equinumerosity,
    CountableSet,
    UncountableSet,
    Partition,
    EquivalenceRelation,
    EquivalenceClass,
    FamilyOfSets,
    IndexedFamily,
    Ordinal,
    Cardinal,
    TransitiveSet,
    WellOrdering,
    Axiom,
    ZermeloFraenkelSetTheory,
    ZFC,
    AxiomOfChoice
}

DEFINE ENTITY_TYPES := {
    SET,
    ELEMENT,
    MEMBERSHIP_RELATION,
    SET_RELATION,
    SET_OPERATION,
    ORDERED_OBJECT,
    RELATION,
    FUNCTION,
    CARDINAL_OBJECT,
    ORDINAL_OBJECT,
    AXIOM,
    FORMAL_SYSTEM,
    SEMANTIC_OBJECT
}

DEFINE RELATION_TYPES := {
    MEMBER_OF,
    NOT_MEMBER_OF,
    CONTAINS,
    SUBSET_OF,
    PROPER_SUBSET_OF,
    SUPERSET_OF,
    EQUAL_TO,
    DISJOINT_WITH,
    INTERSECTS,
    MAPS_TO,
    HAS_DOMAIN,
    HAS_CODOMAIN,
    HAS_RANGE,
    HAS_CARDINALITY,
    EQUINUMEROUS_WITH,
    PARTITIONS,
    INDEXED_BY,
    WELL_ORDERS,
    IS_INSTANCE_OF,
    IS_SUBTYPE_OF,
    DEPENDS_ON
}

SET SetTheoryOntology.type = FORMAL_SYSTEM
SET SetTheoryOntology.parent = SetTheory
SET SetTheoryOntology.semantic_domain = MathematicalLogic
SET SetTheoryOntology.role =
    "provide a typed semantic representation of sets, membership, set relations, operations, functions, cardinality, ordinals and axiomatic foundations"

RULE membership:
    Object(x)
    ∧ Set(A)
    ∧ x ∈ A
    -> MEMBER_OF(x,A)
    ∧ CONTAINS(A,x)

RULE nonmembership:
    Object(x)
    ∧ Set(A)
    ∧ x ∉ A
    -> NOT_MEMBER_OF(x,A)

RULE extensional_equality:
    Set(A)
    ∧ Set(B)
    ∧ FOR_ALL x [
        x ∈ A <=> x ∈ B
    ]
    -> EQUAL_TO(A,B)

RULE subset:
    Set(A)
    ∧ Set(B)
    ∧ FOR_ALL x [
        x ∈ A -> x ∈ B
    ]
    -> SUBSET_OF(A,B)

RULE proper_subset:
    SUBSET_OF(A,B)
    ∧ A != B
    -> PROPER_SUBSET_OF(A,B)

RULE superset:
    SUBSET_OF(A,B)
    -> SUPERSET_OF(B,A)

RULE empty_set:
    Set(E)
    ∧ FOR_ALL x [x ∉ E]
    -> E = ∅

RULE singleton:
    Object(a)
    -> Set({a})
    ∧ Singleton({a})
    ∧ Cardinality({a})=1

RULE pair_set:
    Object(a)
    ∧ Object(b)
    -> Set({a,b})

RULE union:
    Set(A)
    ∧ Set(B)
    -> A ∪ B = {
        x | x ∈ A OR x ∈ B
    }

RULE intersection:
    Set(A)
    ∧ Set(B)
    -> A ∩ B = {
        x | x ∈ A AND x ∈ B
    }

RULE set_difference:
    Set(A)
    ∧ Set(B)
    -> A \ B = {
        x | x ∈ A AND x ∉ B
    }

RULE symmetric_difference:
    Set(A)
    ∧ Set(B)
    -> A △ B =
       (A \ B) ∪ (B \ A)

RULE complement:
    UniversalSet(U)
    ∧ SUBSET_OF(A,U)
    -> Complement_U(A) = U \ A

RULE disjoint_sets:
    Set(A)
    ∧ Set(B)
    ∧ A ∩ B = ∅
    -> DISJOINT_WITH(A,B)

RULE power_set:
    Set(A)
    -> P(A) = {
        X | X ⊆ A
    }

RULE finite_power_set:
    FiniteSet(A)
    ∧ Cardinality(A)=n
    -> Cardinality(P(A))=2^n

RULE cartesian_product:
    Set(A)
    ∧ Set(B)
    -> A × B = {
        (a,b) | a ∈ A AND b ∈ B
    }

RULE ordered_pair:
    Object(a)
    ∧ Object(b)
    -> OrderedPair(a,b)

RULE relation:
    Set(A)
    ∧ Set(B)
    ∧ R ⊆ A × B
    -> Relation(R,A,B)

RULE function:
    Relation(f,A,B)
    ∧ FOR_ALL a ∈ A [
        EXISTS_UNIQUE b ∈ B [
            (a,b) ∈ f
        ]
    ]
    -> Function(f:A->B)

RULE injection:
    Function(f:A->B)
    ∧ FOR_ALL x,y ∈ A [
        f(x)=f(y) -> x=y
    ]
    -> Injection(f)

RULE surjection:
    Function(f:A->B)
    ∧ FOR_ALL y ∈ B [
        EXISTS x ∈ A [
            f(x)=y
        ]
    ]
    -> Surjection(f)

RULE bijection:
    Injection(f)
    ∧ Surjection(f)
    -> Bijection(f)

RULE equinumerosity:
    Set(A)
    ∧ Set(B)
    ∧ EXISTS bijection f:A->B
    -> EQUINUMEROUS_WITH(A,B)

RULE cardinality_equivalence:
    EQUINUMEROUS_WITH(A,B)
    -> Cardinality(A)=Cardinality(B)

RULE finite_cardinality:
    FiniteSet(A)
    -> HAS_CARDINALITY(A, number_of_distinct_elements(A))

RULE countable:
    Set(A)
    ∧ EXISTS injection f:A->NaturalNumbers
    -> CountableSet(A)

RULE countably_infinite:
    Set(A)
    ∧ EXISTS bijection f:NaturalNumbers->A
    -> CountablyInfiniteSet(A)

RULE uncountable:
    InfiniteSet(A)
    ∧ NOT CountableSet(A)
    -> UncountableSet(A)

RULE partition:
    Set(A)
    ∧ FamilyOfSets(P)
    ∧ FOR_ALL X ∈ P [X != ∅]
    ∧ FOR_ALL X,Y ∈ P [
        X != Y -> X ∩ Y = ∅
    ]
    ∧ UNION(P)=A
    -> PARTITIONS(P,A)

RULE equivalence_relation:
    Relation(R,A,A)
    ∧ Reflexive(R)
    ∧ Symmetric(R)
    ∧ Transitive(R)
    -> EquivalenceRelation(R)

RULE equivalence_class:
    EquivalenceRelation(R)
    ∧ a ∈ A
    -> [a]_R = {
        x ∈ A | x R a
    }

DEFINE MEMBERSHIP_MODEL := {
    positive: "x ∈ A",
    negative: "x ∉ A",
    distinction:
        "membership relates an object to a set and must not be conflated with the subset relation between sets"
}

DEFINE SUBSET_MODEL := {
    subset: "A ⊆ B iff every member of A is a member of B",
    proper_subset: "A ⊂ B iff A ⊆ B and A != B",
    equality: "A = B iff A ⊆ B and B ⊆ A"
}

DEFINE CORE_OPERATIONS := {
    Union: "A ∪ B",
    Intersection: "A ∩ B",
    Difference: "A \ B",
    SymmetricDifference: "A △ B",
    Complement: "U \ A",
    PowerSet: "P(A)",
    CartesianProduct: "A × B"
}

DEFINE AXIOMATIC_CORE := {
    Extensionality,
    Pairing,
    UnionAxiom,
    PowerSetAxiom,
    InfinityAxiom,
    SeparationSchema,
    ReplacementSchema,
    Foundation
}

DEFINE ZFC_MODEL := {
    base_system: ZermeloFraenkelSetTheory,
    extension: AxiomOfChoice,
    expression: "ZFC = ZF + Choice"
}

RULE extensionality_axiom:
    FOR_ALL A,B [
        (FOR_ALL x [
            x ∈ A <=> x ∈ B
        ])
        -> A=B
    ]

RULE pairing_axiom:
    FOR_ALL a,b [
        EXISTS C [
            FOR_ALL x [
                x ∈ C <=> (x=a OR x=b)
            ]
        ]
    ]

RULE union_axiom:
    FOR_ALL A [
        EXISTS U [
            FOR_ALL x [
                x ∈ U
                <=> EXISTS B [
                    B ∈ A AND x ∈ B
                ]
            ]
        ]
    ]

RULE power_set_axiom:
    FOR_ALL A [
        EXISTS P [
            FOR_ALL X [
                X ∈ P <=> X ⊆ A
            ]
        ]
    ]

RULE infinity_axiom:
    EXISTS I [
        ∅ ∈ I
        ∧ FOR_ALL x [
            x ∈ I
            -> x ∪ {x} ∈ I
        ]
    ]

RULE foundation_axiom:
    FOR_ALL nonempty A [
        EXISTS x ∈ A [
            x ∩ A = ∅
        ]
    ]

RULE choice_axiom:
    FamilyOfNonemptySets(F)
    -> EXISTS choice_function c [
        FOR_ALL A ∈ F [
            c(A) ∈ A
        ]
    ]

DEFINE ORDINAL_STRUCTURE := {
    definition:
        "an ordinal is represented in the von Neumann approach as a transitive set well-ordered by membership",
    zero: "0 = ∅",
    successor: "S(α) = α ∪ {α}",
    omega: "ω = set of finite ordinals"
}

DEFINE CARDINAL_STRUCTURE := {
    basis: Equinumerosity,
    finite:
        "cardinality equals the number of distinct elements",
    infinite:
        "cardinality is compared through injections, surjections and bijections"
}

DEFINE EXAMPLE_1 := {
    A: "{1,2,3}",
    B: "{3,4,5}",
    union: "{1,2,3,4,5}",
    intersection: "{3}",
    difference_A_B: "{1,2}"
}

DEFINE EXAMPLE_2 := {
    A: "{a,b}",
    subsets: {
        "∅",
        "{a}",
        "{b}",
        "{a,b}"
    },
    power_set_cardinality: 4
}

DEFINE EXAMPLE_3 := {
    A: "{1,2}",
    B: "{x,y}",
    cartesian_product: {
        "(1,x)",
        "(1,y)",
        "(2,x)",
        "(2,y)"
    }
}

DEFINE SEMANTIC_PIPELINE :=
    MathematicalExpression
    -> ParseSetNotation
    -> IdentifySets
    -> IdentifyElements
    -> ResolveMembership
    -> ResolveSubsetAndEqualityRelations
    -> ApplySetOperations
    -> ConstructOrderedPairs
    -> ConstructRelations
    -> DetectFunctions
    -> DetermineMappingProperties
    -> DetermineCardinality
    -> ApplyAxiomaticConstraints
    -> ReturnSemanticSetStructure

DEFINE REASONING_PIPELINE :=
    InputSetProblem
    -> NormaliseNotation
    -> BuildMembershipGraph
    -> ApplyExtensionality
    -> InferSubsetRelations
    -> EvaluateOperations
    -> EvaluateRelationsAndFunctions
    -> CompareCardinalities
    -> ApplyRelevantAxioms
    -> DeriveConsequences

DEFINE CONSTRUCTION_PIPELINE :=
    EmptySet
    -> SingletonAndPairSets
    -> Unions
    -> PowerSets
    -> CartesianProducts
    -> Relations
    -> Functions
    -> NaturalNumbers
    -> Ordinals
    -> Cardinals
    -> HigherMathematicalStructures

DEFINE ONTOLOGY_RELATIONS := {
    SetTheoryOntology IS_COMPONENT_OF SetTheory,
    SetTheory IS_SUBTYPE_OF MathematicalLogic,
    Set CONTAINS Element,
    Element MEMBER_OF Set,
    Subset SUBSET_OF Set,
    ProperSubset PROPER_SUBSET_OF Set,
    PowerSet CONTAINS Subsets,
    Relation IS_SUBSET_OF CartesianProduct,
    Function IS_SUBTYPE_OF Relation,
    Injection IS_SUBTYPE_OF Function,
    Surjection IS_SUBTYPE_OF Function,
    Bijection IS_SUBTYPE_OF Function,
    Cardinality DEPENDS_ON Equinumerosity,
    Partition PARTITIONS Set,
    EquivalenceClass DEPENDS_ON EquivalenceRelation,
    ZFC DEPENDS_ON ZermeloFraenkelSetTheory,
    ZFC CONTAINS AxiomOfChoice
}

DEFINE SEMANTIC_EQUIVALENCE := {
    "set theory ontology" <=> SetTheoryOntology,
    "set theory" <=> SetTheory,
    "element of" <=> MEMBER_OF,
    "member of" <=> MEMBER_OF,
    "subset of" <=> SUBSET_OF,
    "proper subset" <=> PROPER_SUBSET_OF,
    "power set" <=> PowerSet,
    "Cartesian product" <=> CartesianProduct,
    "same cardinality" <=> Equinumerosity WHEN set_context=TRUE,
    "ZF" <=> ZermeloFraenkelSetTheory,
    "ZFC" <=> "ZF + Axiom of Choice"
}

DEFINE AI_CONSUMPTION := {
    purpose: "machine-readable ontology for foundational set-theoretic entities, operations and axioms",
    preserve_set_identity: TRUE,
    preserve_element_identity: TRUE,
    distinguish_membership_from_subset: TRUE,
    enforce_extensional_equality: TRUE,
    preserve_operation_semantics: TRUE,
    preserve_order_in_ordered_pairs: TRUE,
    distinguish_relation_from_function: TRUE,
    support_mapping_classification: TRUE,
    support_cardinality_reasoning: TRUE,
    support_axiomatic_reasoning: TRUE,
    support_recursive_set_construction: TRUE,
    distinguish_ZF_from_ZFC: TRUE,
    reasoning_mode: "symbolic + extensional + axiomatic + relational"
}

DEFINE CONFIDENCE := {
    ontology_identity: 1.00,
    membership_mapping: 0.99,
    subset_mapping: 0.99,
    extensional_equality: 0.99,
    finite_set_operations: 0.99,
    relation_function_classification: 0.99,
    finite_cardinality: 0.99,
    infinite_cardinality_reasoning: context_dependent,
    axiomatic_reasoning: axiom_system_dependent
}

DEFINE UPDATE_MODEL := {
    version: "1.0",
    update_policy: "append-compatible",
    immutable_core: {
        membership_relation,
        extensionality,
        subset_relation,
        core_set_operations,
        cartesian_product,
        relation_definition,
        function_definition,
        cardinality_via_bijection
    },
    extensible_layers: {
        alternative_axiomatic_set_theories,
        ZF,
        ZFC,
        NBG,
        MK_set_theory,
        ordinal_arithmetic,
        cardinal_arithmetic,
        forcing,
        large_cardinals,
        descriptive_set_theory
    }
}

DEFINE FLOW_HASH_INPUT :=
    CanonicalURL
    + DOMAIN
    + ENTITY_TYPES
    + RELATION_TYPES
    + RULES
    + MEMBERSHIP_MODEL
    + SUBSET_MODEL
    + CORE_OPERATIONS
    + AXIOMATIC_CORE
    + ZFC_MODEL
    + ORDINAL_STRUCTURE
    + CARDINAL_STRUCTURE
    + SEMANTIC_PIPELINE
    + REASONING_PIPELINE
    + CONSTRUCTION_PIPELINE
    + ONTOLOGY_RELATIONS
    + AI_CONSUMPTION
    + UPDATE_MODEL

FLOW_HASH := HASH(FLOW_HASH_INPUT)

RETURN {
    ontology: SetTheoryOntology,
    canonical_url: "https://kirethresearch.org/booksai-core/ontologies/mathematical-ontologies/mathematical-logic-ontologies/set-theory/set-theory-ontology.html",
    parent_domain: SetTheory,
    semantic_domain: MathematicalLogic,
    primary_entity: Set,
    membership_sensitive: TRUE,
    extensional_reasoning_enabled: TRUE,
    axiomatic_reasoning_enabled: TRUE,
    machine_consumable: TRUE,
    recursive_reasoning_enabled: TRUE,
    flow_complete: TRUE
}

END_FLOW
Kireth Research
38 Thorndale Croft, Wetwang, Driffield
East Riding of Yorkshire YO25 9XZ