A function f: A → B is a rule assigning to each element of the domain A exactly one element of the codomain B. Formally, a function is a set of ordered pairs (a, b) with a ∈ A and b ∈ B, such that each a appears in exactly one pair. The image (or range) of f is the set of elements b ∈ B that actually appear as outputs.
A function is injective (one-to-one) if distinct inputs produce distinct outputs: f(a₁) = f(a₂) implies a₁ = a₂. It is surjective (onto) if every element of B is an output. A function that is both injective and surjective is bijective — it establishes a one-to-one correspondence between A and B.
Functions compose: given f: A → B and g: B → C, the composite g ∘ f: A → C sends a to g(f(a)). Composition is associative, and the identity function id_A: A → A acts as a neutral element. These properties make functions the morphisms of the category Set, the category of sets and functions.
In the semiotic universe, the operators in Op are functions on the Heyting algebra H — the semantic, syntactic, and fusion closures are all functions from H to H satisfying specific algebraic properties. A functor generalizes functions to the categorical setting, preserving composition and identities.