Documentation

Complexity.Logics.FirstOrder.Ordered.DomainInterpretation.Encoding

Encoding ordered interpretations with a domain formula #

A well-formed source of size at least two is mapped to the encoding of its image, whose universe is numbered by the lexicographic rank of the domain tuples. This is defined for every source, including those with fewer than two domain tuples, whose encoded image has no canonical ordered decoding. Only the target input relations are serialized; the canonical order, BIT and constants are determined by the cardinality. Malformed sources and sizes zero and one map to the same malformed target as FullTupleInterpretation.encodedMap.

Partial decoding of source-only encodings turns an ordered query language into the set of encodings that decode to members, and an admissible interpretation commutes with decoding. This is the simulation hypothesis of Cslib.Complexity.ManyOneReducibleBy.lift.

Main definitions #

Main results #

References #

Decode a source-only encoding as a canonically ordered structure, when it is well formed and has at least two elements.

Instances For
    @[simp]

    Canonical encodings decode to their structures.

    An ordered query language consists of the encodings decoding to members of the query.

    Encode the target input relations on the ranks of the domain tuples. Invalid shapes or sizes below two produce one empty table too many, outside every target query language.

    Instances For

      The encoded image has one element per domain tuple.

      @[simp]

      Shape validity of the result is exactly source admissibility, whatever the number of domain tuples.

      theorem Cslib.Logic.FO.Ordered.DomainInterpretation.table_encodedMap {L : FirstOrder.Language} {L' : FirstOrder.Language} [L.IsRelational] [L'.IsRelational] {k : ℕ} (I : DomainInterpretation L L' k) (v : Vocabulary L) (v' : Vocabulary L') {a : EncodedStructure} (ha : v.WellFormed a) (hn : 2 ≤ a.1) {r : ℕ} (R : L'.Relations r) (x : Fin r → Fin (I.card (decoded v a hn))) :
      (v'.table (I.encodedMap v v' a) ⟨r, R⟩).getD (tupleIndex x) false = true ↔ (I.rel R).Realize fun (p : Fin r × Fin k) => I.unrank (decoded v a hn) (x p.1) p.2

      The bit at the table index of some target ranks is the defining formula on the domain tuples of these ranks. Numeric predicates are not serialized as extra tables.

      theorem Cslib.Logic.FO.Ordered.DomainInterpretation.length_encStructure_encodedMap {L : FirstOrder.Language} {L' : FirstOrder.Language} [L.IsRelational] [L'.IsRelational] {k : ℕ} (I : DomainInterpretation L L' k) (v : Vocabulary L) (v' : Vocabulary L') {a : EncodedStructure} (ha : v.WellFormed a) (hn : 2 ≤ a.1) :
      (encStructure (I.encodedMap v v' a)).length = 2 * I.card (decoded v a hn) + 1 + ∑ j : Fin v'.count, (2 * I.card (decoded v a hn) ^ v'.arity j + 1)

      The output length includes its unary cardinality and every framed relation table.

      For an admissible interpretation, the encoded image is the canonical encoding of the image.

      Decoding commutes with an admissible interpretation. Undecodable sources map to undecodable targets.