Constant-domain first-order Kripke structures and modal formulas #
Mathlib's ModelTheory is classical: one structure, no accessibility. A
KripkeStructure L W M is a W-indexed family of L-structures on a
constant domain M together with Finset-valued accessibility — the shape
Semantics/Composition/Model.lean (without accessibility) and
Core/Logic/Modal/QBSML/Defs.lean already instantiate. On top,
ModalFormula L α layers □ and named quantifiers over embedded classical
L.Formulas, and ModalFormula.Realize is Kripke satisfaction
K, w ⊨_v φ. Upstream candidates.
Main declarations #
KripkeStructure— accessibility plus a world-indexed family of first-order structures on a constant domain.KripkeStructure.RealizeAt— classical satisfaction at a world, with the transportedFormula.realize_*simp set.ModalFormula,ModalFormula.Realize— modal formulas over embedded classical formulas, and Kripke satisfaction;ModalFormula.diais the derived◇ := ¬□¬.
Implementation notes #
- Structures are carried as terms, not instances — a world-indexed
family cannot be instance-based — so interfacing with instance-based
mathlib API (
Formula.Realize) threadsletI := K.interp w. - Accessibility is
Finset-valued (computability-first, matching the team-semantics consumers); generalize to aProp-valued relation when a consumer needs infinite branching. ModalFormulaquantifiers bind named variables withFunction.updatesemantics (theFormula.all₁/ex₁convention ofCore/Logic/FirstOrder/Binders.lean), not de Bruijn indices: the modal layer's consumers carry named variables, and the embedding of classical formulas viaofFormulamakes satisfaction commute by construction (ModalFormula.realize_ofFormulaisIff.rfl).
A constant-domain first-order Kripke structure: Finset-valued
accessibility plus a W-indexed family of L-structures on the
domain M.
- access : W → Finset W
Accessibility relation (per-world set of accessible worlds).
- interp : W → L.Structure M
World-indexed interpretation of the signature.
Instances For
Classical first-order satisfaction at a world — K, w ⊨_v ψ, mathlib's
Formula.Realize in the structure the Kripke structure carries
at w.
Equations
- K.RealizeAt w ψ v = ψ.Realize v
Instances For
Modal formulas over L with named free variables α: classical
L.Formulas embedded wholesale via ofFormula, closed under the
connectives, □, and named quantifiers (◇ is derived —
ModalFormula.dia).
- ofFormula
{L : Language}
{α : Type u_4}
: L.Formula α → L.ModalFormula α
An embedded classical (modal-free) formula.
- not
{L : Language}
{α : Type u_4}
: L.ModalFormula α → L.ModalFormula α
Negation.
- inf
{L : Language}
{α : Type u_4}
: L.ModalFormula α → L.ModalFormula α → L.ModalFormula α
Conjunction.
- sup
{L : Language}
{α : Type u_4}
: L.ModalFormula α → L.ModalFormula α → L.ModalFormula α
Disjunction.
- box
{L : Language}
{α : Type u_4}
: L.ModalFormula α → L.ModalFormula α
Necessity.
- all
{L : Language}
{α : Type u_4}
: α → L.ModalFormula α → L.ModalFormula α
Universal quantification of a named variable.
- ex
{L : Language}
{α : Type u_4}
: α → L.ModalFormula α → L.ModalFormula α
Existential quantification of a named variable.
Instances For
Possibility, derived: ◇φ := ¬□¬φ.
Instances For
Kripke satisfaction K, w ⊨_v φ: classical formulas evaluate at the
world's structure, □ quantifies over accessible worlds, and named
quantifiers update the valuation.
Equations
- FirstOrder.Language.ModalFormula.Realize K x✝¹ (FirstOrder.Language.ModalFormula.ofFormula ψ) x✝ = K.RealizeAt x✝¹ ψ x✝
- FirstOrder.Language.ModalFormula.Realize K x✝¹ φ.not x✝ = ¬FirstOrder.Language.ModalFormula.Realize K x✝¹ φ x✝
- FirstOrder.Language.ModalFormula.Realize K x✝¹ (φ.inf ψ) x✝ = (FirstOrder.Language.ModalFormula.Realize K x✝¹ φ x✝ ∧ FirstOrder.Language.ModalFormula.Realize K x✝¹ ψ x✝)
- FirstOrder.Language.ModalFormula.Realize K x✝¹ (φ.sup ψ) x✝ = (FirstOrder.Language.ModalFormula.Realize K x✝¹ φ x✝ ∨ FirstOrder.Language.ModalFormula.Realize K x✝¹ ψ x✝)
- FirstOrder.Language.ModalFormula.Realize K x✝¹ φ.box x✝ = ∀ w' ∈ K.access x✝¹, FirstOrder.Language.ModalFormula.Realize K w' φ x✝
- FirstOrder.Language.ModalFormula.Realize K x✝¹ (FirstOrder.Language.ModalFormula.all x_3 φ) x✝ = ∀ (d : M), FirstOrder.Language.ModalFormula.Realize K x✝¹ φ (Function.update x✝ x_3 d)
- FirstOrder.Language.ModalFormula.Realize K x✝¹ (FirstOrder.Language.ModalFormula.ex x_3 φ) x✝ = ∃ (d : M), FirstOrder.Language.ModalFormula.Realize K x✝¹ φ (Function.update x✝ x_3 d)
Instances For
Embedded classical formulas realize classically — by construction.