definition
No public endorsements yet.
Loading review…
Sign in with ORCIDConcept map
Definition
Monadic second-order formulas over an arbitrary first-order language. A formula in context has first-order variables and monadic second-order variables. First-order terms are the terms of the underlying first-order language. Disjunction and negation are primitive; conjunction and the other usual connectives are derived operations.
Lean source view on GitHub
| 1 | import Mathlib.ModelTheory.Semantics |
| 2 | |
| 3 | /-! |
| 4 | --- |
| 5 | title: Monadic second-order syntax |
| 6 | type: definition |
| 7 | --- |
| 8 | |
| 9 | Monadic second-order formulas over an arbitrary first-order language. A formula |
| 10 | in context `(n, m)` has `n` first-order variables and `m` monadic second-order |
| 11 | variables. First-order terms are the terms of the underlying first-order |
| 12 | language. Disjunction and negation are primitive; conjunction and the other |
| 13 | usual connectives are derived operations. |
| 14 | -/ |
| 15 | |
| 16 | namespace Lax52.MSOSyntax |
| 17 | |
| 18 | open FirstOrder |
| 19 | |
| 20 | universe u v |
| 21 | |
| 22 | /-- Monadic second-order formulas over `L`, intrinsically scoped by the numbers |
| 23 | of available first-order and monadic variables. -/ |
| 24 | inductive Formula (L : Language.{u, v}) : Nat → Nat → Type (max u v) |
| 25 | | falsum {n m : Nat} : Formula L n m |
| 26 | | equal {n m : Nat} : L.Term (Fin n) → L.Term (Fin n) → Formula L n m |
| 27 | | rel {n m k : Nat} : L.Relations k → (Fin k → L.Term (Fin n)) → Formula L n m |
| 28 | | mem {n m : Nat} : L.Term (Fin n) → Fin m → Formula L n m |
| 29 | | or {n m : Nat} : Formula L n m → Formula L n m → Formula L n m |
| 30 | | neg {n m : Nat} : Formula L n m → Formula L n m |
| 31 | | exFO {n m : Nat} : Formula L (n + 1) m → Formula L n m |
| 32 | | exSO {n m : Nat} : Formula L n (m + 1) → Formula L n m |
| 33 | |
| 34 | /-- An MSO sentence has no free variables of either sort. -/ |
| 35 | abbrev Sentence (L : Language.{u, v}) := Formula L 0 0 |
| 36 | |
| 37 | namespace Formula |
| 38 | |
| 39 | variable {L : Language.{u, v}} {n m : Nat} |
| 40 | |
| 41 | /-- Derived conjunction. -/ |
| 42 | def and (phi psi : Formula L n m) : Formula L n m := |
| 43 | .neg (.or (.neg phi) (.neg psi)) |
| 44 | |
| 45 | /-- Derived truth. -/ |
| 46 | def verum : Formula L n m := .neg .falsum |
| 47 | |
| 48 | /-- Derived implication. -/ |
| 49 | def imp (phi psi : Formula L n m) : Formula L n m := |
| 50 | .or (.neg phi) psi |
| 51 | |
| 52 | /-- Derived biconditional. -/ |
| 53 | def iff (phi psi : Formula L n m) : Formula L n m := |
| 54 | and (imp phi psi) (imp psi phi) |
| 55 | |
| 56 | /-- Derived universal first-order quantification. -/ |
| 57 | def allFO (phi : Formula L (n + 1) m) : Formula L n m := |
| 58 | .neg (.exFO (.neg phi)) |
| 59 | |
| 60 | /-- Derived universal monadic second-order quantification. -/ |
| 61 | def allSO (phi : Formula L n (m + 1)) : Formula L n m := |
| 62 | .neg (.exSO (.neg phi)) |
| 63 | |
| 64 | end Formula |
| 65 | |
| 66 | end Lax52.MSOSyntax |
| 67 |
Builds on
none
From Mathlib
Community review
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above; your ORCID profile must share a public name.
0 comments