Documentation

Complexitylib.Languages.Trivial

Trivial languages: and Set.univ #

The two easiest languages to decide, along with their complexity. Both are decided by writeTM — a machine that writes a fixed symbol to the output tape and halts in constant time — and therefore belong to every standard complexity class.

Main definitions #

Main results #

@[reducible, inline]

The empty language (no strings accepted).

Equations
Instances For
    @[reducible, inline]

    The universal language (all strings accepted).

    Equations
    Instances For

      Tape.init [] is the canonical output-tape initial value: cell 0 is , every other cell is , and the head is at position 0. This is exactly the well-formedness precondition of writeTM_hoareTime with B = 0.

      theorem Complexity.TM.writeTM_decidesInTime_const {n : } (sym : Γw) (x : List Bool) :
      ∃ (c' : Cfg n (writeTM sym).Q), t3, (writeTM sym).reachesIn t ((writeTM sym).initCfg x) c' (writeTM sym).halted c' c'.output.cells 1 = sym.toΓ

      writeTM halts on every input in 3 steps with sym on output cell 1.

      Specialization of writeTM_hoareTime (B = 0) to the initial configuration, packaged in the exact form required by DecidesInTime.

      The empty language is decidable in constant time. writeZeroTM always writes 0 to output cell 1 and halts in at most 3 steps.

      The universal language is decidable in constant time. writeOneTM always writes 1 to output cell 1 and halts in at most 3 steps.