Circuit complexity as a distance #
Let I interpret a signature over a carrier U with an additive group structure, so that the
functions (Fin n → U) → U form a group under pointwise operations. The difference distance
Cslib.Circuits.diffDist I c f g is 0 when f = g, and otherwise the circuit complexity of
f - g plus a constant c. Two circuit facts make it a distance:
- combining two outputs by an operation costs at most the complexity of that operation on two
inputs (
Cslib.Circuits.complexity_single_binary_le). Sincef - h = (f - g) + (g - h), the triangle inequality holds oncecpays for an addition circuit (Cslib.Circuits.diffDist_triangle); - since
g - f = -(f - g), exchanging the arguments costs at most a negation circuit (Cslib.Circuits.diffDist_comm_le).
So diffDist I c is a right-translation-invariant quasi-metric when c is positive and pays for
addition. It need not be symmetric: over a complete basis in which negation costs a gate,
the projection x ↦ x 0 is computed by no gates while its negation needs one. It is symmetric
when negation leaves complexity unchanged, as in a group of exponent two, where -u = u. A
negation circuit of cost zero only exists in that case, since circuits without gates compute
projections (Cslib.Circuits.one_le_complexity_single).
When c is positive and pays for addition, and negation leaves complexity unchanged, the map
sending 0 to 0 and every other f to C(f) + c is a norm on the group of functions
(Cslib.Circuits.diffNorm). For commutative groups its distance is the difference distance
(Cslib.Circuits.dist_diffNorm). Circuit complexity is then, up to the constant, a norm on a
translation-invariant metric group. Boolean functions with the De Morgan basis are the case
c = 4, with addition the exclusive or; see Complexity.Computability.Circuit.Boolean.Metric.
Main definitions #
Cslib.Circuits.diffDist: the difference distance.Cslib.Circuits.diffNorm: the corresponding norm, under negation invariance.
Main results #
Cslib.Circuits.diffDist_eq_zero_iff,Cslib.Circuits.diffDist_triangle,Cslib.Circuits.diffDist_comm_le: a quasi-metric.Cslib.Circuits.diffDist_add_right,Cslib.Circuits.diffDist_add_left: translation invariance.Cslib.Circuits.diffDist_comm: symmetry under negation invariance.Cslib.Circuits.dist_diffNorm: the norm induces the difference distance.
References #
The difference distance #
The difference distance between f and g: 0 if they are equal, and otherwise the circuit
complexity of f - g plus c.
Instances For
The difference distance separates functions when c is positive.
The difference distance is invariant under translation on the right.
The triangle inequality, when c pays for a circuit adding two inputs.
Exchanging the arguments costs at most a circuit negating its input.
The difference distance is symmetric when negation leaves complexity unchanged.
The difference distance is invariant under translation on the left, for commutative groups.
The norm #
Circuit complexity as a norm: 0 at 0, and otherwise the complexity plus c, when c is
positive and pays for a circuit adding two inputs, and negation leaves complexity unchanged.
Instances For
The norm induces the difference distance on the normed group of functions.