Documentation

Complexitylib.Circuits.Family

Boolean circuit families #

This module provides the public API for circuit-family semantics, concrete size/depth bounds, and the equivalence between pointwise polynomial bounds and the power big-O convention used by complexity classes.

theorem Complexity.Circuit.computes_congr {B : Basis} {N G : } [NeZero N] (c : Circuit B N 1 G) {f g : BitString NBool} (h : f = g) :

Computes respects equality of the target function.

theorem Complexity.Circuit.computesOnLength_congr {B : Basis} {N G : } [NeZero N] (c : Circuit B N 1 G) {f g : BoolFunFamily} (h : f N = g N) :

ComputesOnLength depends only on the family's component at length N.

theorem Complexity.Circuit.Computes.apply {B : Basis} {N G : } [NeZero N] {c : Circuit B N 1 G} {f : BitString NBool} (h : c.Computes f) (x : BitString N) :
c.eval x 0 = f x

A circuit computing f evaluates to f x on each input x.

theorem Complexity.Circuit.ComputesOnLength.apply {B : Basis} {N G : } [NeZero N] {c : Circuit B N 1 G} {f : BoolFunFamily} (h : c.ComputesOnLength f) (x : BitString N) :
c.eval x 0 = f N x

A circuit computing a family at length N evaluates to f N x on each input x.

theorem Complexity.Circuit.Computes.sizeComplexity_le {B : Basis} {N G : } [NeZero N] {c : Circuit B N 1 G} {f : BitString NBool} (h : c.Computes f) :

Any circuit computing f witnesses an upper bound on the size complexity of f.

@[simp]

At length 0 the family's function is the designated empty-input output.

@[simp]
theorem Complexity.CircuitFamily.function_succ {B : Basis} (F : CircuitFamily B) (n : ) (x : BitString (n + 1)) :
F.function (n + 1) x = (F.circuit (n + 1)).eval x 0

At positive lengths the family's function is evaluation of the length-n + 1 circuit.

@[simp]

The size of a circuit family at length 0 is 0.

@[simp]
theorem Complexity.CircuitFamily.size_succ {B : Basis} (F : CircuitFamily B) (n : ) :
F.size (n + 1) = (F.circuit (n + 1)).size

At positive lengths the family's size is the size of the length-n + 1 circuit.

@[simp]

The depth of a circuit family at length 0 is 0.

@[simp]
theorem Complexity.CircuitFamily.depth_succ {B : Basis} (F : CircuitFamily B) (n : ) :
F.depth (n + 1) = (F.circuit (n + 1)).depth

At positive lengths the family's depth is the depth of the length-n + 1 circuit.

theorem Complexity.CircuitFamily.sizeBoundedBy_mono {B : Basis} (F : CircuitFamily B) {s t : } (hF : F.SizeBoundedBy s) (hst : ∀ (n : ), s n t n) :

A size bound may be weakened to any pointwise larger bound.

theorem Complexity.CircuitFamily.depthBoundedBy_mono {B : Basis} (F : CircuitFamily B) {d e : } (hF : F.DepthBoundedBy d) (hde : ∀ (n : ), d n e n) :

A depth bound may be weakened to any pointwise larger bound.

A pointwise size bound yields a big-O size bound.

Pointwise polynomial size is equivalent to a big-O power bound.

Computes respects equality of the target function family.

theorem Complexity.CircuitFamily.computes_unique {B : Basis} (F : CircuitFamily B) {f g : BoolFunFamily} (hf : F.Computes f) (hg : F.Computes g) :
f = g

A circuit family computes at most one function family.

@[simp]

Evaluating the serialized fixed-length input agrees with family evaluation at that length.

@[simp]

Evaluating the list form of a fixed-length input agrees with family evaluation at that length.

@[simp]

Evaluating the empty list yields the designated empty-input output.

theorem Complexity.CircuitFamily.Computes.apply {B : Basis} {F : CircuitFamily B} {f : BoolFunFamily} (h : F.Computes f) (n : ) (x : BitString n) :
F.function n x = f n x

A family computing f agrees with f at every length and input.

A family computing f evaluates any list input to f at the list's length.