Padding layered Boolean circuits with copies #
An identity layer copies every wire in order. Appending such layers extends a schedule to a chosen layer count without changing its value or output width. Schedules already longer than the target are unchanged. The construction also covers zero-width rows and empty schedules.
Main definitions #
Cslib.Circuits.Boolean.Layered.identityLayer: one copy node per input wire.Cslib.Circuits.Boolean.Layered.padTo: append copies up to a target layer count.
Main results #
Cslib.Circuits.Boolean.Layered.eval_padTo: padding preserves evaluation on actual inputs.Cslib.Circuits.Boolean.Layered.outputWidth_padTo: padding preserves the final width.Cslib.Circuits.Boolean.Layered.WellFormed.padTo: padding preserves valid references.Cslib.Circuits.Boolean.Layered.length_padTo: the resulting length is the larger of the original length and the target.
References #
Copy gates between consecutive layers are used in Gentry, Section 2.
Copy every wire in order, including the empty row when width = 0.
Instances For
@[simp]
theorem Cslib.Circuits.Boolean.Layered.valid_identityLayer (width : ℕ) (node : Node) :
node ∈ identityLayer width → Node.Valid width node
@[simp]
@[simp]
theorem Cslib.Circuits.Boolean.Layered.eval_replicate_identityLayer (inputs : List Bool) (count : ℕ) :
@[simp]
theorem Cslib.Circuits.Boolean.Layered.wellFormed_replicate_identityLayer (width count : ℕ) :
WellFormed width (List.replicate count (identityLayer width))
@[simp]
theorem Cslib.Circuits.Boolean.Layered.outputWidth_padTo (inputCount target : ℕ) (layers : List (List Node)) :
theorem Cslib.Circuits.Boolean.Layered.WellFormed.padTo {inputCount : ℕ} {layers : List (List Node)} (h : WellFormed inputCount layers) (target : ℕ) :
WellFormed inputCount (Layered.padTo inputCount target layers)