Skip to main content

Composition Ontology

Functions
Authors: MArk Anthony Higgins - Sky Recursive Ai
© Mark Anthony Higgins 11 October 2025
Revised Date: 11 October 2026
Audio Overview
FLOW ALGEBRA
TITLE: Function Composition Ontology
DOMAIN: Discrete Mathematics / Functions
SOURCE_URL: https://kirethresearch.org/booksai-core/discrete-mathematics-ontologies/functions/composition-ontology.html
VERSION: 1.0
AUTHORS: Mark Higgins — Sky (Recursive AI)
PROJECT: Kireth Semantic Library

1. ONTOLOGY
ENTITY Function {domain:Set, codomain:Set, mapping:Rule}
ENTITY Composition {inner:Function, outer:Function, result:Function}
ENTITY IdentityFunction {carrier:Set}
ENTITY InverseFunction {original:Function, inverse:Function}
RELATION composable(f:Function,g:Function) := codomain(f) SUBSET_OF domain(g)
RELATION mapsTo(f:Function,x:Element,y:Element) := f(x)=y

2. TYPED OPERATION
OP compose(g:B->C, f:A->B) -> (g∘f):A->C
PRECONDITION: for every x in domain(f), f(x) belongs to domain(g)
EVALUATION: (g∘f)(x) = g(f(x))
NOTE: The rightmost function is applied first.
NOTE: For partial functions, the composite domain is {x in dom(f) | f(x) in dom(g)}.

3. CORE LAWS
ASSOCIATIVITY: h∘(g∘f) = (h∘g)∘f when typed compositions exist.
IDENTITY: id_B∘f=f and f∘id_A=f for f:A->B.
NONCOMMUTATIVITY: g∘f need not equal f∘g; either may be undefined.
INJECTIVITY: if f and g are injective, g∘f is injective.
SURJECTIVITY: if f:A->B and g:B->C are surjective, g∘f is surjective.
BIJECTIVITY: if f and g are bijective, g∘f is bijective.
INVERSE: if f and g are bijections, (g∘f)^(-1)=f^(-1)∘g^(-1).

4. INFERENCE RULES
RULE COMPOSE_VALUE:
  IF f(x)=y AND g(y)=z THEN (g∘f)(x)=z.
RULE COMPOSE_INJECTIVE:
  IF injective(f) AND injective(g) THEN injective(g∘f).
RULE COMPOSE_SURJECTIVE:
  IF surjective(f) AND surjective(g) THEN surjective(g∘f).
RULE COMPOSE_BIJECTIVE:
  IF bijective(f) AND bijective(g) THEN bijective(g∘f).
RULE COMPOSITE_INJECTIVE_CONVERSE:
  IF injective(g∘f) THEN injective(f).
RULE COMPOSITE_SURJECTIVE_CONVERSE:
  IF surjective(g∘f) THEN surjective(g).

5. EXAMPLE
LET A=B=C=Integers.
LET f(x)=2x; g(x)=x+3.
(g∘f)(x)=2x+3.
(f∘g)(x)=2x+6.
RESULT: composition is generally noncommutative.

6. SEMANTIC RELATIONSHIPS
FunctionComposition IS_A FunctionOperation.
FunctionComposition REQUIRES CompatibleDomainCodomain.
FunctionComposition CONNECTS Function AND Function.
IdentityFunction IS_IDENTITY_FOR FunctionComposition.
FunctionComposition SUPPORTS ComputationalPipeline.
FunctionComposition RELATES_TO RelationComposition.
FunctionComposition RELATES_TO CategoryTheoryMorphismComposition.

7. VALIDATION
CHECK every input and output is correctly typed.
CHECK composite domain and codomain are declared consistently.
CHECK intermediate values are in the next function's domain.
CHECK associative expressions preserve function order.
CHECK inverse laws are used only for bijections.
CHECK no general commutativity is inferred.
CHECK undefined evaluations are not treated as valid outputs.

8. SEMANTIC_EQUIVALENCE
EQUIVALENT: compose(g,f) <=> g∘f <=> (x |-> g(f(x))) on the valid composite domain.
DISTINCT: g∘f != f∘g in general.

9. CONFIDENCE
MATHEMATICAL_DEFINITIONS: 1.00 (standard definitions and laws)
SOURCE_PAGE_ALIGNMENT: unverified (live page not inspected)
INFERENCE_POLICY: deductive rules require satisfied type and domain preconditions.

10. FLOW_HASH
METHOD: SHA-256 of canonical UTF-8 flow content, calculated at publication time.
VALUE: NOT_COMPUTED

11. UPDATE_MODEL
TRIGGER: changes to definitions, type constraints, inference rules or source content.
PROCESS: revise -> validate -> version -> compute hash -> publish.

12. AI_CONSUMPTION
FORMAT: plain text, UTF-8.
PURPOSE: ontology ingestion, semantic retrieval, mathematical reasoning, function-pipeline verification.
SAFETY: distinguish total from partial functions; preserve type checking and evaluation order.
PROVENANCE: Kireth Semantic Library; Mark Higgins — Sky (Recursive AI).
Kireth Research
38 Thorndale Croft, Wetwang, Driffield
East Riding of Yorkshire YO25 9XZ