Documentation

CslibFrontier.Computability.Circuit.Support

Circuit input support #

cslib computes the original inputs that can affect each wire (Cslib.Circuits.Program.wireSupport, Cslib.Circuits.Circuit.inputSupport) and proves that circuit evaluation depends only on those inputs (Cslib.Circuits.Circuit.dependsOn_eval); these were upstreamed from this file in cslib#1181. This file keeps the additions cslib does not have: the support of a gate and of a designated output, and essential coordinates. An input on which a function depends essentially (EssentialAt) reaches an output of every circuit computing it.

Main definitions #

Main results #

def Cslib.Circuits.EssentialAt {U : Type u_1} {V : Type u_2} {n : ℕ} (f : (Fin n → U) → V) (i : Fin n) :

Changing only coordinate i can change the value of f.

theorem Cslib.Circuits.EssentialAt.mem_support {U : Type u_1} {V : Type u_2} {n : ℕ} {f : (Fin n → U) → V} {support : Finset (Fin n)} {i : Fin n} (h : EssentialAt f i) (hf : DependsOn f ↑support) :
i ∈ support

Every essential coordinate belongs to any support of the function.

theorem Cslib.Circuits.essentialAt_iff_not_dependsOn {U : Type u_1} {V : Type u_2} {n : ℕ} {f : (Fin n → U) → V} {i : Fin n} :

A coordinate is essential exactly when the function does not depend only on the others.

def Cslib.Circuits.Program.gateSupport {σ : Signature} {n g : ℕ} (program : Program σ n g) :
Fin g → Finset (Fin n)

The input support of every gate in a program.

@[simp]
theorem Cslib.Circuits.Program.wireSupport_gate {σ : Signature} {n g : ℕ} (program : Program σ n g) (gate : Fin g) :
program.wireSupport (Wire.gate gate) = program.gateSupport gate

A gate-output wire has the support of that gate.

@[simp]
theorem Cslib.Circuits.Program.gateSupport_gate_last {σ : Signature} {n g : ℕ} (program : Program σ n g) (line : Line σ n g) :
(program.gate line).gateSupport (Fin.last g) = line.inputSupport program.wireSupport

The new gate is supported by precisely the inputs supporting the new line.

def Cslib.Circuits.Circuit.outputSupport {σ : Signature} {n m : ℕ} (c : Circuit σ n m) :
Fin m → Finset (Fin n)

The input support of every designated output wire in a circuit.

theorem Cslib.Circuits.Program.eval_congr {σ : Signature} {U : Type u_1} {n g : ℕ} (program : Program σ n g) (interpretation : Interpretation σ U) (left right : Fin n → U) (k : Fin g) (agree : ∀ i ∈ program.gateSupport k, left i = right i) :
program.eval interpretation left k = program.eval interpretation right k

Program gates agree whenever their supporting inputs agree.

theorem Cslib.Circuits.Circuit.Computes.dependsOn {σ : Signature} {U : Type u_1} {n m : ℕ} {c : Circuit σ n m} {interpretation : Interpretation σ U} {target : (Fin n → U) → Fin m → U} (computes : c.Computes interpretation target) :

A computed function depends only on the circuit's structural input support.