Erasure identities and exact consistency #
The original and erased programs have identical wire namespaces. Gate equations therefore compare their traces directly, using CSLib's acyclic uniqueness theorem.
theorem
Algebraic.Aggregate.eraseLine_eval
{J : Type}
{State : J → Type}
{n g : ℕ}
[(j : J) → CommMonoid (State j)]
(line : Line (signature State) n g)
(value : Bool)
(input : Fin n → Bool)
(gates : Fin g → Bool)
:
(eraseLine line value).eval ordinaryInterpretation input gates = if Op.isSpecial line.op = true then value else line.eval interpretation input gates
theorem
Algebraic.Aggregate.eraseWith_eval_gate
{J : Type}
{State : J → Type}
{n g : ℕ}
[(j : J) → CommMonoid (State j)]
(p : Program (signature State) n g)
(values : Fin g → Bool)
(input : Fin n → Bool)
(gate : Fin g)
:
(eraseWith p values).eval ordinaryInterpretation input gate = if Op.isSpecial (p.lines gate).op = true then values gate
else (p.lines gate).eval interpretation input ((eraseWith p values).eval ordinaryInterpretation input)
theorem
Algebraic.Aggregate.erase_fanInAtMost
{J : Type}
{State : J → Type}
{n g : ℕ}
(p : Program (signature State) n g)
(a : Guess p)
:
(erase p a).FanInAtMost 2
theorem
Algebraic.Aggregate.erase_eval_special
{J : Type}
{State : J → Type}
{n g : ℕ}
[(j : J) → CommMonoid (State j)]
(p : Program (signature State) n g)
(a : Guess p)
(input : Fin n → Bool)
(gate : SpecialGate p)
:
theorem
Algebraic.Aggregate.erase_eval_of_consistent
{J : Type}
{State : J → Type}
{n g : ℕ}
[(j : J) → CommMonoid (State j)]
(p : Program (signature State) n g)
(a : Guess p)
(input : Fin n → Bool)
(h : Consistent p a input)
:
theorem
Algebraic.Aggregate.erase_eval_actualGuess
{J : Type}
{State : J → Type}
{n g : ℕ}
[(j : J) → CommMonoid (State j)]
(p : Program (signature State) n g)
(input : Fin n → Bool)
:
theorem
Algebraic.Aggregate.actualGuess_consistent
{J : Type}
{State : J → Type}
{n g : ℕ}
[(j : J) → CommMonoid (State j)]
(p : Program (signature State) n g)
(input : Fin n → Bool)
:
Consistent p (actualGuess p input) input
theorem
Algebraic.Aggregate.consistent_iff_eq_actualGuess
{J : Type}
{State : J → Type}
{n g : ℕ}
[(j : J) → CommMonoid (State j)]
(p : Program (signature State) n g)
(a : Guess p)
(input : Fin n → Bool)
: