Fixed-arity inputs for Cobham's characterization #
FP is defined for unary string functions, while Cobham's algebra is inherently
multi-arity. This module gives the public, auditable bridge: encodeVec packs a
fixed-arity argument vector into one string, vectorLength measures its unencoded
size, and FPn asks a unary FP function to agree on the encoded vectors.
The nested pairing has an arity-dependent constant overhead. It is injective, and
for every fixed arity its encoded length is linear in vectorLength.
Main definitions and results #
Cobham.encodeVec— nested-pairing tuple encoding, head component lastCobham.vectorLength— sum of the component lengthsCobham.encodeVec_injective— tuple encoding loses no informationCobham.encodeVec_length_le— fixed-arity linear length boundCobham.FPn— polynomial time on encoded argument vectors
encodeVec is injective at every arity.
For fixed arity n, the nested encoding has length linear in the sum of the
component lengths. The explicit coefficient also records that this is not a
uniform-in-arity linear bound.
Multi-arity polynomial time. A function of an argument vector is FPn
when some genuine unary FP function computes it on encoded vectors.
Equations
- Complexity.Cobham.FPn f = ∃ g ∈ Complexity.FP, ∀ (v : Fin n → List Bool), g (Complexity.Cobham.encodeVec v) = f v