Documentation

Complexitylib.Algebraic.Basis.Aggregate

Binary gates and finite commutative aggregates #

A special operation multiplies one contribution for each ordered input slot and applies a Boolean readout. Slots may repeat wires. Commutativity permits partitioning the contributions; no cancellation, inverse, or group structure is required.

inductive Algebraic.Aggregate.Op {J : Type} (State : J → Type) :

A full binary Boolean operation or a finite-arity aggregate operation.

  • binary {J : Type} {State : J → Type} (function : Bool → Bool → Bool) : Op State
  • special {J : Type} {State : J → Type} (kind : J) (arity : ℕ) (contribution : Fin arity → Bool → State kind) (readout : State kind → Bool) : Op State
Instances For
    @[reducible, inline]
    abbrev Algebraic.Aggregate.signature {J : Type} (State : J → Type) :

    The mixed signature retains the special operation's ordered slots.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      def Algebraic.Aggregate.Op.isSpecial {J : Type} {State : J → Type} :
      Op State → Bool

      Whether an operation needs an aggregate consistency check.

      Equations
      Instances For
        @[reducible, inline]
        abbrev Algebraic.Aggregate.Op.Register {J : Type} {State : J → Type} :
        Op State → Type

        The register carried by an operation; binary operations need no register.

        Equations
        Instances For
          @[instance_reducible]
          instance Algebraic.Aggregate.instCommMonoidRegister {J : Type} {State : J → Type} [(j : J) → CommMonoid (State j)] (op : Op State) :
          Equations
          • One or more equations did not get rendered due to their size.
          @[instance_reducible]
          instance Algebraic.Aggregate.instFintypeRegister {J : Type} {State : J → Type} [(j : J) → Fintype (State j)] (op : Op State) :
          Equations
          • One or more equations did not get rendered due to their size.
          def Algebraic.Aggregate.Op.slotContribution {J : Type} {State : J → Type} (op : Op State) :
          Fin ((signature State).Arity op) → Bool → op.Register

          A slot's contribution; the unused register of a binary gate is trivial.

          Equations
          Instances For
            def Algebraic.Aggregate.Op.readout {J : Type} {State : J → Type} (op : Op State) :
            op.Register → Bool

            The Boolean predicate applied to a special register; unused on binary operations.

            Equations
            Instances For
              def Algebraic.Aggregate.interpretation {J : Type} {State : J → Type} [(j : J) → CommMonoid (State j)] :

              Boolean evaluation of the mixed signature.

              Equations
              Instances For

                Operations of the ordinary circuit after guessing all special output bits.

                Instances For
                  @[reducible, inline]

                  Erased special gates have zero incoming wires.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For

                    Each ordinary operation has at most two input slots.