Documentation

CslibFrontier.Computability.PostCorrespondence.Basic

Post's correspondence problem #

A domino is a pair of words over an alphabet α, its top and its bottom. An instance of Post's correspondence problem (PCP) is a finite list P of dominoes. It is solvable when some nonempty sequence of dominoes of P, repetitions allowed, has equal top and bottom concatenations [Pos46]; [Sipser2013, §5.2]. The modified correspondence problem (MPCP) of [Sipser2013, §5.2] additionally fixes the first domino of the match. Here an MPCP instance is a start domino and a list of dominoes that may follow it, so the start domino may recur only if it is also in the list; Sipser's MPCP, where the start domino belongs to the instance, is the case where it is.

Instances are encoded through Primcodable instances, so the two decision problems are predicates for Mathlib's ComputablePred and many-one reducibility ≤₀. Their undecidability is proved in CslibFrontier.Computability.PostCorrespondence.Undecidable.

Main definitions #

Main results #

References #

Dominoes and instances #

structure Cslib.PostCorrespondence.Domino (α : Type u_2) :
Type u_2

A domino: a pair of words, its top and its bottom.

  • top : List α

    The top word.

  • bottom : List α

    The bottom word.

Instances For
    def Cslib.PostCorrespondence.instDecidableEqDomino.decEq {α✝ : Type u_2} [DecidableEq α✝] (x✝ x✝¹ : Domino α✝) :
    Decidable (x✝ = x✝¹)
    @[instance_reducible]
    def Cslib.PostCorrespondence.tops {α : Type u_1} (ds : List (Domino α)) :
    List α

    The concatenation of the top words of a sequence of dominoes.

    def Cslib.PostCorrespondence.bottoms {α : Type u_1} (ds : List (Domino α)) :
    List α

    The concatenation of the bottom words of a sequence of dominoes.

    @[simp]
    theorem Cslib.PostCorrespondence.tops_cons {α : Type u_1} (d : Domino α) (ds : List (Domino α)) :
    tops (d :: ds) = d.top ++ tops ds
    @[simp]
    theorem Cslib.PostCorrespondence.bottoms_cons {α : Type u_1} (d : Domino α) (ds : List (Domino α)) :
    bottoms (d :: ds) = d.bottom ++ bottoms ds
    @[simp]
    theorem Cslib.PostCorrespondence.tops_append {α : Type u_1} (ds es : List (Domino α)) :
    tops (ds ++ es) = tops ds ++ tops es
    @[simp]
    theorem Cslib.PostCorrespondence.bottoms_append {α : Type u_1} (ds es : List (Domino α)) :
    bottoms (ds ++ es) = bottoms ds ++ bottoms es

    A PCP instance P, a list of dominoes, is solvable when some nonempty sequence of dominoes of P, repetitions allowed, has equal top and bottom concatenations.

    Solvability in the index form of the textbooks: a nonempty sequence of indices i₁, …, iₖ with t_{i₁} ⋯ t_{iₖ} = b_{i₁} ⋯ b_{iₖ}.

    theorem Cslib.PostCorrespondence.not_solvable_of_length_lt {α : Type u_1} {P : List (Domino α)} (hP : ∀ d ∈ P, d.bottom.length < d.top.length) :

    An instance whose every domino has a shorter bottom than top has no match: the top of a nonempty sequence of its dominoes is longer than the bottom.

    structure Cslib.PostCorrespondence.MInstance (α : Type u_2) :
    Type u_2

    An instance of the modified correspondence problem (MPCP): a start domino and a list of dominoes.

    • start : Domino α

      The domino every match starts with.

    • dominoes : List (Domino α)

      The dominoes that may follow it.

    Instances For

      An MPCP instance is solvable when the start domino followed by some sequence of its dominoes has equal top and bottom concatenations. The start domino occurs again only if it is listed in dominoes.

      Encodings #

      Dominoes as pairs of words.

      @[instance_reducible]

      MPCP instances as pairs of a domino and a list of dominoes.