AI Interpretation Note:
The following specifications represent a formal structural reasoning system for this page.
Execute as formal rules, not pseudocode.
FLOW ALGEBRA
SET ONTOLOGY
Kireth Semantic Library | Entity Graph | Mathematical Entities | Set Entities
Source: https://kirethresearch.org/booksai-core/entity-graph/mathematical-entities/set-entities/set-ontology-3.html
Authors: Mark Higgins — Sky (Recursive AI)
Status: Mathematical specification; source page content not independently verified.
Version: 1.0 | Date: 2026-10-13
01. PURPOSE
flow "SetOntology" v1.0
intent: represent sets, membership, construction, operations and deductions
domain: axiomatic set theory and mathematical knowledge representation
semantics: classical extensional sets; foundational assumptions explicit
02. CORE TYPES
Set := extensional collection in a declared foundational universe
Element := entity eligible for membership in a Set
Predicate := expression mapping an admissible element to a truth value
Relation := subset of a Cartesian product
FamilyOfSets := indexed collection of sets
Cardinal := equivalence class under bijection, or cardinal representative
Truth := {true, false, unknown}
03. ENTITY SCHEMA
SetEntity:
id: stable_identifier
notation: optional_string
members: optional_finite_enumeration
defining_predicate: optional_formula
ambient_domain: optional_SetEntity
cardinality: optional_Cardinal
construction: enum[enumeration, comprehension, union, intersection,
difference, power_set, cartesian_product, image, other]
foundation: enum[ZF, ZFC, typed_set_theory, specified_other]
provenance: optional_source
confidence: optional_number_in_[0,1]
04. MEMBERSHIP AND EXTENSIONALITY
MEMBER(x,A) := x ∈ A
NOT_MEMBER(x,A) := x ∉ A
EXTENSIONAL_EQUAL(A,B) := forall x (x ∈ A iff x ∈ B)
rule EXTENSIONAL_EQUAL(A,B) -> A = B
rule A = B -> forall x (x ∈ A iff x ∈ B)
caution: membership and subset are different relations
05. SUBSET AND PROPER SUBSET
SUBSET(A,B) := forall x (x ∈ A -> x ∈ B)
PROPER_SUBSET(A,B) := SUBSET(A,B) and A != B
rule SUBSET(A,A)
rule SUBSET(A,B) and SUBSET(B,C) -> SUBSET(A,C)
rule SUBSET(A,B) and SUBSET(B,A) -> A = B
06. EMPTY AND SINGLETON SETS
EMPTY := unique set with no members
rule forall x NOT_MEMBER(x,EMPTY)
rule forall A SUBSET(EMPTY,A)
SINGLETON(x) := {x}
rule MEMBER(y,SINGLETON(x)) iff y = x
distinguish: EMPTY != {EMPTY}
07. PAIRING AND FINITE ENUMERATION
PAIR(x,y) := {x,y}
ENUMERATE(x1,...,xn) := set containing exactly listed members
invariant: repetitions do not create distinct set members
invariant: member order does not affect extensional identity
08. UNION AND INTERSECTION
UNION(A,B) := {x | x ∈ A or x ∈ B}
INTERSECTION(A,B) := {x | x ∈ A and x ∈ B}
rule UNION(A,EMPTY) = A
rule INTERSECTION(A,EMPTY) = EMPTY
rule UNION(A,A) = A
rule INTERSECTION(A,A) = A
rule UNION(A,B) = UNION(B,A)
rule INTERSECTION(A,B) = INTERSECTION(B,A)
rule INTERSECTION(A,UNION(B,C)) = UNION(INTERSECTION(A,B),INTERSECTION(A,C))
09. DIFFERENCE AND COMPLEMENT
DIFFERENCE(A,B) := {x | x ∈ A and x ∉ B}
COMPLEMENT(A,U) := DIFFERENCE(U,A) provided SUBSET(A,U)
rule DIFFERENCE(A,EMPTY) = A
rule DIFFERENCE(A,A) = EMPTY
rule COMPLEMENT(COMPLEMENT(A,U),U) = A when SUBSET(A,U)
caution: complement requires an explicit ambient universe U
10. SYMMETRIC DIFFERENCE
SYM_DIFF(A,B) := UNION(DIFFERENCE(A,B),DIFFERENCE(B,A))
rule SYM_DIFF(A,A) = EMPTY
rule SYM_DIFF(A,EMPTY) = A
11. POWER SET
POWER_SET(A) := {B | SUBSET(B,A)}
rule MEMBER(EMPTY,POWER_SET(A))
rule MEMBER(A,POWER_SET(A))
rule finite(A) and |A|=n -> |POWER_SET(A)|=2^n
theorem: |POWER_SET(A)| > |A| for every set A (Cantor)
12. CARTESIAN PRODUCT
CARTESIAN(A,B) := {(a,b) | a ∈ A and b ∈ B}
ordered_pair: (a,b) distinguishes order
rule CARTESIAN(A,EMPTY) = EMPTY
rule finite(A) and finite(B) -> |CARTESIAN(A,B)|=|A|*|B|
13. SET BUILDER CONSTRUCTION
SEPARATION(A,P) := {x ∈ A | P(x)}
requirement: predicate P must be well-formed in the foundation
caution: unrestricted comprehension is not permitted in ZF/ZFC
reason: avoids Russell-style inconsistency
14. INDEXED SET FAMILIES
BIG_UNION(F) := {x | exists A ∈ F: x ∈ A}
BIG_INTERSECTION(F) := {x | forall A ∈ F: x ∈ A}
caution: intersection of an empty family requires an ambient domain
INDEXED_UNION(I,A_i) := {x | exists i ∈ I: x ∈ A_i}
15. FINITENESS AND CARDINALITY
FINITE(A) := A bijective with {0,...,n-1} for some n >= 0
EQUINUMEROUS(A,B) := exists bijection f:A -> B
COUNTABLE(A) := A finite or bijective with a subset of natural numbers
INFINITE(A) := not FINITE(A)
rule finite(A) and SUBSET(B,A) -> finite(B)
caution: comparisons of infinite cardinalities may depend on axioms
16. DISJOINTNESS AND PARTITIONS
DISJOINT(A,B) := INTERSECTION(A,B) = EMPTY
PARTITION(P,A) := each B ∈ P is nonempty and SUBSET(B,A),
distinct blocks are disjoint, and BIG_UNION(P)=A
rule PARTITION(P,A) -> every x ∈ A belongs to exactly one block of P
17. RELATIONS AND FUNCTIONS
RELATION(R,A,B) := SUBSET(R,CARTESIAN(A,B))
FUNCTION(f,A,B) := RELATION(f,A,B) and
forall a ∈ A exists exactly one b ∈ B: (a,b) ∈ f
IMAGE(f,S) := {f(x) | x ∈ S}, for S subset domain(f)
PREIMAGE(f,T) := {x ∈ domain(f) | f(x) ∈ T}
18. KNOWLEDGE GRAPH RELATIONSHIPS
Set --hasMember--> Element
Set --isSubsetOf--> Set
Set --isProperSubsetOf--> Set
Set --isDisjointFrom--> Set
Set --hasCardinality--> Cardinal
Set --hasPowerSet--> Set
Set --hasUnionWith--> Set
Set --hasIntersectionWith--> Set
Set --definedBy--> Predicate
Set --usesFoundation--> Foundation
Set --derivedFrom--> Source
19. SEMANTIC EQUIVALENCE
SEMANTIC_EQUIVALENCE(A,B) := EXTENSIONAL_EQUAL(A,B)
equivalent_notations: {1,2} = {2,1} = {1,1,2}
distinguish: equal sets versus equal cardinality
distinguish: element-of versus subset-of
canonicalisation: normalise finite enumeration by unique members
caution: symbolic equality may require a proof or declared assumptions
20. INFERENCE RULES
infer MEMBER(x,A) and SUBSET(A,B) -> MEMBER(x,B)
infer MEMBER(x,INTERSECTION(A,B)) -> MEMBER(x,A) and MEMBER(x,B)
infer MEMBER(x,UNION(A,B)) -> MEMBER(x,A) or MEMBER(x,B)
infer MEMBER(x,DIFFERENCE(A,B)) -> MEMBER(x,A) and NOT_MEMBER(x,B)
infer SUBSET(A,B) -> INTERSECTION(A,B)=A
infer DISJOINT(A,B) -> INTERSECTION(A,B)=EMPTY
inference_policy: never infer nonmembership from missing graph edges
21. VALIDATION
check every member belongs to the declared ambient domain if supplied
check construction operands are sets
check type of membership arguments
check subset and extensional equality proofs or finite enumerations
check complements have an ambient universe
check cardinality assertions have a proof, computation, or citation
check source provenance and foundation assumptions
three_valued_policy: unresolved assertions are unknown, not false
22. CONFIDENCE AND PROVENANCE
CONFIDENCE(assertion) in [0,1]
axiomatic_verified: confidence 1 under explicitly stated axioms
proof_verified: confidence 1 conditional on verified premises
source_reported: confidence depends on source reliability
unresolved: retain unknown status and record missing evidence
provenance_fields: source_uri, author, timestamp, derivation, assumptions
23. FLOW HASH AND UPDATE MODEL
FLOW_HASH := SHA256(canonical_utf8(ontology_version, axioms,
definitions, rules, entity_relations))
note: hash computed at publication, not invented in this specification
UPDATE_MODEL:
preserve stable entity identifiers
increment version for semantic changes
record change log and previous hash
rerun validation and inference regression tests
invalidate derived claims when premises change
24. AI CONSUMPTION
inputs: typed sets, membership claims, predicates, assumptions
outputs: typed set entities, derived relations, proof traces, uncertainty
process: parse -> typecheck -> normalise -> infer -> validate -> publish
guardrails: distinguish closed-world data from open-world knowledge
guardrails: prevent paradoxical unrestricted comprehension
guardrails: never fabricate membership or proof status
interoperability: RDF/OWL representation where expressivity permits;
use formal logic or theorem provers for full set theory
25. TEST CASES
assert UNION({1,2},{2,3}) = {1,2,3}
assert INTERSECTION({1,2},{2,3}) = {2}
assert DIFFERENCE({1,2},{2}) = {1}
assert POWER_SET({1,2}) = {EMPTY,{1},{2},{1,2}}
assert SUBSET(EMPTY,{1})
assert not MEMBER(EMPTY,EMPTY)
assert MEMBER(EMPTY,{EMPTY})
assert {1,2} = {2,1,1}
assert not ({1} = 1)
END FLOW ALGEBRA