Documentation

CslibFrontier.Logics.FirstOrder.Encoding.Sum

Encodings for sums of relational vocabularies #

Vocabulary.sum enumerates the left language's relation symbols before the right language's. Consequently concatenating the two lists of relation tables gives the encoding for the sum language. Table lookup preserves both parts, and well-formedness splits into the corresponding conditions on the two lists. No tables for function symbols are introduced.

Main definitions #

Main results #

Enumerate the symbols of the left vocabulary followed by the symbols of the right one.

@[simp]

The sum vocabulary has one entry for each entry of its two summands.

@[simp]

A left relation retains its original table index.

@[simp]

A right relation's table index is shifted by the number of left relations.

@[simp]

The arity of a left entry in the combined enumeration is unchanged.

@[simp]

The arity of a right entry in the combined enumeration is unchanged.

theorem Cslib.Logic.Vocabulary.table_sum_inl {L : FirstOrder.Language} {L' : FirstOrder.Language} (v : Vocabulary L) (w : Vocabulary L') (n : ℕ) (xs ys : List (List Bool)) (hlen : xs.length = v.count) (r : (k : ℕ) × L.Relations k) :
(v.sum w).table (n, xs ++ ys) ⟨r.fst, Sum.inl r.snd⟩ = v.table (n, xs) r

Left relation tables are preserved by concatenation when the left list has its expected number of tables.

theorem Cslib.Logic.Vocabulary.table_sum_inr {L : FirstOrder.Language} {L' : FirstOrder.Language} (v : Vocabulary L) (w : Vocabulary L') (n : ℕ) (xs ys : List (List Bool)) (hlen : xs.length = v.count) (r : (k : ℕ) × L'.Relations k) :
(v.sum w).table (n, xs ++ ys) ⟨r.fst, Sum.inr r.snd⟩ = w.table (n, ys) r

Right relation tables are preserved by concatenation when the left list has its expected number of tables.

If the number of right tables is fixed, combined well-formedness is exactly well-formedness of both inputs. In particular a malformed left input cannot be repaired by appending right tables.

theorem Cslib.Logic.Vocabulary.WellFormed.sum {L : FirstOrder.Language} {L' : FirstOrder.Language} {v : Vocabulary L} {w : Vocabulary L'} {n : ℕ} {xs ys : List (List Bool)} (hx : v.WellFormed (n, xs)) (hy : w.WellFormed (n, ys)) :
(v.sum w).WellFormed (n, xs ++ ys)

Concatenating well-formed relation tables gives a well-formed sum-language input.