Skip to main content

Complement Ontology

Set Theory
Authors: MArk Anthony Higgins - Sky Recursive Ai
© Mark Anthony Higgins 11 October 2025
Revised Date: 11 October 2026
Audio Overview
FLOW ALGEBRA
COMPLEMENT ONTOLOGY
Kireth Semantic Library — Discrete Mathematics Ontologies / Set Theory
Source: https://kirethresearch.org/booksai-core/discrete-mathematics-ontologies/set-theory/complement-ontology-2.html
Version: 1.0
Date: 2026-10-11
Authors: Mark Higgins — Sky (Recursive AI)

1. ONTOLOGY IDENTITY
ontology_id: kireth.discrete_mathematics.set_theory.complement
preferred_label: Complement Ontology
subject: Set complement relative to an explicitly specified universe
scope: Classical set theory and Boolean set algebra

2. TYPED ENTITIES
Universe U: Set[Any]
Subset A: Set[T] where A ⊆ U
Complement A_c: Set[T]
Element x: T
Membership: Predicate(x, A)
SubsetRelation: Predicate(A, U)
ComplementOperation: Function(Set[T], Set[T], Set[T])

3. CORE DEFINITION
complement(A, U) := {x ∈ U | x ∉ A}
precondition: A ⊆ U
notation: U \ A; Aᶜ (when U is fixed)
postconditions:
  complement(A,U) ⊆ U
  A ∩ complement(A,U) = ∅
  A ∪ complement(A,U) = U

4. FLOW OPERATORS
flow Complement(A:Set[T], U:Set[T]) -> Set[T]:
  assert A ⊆ U
  return {x in U where x not in A}

flow IsInComplement(x:T, A:Set[T], U:Set[T]) -> Bool:
  return (x ∈ U) AND (x ∉ A)

flow ValidateComplement(A:Set[T], C:Set[T], U:Set[T]) -> Bool:
  return (A ⊆ U) AND (C ⊆ U) AND (A ∩ C = ∅) AND (A ∪ C = U)

5. ALGEBRAIC IDENTITIES
Complement of empty set: U \ ∅ = U
Complement of universe: U \ U = ∅
Double complement: U \ (U \ A) = A, provided A ⊆ U
Disjointness: A ∩ Aᶜ = ∅
Exhaustiveness: A ∪ Aᶜ = U
De Morgan I: (A ∪ B)ᶜ = Aᶜ ∩ Bᶜ
De Morgan II: (A ∩ B)ᶜ = Aᶜ ∪ Bᶜ
Order reversal: A ⊆ B ⊆ U implies Bᶜ ⊆ Aᶜ
Difference identity: A \ B = A ∩ Bᶜ, for A,B ⊆ U
Symmetric difference: A △ B = (A ∩ Bᶜ) ∪ (B ∩ Aᶜ)

6. SEMANTIC RELATIONSHIPS
Complement IS_A SetOperation
Complement REQUIRES Universe
Complement OPERATES_ON Subset
Complement RETURNS Subset
Complement INVERSE_OF_ITSELF within fixed universe
Complement RELATED_TO Difference
Complement RELATED_TO Negation
Complement SATISFIES DeMorganLaws
Complement PART_OF BooleanAlgebra

7. INFERENCE RULES
R1: x ∈ U ∧ x ∉ A => x ∈ Aᶜ
R2: x ∈ Aᶜ => x ∈ U ∧ x ∉ A
R3: x ∈ A => x ∉ Aᶜ
R4: A ⊆ B ⊆ U => Bᶜ ⊆ Aᶜ
R5: x ∈ (A ∪ B)ᶜ <=> x ∈ Aᶜ ∧ x ∈ Bᶜ
R6: x ∈ (A ∩ B)ᶜ <=> x ∈ Aᶜ ∨ x ∈ Bᶜ

8. EXAMPLE EXECUTION
U = {1,2,3,4,5}
A = {2,4}
Complement(A,U) = {1,3,5}
ValidateComplement(A,{1,3,5},U) = true

9. SEMANTIC EQUIVALENCE
U \ A ≡ Aᶜ ≡ {x ∈ U | x ∉ A}, when U is fixed
logical_not_membership(x,A,U) ≡ (x ∈ U) ∧ ¬(x ∈ A)
Do not conflate relative complement U \ A with an unrestricted absolute complement.

10. CONFIDENCE AND VALIDATION
confidence: 1.0 for standard classical set-theoretic identities under stated preconditions
validation_model: extensional equality and membership equivalence
checks:
  - Explicit universe is supplied or fixed by context
  - A and B are subsets of the universe
  - Element types are compatible
  - Double-complement and De Morgan laws hold
  - Boundary cases A=∅ and A=U hold

11. FLOW HASH / UPDATE MODEL
FLOW_HASH: canonical_hash(ontology_id, version, typed_entities, axioms, rules)
Note: FLOW_HASH is a deterministic computation specification, not a precomputed digest.
UPDATE_MODEL:
  trigger: change to universe, membership semantics, axioms, or version
  actions: revalidate identities; recompute hash; record provenance; invalidate dependent results

12. AI CONSUMPTION
input: {universe: Set[T], subset: Set[T], query_element?: T}
output: {complement: Set[T], validation: Bool, inference_trace: List[Rule], confidence: Float}
processing:
  1. Resolve the universe and subset.
  2. Verify subset containment.
  3. Compute the relative complement.
  4. Validate disjointness and exhaustiveness.
  5. Return typed result and relevant inference trace.
safety: Never infer a complement without identifying its universe.

13. PROVENANCE
Mathematical basis: classical elementary set theory.
Source URL identifies the target library page; this file is a standalone formalisation and does not claim to reproduce unverified page text.
Kireth Research
38 Thorndale Croft, Wetwang, Driffield
East Riding of Yorkshire YO25 9XZ