Documentation

Complexitylib.Classes.P.Cobham.Vec

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 #

Encode an argument vector as a single bitstring by nested pairing, with the head component placed in the verbatim suffix: encodeVec ![] = [] and encodeVec (x ::ᵥ v) = pair (encodeVec v) x.

Equations
Instances For
    @[simp]
    theorem Complexity.Cobham.encodeVec_succ {n : } (v : Fin (n + 1)List Bool) :

    The arity-one encoding is the single component placed in the verbatim suffix of an empty block: encodeVec ![x] = pair [] x.

    The sum of the component lengths of a fixed-arity input vector.

    Equations
    Instances For

      Exact recursive length law for the nested tuple encoding.

      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.

      def Complexity.Cobham.FPn {n : } (f : (Fin nList Bool)List Bool) :

      Multi-arity polynomial time. A function of an argument vector is FPn when some genuine unary FP function computes it on encoded vectors.

      Equations
      Instances For