Documentation

MIPRE.TM.CookLevin.LayoutProg

The layout arithmetic as programs #

The widths and offsets of the index layout (Layout.lean) as programs. Two conventions make them cheap:

Unary arithmetic #

Resizing a bit string #

The low w bits of a bit string, padded with false to the width w.

Equations
Instances For
    theorem MIPRE.TM.CookLevin.Desc.getD_resize {w : ℕ} (bs : Cost.BitStr) {i : ℕ} (hi : i < w) :
    theorem MIPRE.TM.CookLevin.Desc.resize_eq_nbits (w : ℕ) (bs : Cost.BitStr) (k : ℕ) (h : ∀ (i : ℕ), List.getD bs i false = k.testBit i) :
    resize w bs = nbits w k

    A constant of a width is a resize: if the bits of bs are those of k, then the low w bits of bs are the w-bit constant k.

    The bit strings of the numbers the describer needs #

    theorem MIPRE.TM.CookLevin.Desc.getD_false_cons (bs : Cost.BitStr) (k : ℕ) (h : ∀ (i : ℕ), List.getD bs i false = k.testBit i) (i : ℕ) :
    (false :: bs).getD i false = (2 * k).testBit i

    Powers of two #

    Resizing, as a program #

    resize, the width in unary.

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

      2 ^ e, from e in unary: its bit string is e zeros and a one.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        @[simp]
        theorem MIPRE.TM.CookLevin.Desc.incN_apply (k n : ℕ) :
        (incN k).toFun n = n + k

        Readers of the layout #

        The constant k on w bits, read off a width in unary and the bits of k.

        Equations
        Instances For
          theorem MIPRE.TM.CookLevin.Desc.nbitsR_apply {ι : Type u_1} [Cost.SizedEncoding ι] {w : Cost.PolyTimeFun ι Cost.Unary} {bs : Cost.PolyTimeFun ι Cost.BitStr} {i : ι} (k : ℕ) (h : ∀ (j : ℕ), List.getD (bs.toFun i) j false = k.testBit j) :
          (nbitsR w bs).toFun i = nbits (List.length (w.toFun i)) k

          The formulas of the constant k on w bits.

          Equations
          Instances For
            theorem MIPRE.TM.CookLevin.Desc.cstR_apply {ι : Type u_1} [Cost.SizedEncoding ι] {w : Cost.PolyTimeFun ι Cost.Unary} {bs : Cost.PolyTimeFun ι Cost.BitStr} {i : ι} (k : ℕ) (h : ∀ (j : ℕ), List.getD (bs.toFun i) j false = k.testBit j) :
            (cstR w bs).toFun i = cst (List.length (w.toFun i)) k

            The constant read off a width in unary and a reader of the number itself.

            The bits of a numeral, as a reader.

            Equations
            Instances For
              theorem MIPRE.TM.CookLevin.Desc.bitsR_spec {ι : Type u_1} [Cost.SizedEncoding ι] (k : ℕ) (i : ι) (j : ℕ) :

              The widths and offsets #

              3, 4 and Qb and Gb Gc, in unary: the widths that do not depend on e.

              Equations
              Instances For

                mOf e Gc, in unary.

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

                  flagOff e Gc, in unary.

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

                    gOff e, in unary.

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

                      jsOff e d, in unary.

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

                        muxList, as a program #

                        muxList.

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