Lax678846.ExistentialSecondOrder
Existential second-order logic
concepts/Lax678846/ExistentialSecondOrder.lean · lax-678846
No public endorsements yet.
Loading review…
Sign in with ORCIDConcept map
Definition and theorem
An existential second-order sentence has the form , where each relation has a fixed arity and the matrix is first-order. Witness relations range over all relations of their arities on the existing universe.
The first-order basis consists of truth, equality, input-relation and witness-relation atoms, negation, conjunction, and existential element quantification. There is no built-in order or fixed-point operator. Element quantification binds variable zero. The witness vocabulary records the finite second-order quantifier prefix.
Lean source view on GitHub
| 1 | import Lax678846.FiniteStructures |
| 2 | |
| 3 | /-! |
| 4 | --- |
| 5 | title: Existential second-order logic |
| 6 | type: definition and theorem |
| 7 | --- |
| 8 | An existential second-order sentence has the form |
| 9 | , where each relation has a fixed |
| 10 | arity and the matrix is first-order. Witness relations range over |
| 11 | all relations of their arities on the existing universe. |
| 12 | |
| 13 | The first-order basis consists of truth, equality, input-relation and |
| 14 | witness-relation atoms, negation, conjunction, and existential element |
| 15 | quantification. There is no built-in order or fixed-point operator. |
| 16 | Element quantification binds variable zero. The witness vocabulary records |
| 17 | the finite second-order quantifier prefix. |
| 18 | -/ |
| 19 | |
| 20 | namespace Lax678846.ExistentialSecondOrder |
| 21 | |
| 22 | open Lax678846.FiniteStructures |
| 23 | |
| 24 | inductive FirstOrder (σ τ : Vocabulary) : Nat → Type |
| 25 | | truth {m} : FirstOrder σ τ m |
| 26 | | equal {m} (x y : Fin m) : FirstOrder σ τ m |
| 27 | | relation {m} (r : Symbol σ) (args : Fin (σ.get r) → Fin m) : FirstOrder σ τ m |
| 28 | | variable {m} (r : Symbol τ) (args : Fin (τ.get r) → Fin m) : FirstOrder σ τ m |
| 29 | | neg {m} (φ : FirstOrder σ τ m) : FirstOrder σ τ m |
| 30 | | conj {m} (φ ψ : FirstOrder σ τ m) : FirstOrder σ τ m |
| 31 | | exists' {m} (φ : FirstOrder σ τ (m + 1)) : FirstOrder σ τ m |
| 32 | |
| 33 | def FirstOrder.eval {σ τ : Vocabulary} {m : Nat} (φ : FirstOrder σ τ m) |
| 34 | (A : Structure σ) (R : Interpretation τ A.size) (v : Fin m → Fin A.size) : Prop := |
| 35 | match φ with |
| 36 | | .truth => True |
| 37 | | .equal x y => v x = v y |
| 38 | | .relation r args => A.relation r (v ∘ args) = true |
| 39 | | .variable r args => R r (v ∘ args) = true |
| 40 | | .neg ψ => ¬ ψ.eval A R v |
| 41 | | .conj ψ χ => ψ.eval A R v ∧ χ.eval A R v |
| 42 | | .exists' ψ => ∃ a : Fin A.size, ψ.eval A R (Fin.cons a v) |
| 43 | |
| 44 | structure Sentence (σ : Vocabulary) where |
| 45 | witnesses : Vocabulary |
| 46 | matrix : FirstOrder σ witnesses 0 |
| 47 | |
| 48 | def Satisfies {σ : Vocabulary} (A : Structure σ) (φ : Sentence σ) : Prop := |
| 49 | ∃ R : Interpretation φ.witnesses A.size, φ.matrix.eval A R Fin.elim0 |
| 50 | |
| 51 | def Definable {σ : Vocabulary} (Q : Property σ) : Prop := |
| 52 | ∃ φ : Sentence σ, ∀ A : Structure σ, Q A ↔ Satisfies A φ |
| 53 | |
| 54 | axiom satisfiesInvariant {σ : Vocabulary} (φ : Sentence σ) : |
| 55 | IsomorphismInvariant (fun A => Satisfies A φ) |
| 56 | |
| 57 | end Lax678846.ExistentialSecondOrder |
| 58 |
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