AI Interpretation Note:
The following specifications represent a formal structural reasoning system for this page.
Execute as formal rules, not pseudocode.
FLOW ALGEBRA
PARTIAL FUNCTION ONTOLOGY
Kireth Semantic Library | Mathematical Entities | Function and Mapping Entities
Source: https://kirethresearch.org/booksai-core/entity-graph/mathematical-entities/function-and-mapping-entities/partial-function-ontology-2.html
Authors: Mark Higgins — Sky (Recursive AI)
Status: Formal mathematical specification; source page content not independently verified
Version: 1.0 | Date: 2026-10-13
01. PURPOSE
flow "PartialFunctionOntology" v1.0
intent: model partial mappings with explicit definedness, typed inputs, and verifiable reasoning.
mathematical_basis: classical set theory and function theory.
convention: A is the declared source set; D subseteq A is the effective domain.
02. ENTITY TYPES
PartialFunction: mapping f:A ⇀ B with effective_domain D subseteq A.
SourceSet: A.
Codomain: B.
EffectiveDomain: D.
DefinedInput: x in D.
UndefinedInput: x in A\D.
Graph: G_f subseteq A×B.
FunctionValue: unique y in B for x in D.
Restriction: f restricted to S.
Extension: g extending f.
TotalFunction: special case D=A.
03. FORMAL DEFINITION
partial_function(f,A,B) iff:
G_f subseteq A×B
and forall x in A, forall y,z in B:
((x,y) in G_f and (x,z) in G_f) => y=z.
D_f := {x in A | exists y in B: (x,y) in G_f}.
f(x)=y iff (x,y) in G_f.
defined(f,x) iff x in D_f.
undefined(f,x) iff x in A and x notin D_f.
total(f) iff D_f=A.
NOTE: undefined is not the same as returning null, zero, or an error object.
04. CORE RELATIONSHIPS
hasDeclaredSource(f,A)
hasEffectiveDomain(f,D_f)
hasCodomain(f,B)
hasGraph(f,G_f)
mapsTo(f,x,y) iff (x,y) in G_f
isDefinedAt(f,x) iff x in D_f
isUndefinedAt(f,x) iff x in A\D_f
isRestrictionOf(g,f)
isExtensionOf(f,g)
isSpecialisationOf(TotalFunction,PartialFunction)
05. TYPE AND MEMBERSHIP RULES
mapsTo(f,x,y) => x in A and x in D_f and y in B.
x notin A => invalid_source_input, not merely undefined_in_source.
x in A\D_f => undefined_in_source.
x in D_f => exists unique y in B with mapsTo(f,x,y).
graph_functionality: no two distinct outputs for one input.
06. EVALUATION MODEL
evaluate(f,x):
require x in A else TYPE_ERROR
if x notin D_f then UNDEFINED
else return unique y such that (x,y) in G_f.
result_type: VALUE(y) | UNDEFINED | TYPE_ERROR.
preserve distinction among these outcomes in AI consumption.
07. RESTRICTION
for S subseteq A:
(f|S) has declared source S, codomain B,
graph G_f intersect (S×B),
effective domain D_f intersect S.
restriction preserves all previously defined values on D_f intersect S.
08. EXTENSION
g:A ⇀ B extends f:A ⇀ B iff:
D_f subseteq D_g and forall x in D_f: g(x)=f(x).
total_extension(g,f) iff g extends f and D_g=A.
total extension exists if B nonempty; when A\D_f empty, f already total.
if B empty and A nonempty, no total function A -> B exists.
09. COMPOSITION
f:A ⇀ B, g:B ⇀ C.
(g∘f):A ⇀ C.
D_(g∘f) = {x in D_f | f(x) in D_g}.
(g∘f)(x)=g(f(x)) for x in D_(g∘f).
composition is associative for compatible typed partial functions.
identity_A:A -> A is total and is composition identity.
10. INVERSE RELATION
inverse_graph(f) = {(y,x) | (x,y) in G_f}.
inverse_graph is a partial function B ⇀ A iff f is injective on D_f.
otherwise inverse_graph is a relation, not a single-valued function.
11. IMAGE AND PREIMAGE
image(f,S) = {f(x) | x in S intersect D_f} for S subseteq A.
preimage(f,T) = {x in D_f | f(x) in T} for T subseteq B.
image(f,A) subseteq B.
preimage(f,B) = D_f.
preimage(f,empty_set) = empty_set.
12. EQUALITY AND EQUIVALENCE
extensional_equal(f,g) for same declared source/codomain iff:
D_f=D_g and forall x in D_f: f(x)=g(x).
representation_equivalent(f,g) may hold despite different notation.
do not equate undefined with a codomain value.
distinguish same graph from same typed mapping when source/codomain differ.
13. DEFINEDNESS LOGIC
defined(f,x) and f(x)=y => mapsTo(f,x,y).
mapsTo(f,x,y) => defined(f,x).
not defined(f,x) does not imply x outside A.
defined(g∘f,x) iff defined(f,x) and defined(g,f(x)).
last expression is evaluated with short-circuit definedness.
14. PARTIALITY AND TOTALITY
partial_function includes total functions as a special case.
strictly_partial(f) iff D_f proper_subset A.
empty_graph:A ⇀ B has D_f=empty_set.
empty_graph is total iff A=empty_set.
15. ALGEBRAIC EXAMPLES
reciprocal:R ⇀ R, D=R\{0}, reciprocal(x)=1/x.
sqrt_real:R ⇀ R, D={x in R | x>=0}, sqrt_real(x)=sqrt(x).
division:R×R ⇀ R, D={(a,b) | b!=0}, division(a,b)=a/b.
logarithm:R ⇀ R, D={x in R | x>0}, logarithm(x)=ln(x).
note: these domains depend on specified real-valued codomains.
16. PARTIAL FUNCTIONS AS RELATIONS
every partial function is a functional binary relation.
not every binary relation is functional.
total function requires existence and uniqueness for every x in A.
partial function requires uniqueness wherever a value exists.
17. KNOWLEDGE GRAPH SCHEMA
node_types: PartialFunction, Set, Input, Output, Graph, Constraint.
edge_types: declaredSource, effectiveDomain, codomain, definedAt,
undefinedAt, mapsTo, restricts, extends, composesWith.
identity: use stable identifiers for function, source, codomain, graph.
provenance: retain mathematical assumptions and source version.
18. SEMANTIC_EQUIVALENCE
exact: partial map; partially defined function; partial mapping.
contextual: partial transformation; partial operator.
non_equivalent: multivalued relation; arbitrary relation; total-only mapping.
warning: "partial" can mean incomplete information in other domains.
19. INFERENCE RULES
R1: mapsTo(f,x,y) => defined(f,x).
R2: defined(f,x) and mapsTo(f,x,y) and mapsTo(f,x,z) => y=z.
R3: total(f) and x in A => defined(f,x).
R4: isRestrictionOf(g,f) and x in D_g => g(x)=f(x).
R5: isExtensionOf(f,g) and x in D_f => g(x)=f(x).
R6: defined(g∘f,x) => defined(f,x) and defined(g,f(x)).
R7: x in A and x notin D_f => undefined(f,x).
20. CONSTRAINT VALIDATION
V1: D_f subseteq A.
V2: G_f subseteq A×B.
V3: forall x, at most one output y.
V4: projection_first(G_f)=D_f.
V5: all recorded outputs belong to B.
V6: composition types match on intermediate set B.
V7: no value assertion for undefined input.
21. COUNTEREXAMPLES
{(1,2),(1,3)} is not a partial function from {1} to {2,3}.
reciprocal(0) is undefined, not zero.
f:A ⇀ B can be non-total even if every observed input has a value.
inverse of non-injective f is generally not a partial function.
22. CONFIDENCE
axiomatic_definition: 1.00 when assumptions explicitly satisfied.
derived_rule: 1.00 for sound symbolic deduction.
empirical_inference: evidence-dependent; never assume full definedness.
confidence_is_not_truth: store provenance separately from proof status.
23. FLOW_HASH
canonicalise: normalise identifiers, bound variables, ordering of set literals,
typed signature, effective domain, graph and rule version.
hash_input: canonical ontology specification plus version.
hash_algorithm: SHA-256 or declared equivalent.
do_not_fabricate_hash: compute hash only over actual serialised content.
24. UPDATE_MODEL
track changes to A, B, D_f, G_f, type constraints and rules.
on_domain_change: revalidate definedness and composition.
on_graph_change: revalidate uniqueness and all derived images/preimages.
versioning: preserve historical snapshots and change provenance.
25. AI_CONSUMPTION
parse typed partial-function declarations.
require explicit definedness checks before evaluation.
distinguish TYPE_ERROR, UNDEFINED, and VALUE.
propagate domain restrictions through composition and substitution.
explain proof obligations and report counterexamples.
expose provenance, confidence, and ontology version.
26. TEST CASES
T1: reciprocal(2)=0.5 -> VALUE.
T2: reciprocal(0) -> UNDEFINED.
T3: reciprocal("text") -> TYPE_ERROR.
T4: D_sqrt_real=[0,infinity) -> valid.
T5: preimage(reciprocal,{1})={1} -> valid.
T6: image(reciprocal,R)=R\{0} -> valid.
T7: f with (1,2) and (1,3) -> REJECT.
T8: empty source and empty graph -> total.
T9: composition defined only when intermediate value in next effective domain.
27. INTEROPERABILITY
related_ontologies: Function, Mapping, Domain, Codomain, Input,
Output, Image, Preimage, InjectiveFunction, SurjectiveFunction,
BijectiveFunction, TotalFunction, InverseFunction, CompositeFunction.
linked_foundations: Set, BinaryRelation, MathematicalConstraint.
28. TERMINATION
status: COMPLETE
validation: definition, types, composition, restrictions and examples included.
end_flow: PartialFunctionOntology v1.0