Documentation

Complexitylib.Circuits.AC0.NormalForm.Defs

Negation-normal unbounded formulas for AC0 #

AC0Formula N is an unbounded-fan-in formula over exactly N variables. Negation occurs only in literal polarity, which is the representation needed by restriction and switching-lemma arguments. Unlike a circuit, this syntax is a tree and therefore records repeated subcomputations separately.

Children are stored in the mutually inductive AC0Forest. This gives Lean a direct structural induction principle for unbounded formulas; ofList and toList provide the usual list interface. Empty conjunctions and disjunctions denote true and false, respectively.

inductive Complexity.AC0Formula (N : ) :

A negation-normal Boolean formula with unbounded AND and OR gates.

Instances For
    inductive Complexity.AC0Forest (N : ) :

    A structurally recursive forest of unbounded-formula children.

    Instances For
      def Complexity.instDecidableEqAC0Formula.decEq_1 {N✝ : } (x✝ x✝¹ : AC0Formula N✝) :
      Decidable (x✝ = x✝¹)
      Equations
      Instances For
        def Complexity.instDecidableEqAC0Forest.decEq_1 {N✝ : } (x✝ x✝¹ : AC0Formula N✝) :
        Decidable (x✝ = x✝¹)
        Equations
        Instances For

          Convert a list to the structurally recursive forest representation.

          Equations
          Instances For

            Convert a formula forest back to a list.

            Equations
            Instances For

              Number of formulas in a forest.

              Equations
              Instances For
                @[simp]
                theorem Complexity.AC0Forest.toList_ofList {N : } (formulas : List (AC0Formula N)) :
                (ofList formulas).toList = formulas
                @[simp]
                theorem Complexity.AC0Forest.ofList_toList {N : } (formulas : AC0Forest N) :
                ofList formulas.toList = formulas

                Converting a forest to a list and back is exact.

                @[simp]
                theorem Complexity.AC0Forest.length_ofList {N : } (formulas : List (AC0Formula N)) :
                (ofList formulas).length = formulas.length

                Evaluate an unbounded formula on an N-bit input.

                Equations
                Instances For

                  Evaluate a forest as a conjunction.

                  Equations
                  Instances For

                    Evaluate a forest as a disjunction.

                    Equations
                    Instances For

                      Total tree size, counting constants, literal occurrences, and gates.

                      Equations
                      Instances For

                        Formula depth. Leaves have depth zero and every unbounded gate adds one.

                        Equations
                        Instances For
                          theorem Complexity.AC0Formula.depth_le_forestDepth_of_mem {N : } (formula : AC0Formula N) (formulas : AC0Forest N) (hmem : formula formulas.toList) :
                          formula.depth forestDepth formulas

                          Every member of a forest has depth at most the forest maximum.

                          The finite set of input variables mentioned by a formula.

                          Equations
                          Instances For

                            Union of the variable supports of every formula in a forest.

                            Equations
                            Instances For
                              def Complexity.AC0Formula.ofOp {N : } (op : AndOrOp) (children : AC0Forest N) :

                              Build the gate selected by an AND/OR operation.

                              Equations
                              Instances For

                                Build an unbounded conjunction from an ordinary list.

                                Equations
                                Instances For

                                  Build an unbounded disjunction from an ordinary list.

                                  Equations
                                  Instances For
                                    theorem Complexity.AC0Formula.one_le_size {N : } (formula : AC0Formula N) :
                                    1 formula.size

                                    Every AC0 formula has at least one syntax-tree node.