First-order formula and sentence combinators #
This file provides reusable first-order formula and sentence combinators over FirstOrder.Language:
- universal and existential closure (
FO.closeAll,FO.closeEx) over finite free-variable types, - variable relabeling, equality, and unary/binary relation application (
FO.atVar,FO.varEq,FO.rel₁,FO.rel₂), - order-theoretic formulas (
FO.lt,FO.le,FO.isZero,FO.isMax,FO.succ,FO.isFirstOut) with respect to a binary relation symbol interpreted as<onFin B, and - finite-domain cardinality sentences (
FO.cardEqSentence, built fromSentence.cardGe) and finite Boolean combinations of sentences (FO.truthTableSentence).
Main definitions #
Cslib.Logic.FO.closeAll,Cslib.Logic.FO.closeEx: universal and existential closure of a first-order formula over a finite type of free variables.Cslib.Logic.FO.atVar,Cslib.Logic.FO.varEq,Cslib.Logic.FO.rel₁,Cslib.Logic.FO.rel₂: atomic formula combinators.Cslib.Logic.FO.lt,Cslib.Logic.FO.le,Cslib.Logic.FO.isZero,Cslib.Logic.FO.isMax,Cslib.Logic.FO.succ,Cslib.Logic.FO.isFirstOut: order formulas onFin B.Cslib.Logic.FO.cardEqSentence: sentence assertingNat.card M = non finite structures.Cslib.Logic.FO.truthTableSentence: finite Boolean combination of sentences indexed byFin m.
Main results #
Cslib.Logic.FO.realize_closeAll,Cslib.Logic.FO.realize_closeEx: satisfaction of universal and existential closures.Cslib.Logic.FO.realize_isZero,Cslib.Logic.FO.realize_isMax,Cslib.Logic.FO.realize_succ,Cslib.Logic.FO.realize_isFirstOut: satisfaction of order formulas onFin B.Cslib.Logic.FO.realize_cardGe_iff_le_card,Cslib.Logic.FO.realize_cardEqSentence: characterizations ofSentence.cardGeandcardEqSentenceviaNat.cardon finite structures.Cslib.Logic.FO.realize_truthTableSentence: satisfaction oftruthTableSentence.Cslib.Logic.FO.relMap_pair_equiv,Cslib.Logic.FO.relMap_single_equiv: isomorphisms preserve binary and unary relations.
References #
Closure and atomic combinators #
Universal closure of a formula over a finite type of free variables.
Instances For
Existential closure of a formula over a finite type of free variables.
Instances For
Relabel a single-variable formula φ : L.Formula (Fin 1) to free variable u : V.
Instances For
Equality of two free variables as a formula.
Instances For
Application of a unary relation symbol to a free variable.
Instances For
Application of a binary relation symbol to two free variables.
Instances For
The formula ⊤ holds, as a term.
An isomorphism preserves a binary relation on pairs.
An isomorphism preserves a unary relation.
The strict order formula u < w with respect to a binary relation symbol r.
Instances For
The weak order formula u ≤ w (¬ (w < u)) with respect to r.
Instances For
The formula ∀ z, ¬ (z < u), characterizing the minimum element 0 of Fin B.
Instances For
The formula ∀ z, ¬ (u < z), characterizing the maximum element B - 1 of Fin B.
Instances For
The successor formula u < w ∧ ∀ z, ¬ (u < z) ∨ ¬ (z < w), characterizing
(w : ℕ) = (u : ℕ) + 1 on Fin B.
Instances For
Given a domain formula inDom : L.Formula (Fin 1) holding of < M, the formula
isFirstOut r inDom u asserts ¬ inDom(u) ∧ ∀ k < u, inDom(k), holding solely of M.
Instances For
On Fin B, with r read as <, isZero r u holds exactly when u is assigned 0.
On Fin B, with r read as <, isMax r u holds exactly when u is assigned B - 1.
On Fin B, with r read as <, succ r u w holds exactly when w is assigned the
successor of the value of u.
On Fin B, with r read as < and a domain formula holding exactly below M < B,
isFirstOut r inDom u holds exactly when u is assigned M.
Finite-domain cardinality and truth-table sentences #
On a finite structure M, Mathlib's Sentence.cardGe L n holds iff n ≤ Nat.card M.
The first-order sentence Sentence.cardGe L n ⊓ ∼(Sentence.cardGe L (n + 1)), which holds on a
finite structure M iff Nat.card M = n.
Instances For
On a finite structure, cardEqSentence L n holds exactly when the structure has n
elements.
Given m sentences φ and a predicate P on bit vectors Fin m → Bool, the first-order
sentence asserting that the truth values i ↦ (M ⊨ φ i) satisfy P.
Instances For
truthTableSentence φ P holds exactly when the truth values of the sentences φ i satisfy
P.