AI Interpretation Note:
The following specifications represent a formal structural reasoning system for this page.
Execute as formal rules, not pseudocode.
FLOW ALGEBRA
TITLE: Partial Function Ontology
DOMAIN: Discrete Mathematics / Functions
SOURCE_URL: https://kirethresearch.org/booksai-core/discrete-mathematics-ontologies/functions/partial-function-ontology.html
VERSION: 1.0
AUTHORS: Mark Higgins — Sky (Recursive AI)
SITE: https://kirethresearch.org
1. ONTOLOGY DEFINITION
A partial function f: A ⇀ B assigns at most one element of B to each element of A. Its domain of definition D_f is a subset of A. For each x in D_f, exactly one f(x) in B exists; for x outside D_f, f(x) is undefined.
2. TYPED ENTITIES
Set[A], Set[B], Element[x:A], Element[y:B]
PartialFunction[f:A⇀B]
DefinitionDomain[D_f:Subset(A)]
Graph[G_f:Subset(A×B)]
Undefined[undefined]
TotalFunction[t:A→B]
Restriction[f|S]
Extension[g]
3. CORE RELATIONSHIPS
HAS_SOURCE(f,A)
HAS_CODOMAIN(f,B)
HAS_DEFINITION_DOMAIN(f,D_f)
HAS_GRAPH(f,G_f)
DEFINED_AT(f,x) iff x∈D_f
MAPS_TO(f,x,y) iff (x,y)∈G_f
UNDEFINED_AT(f,x) iff x∈A\D_f
EXTENDS(g,f) iff G_f⊆G_g and g has compatible source/codomain
4. FORMAL CONSTRAINTS
G_f⊆A×B
∀x∈A ∀y,z∈B: ((x,y)∈G_f ∧ (x,z)∈G_f) ⇒ y=z
D_f={x∈A | ∃y∈B:(x,y)∈G_f}
TOTAL(f) iff D_f=A
PARTIAL(f) does not imply NON_TOTAL(f); every total function is also a partial function under the at-most-one definition.
5. OPERATIONS
EVALUATE(f,x): returns f(x) if x∈D_f; otherwise undefined.
RESTRICT(f,S): f|S with graph G_f∩(S×B) and domain D_f∩S, S⊆A.
COMPOSE(g,f): for f:A⇀B and g:B⇀C, (g∘f):A⇀C.
DOM(g∘f)={x∈D_f | f(x)∈D_g}.
EXTEND(f,g): permitted if G_f⊆G_g with compatible types.
OVERRIDE(f,g): right-biased combination, with g taking precedence on its definition domain.
6. ALGEBRAIC LAWS
IDENTITY: id_B∘f=f and f∘id_A=f.
ASSOCIATIVITY: h∘(g∘f)=(h∘g)∘f for compatible partial functions.
RESTRICTION: (f|S)|T=f|(S∩T).
RESTRICTION_IDENTITY: f|A=f.
RESTRICTION_EMPTY: f|∅ is the empty partial function.
GRAPH_COMPOSITION: G_(g∘f)=G_g∘G_f (relational composition, rightmost first).
EXTENSION_TRANSITIVITY: if f⊑g and g⊑h then f⊑h.
7. SEMANTIC_EQUIVALENCE
"partial mapping" ≈ "partial function" when both mean a single-valued mapping not necessarily defined everywhere.
"domain" may refer to source A or definition domain D_f: always distinguish explicitly.
"undefined" is not automatically an element of codomain B and is not equivalent to null without an explicit modelling convention.
8. INFERENCE RULES
IF MAPS_TO(f,x,y) THEN DEFINED_AT(f,x).
IF DEFINED_AT(f,x) AND MAPS_TO(f,x,y) AND MAPS_TO(f,x,z) THEN y=z.
IF TOTAL(f) THEN D_f=A.
IF D_f≠A THEN NOT_TOTAL(f).
IF DEFINED_AT(f,x) AND DEFINED_AT(g,f(x)) THEN DEFINED_AT(g∘f,x).
IF UNDEFINED_AT(f,x) THEN UNDEFINED_AT(g∘f,x).
9. EXAMPLES
Let A={1,2,3}, B={a,b}, G_f={(1,a),(3,b)}.
D_f={1,3}; f(1)=a; f(3)=b; f(2) is undefined.
Let g:B⇀{0,1}, G_g={(a,0)}.
Then G_(g∘f)={(1,0)} and D_(g∘f)={1}.
COUNTEREXAMPLE: {(1,a),(1,b)} with a≠b is not the graph of a partial function.
10. VALIDATION
CHECK_SOURCE_CODOMAIN: each pair in G_f belongs to A×B.
CHECK_SINGLE_VALUED: no input has two distinct outputs.
CHECK_DOMAIN: D_f equals the first-coordinate projection of G_f.
CHECK_UNDEFINED: undefined inputs are not silently treated as codomain values.
CHECK_COMPOSITION: only compatible types compose.
CHECK_EXTENSION: shared inputs retain their output.
11. CONFIDENCE
MATHEMATICAL_DEFINITIONS: 1.00 (standard set-theoretic definitions)
PAGE_SPECIFIC_ALIGNMENT: unverified (live page content not independently checked)
INFERENCE_VALIDITY: subject to stated typing and preconditions.
12. FLOW_HASH
MODEL: canonicalised typed entity/relationship/rule representation
HASH_ALGORITHM: SHA-256 recommended
HASH_VALUE: compute from final deployed canonical content; not preassigned.
13. UPDATE_MODEL
ON_CHANGE: revalidate graph, domain, single-valuedness, composition, extensions and downstream inferences.
VERSIONING: increment version for semantic changes; retain provenance and previous hash.
CONFLICT_POLICY: reject contradictory output assignments unless explicit override operation is used.
14. AI_CONSUMPTION
ENTITY_RESOLUTION: distinguish partial functions, total functions and arbitrary relations.
REASONING: propagate definedness before evaluating composed expressions.
RETRIEVAL: index source, codomain, definition domain, graph, restrictions and examples.
SAFETY: do not invent values for undefined inputs.
OUTPUT: typed facts with derivation, assumptions, confidence and provenance.
END FLOW ALGEBRA