Documentation

CslibFrontier.Computability.Circuit.Normalization

Projection-aware deduplication #

Program.exists_irredundant_ne_input strengthens cslib's Program.exists_irredundant. Besides merging gates that compute the same function, it skips gates computing an input projection, so the rebuilt program has one gate per distinct gate function that is not a projection. Every gate of the rebuilt program computes the function of some gate of the original.

Main results #

References #

This is the deduplication step of Ilango, Loff and Oliveira, Proposition 14 (pp. 22:21–22:22), generalized to arbitrary signatures and interpretations.

theorem Cslib.Circuits.Program.exists_irredundant_ne_input {σ : Signature} {U : Type u} {n s : ℕ} (p : Program σ n s) (I : Interpretation σ U) :
∃ s' ≤ s, ∃ (q : Program σ n s') (ρ : Wire.Renaming n s s'), (∀ (x : Fin n → U) (w : Wire n s), q.trace I x (ρ.apply w) = p.trace I x w) ∧ q.Irredundant I ∧ (∀ (t : Fin s') (i : Fin n), q.gateFunction I t ≠ fun (x : Fin n → U) => x i) ∧ ∀ (t : Fin s'), ∃ (t₀ : Fin s), ρ.gates t₀ = Wire.gate t

Projection-aware deduplication, strengthening Program.exists_irredundant. A program can be rebuilt so that its gates compute pairwise distinct functions, none of which is an input projection, while every wire keeps its value. Each new gate computes the function of some gate of the original program.