Documentation

Complexitylib.Algebraic.Basis.Arithmetic

Arithmetic circuit basis #

The arithmetic basis has binary addition and multiplication together with a family of nullary constants. The constant symbols are parameterized independently of the semantic carrier, so the same syntax can be interpreted in a polynomial ring, an extension field, a quotient, or an abstract algebra.

No ring laws are built into the circuit syntax. interpretation only asks for addition and multiplication on the carrier and for a map assigning semantic values to constant symbols. Algebraic laws and homomorphism properties belong to the chosen interpretations.

inductive Algebraic.Arithmetic.Op (K : Type u) :

Addition, multiplication, and a parameterized family of constants.

Instances For

    Arithmetic operations are equivalent to two binary symbols plus the constant-symbol type.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      @[instance_reducible]
      noncomputable instance Algebraic.Arithmetic.instFintypeOp {K : Type u_1} [Fintype K] :

      A finite constant alphabet gives a finite arithmetic signature.

      Equations
      @[simp]
      theorem Algebraic.Arithmetic.arity_constant {K : Type u_1} (value : K) :
      arity (Op.constant value) = 0
      @[reducible, inline]

      Signature of arithmetic circuits with constants named by K.

      Equations
      Instances For
        def Algebraic.Arithmetic.interpretation {R : Type u_1} {K : Type u_2} [Add R] [Mul R] (constant : K → R) (op : Op K) :
        (Fin (arity op) → R) → R

        Interpret arithmetic syntax in any carrier with addition and multiplication, using constant to interpret the nullary symbols.

        Equations
        Instances For

          Interpret constants by themselves in their native arithmetic carrier.

          Equations
          Instances For
            def Algebraic.Arithmetic.weightedCost {K : Type u_1} (addition multiplication : ℕ) :

            Charge additions and multiplications independently; constants are free.

            Equations
            Instances For

              Standard arithmetic gate count: additions and multiplications cost one.

              Equations
              Instances For

                Multiplicative complexity: only multiplication gates are charged.

                Equations
                Instances For

                  Additive complexity: only addition gates are charged.

                  Equations
                  Instances For
                    @[simp]
                    theorem Algebraic.Arithmetic.weightedCost_add {K : Type u_1} (addition multiplication : ℕ) :
                    weightedCost addition multiplication Op.add = addition
                    @[simp]
                    theorem Algebraic.Arithmetic.weightedCost_mul {K : Type u_1} (addition multiplication : ℕ) :
                    weightedCost addition multiplication Op.mul = multiplication
                    @[simp]
                    theorem Algebraic.Arithmetic.weightedCost_constant {K : Type u_1} (addition multiplication : ℕ) (value : K) :
                    weightedCost addition multiplication (Op.constant value) = 0
                    @[simp]
                    theorem Algebraic.Arithmetic.gateCost_constant {K : Type u_1} (value : K) :
                    @[simp]