Documentation

CslibFrontier.Computability.Circuit.Boolean.AffineDisperser4n.Normal

Normal form and Cases 1–5a of Lemma 4.2 for 4n - 9d gate elimination #

Every valid state S for a d-affine disperser with d < S.a either admits a step strictly reducing m + s with ΔW ≤ 9 Δa (via deletions, moving an affine gate into the affine system, or eliminating a degenerate pair, shared child, pair in an equation, or AND gate reading a paired parameter), or else satisfies State.Normal:

Main definitions #

Main results #

References #

Helper lemmas on pairs #

Moving affine gates #

Whether S has an affine gate reading no gates, ready to be moved into the affine system.

An equation identifier guaranteed not to belong to S.eqns.

Moving an affine gate reading no gates is a preparatory operation reducing gates.card.

Case 2: Degenerate paired parameter #

A paired parameter whose degree is 0 or at least 2 (Case 2).

When no paired parameter is degenerate, every paired parameter has degree 1.

Fixing the partner of a paired parameter p of degree 0 to its bias gives a valid step with Δa = 0 and ΔW ≤ 0 (Case 2).

theorem Cslib.Circuits.Boolean.AffineDisperser4n.State.Valid.step_degeneratePair_two {n : ℕ} {S : State n} {f : BooleanFunction n} (hS : AffineDisperserCore.State.Valid S f) {pr : ZeroPair} (hpr : pr ∈ S.pairs) {p : ℕ} (hprp : pr.Contains p) {N₁ N₂ : ℕ ⊕ ℕ} (hN₁ : N₁ ∈ S.children p) (hN₂ : N₂ ∈ S.children p) (hN₁₂ : N₁ ≠ N₂) :

Fixing a paired parameter p to its bias and deleting two distinct children N₁ ≠ N₂ of p gives a valid step with Δa = 0 and ΔW ≤ 0 (Case 2).

Eliminating a degenerate paired parameter gives a valid step with Δa = 0 and ΔW ≤ 0.

Case 3: Partners sharing a child #

Two paired partners share a child (Case 3).

The successor state of Case 3 for paired partners pr.fst and pr.snd sharing the child H. For a gate H = .inl G, φ is the operation of G as a function of the values of pr.fst and pr.snd. If φ does not depend on its second argument when the first is pr.fstBias, then pr.fst is fixed to pr.fstBias; symmetrically for pr.snd. Otherwise pr.fst is restricted to the literal of pr.snd that satisfies the pair, on which G is constant. In each case the now constant gate G is deleted. For an equation H = .inr e, pr.fst is restricted to that literal and e is deleted.

Eliminating a shared child H of paired partners by S.partnersShareChildStep pr H gives a valid step with Δa = 0 and ΔW ≤ -4, provided every paired parameter has degree 1 and every equation has more than two terms.

Eliminating a shared child of paired partners gives a valid step with Δa = 0 and ΔW ≤ -4.

Case 4: Paired parameter in an affine equation #

A paired parameter occurring in an affine equation (Case 4).

theorem Cslib.Circuits.Boolean.AffineDisperser4n.State.Valid.step_pairInSystem_of {n : ℕ} {S : State n} {f : BooleanFunction n} (hS : AffineDisperserCore.State.Valid S f) (hndeg : ¬S.DegeneratePair) (hnsh : ¬S.PartnersShareChild) {pr : ZeroPair} (hpr : pr ∈ S.pairs) {p e : ℕ} (hprp : pr.Contains p) (he : e ∈ S.eqns) (hpe : p ∈ (S.eqn e).terms) (hout : ¬S.out.Reads p) {Hr : ℕ ⊕ ℕ} (hHr : Hr ∈ S.children (pr.partner p)) :
have S₂ := (AffineDisperserCore.State.fixConst S (pr.partner p) (pr.partnerBias p)).deleteConstraint Hr; S₂.Valid f ∧ p ∈ S₂.unpaired ∧ S₂.children p ⊆ {Sum.inr e} ∧ (S₂.deg p = 0 → AffineDisperserCore.State.Step f S S₂) ∧ (S₂.deg p ≠ 0 → ∀ (Q : ℕ) (c : Bool) (T : Finset ℕ), Q ∈ S₂.aux → SemiCircuit.AffineIn Q c T → p ∈ T → AffineDisperserCore.State.Step f S ((S₂.swap p Q c T).dropEqn e p))

Case 4, concretely and without a disperser hypothesis. Let p be a paired parameter occurring in the equation e and not read by the output, and Hr a child of its partner. Fixing the partner to its pair bias and deleting Hr gives S₂, in which p is unpaired with children among {.inr e}. If p has degree 0 in S₂, then S₂ is a step; otherwise unit-deleting p with any auxiliary variable Q affine in parameters containing p is a step.

Eliminating a paired parameter in an equation (and unit-deleting if its partner's degree stays 1) gives a valid step with Δa = 0 and ΔW ≤ 0.

Case 5a: Non-affine gate reading a paired parameter and another parameter #

A non-affine gate reading a paired parameter p and another parameter w ≠ p (Case 5a).

theorem Cslib.Circuits.Boolean.AffineDisperser4n.State.Valid.child_partner_ne_of_reads {n : ℕ} {S : State n} {f : BooleanFunction n} (hS : AffineDisperserCore.State.Valid S f) (hnsh : ¬S.PartnersShareChild) {pr : ZeroPair} (hpr : pr ∈ S.pairs) {p : ℕ} (hprp : pr.Contains p) {G : ℕ} (hG : G ∈ S.gates) (hGp : (S.gate G).Reads p) {Hr : ℕ ⊕ ℕ} (hHr : Hr ∈ S.children (pr.partner p)) :

When partners share no child, a child Hr of the partner of the paired parameter p is not a gate G reading p (the side condition Hr ≠ .inl G of Case 5a).

theorem Cslib.Circuits.Boolean.AffineDisperser4n.State.Valid.andOnPair_child_ne {n : ℕ} {S : State n} {f : BooleanFunction n} (hS : AffineDisperserCore.State.Valid S f) (hnsh : ¬S.PartnersShareChild) {G : ℕ} (hG : G ∈ S.gates) {pr q : ZeroPair} (hpr : pr ∈ S.pairs) (hq : q ∈ S.pairs) {p w : ℕ} (hprp : pr.Contains p) (hqw : q.Contains w) (hpw : p ≠ w) (hGp : (S.gate G).Reads p) (hGw : (S.gate G).Reads w) {K : ℕ} (hKr : (S.gate K).Reads G) {Hw' : ℕ ⊕ ℕ} (hHw' : Hw' ∈ S.children (q.partner w)) :
Hw' ≠ Sum.inl G ∧ (Sum.inl K ∈ S.children (pr.partner p) → Hw' ≠ Sum.inl K)

The third constraint of Case 5a. Let the gate G read the parameter p of the pair pr and the parameter w ≠ p of the pair q, let the gate K read G, and let Hw' be a child of q.partner w. When partners share no child, Hw' is not G, and it is not K when K is a child of pr.partner p: a gate reads at most two names.

def Cslib.Circuits.Boolean.AffineDisperser4n.State.andOnPairStep {n : ℕ} (S : State n) (G : ℕ) (pr : ZeroPair) (p w : ℕ) (prw : Option ZeroPair) (b c : Bool) (Hr : ℕ ⊕ ℕ) (K : ℕ) (Hw' : ℕ ⊕ ℕ) :

The successor in Case 5a. A non-affine gate G reads the parameter p of the pair pr and the parameter w, and becomes the constant c once w = b. Fix the partner of p to its partner bias.

  • When w is unpaired (prw = none) or paired in q with matching bias b = q.bias w, fix w := b, delete G as Lit.const c, and delete Hr (the child of pr.partner p).
  • When w lies in prw = some q with opposite bias b ≠ q.bias w, also fix q.partner w to its partner bias, fix w := b, delete G as Lit.const c, delete the gate K reading G, and delete if Hr = .inl K then Hw' else Hr (a third distinct constraint, since a binary gate K reading G cannot also read both pr.partner p and q.partner w).
theorem Cslib.Circuits.Boolean.AffineDisperser4n.State.Valid.step_andOnPair_of {n : ℕ} {S : State n} {f : BooleanFunction n} (hS : AffineDisperserCore.State.Valid S f) (hndeg : ¬S.DegeneratePair) (hnsh : ¬S.PartnersShareChild) {G : ℕ} (hG : G ∈ S.gates) {p w : ℕ} {pr : ZeroPair} (hpr : pr ∈ S.pairs) (hprp : pr.Contains p) (hwpar : w ∈ S.params) (hpw : p ≠ w) (hGp : (S.gate G).Reads p) (hGw : (S.gate G).Reads w) {prw : Option ZeroPair} (hprw_none : prw = none → ¬AffineDisperserCore.State.Paired S w) (hprw_some : ∀ (q : ZeroPair), prw = some q → q ∈ S.pairs ∧ q.Contains w) {b c : Bool} (hbc : ∀ (val : ℕ → Bool), val w = b → (S.gate G).eval val = c) {Hr : ℕ ⊕ ℕ} (hHr : Hr ∈ S.children (pr.partner p)) {K : ℕ} {Hw' : ℕ ⊕ ℕ} (hK : ∀ (q : ZeroPair), prw = some q → b ≠ q.bias w → K ∈ S.gates ∧ (S.gate K).Reads G) (hHw' : ∀ (q : ZeroPair), prw = some q → b ≠ q.bias w → Hw' ∈ S.children (q.partner w)) :
AffineDisperserCore.State.Step f S (S.andOnPairStep G pr p w prw b c Hr K Hw')

Case 5a with an explicit successor: eliminating a non-affine gate reading a paired parameter p and another parameter w by S.andOnPairStep is a valid step with ΔW ≤ 9 Δa. Here prw is the pair of w, if any, G is the constant c once w = b, Hr is a child of pr.partner p, and in the opposite-bias paired case K is a gate reading G and Hw' is a child of q.partner w.

Eliminating a non-affine gate reading a paired parameter p and another parameter w gives a valid step with ΔW ≤ 9 Δa.

Normal form #

A normal state has no movable affine gate and satisfies none of Cases 1–5a.

Every parameter occurring in an affine equation of a normal state is unpaired with degree at least 2.

theorem Cslib.Circuits.Boolean.AffineDisperser4n.State.Normal.unpaired_of_and_reads {n : ℕ} {S : State n} (hN : S.Normal) {G p w : ℕ} (hG : G ∈ S.gates) (hnotaff : ¬SemiCircuit.IsAffineOp (S.gate G).op) (hpw : p ≠ w) (hp_par : p ∈ S.params) (hw_par : w ∈ S.params) (hGp : (S.gate G).Reads p) (hGw : (S.gate G).Reads w) :

Any parameter read by a non-affine gate of a normal state is unpaired with degree at least 1.

theorem Cslib.Circuits.Boolean.AffineDisperser4n.State.Normal.two_reads_of_gate {n : ℕ} {S : State n} (hN : S.Normal) {G : ℕ} (hG : G ∈ S.gates) :
∃ (a : ℕ) (b : ℕ), a ≠ b ∧ (S.gate G).Reads a ∧ (S.gate G).Reads b

In a normal state, every gate reads two distinct inputs.

Either Cases 1–5a yield a valid step strictly reducing m + s with ΔW ≤ 9 Δa, or S is in normal form.