Documentation

Complexity.Logics.FirstOrder.Ordered.FullTuple.Encoding

Encoding canonical full-tuple interpretations #

A full-tuple interpretation is the ordered interpretation whose domain formula is true (FullTupleInterpretation.toDomainInterpretation), with ranks given by lexicographic rank on all tuples. A valid source of size at least two is mapped to the full tuple universe, numbered by lexRank, agreeing with DomainInterpretation.encodedMap (FullTupleInterpretation.encodedMap_toDomainInterpretation). Only the target input relations are serialized; canonical order, BIT and constants are computed from the target cardinality. Relation tables keep tupleIndex order across their arguments. Malformed sources and sizes zero and one map to a fixed malformed target.

Main definitions #

Main results #

References #

A full-tuple interpretation is the ordered interpretation with domain formula true.

Instances For

    The ranks of a full-tuple interpretation are the lexicographic ranks of all tuples.

    Positive-dimensional full-tuple interpretations are admissible.

    Encode the interpreted input relations on the canonical rank universe. Invalid shapes or sizes below two produce one empty table too many, outside every target query language.

    Instances For

      The encoded maps agree: the full-tuple encoded map is that of the embedded interpretation, for every dimension and every input.

      The canonical rank universe has exactly one element per source tuple.

      @[simp]

      Shape validity of the result is exactly source admissibility. Positive dimension is only needed when asking for canonical target numerics, not for this shape statement.

      A positive-dimensional admissible source produces an admissible target cardinality.

      theorem Cslib.Logic.FO.Ordered.FullTupleInterpretation.table_encodedMap {L : FirstOrder.Language} {L' : FirstOrder.Language} [L.IsRelational] [L'.IsRelational] {k : ℕ} (I : FullTupleInterpretation 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 (a.1 ^ k)) :
      (v'.table (I.encodedMap v v' a) ⟨r, R⟩).getD (tupleIndex x) false = true ↔ (I.rel R).Realize fun (p : Fin r × Fin k) => lexEquiv.symm (x p.1) p.2

      The bit at the existing table index of the target arguments is the defining formula on their inverse lexicographic ranks. Numeric predicates are not serialized as extra tables.

      theorem Cslib.Logic.FO.Ordered.FullTupleInterpretation.length_encStructure_encodedMap {L : FirstOrder.Language} {L' : FirstOrder.Language} [L.IsRelational] [L'.IsRelational] {k : ℕ} (I : FullTupleInterpretation 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 * a.1 ^ k + 1 + ∑ j : Fin v'.count, (2 * (a.1 ^ k) ^ v'.arity j + 1)

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

      The decoded output, with its own canonical numerics, is the interpreted full ordered structure. Its underlying numbering is the exact lexicographic rank, not an arbitrary input relation isomorphism.

      Instances For

        Every element retains its exact natural-number rank in the decoded target.