Documentation

CslibFrontier.Logics.FirstOrder.DefinitionalExpansion

Unfolding defined symbols #

A language L is often extended by symbols that are definable in L. For example, successor can be added to an ordered vocabulary as a primitive relation. Cslib.Logic.FO.unfoldSymbols translates formulas of the extended language back into L. Each function symbol is replaced by a term of L and each relation symbol by a formula of L; variables, connectives and quantifiers are unchanged. A symbol that L already has is replaced by itself, applied to its argument variables. If every replacement defines its symbol in a structure M, the translation preserves truth in M (Cslib.Logic.FO.realize_unfoldSymbols).

The definitions may use quantifiers, so the translation of a quantifier-free formula need not be quantifier-free; it is when every relation definition is (Cslib.Logic.FO.isQF_unfoldSymbols). Function symbols are replaced with Mathlib's Term.substFunc.

Cslib.Logic.FO.Interpretation.onFormula also replaces each relation symbol by a formula. It interprets a relational language on tuples cut out by a domain formula, so it changes the universe and handles no function symbols. Here the universe stays the same and the language may keep its constants and functions.

Main definitions #

Main results #

noncomputable def Cslib.Logic.FO.unfoldSymbols {L : FirstOrder.Language} {L' : FirstOrder.Language} {α : Type u_1} (tf : {n : ℕ} → L.Functions n → L'.Term (Fin n)) (rf : {n : ℕ} → L.Relations n → L'.Formula (Fin n)) {k : ℕ} :
L.BoundedFormula α k → L'.BoundedFormula α k

Replace each function symbol of L by a term of L' and each relation symbol of L by a formula of L' in the argument variables. Variables, connectives and quantifiers are kept.

theorem Cslib.Logic.FO.isQF_unfoldSymbols {L : FirstOrder.Language} {L' : FirstOrder.Language} {α : Type u_1} (tf : {n : ℕ} → L.Functions n → L'.Term (Fin n)) {rf : {n : ℕ} → L.Relations n → L'.Formula (Fin n)} (hrf : ∀ {n : ℕ} (R : L.Relations n), FirstOrder.Language.BoundedFormula.IsQF (rf R)) {k : ℕ} {φ : L.BoundedFormula α k} (h : φ.IsQF) :
(unfoldSymbols (fun {n : ℕ} => tf) (fun {n : ℕ} => rf) φ).IsQF

Unfolding by quantifier-free relation definitions preserves quantifier-freeness. Function symbols may be replaced by arbitrary terms.

theorem Cslib.Logic.FO.realize_unfoldSymbols {L : FirstOrder.Language} {L' : FirstOrder.Language} {α : Type u_1} {M : Type u_2} [L.Structure M] [L'.Structure M] {tf : {n : ℕ} → L.Functions n → L'.Term (Fin n)} {rf : {n : ℕ} → L.Relations n → L'.Formula (Fin n)} (htf : ∀ {n : ℕ} (f : L.Functions n) (x : Fin n → M), FirstOrder.Language.Term.realize x (tf f) = FirstOrder.Language.Structure.funMap f x) (hrf : ∀ {n : ℕ} (R : L.Relations n) (x : Fin n → M), (rf R).Realize x ↔ FirstOrder.Language.Structure.RelMap R x) {k : ℕ} (φ : L.BoundedFormula α k) (v : α → M) (xs : Fin k → M) :
(unfoldSymbols (fun {n : ℕ} => tf) (fun {n : ℕ} => rf) φ).Realize v xs ↔ φ.Realize v xs

Unfolding preserves truth. If each function symbol of L agrees in M with its replacement term and each relation symbol with its replacement formula, then a bounded formula and its translation hold under the same assignments.

theorem Cslib.Logic.FO.realize_unfoldSymbols_formula {L : FirstOrder.Language} {L' : FirstOrder.Language} {α : Type u_1} {M : Type u_2} [L.Structure M] [L'.Structure M] {tf : {n : ℕ} → L.Functions n → L'.Term (Fin n)} {rf : {n : ℕ} → L.Relations n → L'.Formula (Fin n)} (htf : ∀ {n : ℕ} (f : L.Functions n) (x : Fin n → M), FirstOrder.Language.Term.realize x (tf f) = FirstOrder.Language.Structure.funMap f x) (hrf : ∀ {n : ℕ} (R : L.Relations n) (x : Fin n → M), (rf R).Realize x ↔ FirstOrder.Language.Structure.RelMap R x) (φ : L.Formula α) (v : α → M) :
FirstOrder.Language.Formula.Realize (unfoldSymbols (fun {n : ℕ} => tf) (fun {n : ℕ} => rf) φ) v ↔ φ.Realize v

Unfolding preserves the truth of formulas, under the hypotheses of Cslib.Logic.FO.realize_unfoldSymbols.