Quantified bilateral state-based modal logic (QBSML) #
Core definitions for QBSML, the first-order extension of BSML ([Alo22],
[Ant21]) presented in [AvO23]: indices pair a world
with a partial assignment, states are finite sets of indices, and the formula
language adds predicates and quantifiers, the latter evaluated via state
extensions. Bilateral evaluation, split disjunction (via
Core.Logic.Team.splitsAs), and the NE atom carry over from BSML; frame
conditions are inherited through the world projection s↓, so support fits
the Core.Logic.Team.isFlat_iff template at the point type
Index W Var Domain exactly as BSML's does at W (see
Core/Logic/Modal/QBSML/Properties.lean).
Main declarations #
Assignment,Index: partial variable assignments and world–assignment pairs ([AvO23] Definition 4.2).State.extendIndividual,State.extendUniversal,State.extendFunctional: the state extensionss[x/d],s[x],s[x/h]interpreting quantifiers ([AvO23] Definitions 4.5–4.7).State.modalLift,State.worldProj: pairing accessible worlds with an assignment, and the world projections↓.QBSMLFormula: the formula language ([AvO23] Definition 4.1), with□derived asQBSMLFormula.nec.QBSMLFormula.IsNEFree: the NE-free fragment.monadicLang,monadicStructure: the monadic first-order signature onConstandPredand its structures, as a mathlibFirstOrder.Language.QBSMLModel(an abbreviation forFirstOrder.Language.KripkeStructureovermonadicLang),eval,support,antiSupport: bilateral evaluation ([AvO23] Definition 4.9), with the interpretation carried as a world-indexed family of mathlib structures.isBilateral:support/antiSupportform aCore.Logic.Bilateral.IsBilateralunderQBSMLFormula.neg.KripkeStructure.IsStateBased,KripkeStructure.IsIndisputable: frame conditions vias↓([AvO23] Definition 4.10).
Implementation notes #
- Predicates are monadic and the paper's terms
t := c | xappear as the two atom constructorspred(variable) andpredc(constant), so there is no separate term type: [AvO23] interpretsPⁿ(t₁ … tₙ)for arbitrary arity; higher arities can be added without changing the substrate abstraction. - The paper's domain
D(part ofM = ⟨W, D, R, I⟩) is aDomain : Type*parameter, with[Fintype Domain]where the universal extension must range over all of it. The interpretationIis a world-indexed family of mathlib first-order structures:QBSMLModelisFirstOrder.Language.KripkeStructureover the monadic signature, andKripkeStructure.pInterp/KripkeStructure.cInterpread the world-dependent (non-rigid) predicate and constant denotations offStructure.RelMap/Structure.funMap. - The paper requires all indices in a state to share an assignment domain
(
dom gᵢ = dom gⱼ); this is not enforced at the type level — the state operations preserve it. □is not primitive: the paper takes□primitive and derives◇; we invert this, soeval'spossclauses match the paper's derived◇-clauses andQBSMLFormula.necmatches its primitive□.
Assignments and indices #
A partial assignment of domain values to variables
([AvO23] Definition 4.2: gᵢ : V → D); Option D
represents the partiality.
Equations
- Core.Logic.Modal.QBSML.Assignment Var Domain = (Var → Option Domain)
Instances For
An index is a (world, assignment) pair ([AvO23]
Definition 4.2: i = ⟨wᵢ, gᵢ⟩).
Equations
- Core.Logic.Modal.QBSML.Index W Var Domain = (W × Core.Logic.Modal.QBSML.Assignment Var Domain)
Instances For
The assignment component of an index.
Equations
- i.assign = i.2
Instances For
Update an assignment at a single variable: g[x/d](y) = d if y = x,
else g(y).
Equations
- g.update x d = Function.update g x (some d)
Instances For
Update an index's assignment ([AvO23] Definitions 4.3–4.4:
i[x/d] := ⟨wᵢ, gᵢ[x/d]⟩, with the assignment update gᵢ[x/d] as
mathlib's Function.update).
Instances For
The world projection #
The world projection s↓ of a state of indices: the set of worlds
appearing in some index ([AvO23] Definition 4.10:
s↓ := {w | ∃g, (w, g) ∈ s}). Frame conditions on accessibility are
stated relative to s↓, so QBSML reuses BSML's notions via this
projection.
Equations
- Core.Logic.Modal.QBSML.State.worldProj s = Finset.image Core.Logic.Modal.QBSML.Index.world s
Instances For
State extensions #
Individual extension s[x/d]: assign x to d in every index
([AvO23] Definition 4.5: s[x/d] := {i[x/d] | i ∈ s}).
Equations
- Core.Logic.Modal.QBSML.State.extendIndividual s x d = Finset.image (fun (i : Core.Logic.Modal.QBSML.Index W Var Domain) => i.update x d) s
Instances For
Universal extension s[x]: extend with every domain value at x
([AvO23] Definition 4.6: s[x] := {i[x/d] | i ∈ s, d ∈ D}).
Requires [Fintype Domain] to range over the entire domain.
Equations
- Core.Logic.Modal.QBSML.State.extendUniversal s x = Finset.univ.biUnion fun (d : Domain) => Core.Logic.Modal.QBSML.State.extendIndividual s x d
Instances For
Functional extension s[x/h]: for each i ∈ s, extend with values
drawn from h i ([AvO23] Definition 4.7:
s[x/h] := {i[x/d] | i ∈ s, d ∈ h(i)}). Interprets existential
quantification: ∃x φ iff M, s[x/h] ⊨ φ for some functional h.
Equations
- Core.Logic.Modal.QBSML.State.extendFunctional s x h = s.biUnion fun (i : Core.Logic.Modal.QBSML.Index W Var Domain) => Finset.image (fun (d : Domain) => i.update x d) (h i)
Instances For
Membership characterisations #
Extension algebra #
The universal extension is the functional extension with the constant full-domain functional.
Witness reconstruction: a state t consisting of x-updates of
indices of s is recovered exactly as the functional extension of s
by the functional collecting, at each index, the values whose updates
land in t. The shared Finset surgery behind the existential-witness
steps of the free-choice facts
(Core/Logic/Modal/QBSML/FreeChoice.lean).
Modal pairing #
Modal pairing R(wᵢ)[gᵢ]: pair each accessible world with the
assignment of the original index. Used in modal evaluation
([AvO23] Definition 4.9).
Equations
- Core.Logic.Modal.QBSML.State.modalLift X g = Finset.image (fun (v : W) => (v, g)) X
Instances For
A state contained in a modal pairing is recovered by projecting its
worlds and pairing them back with the same assignment: every index of
s ⊆ State.modalLift X g carries the assignment g.
The formula language #
QBSML formula language ([AvO23] Definition 4.1),
parameterized over variable type Var, constant type Const, and
(monadic) predicate type Pred. The paper's terms t := c | x appear
as the two atom constructors. □ is not primitive — see
QBSMLFormula.nec.
- pred
{Var : Type u_6}
{Const : Type u_7}
{Pred : Type u_8}
: Pred → Var → QBSMLFormula Var Const Pred
Monadic predicate applied to a variable.
- predc
{Var : Type u_6}
{Const : Type u_7}
{Pred : Type u_8}
: Pred → Const → QBSMLFormula Var Const Pred
Monadic predicate applied to an individual constant.
- ne
{Var : Type u_6}
{Const : Type u_7}
{Pred : Type u_8}
: QBSMLFormula Var Const Pred
Non-emptiness atom: state is non-empty.
- neg
{Var : Type u_6}
{Const : Type u_7}
{Pred : Type u_8}
: QBSMLFormula Var Const Pred → QBSMLFormula Var Const Pred
Bilateral negation: swap support/anti-support.
- conj
{Var : Type u_6}
{Const : Type u_7}
{Pred : Type u_8}
: QBSMLFormula Var Const Pred → QBSMLFormula Var Const Pred → QBSMLFormula Var Const Pred
Conjunction.
- disj
{Var : Type u_6}
{Const : Type u_7}
{Pred : Type u_8}
: QBSMLFormula Var Const Pred → QBSMLFormula Var Const Pred → QBSMLFormula Var Const Pred
Split (tensor) disjunction.
- poss
{Var : Type u_6}
{Const : Type u_7}
{Pred : Type u_8}
: QBSMLFormula Var Const Pred → QBSMLFormula Var Const Pred
Possibility modal.
- exi
{Var : Type u_6}
{Const : Type u_7}
{Pred : Type u_8}
: Var → QBSMLFormula Var Const Pred → QBSMLFormula Var Const Pred
Existential quantifier.
- univ
{Var : Type u_6}
{Const : Type u_7}
{Pred : Type u_8}
: Var → QBSMLFormula Var Const Pred → QBSMLFormula Var Const Pred
Universal quantifier.
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Necessity, derived: □φ := ¬◇¬φ. [AvO23] takes □
primitive and ◇ := ¬□¬ derived; we invert this, so eval's poss
clauses match the paper's derived ◇-clauses and nec matches its
primitive □.
Instances For
The NE-free fragment: formulas not containing the NE atom. On this
fragment QBSML reduces to classical first-order modal logic
([AvO23] analogue of [Ant21]
Proposition 2.2.16); see Core/Logic/Modal/QBSML/Properties.lean.
- pred {Var : Type u_2} {Const : Type u_4} {Pred : Type u_5} (P : Pred) (x : Var) : (QBSMLFormula.pred P x).IsNEFree
- predc {Var : Type u_2} {Const : Type u_4} {Pred : Type u_5} (P : Pred) (c : Const) : (QBSMLFormula.predc P c).IsNEFree
- neg {Var : Type u_2} {Const : Type u_4} {Pred : Type u_5} {φ : QBSMLFormula Var Const Pred} : φ.IsNEFree → φ.neg.IsNEFree
- conj {Var : Type u_2} {Const : Type u_4} {Pred : Type u_5} {φ ψ : QBSMLFormula Var Const Pred} : φ.IsNEFree → ψ.IsNEFree → (φ.conj ψ).IsNEFree
- disj {Var : Type u_2} {Const : Type u_4} {Pred : Type u_5} {φ ψ : QBSMLFormula Var Const Pred} : φ.IsNEFree → ψ.IsNEFree → (φ.disj ψ).IsNEFree
- poss {Var : Type u_2} {Const : Type u_4} {Pred : Type u_5} {φ : QBSMLFormula Var Const Pred} : φ.IsNEFree → φ.poss.IsNEFree
- exi {Var : Type u_2} {Const : Type u_4} {Pred : Type u_5} (x : Var) {φ : QBSMLFormula Var Const Pred} : φ.IsNEFree → (QBSMLFormula.exi x φ).IsNEFree
- univ {Var : Type u_2} {Const : Type u_4} {Pred : Type u_5} (x : Var) {φ : QBSMLFormula Var Const Pred} : φ.IsNEFree → (QBSMLFormula.univ x φ).IsNEFree
Instances For
The derived □φ := ¬◇¬φ preserves NE-freeness.
Atom substitution #
Substitute a formula for each atom, commuting with every connective and
quantifier (and fixing NE). The generic congruence machinery for
atom-rewriting operations: an atom map whose images are bilaterally
equivalent to the atoms is salva veritate (eval_mapAtoms_iff in
Core/Logic/Modal/QBSML/Properties.lean), so each such operation — e.g.
[Yan23]'s reinterpretation function in Studies/Yan2023.lean — needs
only its two atom lemmas.
Equations
- One or more equations did not get rendered due to their size.
- Core.Logic.Modal.QBSML.QBSMLFormula.mapAtoms fp fc (Core.Logic.Modal.QBSML.QBSMLFormula.pred a a_1) = fp a a_1
- Core.Logic.Modal.QBSML.QBSMLFormula.mapAtoms fp fc (Core.Logic.Modal.QBSML.QBSMLFormula.predc a a_1) = fc a a_1
- Core.Logic.Modal.QBSML.QBSMLFormula.mapAtoms fp fc Core.Logic.Modal.QBSML.QBSMLFormula.ne = Core.Logic.Modal.QBSML.QBSMLFormula.ne
- Core.Logic.Modal.QBSML.QBSMLFormula.mapAtoms fp fc a.neg = (Core.Logic.Modal.QBSML.QBSMLFormula.mapAtoms fp fc a).neg
- Core.Logic.Modal.QBSML.QBSMLFormula.mapAtoms fp fc (a.conj a_1) = (Core.Logic.Modal.QBSML.QBSMLFormula.mapAtoms fp fc a).conj (Core.Logic.Modal.QBSML.QBSMLFormula.mapAtoms fp fc a_1)
- Core.Logic.Modal.QBSML.QBSMLFormula.mapAtoms fp fc (a.disj a_1) = (Core.Logic.Modal.QBSML.QBSMLFormula.mapAtoms fp fc a).disj (Core.Logic.Modal.QBSML.QBSMLFormula.mapAtoms fp fc a_1)
- Core.Logic.Modal.QBSML.QBSMLFormula.mapAtoms fp fc a.poss = (Core.Logic.Modal.QBSML.QBSMLFormula.mapAtoms fp fc a).poss
Instances For
An atom substitution with NE-free images preserves NE-freeness.
The monadic signature and models #
The monadic signature on Const and Pred: one individual constant per
Const, one unary relation symbol per Pred — [AvO23]
Definition 4.1's signature (terms t := c | x, monadic relations).
Equations
- One or more equations did not get rendered due to their size.
Instances For
A constant as a symbol of the monadic signature (defeq; the parametric
analogue of mathlib's per-symbol abbreviations, cf.
Fragments/English/Toy.lean).
Equations
Instances For
A predicate as a relation symbol of the monadic signature (defeq).
Equations
Instances For
The monadicLang Const Pred structure a constant interpretation and a
predicate valuation induce.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A QBSML model ([AvO23] Definition 4.2:
M = ⟨W, D, R, I⟩) is a constant-domain first-order Kripke
structure over the monadic signature: accessibility R plus the
world-indexed interpretation I, carried as a family of mathlib
structures (FirstOrder.Language.KripkeStructure) — true by
construction, not by bridge.
Equations
- Core.Logic.Modal.QBSML.QBSMLModel W Domain Const Pred = (Core.Logic.Modal.QBSML.monadicLang Const Pred).KripkeStructure W Domain
Instances For
The predicate denotation at a world, read off the model's structure
family via Structure.RelMap — the world-relativized I(w)(Pⁿ) of
[AvO23] Definition 4.2, specialised to monadic P
(cf. Semantics.Composition.Model.pred₁ext).
Equations
- FirstOrder.Language.KripkeStructure.pInterp M P w d = FirstOrder.Language.Structure.RelMap (Core.Logic.Modal.QBSML.monadicRel P) fun (x : Fin 1) => d
Instances For
The constant denotation at a world — the world-relative I(w)(c) of
[AvO23] Definitions 4.2 and 4.8, read off
Structure.funMap (cf. Semantics.Composition.Model.const).
Equations
- FirstOrder.Language.KripkeStructure.cInterp M c w = FirstOrder.Language.Structure.funMap (Core.Logic.Modal.QBSML.monadicConst c) default
Instances For
Bilateral evaluation #
Bilateral evaluation of QBSML formulas ([AvO23]
Definition 4.9): eval M true φ s is support (M, s ⊨ φ),
eval M false φ s anti-support (M, s ⫤ φ). Negation flips the
polarity, making double-negation elimination definitional.
Equations
- One or more equations did not get rendered due to their size.
- Core.Logic.Modal.QBSML.eval M true (Core.Logic.Modal.QBSML.QBSMLFormula.pred P x_3) x✝ = ∀ i ∈ x✝, ∃ (d : Domain), i.assign x_3 = some d ∧ FirstOrder.Language.KripkeStructure.pInterp M P i.world d
- Core.Logic.Modal.QBSML.eval M true Core.Logic.Modal.QBSML.QBSMLFormula.ne x✝ = x✝.Nonempty
- Core.Logic.Modal.QBSML.eval M false Core.Logic.Modal.QBSML.QBSMLFormula.ne x✝ = (x✝ = ∅)
- Core.Logic.Modal.QBSML.eval M true ψ.neg x✝ = Core.Logic.Modal.QBSML.eval M false ψ x✝
- Core.Logic.Modal.QBSML.eval M false ψ.neg x✝ = Core.Logic.Modal.QBSML.eval M true ψ x✝
- Core.Logic.Modal.QBSML.eval M true (φ.conj ψ) x✝ = (Core.Logic.Modal.QBSML.eval M true φ x✝ ∧ Core.Logic.Modal.QBSML.eval M true ψ x✝)
- Core.Logic.Modal.QBSML.eval M false (φ.disj ψ) x✝ = (Core.Logic.Modal.QBSML.eval M false φ x✝ ∧ Core.Logic.Modal.QBSML.eval M false ψ x✝)
- Core.Logic.Modal.QBSML.eval M true ψ.poss x✝ = ∀ i ∈ x✝, ∃ X ⊆ M.access i.world, X.Nonempty ∧ Core.Logic.Modal.QBSML.eval M true ψ (Core.Logic.Modal.QBSML.State.modalLift X i.assign)
- Core.Logic.Modal.QBSML.eval M false ψ.poss x✝ = ∀ i ∈ x✝, Core.Logic.Modal.QBSML.eval M false ψ (Core.Logic.Modal.QBSML.State.modalLift (M.access i.world) i.assign)
- Core.Logic.Modal.QBSML.eval M true (Core.Logic.Modal.QBSML.QBSMLFormula.univ x_3 ψ) x✝ = Core.Logic.Modal.QBSML.eval M true ψ (Core.Logic.Modal.QBSML.State.extendUniversal x✝ x_3)
- Core.Logic.Modal.QBSML.eval M false (Core.Logic.Modal.QBSML.QBSMLFormula.exi x_3 ψ) x✝ = Core.Logic.Modal.QBSML.eval M false ψ (Core.Logic.Modal.QBSML.State.extendUniversal x✝ x_3)
Instances For
Support: positive evaluation.
Equations
- Core.Logic.Modal.QBSML.support M φ s = Core.Logic.Modal.QBSML.eval M true φ s
Instances For
Anti-support: negative evaluation.
Equations
- Core.Logic.Modal.QBSML.antiSupport M φ s = Core.Logic.Modal.QBSML.eval M false φ s
Instances For
support and antiSupport form a paraconsistent bilateral logic
(Core.Logic.Bilateral.IsBilateral) under QBSMLFormula.neg, like
BSML's isBilateral at the point type Index W Var Domain.
Frame conditions via the world projection #
R is state-based on (M, s): every world in s↓ sees exactly s↓
([AvO23] Definition 4.10). Defined via
Core.Logic.Team.IsStateBased applied to State.worldProj s, sharing
BSML's frame-condition substrate.
Equations
Instances For
R is indisputable on (M, s): all worlds in s↓ see the same
accessible set ([AvO23] Definition 4.10).
Equations
Instances For
Equations
- Core.Logic.Modal.QBSML.instDecidableIsStateBasedOfFintype M s = id inferInstance
Equations
- Core.Logic.Modal.QBSML.instDecidableIsIndisputableOfFintype M s = id inferInstance