Documentation

Complexitylib.Algebraic.LowerBound.KarchmerWigderson.Sharing.Extended.Defs

The De Morgan basis extended by XOR and EQUIV gates #

This file defines the circuit basis of Extended.signature: the De Morgan operations (Boolean constants, identity, NOT, binary AND and OR) together with binary XOR and EQUIV gates, its standard interpretation Extended.interpretation, and three cost models: Extended.deMorganCost counts the AND and OR gates, Extended.xorCost the XOR and EQUIV gates, and Extended.binaryCost all binary gates.

It also defines the four-leaf De Morgan formulas Formula.xorGadget z₁ z₂ and Formula.equivGadget z₁ z₂ computing z₁ ⊕ z₂ and z₁ ↔ z₂. When both variables are shared values (indices at least m), the gadgets have no input leaves below m; this is what lets an XOR or EQUIV gate of any fan-out be charged only two shared values in the Khrapchenko bound of Complexitylib.Algebraic.LowerBound.KarchmerWigderson.Sharing.Extended.

XOR and EQUIV gadgets #

def Algebraic.KW.Formula.xorGadget {N : ℕ} (z₁ z₂ : Fin N) :

The De Morgan formula (z₁ ∧ ¬z₂) ∨ (¬z₁ ∧ z₂) computing z₁ ⊕ z₂ on two variables.

Equations
  • One or more equations did not get rendered due to their size.
Instances For
    def Algebraic.KW.Formula.equivGadget {N : ℕ} (z₁ z₂ : Fin N) :

    The De Morgan formula (z₁ ∧ z₂) ∨ (¬z₁ ∧ ¬z₂) computing z₁ ↔ z₂ on two variables.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      @[simp]
      theorem Algebraic.KW.Formula.eval_xorGadget {N : ℕ} (z₁ z₂ : Fin N) (x : Fin N → Bool) :
      (xorGadget z₁ z₂).eval x = (x z₁ ^^ x z₂)
      @[simp]
      theorem Algebraic.KW.Formula.eval_equivGadget {N : ℕ} (z₁ z₂ : Fin N) (x : Fin N → Bool) :
      (equivGadget z₁ z₂).eval x = (x z₁ == x z₂)
      theorem Algebraic.KW.Formula.inputLeaves_xorGadget_of_ge {N m : ℕ} {z₁ z₂ : Fin N} (h₁ : m ≤ ↑z₁) (h₂ : m ≤ ↑z₂) :
      (xorGadget z₁ z₂).inputLeaves m = 0

      When both variables z₁, z₂ are shared variables (≥ m), xorGadget z₁ z₂ contributes zero input leaves below m.

      theorem Algebraic.KW.Formula.inputLeaves_equivGadget_of_ge {N m : ℕ} {z₁ z₂ : Fin N} (h₁ : m ≤ ↑z₁) (h₂ : m ≤ ↑z₂) :
      (equivGadget z₁ z₂).inputLeaves m = 0

      When both variables z₁, z₂ are shared variables (≥ m), equivGadget z₁ z₂ contributes zero input leaves below m.

      The extended basis #

      Operation symbols of the extended De Morgan basis with binary xor and equiv gates.

      Instances For
        @[instance_reducible]
        Equations
        @[instance_reducible]
        Equations
        • One or more equations did not get rendered due to their size.
        @[reducible, inline]

        Signature of the extended De Morgan + XOR/EQUIV basis.

        Equations
        Instances For