FLOW ALGEBRA
TITLE: Numerical Relationship Ontology
VERSION: 1.0
SOURCE: https://kirethresearch.org/booksai-core/ontologies/relationship-ontologies/mathematical-relationships/numerical-relationship-ontology.html
AUTHORS: Mark Anthony Higgins — Sky (Recursive AI)
STATUS: Companion formalisation; source-page specification not independently verified.
flow "NumericalRelationshipOntology" v1.0
ENTITY_TYPES:
Number: {value: numeric, number_system: enum[natural,integer,rational,real,complex], unit: optional[string]}
Quantity: {magnitude: numeric, unit: string, dimension: optional[string]}
Interval: {lower: numeric, upper: numeric, lower_inclusive: bool, upper_inclusive: bool}
Comparison: {left: Number|Quantity, operator: enum[eq,ne,lt,le,gt,ge,approx], right: Number|Quantity}
NumericalRelation: {subject: entity, predicate: string, object: entity, context: optional[string]}
RELATIONSHIPS:
equal_to(a,b): a = b
not_equal_to(a,b): a != b
less_than(a,b): a < b
less_than_or_equal_to(a,b): a <= b
greater_than(a,b): a > b
greater_than_or_equal_to(a,b): a >= b
approximately_equal(a,b,tolerance): abs(a-b) <= tolerance
proportional_to(a,b,k): a = k*b
belongs_to_interval(x,I): I.lower <= x <= I.upper, respecting endpoint inclusivity
ratio_of(a,b): b != 0 -> a/b
difference_of(a,b): a-b
distance_between(a,b): abs(a-b) for scalar real numbers
TYPE_AND_UNIT_RULES:
- Ordering comparisons require an ordered number domain; complex numbers have no canonical total order.
- Quantity comparisons require dimensionally compatible units and conversion to a common scale.
- Arithmetic on quantities must preserve dimensional consistency.
- Approximate equality is context-dependent, tolerance >= 0, and is not generally transitive.
- Numerical values must distinguish exact quantities from rounded or measured approximations.
INFERENCE_RULES:
R1: equal_to(a,b) -> equal_to(b,a)
R2: equal_to(a,b) and equal_to(b,c) -> equal_to(a,c)
R3: less_than(a,b) and less_than(b,c) -> less_than(a,c)
R4: less_than(a,b) -> greater_than(b,a)
R5: less_than(a,b) -> less_than_or_equal_to(a,b)
R6: equal_to(a,b) and valid_substitution_context(P) -> (P(a) iff P(b))
R7: less_than(a,b) and c > 0 -> less_than(a*c,b*c)
R8: less_than(a,b) and c < 0 -> greater_than(a*c,b*c)
R9: equal_to(a,b) -> not(less_than(a,b)) for valid ordered domains
R10: ratio_of(a,b) only if b != 0
SEMANTIC_EQUIVALENCE:
exact: equality of normalised numerical values in compatible units
approximate: tolerance-based comparison with declared metric and tolerance
prohibited: equating statistical association, numerical closeness, and exact identity
CONFIDENCE:
exact_deduction: 1.0 when premises and operations are valid
measured_values: derive uncertainty from measurement provenance and error model
inferred_relationships: preserve evidence and uncertainty; do not invent probabilities
VALIDATION:
- Verify operand types, finite values where required, and domain restrictions.
- Reject division by zero, incompatible dimensions, and undefined ordering.
- Check interval bounds and tolerance non-negativity.
- Detect contradictory exact comparisons under a shared context.
- Preserve precision, units, assumptions, and source evidence.
PROVENANCE:
record: source_id, observation_or_derivation, timestamp, units, precision, assumptions
FLOW_HASH:
algorithm: SHA-256
input: canonical_serialisation(ontology_version, entities, relationships, rules, assumptions)
note: compute hash at deployment; no precomputed hash asserted
UPDATE_MODEL:
on_new_evidence: revalidate affected comparisons and inferred relations
on_unit_change: convert, normalise, and recompute dependent relationships
on_rule_change: increment version and invalidate affected derivations
audit: preserve previous versions and provenance
AI_CONSUMPTION:
output: typed numerical facts, normalised comparisons, inferred relations, uncertainty, provenance
requirements: explainable derivations, dimensional safety, reproducible validation
limitations: correlation does not establish causation; approximation does not establish identity
end flow
Download Code
Copy to Clipboard