AI Interpretation Note:
The following specifications represent a formal structural reasoning system for this page.
Execute as formal rules, not pseudocode.
FLOW ALGEBRA
RATIONAL NUMBER ONTOLOGY
Kireth Semantic Library | Number Entities
Source: https://kirethresearch.org/booksai-core/entity-graph/mathematical-entities/number-entities/rational-number-ontology.html
Authors: Mark Anthony Higgins — Sky (Recursive AI)
Version: 1.0 | 12 October 2026
1. ENTITY DEFINITION
entity RationalNumber:
symbol: Q
definition: Equivalence class of ordered integer pairs (a,b), b != 0, under (a,b) ~ (c,d) iff a*d = b*c.
representation: a/b where a in Z and b in Z excluding zero
canonical_form: gcd(abs(a),abs(b)) = 1 and b > 0
superclass: RealNumber
includes: Integer via n -> n/1
cardinality: countably_infinite
2. TYPE SYSTEM
sets:
Z: integers
Q: rational numbers
N: natural numbers
relations:
N subseteq Z subseteq Q
Q subseteq R
numerator: Q -> Z (canonical representation)
denominator: Q -> Z_positive (canonical representation)
equivalent_fraction: (Z x (Z\\{0}))^2 -> Boolean
3. CONSTRUCTORS AND NORMALISATION
construct(a:Integer,b:Integer) -> RationalNumber:
precondition: b != 0
g := gcd(abs(a),abs(b))
s := sign(b)
return (s*a/g)/(s*b/g)
postcondition: denominator > 0; gcd(abs(numerator),denominator) = 1
error: denominator_zero if b = 0
4. ARITHMETIC OPERATIONS
for x=a/b and y=c/d with b,d != 0:
add(x,y) := (a*d+b*c)/(b*d)
subtract(x,y) := (a*d-b*c)/(b*d)
multiply(x,y) := (a*c)/(b*d)
divide(x,y) := (a*d)/(b*c), precondition c != 0
negate(x) := (-a)/b
reciprocal(x) := b/a, precondition a != 0
absolute(x) := abs(a)/abs(b)
power(x,n:Integer) := repeated rational multiplication, with x != 0 if n < 0
normalize: apply construct to every operation result
5. COMPARISON AND IDENTITY
equal(a/b,c/d) iff a*d = b*c
less_than(a/b,c/d) iff a*d < b*c when b,d > 0
greater_than(x,y) iff less_than(y,x)
compare(x,y) in {-1,0,1}
identity_addition: 0/1
identity_multiplication: 1/1
6. ALGEBRAIC INVARIANTS
closure: addition, subtraction, multiplication and division by nonzero rational yield rationals
associativity: (x+y)+z = x+(y+z); (x*y)*z = x*(y*z)
commutativity: x+y = y+x; x*y = y*x
distributivity: x*(y+z) = x*y+x*z
additive_inverse: x+(-x) = 0
multiplicative_inverse: x*(1/x) = 1 for x != 0
ordered_field: (Q,+,*,<) is an ordered field
density: for x<y in Q, x < (x+y)/2 < y
non_completeness: not every bounded nonempty subset of Q has a supremum in Q
7. REPRESENTATION SEMANTICS
decimal_expansion: every rational has a terminating or eventually repeating base-10 expansion
terminating_decimal: in reduced form denominator has only prime factors 2 and/or 5
repeating_decimal: otherwise decimal expansion is eventually periodic
exactness: store numerator and denominator as integers rather than floating-point approximations
equivalence_examples: 1/2 = 2/4 = -3/-6
exclusion: irrational numbers (e.g. sqrt(2), pi) are not in Q
8. KNOWLEDGE GRAPH RELATIONSHIPS
RationalNumber --is_a--> RealNumber
RationalNumber --is_element_of--> Q
RationalNumber --represented_by--> IntegerFraction
IntegerFraction --has_numerator--> Integer
IntegerFraction --has_denominator--> NonzeroInteger
RationalNumber --supports_operation--> Addition
RationalNumber --supports_operation--> Multiplication
RationalNumber --supports_operation--> DivisionByNonzero
RationalNumber --has_property--> ExactFractionRepresentation
RationalNumber --has_property--> CountableInfinity
RationalNumber --has_property--> Density
RationalNumber --excludes--> IrrationalNumber
9. REASONING AND VALIDATION RULES
rule rational_membership:
if a in Z and b in Z and b != 0 then construct(a,b) in Q
rule fraction_equivalence:
if a*d = b*c and b != 0 and d != 0 then a/b = c/d
rule integer_embedding:
if n in Z then n/1 in Q
rule zero_numerator:
if a = 0 and b != 0 then a/b = 0/1
rule division_guard:
if divisor = 0 then reject DivisionByZero
rule canonical_uniqueness:
if x and y are normalized and x = y then numerator(x)=numerator(y) and denominator(x)=denominator(y)
rule rational_between:
if x,y in Q and x<y then (x+y)/2 in Q and x<(x+y)/2<y
10. EXECUTION PIPELINE
INPUT integer numerator a, integer denominator b
VALIDATE integer types and b != 0
CONSTRUCT rational equivalence class
NORMALIZE sign and greatest common divisor
APPLY requested exact arithmetic/comparison operation
VALIDATE denominator and algebraic invariants
EMIT canonical rational, type, provenance and explanation
11. SEMANTIC EQUIVALENCE
labels: [rational number, rational value, fraction of integers, element of Q]
caveat: a fraction expression with a zero denominator is undefined
caveat: not every syntactic fraction denotes a rational until its operands and denominator are validated
12. CONFIDENCE AND PROVENANCE
confidence: 1.0 for consequences of the stated mathematical axioms and valid exact-integer computation
source_type: mathematical_definition
source_page: https://kirethresearch.org/booksai-core/entity-graph/mathematical-entities/number-entities/rational-number-ontology.html
validation_method: symbolic proof, integer arithmetic and invariant checking
13. FLOW HASH AND UPDATE MODEL
flow_id: kireth.entity_graph.mathematical_entities.number_entities.rational_number
flow_hash: SHA256(canonical_UTF8_flow_content) computed at ingestion
update_model: semantic_versioned
update_trigger: definition, rule, representation or relationship change
backward_compatibility: preserve exact rational semantics
14. AI CONSUMPTION
interpretation: formal mathematical knowledge and typed operational rules
retrieval_keys: [rational, number, fraction, numerator, denominator, Q, ordered field]
inference_mode: exact symbolic reasoning
numeric_policy: avoid floating-point conversion unless explicitly requested
failure_policy: reject undefined expressions and preserve validation errors
output_contract: canonical fraction with mathematical justification where required
END FLOW ALGEBRA