Documentation

Complexitylib.Classes.PH.SipserLautemann.Encode

Bitstring codecs for seeds and shift tuples #

The Lautemann characterization quantifies over seeds Fin m → Bool and over tuples of shifts Fin t → Fin m → Bool, while the polynomial hierarchy quantifies over bitstrings. This file provides the two codecs and their round-trip lemmas: listOfSeed/seedOfList for a single seed, and listOfShifts/shiftsOfList for a tuple, flattened in row-major order.

Decoding is total — out-of-range positions read as false — so a decoder is available on every bitstring, and the length equations pin down the well-formed encodings.

Encode a seed as a bitstring, one bit per position.

Equations
Instances For

    Decode a bitstring as a seed, reading out-of-range positions as false.

    Equations
    Instances For
      theorem Complexity.Lautemann.getD_listOfSeed {m : } (s : Fin mBool) (idx : ) (h : idx < m) :
      (listOfSeed s).getD idx false = s idx, h

      Reading an encoded seed at an in-range position returns that bit.

      def Complexity.Lautemann.flattenShifts {t m : } (u : Fin tFin mBool) :
      Fin (t * m)Bool

      Flatten a tuple of shifts into a single seed of length t * m, in row-major order.

      Equations
      Instances For
        def Complexity.Lautemann.listOfShifts {t m : } (u : Fin tFin mBool) :

        Encode a tuple of shifts as a bitstring of length t * m.

        Equations
        Instances For
          def Complexity.Lautemann.shiftsOfList (t m : ) (w : List Bool) :
          Fin tFin mBool

          Decode a bitstring as a tuple of shifts, reading out-of-range positions as false.

          Equations
          Instances For
            @[simp]
            theorem Complexity.Lautemann.length_listOfShifts {t m : } (u : Fin tFin mBool) :
            @[simp]