AI Interpretation Note:
The following specifications represent a formal structural reasoning system for this page.
Execute as formal rules, not pseudocode.
FLOW ALGEBRA
BINARY RELATION ONTOLOGY
Kireth Semantic Library | Entity Graph | Mathematical Entities | Relation Entities
Source: https://kirethresearch.org/booksai-core/entity-graph/mathematical-entities/relation-entities/binary-relation-ontology-2.html
Authors: Mark Higgins — Sky (Recursive AI)
Version: 1.0 | Date: 2026-10-13
Source status: Formal mathematical specification; source webpage not independently verified.
01. ONTOLOGY IDENTITY
flow "BinaryRelationOntology" v1.0
namespace: kireth.entity_graph.mathematical_entities.relation_entities
entity_type: BinaryRelation
parent: MathematicalRelationEntity
purpose: Represent, validate, transform and reason about binary relations between two sets.
02. CORE DEFINITION
Given sets A and B, a binary relation R from A to B is a subset R ⊆ A × B.
R(a,b) ⇔ (a,b) ∈ R.
A relation on A is R ⊆ A × A.
Ordered-pair direction is significant: R(a,b) need not imply R(b,a).
03. TYPED ENTITY SCHEMA
BinaryRelation:
id: IRI
name: string
source_set: SetRef (A)
target_set: SetRef (B)
pairs: Set[OrderedPair[A,B]]
definition: Predicate[A,B] optional
universe: CartesianProduct[A,B]
provenance: SourceRef
confidence: ConfidenceRecord
version: string
invariant: ∀(a,b)∈pairs, a∈A ∧ b∈B.
04. MEMBERSHIP AND EXTENSION
holds(R,a,b) := (a,b)∈R.
extension(R) := {(a,b)∈A×B | holds(R,a,b)}.
Equal(R,S) iff source and target types agree and extensions coincide.
Intensional definitions may differ while extensions are equal on a fixed universe.
05. DOMAIN, IMAGE, FIBRES
domain(R) := {a∈A | ∃b∈B: R(a,b)}.
range(R) := {b∈B | ∃a∈A: R(a,b)}.
image(R,X) := {b∈B | ∃a∈X: R(a,b)} for X⊆A.
preimage(R,Y) := {a∈A | ∃b∈Y: R(a,b)} for Y⊆B.
forward_fibre(R,a) := {b∈B | R(a,b)}.
backward_fibre(R,b) := {a∈A | R(a,b)}.
The declared source_set and target_set need not equal the effective domain and range.
06. RELATION OPERATIONS
inverse(R) := {(b,a)∈B×A | (a,b)∈R}.
complement(R) := (A×B)\R (relative to declared A×B).
union(R,S) := R∪S for R,S⊆A×B.
intersection(R,S) := R∩S.
difference(R,S) := R\S.
compose(S,R) := {(a,c) | ∃b∈B: R(a,b)∧S(b,c)} for R⊆A×B, S⊆B×C.
identity(A) := {(a,a) | a∈A}.
07. ALGEBRAIC LAWS
inverse(inverse(R)) = R.
inverse(compose(S,R)) = compose(inverse(R),inverse(S)).
compose(T,compose(S,R)) = compose(compose(T,S),R).
compose(R,identity(A)) = R and compose(identity(B),R) = R for R⊆A×B.
Composition distributes over union where types match.
08. ENDORELATION PROPERTIES
For R⊆A×A:
reflexive: ∀a∈A, R(a,a).
irreflexive: ∀a∈A, ¬R(a,a).
symmetric: ∀a,b∈A, R(a,b)⇒R(b,a).
antisymmetric: ∀a,b∈A, (R(a,b)∧R(b,a))⇒a=b.
asymmetric: ∀a,b∈A, R(a,b)⇒¬R(b,a).
transitive: ∀a,b,c∈A, (R(a,b)∧R(b,c))⇒R(a,c).
connected_on_distinct: ∀a≠b∈A, R(a,b)∨R(b,a).
These properties are not automatically applicable to heterogeneous R⊆A×B.
09. RELATION CLASSES
equivalence_relation := reflexive ∧ symmetric ∧ transitive.
preorder := reflexive ∧ transitive.
partial_order := reflexive ∧ antisymmetric ∧ transitive.
strict_partial_order := irreflexive ∧ transitive.
total_order := partial_order ∧ connected_on_distinct.
strict_total_order := asymmetric ∧ transitive ∧ connected_on_distinct.
10. FUNCTIONALITY
right_unique(R): ∀a,b1,b2, R(a,b1)∧R(a,b2)⇒b1=b2.
left_total(R): ∀a∈A, ∃b∈B: R(a,b).
function_graph(R): right_unique(R)∧left_total(R).
left_unique(R): ∀a1,a2,b, R(a1,b)∧R(a2,b)⇒a1=a2.
right_total(R): ∀b∈B, ∃a∈A: R(a,b).
A total function A→B corresponds to a left-total, right-unique relation.
11. FINITE REPRESENTATIONS
pair_list: explicit ordered pairs.
boolean_matrix: M[i,j]=1 iff R(ai,bj), with fixed enumerations.
directed_bipartite_graph: edges from A to B.
predicate: logical condition on (a,b).
Lossless conversion requires complete universe, element identities and ordering metadata.
12. RELATIONAL REASONING RULES
R(a,b) ⇒ inverse(R)(b,a).
R(a,b)∧S(b,c) ⇒ compose(S,R)(a,c).
reflexive(R)∧a∈A ⇒ R(a,a).
symmetric(R)∧R(a,b) ⇒ R(b,a).
transitive(R)∧R(a,b)∧R(b,c) ⇒ R(a,c).
R⊆S∧R(a,b) ⇒ S(a,b).
Do not infer closed-world negation from absent pairs unless completeness is asserted.
13. CLOSURES
reflexive_closure(R) := R∪identity(A).
symmetric_closure(R) := R∪inverse(R).
transitive_closure(R) := union of R^n for n≥1 on A.
reflexive_transitive_closure(R) := identity(A)∪transitive_closure(R).
For finite A, reachability algorithms can compute transitive closure.
14. SEMANTIC_EQUIVALENCE
exact: same typed source/target sets and same ordered-pair extension.
alpha_renaming: bound variable names in predicates may differ without changing extension.
representation_equivalence: pair-list, matrix, graph and predicate agree under fixed mappings.
not_equivalent: R and inverse(R) generally differ; source/target swaps matter.
context_sensitive: predicate equivalence requires an explicit interpretation and universe.
15. KNOWLEDGE GRAPH
nodes: BinaryRelation, Set, Element, OrderedPair, Predicate, Property, Proof, Source.
edges: HAS_SOURCE_SET, HAS_TARGET_SET, CONTAINS_PAIR, RELATES_FROM, RELATES_TO,
HAS_PROPERTY, INVERSE_OF, COMPOSES_WITH, SUBRELATION_OF, DEFINED_BY,
DERIVED_FROM, VERIFIED_BY.
All relationship predicates are typed and direction-preserving.
16. CONSTRAINTS AND VALIDATION
validate_source_target: every pair belongs to A×B.
validate_order: ordered pairs must not be treated as unordered sets.
validate_inverse: inverse swaps both pairs and declared source/target.
validate_composition: target(R)=source(S) or provide an explicit typed bridge.
validate_property: property checks use declared A, including isolated elements.
validate_complement: require explicit universe A×B.
validate_duplicates: extension is a set, so duplicate pair entries collapse.
17. EXAMPLES
A={1,2,3}; B={x,y}; R={(1,x),(2,x),(2,y)}.
domain(R)={1,2}; range(R)={x,y}.
inverse(R)={(x,1),(x,2),(y,2)}.
R is not a total function A→B: 3 has no image and 2 has two images.
On integers, aRb iff a≤b is a total order.
On integers, aRb iff a-b is divisible by 3 is an equivalence relation.
18. CONFIDENCE
mathematical_axioms: 1.0 when interpreted in classical set theory.
computed_property: 1.0 only after valid exhaustive proof/check.
heuristic_inference: labelled and calibrated separately.
source_alignment: unverified until webpage content is checked.
Never confuse confidence in an assertion with its logical truth value.
19. FLOW_HASH
canonicalise: namespace, schema, typed sets, pair extension or normalised predicate,
assumptions, rules, version and provenance.
hash_input: canonical UTF-8 serialisation with stable ordering.
FLOW_HASH: SHA-256(hash_input), computed by an implementation, not fabricated here.
Changes in domain, codomain, pair extension or assumptions require a new hash.
20. UPDATE_MODEL
immutable_revision: preserve prior versions and provenance.
trigger: source revision, relation extension update, type correction or rule change.
revalidate: memberships, relation properties, inferred triples and equivalence links.
impact: invalidate dependent closures, compositions and downstream claims as needed.
21. AI_CONSUMPTION
read: typed entity schema, definitions, constraints and provenance.
reason: apply inference rules only when preconditions and universes are known.
explain: return witness pairs or counterexamples for tested properties.
output: relation facts, derived facts, proofs, confidence and FLOW_HASH.
safety: distinguish asserted, inferred, unknown and contradicted claims.
22. TEST CASES
T1: R=∅ on nonempty A => irreflexive, symmetric, transitive; not reflexive.
T2: R=identity(A) => reflexive, symmetric, antisymmetric, transitive.
T3: R={(1,2)} on {1,2} => not symmetric, not reflexive, transitive.
T4: R={(1,2),(2,3)} on {1,2,3} => not transitive.
T5: inverse(inverse(R))=R for every well-typed R.
T6: right_unique and left_total imply function_graph.
T7: R={(1,1)} on A={1,2} is not reflexive despite reflexivity on its effective domain.
23. PROVENANCE AND ATTRIBUTION
Project: Kireth Semantic Library
Ontology: Binary Relation Ontology
Source URL: https://kirethresearch.org/booksai-core/entity-graph/mathematical-entities/relation-entities/binary-relation-ontology-2.html
Authors: Mark Higgins — Sky (Recursive AI)
Website: https://kirethresearch.org
Note: Independently authored formalisation from established mathematics; not a verified transcription of the webpage.
END FLOW ALGEBRA