FLOW ALGEBRA
MATHEMATICAL RELATION ONTOLOGY
Kireth Semantic Library | Entity Graph > Mathematical Entities > Foundations
Source: https://kirethresearch.org/booksai-core/entity-graph/mathematical-entities/foundations-of-mathematical-entities/mathematical-relation-ontology-2.html
Authors: Mark Higgins — Sky (Recursive AI)
Version: 1.0 | 2026-10-12
Status: Subject-based formalisation; source page content not independently verified.
01. PURPOSE
flow MathematicalRelationOntology v1.0:
intent: represent, validate, compose and infer mathematical relations
scope: finite/infinite sets, n-ary relations, orders, equivalences, functions, graph relations
logic: typed first-order logic with explicitly stated assumptions
02. TYPES
Entity := MathematicalObject
Set[T] := collection of elements of type T
Tuple[T1,...,Tn] := ordered n-tuple
Relation[A,B] := subset(A × B)
NaryRelation[T1,...,Tn] := subset(T1 × ... × Tn)
Predicate[A,B] := (A,B) -> Boolean
Proof := {premises, derivation, conclusion, system}
Evidence := {source, method, timestamp?, limitations}
TruthStatus := PROVED | DISPROVED | UNKNOWN | INCONSISTENT
03. CORE ENTITIES
MathematicalRelation {id, arity, domains, extension?, predicate?, provenance}
RelationInstance {relation_id, arguments, truth_status, proof?}
RelationProperty {name, domain_constraints, verification_method}
RelationComposition {left_relation, right_relation, result_relation}
RelationGraph {vertices, directed_edges, labels}
EquivalenceClass {relation, representative, members}
QuotientSet {base_set, equivalence_relation, classes}
PartialOrder {carrier, relation}
04. SEMANTIC RELATIONSHIPS
MathematicalRelation --HAS_DOMAIN--> Set
MathematicalRelation --HAS_CODOMAIN--> Set
MathematicalRelation --HAS_ARITY--> NaturalNumber
RelationInstance --INSTANCE_OF--> MathematicalRelation
RelationInstance --RELATES--> MathematicalObject
MathematicalRelation --SATISFIES--> RelationProperty
MathematicalRelation --COMPOSES_WITH--> MathematicalRelation
MathematicalRelation --REPRESENTED_BY--> Predicate | Matrix | Graph
EquivalenceClass --PARTITIONS--> Set
PartialOrder --INDUCES--> HasseDiagram
05. MEMBERSHIP SEMANTICS
R ⊆ A × B
R(a,b) ⇔ (a,b) ∈ R
dom(R) = {a ∈ A | ∃b ∈ B: R(a,b)}
ran(R) = {b ∈ B | ∃a ∈ A: R(a,b)}
inverse(R) = {(b,a) | (a,b) ∈ R}
identity(A) = {(a,a) | a ∈ A}
06. RELATION OPERATIONS
union(R,S) = R ∪ S requires same ambient product
intersect(R,S) = R ∩ S requires same ambient product
difference(R,S) = R \ S requires same ambient product
complement(R) = (A × B) \ R requires declared A and B
compose(S,R) = {(a,c) | ∃b: R(a,b) ∧ S(b,c)}
restrict(R,C,D) = R ∩ (C × D)
07. RELATION PROPERTIES (R ⊆ A × A)
reflexive(R) ⇔ ∀a∈A: R(a,a)
irreflexive(R) ⇔ ∀a∈A: ¬R(a,a)
symmetric(R) ⇔ ∀a,b∈A: R(a,b) ⇒ R(b,a)
antisymmetric(R) ⇔ ∀a,b∈A: (R(a,b) ∧ R(b,a)) ⇒ a=b
asymmetric(R) ⇔ ∀a,b∈A: R(a,b) ⇒ ¬R(b,a)
transitive(R) ⇔ ∀a,b,c∈A: (R(a,b) ∧ R(b,c)) ⇒ R(a,c)
total(R) ⇔ ∀a,b∈A: a≠b ⇒ (R(a,b) ∨ R(b,a))
08. SPECIAL RELATIONS
equivalence(R) ⇔ reflexive(R) ∧ symmetric(R) ∧ transitive(R)
preorder(R) ⇔ reflexive(R) ∧ transitive(R)
partial_order(R) ⇔ preorder(R) ∧ antisymmetric(R)
total_order(R) ⇔ partial_order(R) ∧ total(R)
strict_partial_order(R) ⇔ irreflexive(R) ∧ transitive(R)
tolerance(R) ⇔ reflexive(R) ∧ symmetric(R)
note: tolerance need not be transitive
09. EQUIVALENCE CLASSES
requires equivalence(R) on A
class_R(a) = {x ∈ A | R(x,a)}
quotient(A,R) = {class_R(a) | a ∈ A}
rule: R(a,b) ⇒ class_R(a) = class_R(b)
rule: ¬R(a,b) ⇒ class_R(a) ∩ class_R(b) = ∅
invariant: quotient classes are nonempty and partition A
10. FUNCTIONS AS RELATIONS
functional(R) ⇔ ∀a,b1,b2: (R(a,b1) ∧ R(a,b2)) ⇒ b1=b2
total_on_A(R) ⇔ ∀a∈A: ∃b∈B: R(a,b)
function_A_to_B(R) ⇔ functional(R) ∧ total_on_A(R)
injective(R) ⇔ function_A_to_B(R) ∧ ∀a1,a2,b: (R(a1,b) ∧ R(a2,b)) ⇒ a1=a2
surjective(R) ⇔ function_A_to_B(R) ∧ ∀b∈B: ∃a∈A: R(a,b)
bijective(R) ⇔ injective(R) ∧ surjective(R)
11. CLOSURE OPERATIONS
reflexive_closure(R) = R ∪ identity(A)
symmetric_closure(R) = R ∪ inverse(R)
transitive_closure(R) = R+ = ⋃_{n≥1} R^n
reflexive_transitive_closure(R) = R* = identity(A) ∪ R+
note: composition powers are well-typed on A × A
12. GRAPH REPRESENTATION
directed_graph(R) = (A, {(a,b) | R(a,b)})
adjacency_matrix[i,j] = 1 iff R(ai,aj)
path(a,b) ⇔ R+(a,b)
strongly_connected(a,b) ⇔ R*(a,b) ∧ R*(b,a)
note: graph algorithms require explicit finiteness for termination guarantees
13. INFERENCE RULES
[REFLEXIVITY] reflexive(R), a∈A ⊢ R(a,a)
[SYMMETRY] symmetric(R), R(a,b) ⊢ R(b,a)
[TRANSITIVITY] transitive(R), R(a,b), R(b,c) ⊢ R(a,c)
[ANTISYMMETRY] antisymmetric(R), R(a,b), R(b,a) ⊢ a=b
[COMPOSITION] R(a,b), S(b,c) ⊢ compose(S,R)(a,c)
[EQUIVALENCE] equivalence(R), R(a,b) ⊢ class_R(a)=class_R(b)
guard: never infer R(a,c) from two edges without transitivity or composition semantics
14. VALIDATION
check arity and argument type for every relation instance
check declared carrier set before evaluating reflexivity/order properties
check domain/codomain compatibility before composition
check proof obligations or produce explicit counterexamples
distinguish open-world UNKNOWN from closed-world false
preserve proof system and assumptions
15. UNCERTAINTY AND CONFIDENCE
CONFIDENCE: {score: Real[0,1], method, evidence_refs, calibration_status}
formal_theorem: proof_status takes precedence over probabilistic confidence
empirical_relation: confidence estimates evidential support, not logical truth
avoid assigning confidence=1 without a valid proof or stipulated axiom
16. SEMANTIC_EQUIVALENCE
equivalent_relation_descriptions(R,S) requires:
compatible typed domains AND ∀arguments: (R(arguments) ↔ S(arguments))
alias labels alone do not establish extensional equivalence
isomorphism of relation structures does not imply identical carriers
17. PROVENANCE
record source_uri, source_version, derivation, assumptions, observation_time
distinguish AXIOM, DEFINITION, THEOREM, EMPIRICAL_ASSERTION, HYPOTHESIS
record counterexamples and revision history
18. FLOW_HASH
FLOW_HASH := SHA256(canonical_serialisation({
ontology_id, version, types, axioms, definitions, rules, dependencies
}))
exclude volatile timestamps from canonical payload unless semantically required
canonicalise ordering, whitespace and Unicode before hashing
19. UPDATE_MODEL
on update:
validate_types()
recheck_affected_properties()
invalidate_dependent_proofs_if_axioms_change()
regenerate_equivalence_classes_if_relation_changes()
recompute_FLOW_HASH()
record_version_and_provenance()
20. AI_CONSUMPTION
output:
ontology: MathematicalRelationOntology
entity_types: [MathematicalRelation, RelationInstance, RelationProperty,
EquivalenceClass, PartialOrder]
inference_mode: proof-aware, typed, provenance-preserving
ambiguity_policy: request domain and relation definition when missing
truth_policy: distinguish PROVED, DISPROVED, UNKNOWN, INCONSISTENT
semantic_interoperability: graph, predicate, set-theoretic representation
21. EXECUTION EXAMPLE
let A = {1,2,3}
let R = {(1,1),(2,2),(3,3),(1,2),(2,3),(1,3)}
assert reflexive(R) = true
assert antisymmetric(R) = true
assert transitive(R) = true
assert total_order(R) = true
assert symmetric(R) = false
counterexample symmetric(R): R(1,2) ∧ ¬R(2,1)
22. SAFETY AND LIMITATIONS
symbolic inference requires sound axioms and valid proof rules
undecidable or infinite-domain checks may not terminate
incomplete observations must not be treated as definitive negatives
source webpage may define narrower terminology than this expansion
END FLOW ALGEBRA
Download Code
Copy to Clipboard