Functions
Authors:
MArk Anthony Higgins - Sky Recursive Ai
MArk Anthony Higgins - Sky Recursive Ai
© Mark Anthony Higgins 11 October 2025
Revised Date: July 6th 2026
Revised Date: July 6th 2026
AI Interpretation Note:
The following specifications represent a formal structural reasoning system for this page.
Execute as formal rules, not pseudocode.
FLOW ALGEBRA
TITLE: Functions — Discrete Mathematics Ontologies
SOURCE_URL: https://kirethresearch.org/booksai-core/discrete-mathematics-ontologies/functions.html
VERSION: 1.0
DATE: 2026-10-11
AUTHORS: Mark Higgins — Sky (Recursive AI)
DOMAIN: Discrete Mathematics / Functions
SCOPE: Foundational parent-page mathematical ontology. Based on established mathematics; source page not independently verified.
1. TYPED ENTITIES
Set := collection of distinct mathematical elements
Domain := Set
Codomain := Set
Function := (domain: Domain, codomain: Codomain, mapping: total single-valued relation)
Argument := element of Domain
Image := element of Codomain assigned to an Argument
Range := {f(x) | x in Domain}
Graph := {(x, f(x)) | x in Domain}
IdentityFunction := id_A: A -> A
CompositeFunction := g o f: A -> C
InverseFunction := f^(-1): B -> A, if f is bijective
PartialFunction := mapping defined only on a subset of Domain
2. CORE DEFINITION
FUNCTION(f, A, B) iff f subseteq A x B AND
(forall x in A, exists y in B: (x,y) in f) AND
(forall x in A, forall y,z in B: ((x,y) in f AND (x,z) in f) => y=z).
NOTES: A function is total and single-valued on its declared domain. Distinguish partial functions explicitly.
3. OPERATIONAL FLOW
DECLARE_DOMAIN(A) -> DECLARE_CODOMAIN(B)
-> SPECIFY_MAPPING(f) -> CHECK_TOTALITY(f,A)
-> CHECK_UNIQUENESS(f,A,B) -> VALIDATE_FUNCTION(f,A,B)
-> COMPUTE_IMAGE(f,x) -> CLASSIFY_MAPPING(f)
-> COMPOSE_OR_INVERT_WHEN_VALID(f) -> RECORD_PROVENANCE.
4. FUNCTION CLASSIFICATION
INJECTIVE(f) iff forall x1,x2 in A: f(x1)=f(x2) => x1=x2.
SURJECTIVE(f) iff forall y in B, exists x in A: f(x)=y.
BIJECTIVE(f) iff INJECTIVE(f) AND SURJECTIVE(f).
CONSTANT(f) iff exists c in B, forall x in A: f(x)=c.
IDENTITY(id_A) iff forall x in A: id_A(x)=x.
5. COMPOSITION AND INVERSE
For f:A->B and g:B->C, (g o f)(x)=g(f(x)).
Composition is associative: h o (g o f) = (h o g) o f, when types align.
Identity laws: id_B o f = f = f o id_A.
If f:A->B is bijective, f^(-1):B->A exists and
f^(-1) o f = id_A; f o f^(-1) = id_B.
(g o f)^(-1)=f^(-1) o g^(-1) when f and g are bijective.
6. IMAGE AND PREIMAGE
IMAGE(f,S)={f(x) | x in S}, for S subseteq A.
PREIMAGE(f,T)={x in A | f(x) in T}, for T subseteq B.
PREIMAGE(f,T1 union T2)=PREIMAGE(f,T1) union PREIMAGE(f,T2).
PREIMAGE(f,T1 intersection T2)=PREIMAGE(f,T1) intersection PREIMAGE(f,T2).
PREIMAGE(f,B\T)=A\PREIMAGE(f,T).
IMAGE(f,S1 union S2)=IMAGE(f,S1) union IMAGE(f,S2).
IMAGE(f,S1 intersection S2) subseteq IMAGE(f,S1) intersection IMAGE(f,S2).
7. CARDINALITY AND FINITE SETS
For finite A and B, number of functions A->B = |B|^|A|, with 0^0=1 for the empty-domain case.
If finite A,B and |A|>|B|, no injective function A->B exists.
If finite A,B and |A|<|B|, no surjective function A->B exists.
For finite sets of equal size, injectivity, surjectivity and bijectivity are equivalent.
8. SEMANTIC RELATIONSHIPS
Function --IS_A--> BinaryRelation
Function --HAS_DOMAIN--> Domain
Function --HAS_CODOMAIN--> Codomain
Function --HAS_GRAPH--> Graph
Function --MAPS--> Argument -> Image
Function --MAY_BE--> InjectiveFunction
Function --MAY_BE--> SurjectiveFunction
Function --MAY_BE--> BijectiveFunction
BijectiveFunction --HAS--> InverseFunction
Function --COMPOSES_WITH--> Function [codomain/domain compatible]
Function --RELATED_TO--> SetTheory
Function --RELATED_TO--> RelationTheory
Function --RELATED_TO--> Algorithms
9. INFERENCE RULES
R1: FUNCTION(f,A,B) AND x in A => exists unique y in B: f(x)=y.
R2: INJECTIVE(f) AND f(x)=f(y) => x=y.
R3: SURJECTIVE(f) AND y in B => exists x in A: f(x)=y.
R4: BIJECTIVE(f) => INVERTIBLE(f).
R5: INVERTIBLE(f) => BIJECTIVE(f).
R6: BIJECTIVE(f) AND BIJECTIVE(g) AND TYPE_COMPATIBLE(f,g) => BIJECTIVE(g o f).
R7: FUNCTION(f,A,B) AND FUNCTION(g,B,C) => FUNCTION(g o f,A,C).
10. VALIDATION
REQUIRE explicit domain and codomain.
REQUIRE every domain element has exactly one assigned codomain value.
REJECT duplicate inputs with conflicting outputs.
REJECT output values outside codomain.
REJECT untyped composition with mismatched intermediate sets.
CHECK injectivity/surjectivity against declared domain and codomain.
CHECK inverse exists only for bijections (as a full two-sided inverse).
RECORD proof or counterexample for each classified property.
11. SEMANTIC_EQUIVALENCE
FUNCTION_AS_GRAPH equivalent_to TOTAL_SINGLE_VALUED_BINARY_RELATION [same domain/codomain].
BIJECTION equivalent_to INVERTIBLE_FUNCTION [two-sided inverse].
ONE_TO_ONE equivalent_to INJECTIVE_FUNCTION.
ONTO equivalent_to SURJECTIVE_FUNCTION.
NOTE: Equality of rules requires identical typing and domain/codomain semantics.
12. CONFIDENCE
Mathematical definitions and stated laws: 1.00 (deductive, subject to stated assumptions).
External ontology alignments: require provenance and independent review.
Unverified source-page-specific assertions: NOT_ASSERTED.
13. FLOW_HASH
METHOD: SHA-256 over UTF-8 normalised canonical flow content, excluding FLOW_HASH value.
VALUE: COMPUTE_AT_INGESTION
14. UPDATE_MODEL
TRIGGER: new definitions, corrected laws, ontology mapping changes, or revised provenance.
STEPS: validate -> version -> regenerate hash -> preserve prior version -> publish.
INVARIANT: retain mathematical correctness and explicit domain/codomain constraints.
15. AI_CONSUMPTION
PARSE: typed definitions, operations, constraints, and relationships.
REASON: use inference rules only when their preconditions hold.
VERIFY: check totality, uniqueness, type compatibility and cardinality conditions.
OUTPUT: result, proof/counterexample, confidence, version and provenance.
FAIL_CLOSED: return UNKNOWN rather than inventing undefined values or invalid inverses.
END FLOW ALGEBRA