Constant instances: instConst, closeBy, and their substitution algebra #
The two closing operations by the auxiliary constants of L[[ℕ]], in a neutral module below
both the interpolation layer and the countable-completion kernel:
instConst c ψ— open the single bound variable ofψ : BoundedFormulaω Empty 1and substitute the constantc_c;closeBy φ τ— open allnbound variables ofφ : BoundedFormulaω Empty nand substitute the constantsc_{τ i}.
Their semantic consumer lemmas (realize_instConst, realize_closeBy, …) stay in the modules
that own the structures they realize in. This module holds only syntax: the
connective/universal algebra of closeBy — how it commutes with the connectives, what the
arity-one remainder of a closed universal is, and that the constant instance of that remainder is
closeBy at the extended tuple. Atomic template lemmas (closing an equality or relation template
gives constEq / relInst) belong with those atoms, above this module.
The public surface is deliberately small: instConst, closeBy, the closeBy_* commutations,
closeBy_zero, instConst_eq_closeBy, instConst_closeBy_all_remainder, and the generic
substitution laws Term.subst_subst / Term.subst_relabel / Term.relabel_subst /
BoundedFormulaω.subst_subst. Everything else is proof scaffolding and is private.
The all case #
closeBy φ.all τ is (remainder).all, where the remainder is φ opened, relabeled so that the
last bound variable stays bound, and closed by τ. The instance of that remainder at a constant
c must be closeBy φ (Fin.snoc τ c) — this is what makes universal-instance closure of a
constants-expanded universe follow from a fragment's all_mem. Proving it directly fights
castLE inside BoundedFormulaω.relabel, so instead:
- a private
closeWith ρ φcloses bound variables by a term assignmentρ, by structural recursion with norelabelof formulas; it depends onρonly pointwise and composes; - one private bridge lemma identifies
((openBounds φ).relabel g).subst τ'with acloseWithfor the standard splittingg, using the two relabel-composition lemmas ofOperations.lean; closeBy, its remainder, andinstConstare then allcloseWiths, andinstConst_closeBy_all_remainderis the composition law plus a pointwise check.
Term-level substitution algebra #
Formula-level substitution composition #
Composition of substitutions: substituting f and then g is substituting
a ↦ (f a).subst g. No side condition: subst never touches bound variables.
The closing operations #
The constant instance ψ(c): open the bound variable of ψ and substitute the constant
c_c.
Equations
Instances For
The closing substitution of a bounded formula by constants.
Equations
- FirstOrder.Language.closeBy φ τ = FirstOrder.Language.BoundedFormulaω.subst φ.openBounds fun (i : Fin n) => FirstOrder.Language.constTerm (τ i)
Instances For
Definitional commutations of closeBy #
Each holds by unfolding openBounds and subst on the constructor. The all case exhibits the
arity-one remainder explicitly; relating its instConst to closeBy at the extended parameter
tuple is a separate lemma about openBounds, proved where it is consumed.
The arity-one remainder of closing a universal: closeBy φ.all τ is the universal closure of
φ opened, relabeled so that the last bound variable stays bound, and closed by τ.
closeWith: closing bound variables by a term assignment, without relabeling formulas #
Composition #
The bridge to openBounds #
closeBy, instConst, and the arity-one remainder of closeBy_all are all
((openBounds φ).relabel g).subst τ' for a splitting g. This is the one place where
relabel of a formula — and hence castLE — is met; it is discharged by the two composition
lemmas of Operations.lean, exactly as in openBounds_relabel_sumInr.
Closing a sentence by the empty tuple does nothing.
The instance of the remainder is the closure at the extended tuple.