First-order substitution #
Simultaneous substitution of terms for the free (de Bruijn) variables of a formula,
and its semantic correctness — the substitution theorem
Formula.subst_sat: satisfaction of φ.subst ρ under σ equals satisfaction of φ
under the environment k ↦ ⟦ρ k⟧_σ.
The de Bruijn bookkeeping is handled by Term.shift (raise every index by one, for
crossing a binder) and liftSubst (extend a substitution under a binder: the new
variable 0 stays, everything else is shifted). This is the engine behind the
fundamental theorem of first-order interpretations (roadmap L6): the transport of a
formula along an FOInterpretation.
Main definitions and results #
Term.shift,Term.shift_eval— index shift and its evaluation invariance.Term.substTerm,Term.substTerm_eval— term substitution and its evaluation.liftSubst,liftSubst_eval— lifting a substitution under a binder.Formula.subst,Formula.quantifierRank_subst— formula substitution preserves quantifier rank.Formula.subst_sat— the substitution theorem.
Shift every variable of a term up by one de Bruijn index (to cross a binder).
Equations
Instances For
Shifting a term and evaluating under an extended environment recovers the original
evaluation: the fresh variable 0 is never referenced by a shifted term.
Apply a substitution (a term for each variable) to a term.
Equations
Instances For
Evaluating a substituted term is evaluating the original under the substituted environment.
Lift a substitution under a binder: variable 0 maps to itself, and every other
variable takes its old (shifted) image.
Equations
- Complexity.DescriptiveComplexity.liftSubst ρ i = if h : ↑i = 0 then Complexity.DescriptiveComplexity.Term.var ⟨0, ⋯⟩ else (ρ ⟨↑i - 1, ⋯⟩).shift
Instances For
The environment induced by a lifted substitution is the extension (by the new element) of the environment induced by the original — the compatibility fact that drives the quantifier case of the substitution theorem.
Simultaneous substitution of terms for the free variables of a formula. Under a quantifier the substitution is lifted, so de Bruijn indices stay aligned.
Equations
- One or more equations did not get rendered due to their size.
- φ.neg.subst x✝ = (φ.subst x✝).neg
- (φ.conj ψ).subst x✝ = (φ.subst x✝).conj (ψ.subst x✝)
- (φ.disj ψ).subst x✝ = (φ.subst x✝).disj (ψ.subst x✝)
- φ.exist.subst x✝ = (φ.subst (Complexity.DescriptiveComplexity.liftSubst x✝)).exist
- φ.all.subst x✝ = (φ.subst (Complexity.DescriptiveComplexity.liftSubst x✝)).all
Instances For
Substituting terms for free variables preserves quantifier rank exactly.
The substitution theorem. Satisfaction of a substituted formula under σ
equals satisfaction of the original formula under the environment that evaluates
each substituted term.