Documentation

Complexitylib.Algebraic.Basis.SumOfTerms

Sum-of-terms circuit basis #

This basis represents restricted arithmetic circuits whose charged gates produce members of a prescribed dictionary and whose free gates add already constructed values. By choosing the term type appropriately, it models diagonal depth-three circuits (sums of powers), sums of products, tensor-rank decompositions, and related representation problems.

Coefficients can be included in the term parameter itself. This keeps the syntax independent of any scalar action on the semantic carrier.

inductive Algebraic.SumOfTerms.Op (T : Type u) :

Binary addition and a family of nullary dictionary terms.

Instances For
    @[simp]
    theorem Algebraic.SumOfTerms.arity_term {T : Type u_1} (term : T) :
    arity (Op.term term) = 0
    @[reducible, inline]

    Signature for free addition of charged dictionary terms.

    Equations
    Instances For
      def Algebraic.SumOfTerms.interpretation {V : Type u_1} {T : Type u_2} [Add V] (termValue : T → V) :

      Interpret a term by its dictionary value and addition by carrier addition.

      Equations
      Instances For

        Charge source additions and dictionary terms independently.

        Equations
        Instances For

          Charge one for each dictionary term and make addition free.

          Equations
          Instances For

            Charge each dictionary term by a term-dependent natural weight and make addition free.

            Equations
            Instances For

              Charge source additions and make dictionary terms free.

              Equations
              Instances For

                Charge every source operation once.

                Equations
                Instances For
                  @[simp]
                  theorem Algebraic.SumOfTerms.weightedCost_add {T : Type u_1} (addition term : ℕ) :
                  weightedCost addition term Op.add = addition
                  @[simp]
                  theorem Algebraic.SumOfTerms.weightedCost_term {T : Type u_1} (addition term : ℕ) (value : T) :
                  weightedCost addition term (Op.term value) = term
                  @[simp]
                  theorem Algebraic.SumOfTerms.termCost_term {T : Type u_1} (term : T) :
                  termCost (Op.term term) = 1
                  @[simp]
                  theorem Algebraic.SumOfTerms.dictionaryCost_add {T : Type u_1} (weight : T → ℕ) :
                  @[simp]
                  theorem Algebraic.SumOfTerms.dictionaryCost_term {T : Type u_1} (weight : T → ℕ) (term : T) :
                  dictionaryCost weight (Op.term term) = weight term
                  @[simp]
                  theorem Algebraic.SumOfTerms.additionCost_term {T : Type u_1} (term : T) :
                  @[simp]
                  theorem Algebraic.SumOfTerms.gateCost_term {T : Type u_1} (term : T) :
                  gateCost (Op.term term) = 1
                  theorem Algebraic.SumOfTerms.program_cost_weightedCost {T : Type u_1} {n g : ℕ} (program : Program (signature T) n g) (addition term : ℕ) :
                  Program.cost (weightedCost addition term) program = addition * Program.cost additionCost program + term * Program.cost termCost program

                  Weighted source cost decomposes exactly into addition count and dictionary term count.

                  theorem Algebraic.SumOfTerms.circuit_cost_weightedCost {T : Type u_1} {n m : ℕ} (circuit : Circuit (signature T) n m) (addition term : ℕ) :
                  circuit.cost (weightedCost addition term) = addition * circuit.cost additionCost + term * circuit.cost termCost

                  Circuit form of exact weighted source-cost decomposition.