Documentation

MIPRE.Tailored.Sofic.AssocPrimrec

The associated test is primitive recursive #

primrec_assocTest: the map from a tailored game description to the description of its associated subgroup test (assocTest, Definition I:2086) is primitive recursive, so it composes with the halting reduction. Each of its constructions is a composition of list operations with a Primrec lemma in Mathlib; three are rewritten first into a form those lemmas cover: allBits as an iterate (allBits_eq_iterate), List.dedup as a fold (dedup_eq_foldr), and the enumeration of the fixed literals by List.range (zipIdx_map_eq).

Rewritings #

One step of allBits.

Equations
Instances For
    def MIPRE.Tailored.Sofic.dedupStep {α : Type u_1} [DecidableEq α] (a : α) (acc : List α) :
    List α

    Deduplication as a fold: keep an element unless it occurs later.

    Equations
    Instances For
      theorem MIPRE.Tailored.Sofic.zipIdx_map_eq {α : Type u_1} (l : List (α × Bool)) (d : α × Bool) :
      List.map (fun (p : (α × Bool) × ℕ) => (p.2, p.1.2)) l.zipIdx = List.map (fun (i : ℕ) => (i, (l.getD i d).2)) (List.range l.length)
      theorem MIPRE.Tailored.Sofic.filter_eq_filterMap {α : Type u_1} (p : α → Bool) (l : List α) :
      List.filter p l = List.filterMap (fun (a : α) => if p a = true then some a else none) l

      Primitive recursion #

      @[reducible, inline]

      The arguments (g, x, y) of the per-pair constructions.

      Equations
      Instances For
        theorem MIPRE.Tailored.Sofic.primrec_genX :
        Primrec fun (q : Q) => genX q.1 q.2.1 q.2.2

        genX, on (g, x, i).

        theorem MIPRE.Tailored.Sofic.primrec_wX :
        Primrec fun (q : Q) => wX q.1 q.2.1 q.2.2

        wX g x applied to i, with (g, x) in context.

        theorem MIPRE.Tailored.Sofic.pg :
        Primrec fun (q : Q) => q.1

        g of the arguments.

        theorem MIPRE.Tailored.Sofic.px :
        Primrec fun (q : Q) => q.2.1

        x of the arguments.

        theorem MIPRE.Tailored.Sofic.py :
        Primrec fun (q : Q) => q.2.2

        y of the arguments.

        theorem MIPRE.Tailored.Sofic.primrec_fixedLits :
        Primrec fun (q : Q) => fixedLits q.1 q.2.1 q.2.2
        theorem MIPRE.Tailored.Sofic.primrec_readVars :
        Primrec fun (q : Q) => readVars q.1 q.2.1 q.2.2
        theorem MIPRE.Tailored.Sofic.primrec_readWords :
        Primrec fun (q : Q) => readWords q.1 q.2.1 q.2.2
        theorem MIPRE.Tailored.Sofic.primrec_consAt :
        Primrec fun (q : Q) => consAt q.1 q.2.1 q.2.2
        @[reducible, inline]

        (g, x, y) of a pair whose first component is the arguments.

        Equations
        Instances For
          theorem MIPRE.Tailored.Sofic.primrec_consWord :
          Primrec₂ fun (q : Q) (c : List Bool) => consWord q.1 q.2.1 q.2.2 c

          List.idxOf on words, with the structural BEq of lists, is the one with the BEq of decidable equality, which Mathlib's Primrec.list_idxOf is stated for.

          theorem MIPRE.Tailored.Sofic.primrec_consWords :
          Primrec fun (q : Q) => consWords q.1 q.2.1 q.2.2
          theorem MIPRE.Tailored.Sofic.primrec_words :
          Primrec fun (q : Q) => words q.1 q.2.1 q.2.2
          theorem MIPRE.Tailored.Sofic.primrec_fixedLen :
          Primrec fun (p : Q × List Bool) => (fixedLits p.1.1 p.1.2.1 p.1.2.2).length
          theorem MIPRE.Tailored.Sofic.primrec_readLen :
          Primrec fun (p : Q × List Bool) => (readWords p.1.1 p.1.2.1 p.1.2.2).length

          The fixed literals of a clause, enumerated.

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

            The readable literals of a clause.

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

              The constraint literals of a clause.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                theorem MIPRE.Tailored.Sofic.primrec_clause :
                Primrec₂ fun (q : Q) (r : List Bool) => clause q.1 q.2.1 q.2.2 r
                theorem MIPRE.Tailored.Sofic.primrec_clauses :
                Primrec fun (q : Q) => clauses q.1 q.2.1 q.2.2
                theorem MIPRE.Tailored.Sofic.primrec_challenge :
                Primrec fun (p : ℕ × Q) => challenge p.2.1 p.1 p.2.2.1 p.2.2.2

                The total weight, as a sum over lists.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  theorem MIPRE.Tailored.Sofic.sum_fin_eq_sum_range (n : ℕ) (f : ℕ → ℕ) :
                  ∑ x : Fin (n + 1), f ↑x = (List.map f (List.range (n + 1))).sum
                  theorem MIPRE.Tailored.Sofic.sum_flatMap_nat {α : Type u_1} (L : List α) (f : α → List ℕ) :
                  (List.flatMap f L).sum = (List.map (fun (x : α) => (f x).sum) L).sum

                  The associated test is primitive recursive.