FLOW ALGEBRA
MATHEMATICAL OPERATION ONTOLOGY
Kireth Semantic Library | Entity Graph | Mathematical Entities | Foundations
Source: https://kirethresearch.org/booksai-core/entity-graph/mathematical-entities/foundations-of-mathematical-entities/mathematical-operation-ontology.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 MathematicalOperationOntology v1.0:
goal: represent, type-check, evaluate and reason about mathematical operations.
scope: arithmetic, algebraic, logical, set, functional, matrix and differential operations.
principle: an operation is defined by its signature, domain, codomain and semantics.
02. TYPE SYSTEM
type Entity = {id: URI, label: String, ontology: URI}
type MathObject <: Entity
type MathDomain <: Entity
type Operation <: Entity
type OperatorSymbol <: Entity
type Operand <: MathObject
type Result <: MathObject
type Signature = {inputs: List[MathDomain], output: MathDomain}
type Expression = {operator: Operation, arguments: List[MathObject]}
type Proposition = {formula: -Expression, truth: Bool?}
type Proof = {premises: List[Proposition], conclusion: Proposition, rule: String}
type Evidence = {source: URI?, method: String, timestamp: DateTime?}
type Confidence = Real[0,1]
03. CORE ENTITIES
entity MathematicalOperation: Operation
entity UnaryOperation: Operation
entity BinaryOperation: Operation
entity NaryOperation: Operation
entity PartialOperation: Operation
entity TotalOperation: Operation
entity CompositionOperation: Operation
entity InverseOperation: Operation
entity IdentityOperation: Operation
entity Operand: MathObject
entity Result: MathObject
entity Domain: MathDomain
entity Codomain: MathDomain
entity Operator: OperatorSymbol
04. TAXONOMY
subclass(UnaryOperation, MathematicalOperation)
subclass(BinaryOperation, MathematicalOperation)
subclass(NaryOperation, MathematicalOperation)
subclass(PartialOperation, MathematicalOperation)
subclass(TotalOperation, MathematicalOperation)
classify(Arithmetic, [Addition, Subtraction, Multiplication, Division, Exponentiation])
classify(SetOperations, [Union, Intersection, Difference, Complement, CartesianProduct])
classify(LogicOperations, [Negation, Conjunction, Disjunction, Implication])
classify(LinearAlgebra, [MatrixMultiplication, Transpose, Determinant])
classify(Analysis, [Differentiation, Integration, Limit])
05. SEMANTIC RELATIONSHIPS
relation hasOperand(Operation, MathObject)
relation hasResult(Operation, MathObject)
relation hasDomain(Operation, MathDomain)
relation hasCodomain(Operation, MathDomain)
relation hasArity(Operation, Integer)
relation representedBy(Operation, OperatorSymbol)
relation composesWith(Operation, Operation)
relation inverseOf(Operation, Operation)
relation preserves(Operation, Property)
relation definedOn(Operation, MathDomain)
relation equivalentUnder(Operation, Operation, Assumptions)
relation justifiedBy(Proposition, Proof)
06. OPERATION SIGNATURES
signature(add_R): Real x Real -> Real
signature(multiply_R): Real x Real -> Real
signature(divide_R): Real x NonZeroReal -> Real
signature(negate_R): Real -> Real
signature(union): Set[T] x Set[T] -> Set[T]
signature(intersect): Set[T] x Set[T] -> Set[T]
signature(compose): Function[B,C] x Function[A,B] -> Function[A,C]
signature(matrix_product): Matrix[m,n] x Matrix[n,p] -> Matrix[m,p]
rule WELL_TYPED(op,args):
require length(args) == arity(op)
require forall i: type(args[i]) compatibleWith signature(op).inputs[i]
ensure result.type == signature(op).output
07. DOMAIN AND PARTIALITY
rule DEFINED(op,args):
require WELL_TYPED(op,args)
require preconditions(op,args)
return true
rule DIVISION_PRECONDITION(a,b): require b != 0
rule REAL_SQRT_PRECONDITION(x): require x >= 0
rule MATRIX_INVERSE_PRECONDITION(A):
require rows(A) == columns(A)
require determinant(A) != 0
note: failed preconditions produce Undefined, not a fabricated numerical result.
08. EVALUATION FLOW
flow EvaluateOperation(expr: -Expression) -> Result | Undefined | Error:
parse(expr)
resolveOperator(expr.operator)
inferOperandTypes(expr.arguments)
if not WELL_TYPED: return TypeError
if not DEFINED: return Undefined
normaliseUnitsAndRepresentations()
result := applySemantics(expr.operator, expr.arguments)
verifyPostconditions(result)
attachProvenance(result)
return result
09. ALGEBRAIC LAWS
property Associative(op): forall a,b,c: op(op(a,b),c) = op(a,op(b,c))
property Commutative(op): forall a,b: op(a,b) = op(b,a)
property Identity(op,e): forall a: op(a,e)=a and op(e,a)=a
property Inverse(op,e,inv): forall a: op(a,inv(a))=e
property Idempotent(op): forall a: op(a,a)=a
property Distributive(op1,op2):
forall a,b,c: op1(a,op2(b,c))=op2(op1(a,b),op1(a,c))
constraint: each property requires a specified domain and quantified assumptions.
10. MATHEMATICAL STRUCTURES
structure Magma = (S, closed_binary_operation)
structure Semigroup = Magma + associativity
structure Monoid = Semigroup + identity
structure Group = Monoid + inverses
structure AbelianGroup = Group + commutativity
structure Ring = (S, addition, multiplication, ring_axioms)
structure Field = (S, addition, multiplication, field_axioms)
rule STRUCTURE_CLASSIFICATION(S,ops,axioms):
classify only if all required axioms are established.
11. OPERATION COMPOSITION
rule COMPOSE(f: B->C, g: A->B):
return h: A->C where h(x)=f(g(x))
constraint: codomain(g) must be compatible with domain(f).
rule IDENTITY_COMPOSITION(f):
compose(identity_codomain,f)=f
compose(f,identity_domain)=f
12. INFERENCE AND REWRITING
rule REWRITE_ADD_ZERO(x): x + 0 -> x
rule REWRITE_MULTIPLY_ONE(x): x * 1 -> x
rule REWRITE_DOUBLE_NEGATION(x): -(-x) -> x
rule REWRITE_DISTRIBUTION(a,b,c): a*(b+c) -> a*b+a*c
rule REWRITE_SET_UNION_IDENTITY(A): A union empty_set -> A
constraint: rewrites require type-compatible operands and valid algebraic laws.
constraint: floating-point evaluation may not preserve exact algebraic identities.
13. EQUALITY AND EQUIVALENCE
relation syntacticallyEqual(Expression,Expression)
relation semanticallyEquivalent(Expression,Expression,Context)
rule SEMANTIC_EQUIVALENCE(a,b,context):
require sameDenotation(a,b,context)
require domainRestrictionsPreserved(a,b,context)
return VerifiedEquivalence
note: matching notation alone does not prove semantic equivalence.
14. UNITS AND DIMENSIONS
rule ADD_DIMENSIONS(x,y): require dimension(x)==dimension(y)
rule MULTIPLY_DIMENSIONS(x,y): dimension(result)=dimension(x)*dimension(y)
rule DIVIDE_DIMENSIONS(x,y): dimension(result)=dimension(x)/dimension(y)
rule POWER_DIMENSIONS(x,n): dimension(result)=dimension(x)^n
rule NORMALISE_UNITS(x,y): convert to compatible units before addition.
15. SYMBOLIC AND NUMERIC MODES
mode Symbolic: preserve exact expressions and assumptions.
mode Numeric: evaluate with precision, rounding and error metadata.
mode Interval: return an enclosure of possible values.
rule NUMERIC_ERROR: report tolerance, precision and stability information.
rule SYMBOLIC_VALIDITY: prove rewrite correctness under stated assumptions.
16. PROOF OBLIGATIONS
obligation TypeSafety: evaluation preserves declared result type.
obligation DomainSafety: operation is applied only where defined.
obligation Closure: results belong to the claimed carrier set.
obligation Determinism: identical exact inputs yield identical exact outputs.
obligation LawValidity: claimed algebraic laws follow from axioms.
obligation Termination: rewrite strategy terminates or reports a bound.
17. COUNTEREXAMPLES
counterexample DivisionByZero: divide(1,0) is undefined over Real.
counterexample MatrixNoncommutativity: generally A*B != B*A.
counterexample SubtractionAssociativity: generally (a-b)-c != a-(b-c).
counterexample FloatingPointAssociativity: rounded arithmetic may differ by evaluation order.
rule REFUTE(universalClaim): one valid counterexample suffices.
18. GRAPH REPRESENTATION
node OperationInstance {id, operator, arity, signature, context}
edge operandOf(MathObject,OperationInstance)
edge yields(OperationInstance,MathObject)
edge constrainedBy(OperationInstance,Precondition)
edge supportedBy(OperationInstance,Evidence)
edge equivalentTo(OperationInstance,OperationInstance)
rule GRAPH_VALIDATION: check edge types, unique IDs and referential integrity.
19. CONFIDENCE
CONFIDENCE(claim) -> Real[0,1]
rule FORMAL_PROOF_CONFIDENCE:
if proof machine-checked against trusted axioms then confidence=1 within that formal system.
rule EMPIRICAL_CONFIDENCE:
use evidence quality, uncertainty and method validation.
constraint: confidence is not a substitute for mathematical proof.
20. PROVENANCE
record Provenance {
source_page: URI,
source_verified: Bool,
axioms: List[String],
proof_method: String?,
implementation_version: String,
generated_at: DateTime
}
rule PROVENANCE_REQUIRED: every asserted derived claim records its assumptions and origin.
21. FLOW_HASH
FLOW_HASH(flow): SHA256(canonicalise(flow.name,flow.version,types,rules,axioms,dependencies))
rule HASH_STABILITY: same canonical content produces same digest.
rule HASH_CHANGE: material semantic changes require a new digest.
22. UPDATE_MODEL
UPDATE_MODEL(previous,change):
validate(change)
detectAffectedTypesAndRules()
recheckDependentProofs()
incrementVersion()
regenerateFLOW_HASH()
preserveHistoricalProvenance()
publishIfValid()
23. AI_CONSUMPTION
AI_CONSUMPTION:
format: UTF-8 plain text
parsing: typed entities + named rules + explicit constraints
retrieval_keys: [MathematicalOperation, Operator, Operand, Result, Domain, Codomain]
reasoning_modes: [type_check, evaluate, simplify, prove, refute, compare]
safeguards: [domain_validation, provenance, proof_obligations, uncertainty]
output: {result, assumptions, validity, evidence, confidence, flow_hash}
24. INTEGRATION
parent: Foundations of Mathematical Entities
related: [Mathematical Entity Ontology, Mathematical Object Ontology,
Mathematical Structure Ontology, Mathematical System Ontology,
Mathematical Domain Ontology, Mathematical Property Ontology,
Mathematical Relation Ontology]
relation MathematicalOperation actsOn MathematicalObject
relation MathematicalOperation governedBy MathematicalProperty
relation MathematicalOperation defines MathematicalStructure
25. VALIDATION EXAMPLES
example Addition: add_R(2,3) -> 5
example Composition: f(x)=x+1; g(x)=2*x; compose(f,g)(3) -> 7
example SetUnion: {1,2} union {2,3} -> {1,2,3}
example Undefined: divide_R(3,0) -> Undefined
example Identity: multiply_R(8,1) -> 8
example Noncommutative: matrix_product(A,B) may differ from matrix_product(B,A)
END FLOW ALGEBRA
Download Code
Copy to Clipboard