Documentation

Complexitylib.Classes.PCP.Internal.MaxLoop

The largest of polynomially many values #

An algorithm reading a formula has to know how many variables it mentions, which is the largest index any literal names. More generally: given a rule that computes a value for each index, take the largest over a bounded range.

Values are carried in unary, so "largest" is "longest", and the comparison is the length test already in the toolkit.

Main definitions #

Main results #

def Complexity.maxOver (f : List BoolList Bool) (z : List Bool) :

The largest of the first n values, as a length.

Equations
Instances For

    One step of the running maximum. The state is pair (pair largest counter) input.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      theorem Complexity.maxStep_iterate (f : List BoolList Bool) (z : List Bool) (n : ) :
      ∃ (M : List Bool), (maxStep f)^[n] (pair (pair [] []) z) = pair (pair M (List.replicate n true)) z M.length = maxOver f z n

      The loop takes the maximum.

      theorem Complexity.le_maxOver {f : List BoolList Bool} {z : List Bool} (n i : ) :
      i < n(f (pair z (List.replicate i true))).length maxOver f z n

      Every value is at most the maximum.

      theorem Complexity.maxOver_attained {f : List BoolList Bool} {z : List Bool} (n : ) :
      0 < ni < n, (f (pair z (List.replicate i true))).length = maxOver f z n

      The maximum is attained, when there is anything to maximise over.

      theorem Complexity.maxOver_le {f : List BoolList Bool} {z : List Bool} {B : } (n : ) :
      (∀ i < n, (f (pair z (List.replicate i true))).length B)maxOver f z n B
      noncomputable def Complexity.maxFn (f : List BoolList Bool) (w : List Bool) :

      The packaged loop, on pair (unary count) input.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        theorem Complexity.maxFn_eq (f : List BoolList Bool) {n : } {z : List Bool} :