First-order interpretations and first-order reductions
Lax904597.Interpretations · concepts/Lax904597/Interpretations.lean · lax-904597
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Definition
A tagged -dimensional first-order interpretation of a relational vocabulary in a vocabulary maps an -structure with universe to the -structure with universe , in which an -ary symbol holds of the tagged tuples exactly when the first-order -formula chosen for and the tags holds in of the coordinates . The tags play the role of the constantly many sorts that textbook reductions carve out of an ordered universe.
A first-order reduction from a problem to a problem is such an interpretation mapping yes-instances of exactly to yes-instances of , on every finite nonempty structure. An ordered first-order reduction is one over the expansion of by a linear order, correct for every linear order put on the input; since does not depend on the order, neither does whether the image is a yes-instance of , so the reduction is order-invariant. Both kinds are computable in on encodings of finite structures, hence in particular polynomial-time many-one reductions; this standard fact is not part of the formalization.
Concept map
Lean source view on GitHub
| 1 | import Mathlib.ModelTheory.Semantics |
| 2 | import Mathlib.ModelTheory.Order |
| 3 | import Lax904597.Problems |
| 4 | |
| 5 | /-! |
| 6 | --- |
| 7 | title: First-order interpretations and first-order reductions |
| 8 | type: definition |
| 9 | --- |
| 10 | A *tagged -dimensional first-order interpretation* of a relational |
| 11 | vocabulary in a vocabulary maps an -structure with universe |
| 12 | to the -structure with universe , in which an |
| 13 | -ary symbol holds of the tagged tuples |
| 14 | exactly when the first-order -formula chosen for and |
| 15 | the tags holds in of the coordinates |
| 16 | . The tags play the role of the constantly many sorts that textbook |
| 17 | reductions carve out of an ordered universe. |
| 18 | |
| 19 | A *first-order reduction* from a problem to a problem is such an |
| 20 | interpretation mapping yes-instances of exactly to yes-instances of , |
| 21 | on every finite nonempty structure. An *ordered* first-order reduction is |
| 22 | one over the expansion of by a linear order, correct for every linear |
| 23 | order put on the input; since does not depend on the order, neither |
| 24 | does whether the image is a yes-instance of , so the reduction is |
| 25 | order-invariant. Both kinds are computable in on encodings |
| 26 | of finite structures, hence in particular polynomial-time many-one |
| 27 | reductions; this standard fact is not part of the formalization. |
| 28 | -/ |
| 29 | |
| 30 | namespace Lax904597.Interpretations |
| 31 | |
| 32 | open FirstOrder FirstOrder.Language Lax904597.Problems |
| 33 | |
| 34 | /-- A tagged `dim`-dimensional first-order interpretation of `L'` in `L`: |
| 35 | the defining `L`-formula of each relation symbol of `L'`, for each tuple of |
| 36 | tags; the free variable `(i, j)` is the `j`-th coordinate of the `i`-th |
| 37 | argument tuple. -/ |
| 38 | structure FOInterpretation (L L' : Language.{0, 0}) (Tag : Type) (dim : ℕ) where |
| 39 | /-- The defining `L`-formula of each relation symbol of `L'`, for each tuple |
| 40 | of tags; the free variable `(i, j)` is the `j`-th coordinate of the `i`-th |
| 41 | argument tuple. -/ |
| 42 | relFormula : ∀ {n : ℕ}, L'.Relations n → (Fin n → Tag) → L.Formula (Fin n × Fin dim) |
| 43 | |
| 44 | namespace FOInterpretation |
| 45 | |
| 46 | variable {L L' : Language.{0, 0}} {Tag : Type} {dim : ℕ} |
| 47 | |
| 48 | /-- The universe of the structure interpreted in `A`: tagged `dim`-tuples. -/ |
| 49 | protected def Map (_I : FOInterpretation L L' Tag dim) (A : Type) : Type := |
| 50 | Tag × (Fin dim → A) |
| 51 | |
| 52 | variable (I : FOInterpretation L L' Tag dim) (A : Type) [L.Structure A] |
| 53 | |
| 54 | /-- The `L'`-structure interpreted in the `L`-structure `A`. -/ |
| 55 | instance mapStructure [L'.IsRelational] : L'.Structure (I.Map A) where |
| 56 | funMap f := isEmptyElim f |
| 57 | RelMap R xs := (I.relFormula R fun i => (xs i).1).Realize fun p => (xs p.1).2 p.2 |
| 58 | |
| 59 | end FOInterpretation |
| 60 | |
| 61 | /-- A first-order reduction from the problem `P` on `L`-structures to the |
| 62 | problem `Q` on `L'`-structures: an interpretation mapping yes-instances of |
| 63 | `P` exactly to yes-instances of `Q`, on the finite nonempty structures. -/ |
| 64 | structure FOReduction {L L' : Language.{0, 0}} [L.IsRelational] [L'.IsRelational] |
| 65 | (P : DecisionProblem L) (Q : DecisionProblem L') where |
| 66 | /-- The tags: the copies of `A^dim` the interpretation uses. -/ |
| 67 | Tag : Type |
| 68 | /-- Finitely many tags, so that finite structures map to finite ones. -/ |
| 69 | [tagFinite : Finite Tag] |
| 70 | /-- At least one tag, so that nonempty structures map to nonempty ones. -/ |
| 71 | [tagNonempty : Nonempty Tag] |
| 72 | /-- The dimension of the interpretation. -/ |
| 73 | dim : ℕ |
| 74 | /-- The interpretation. -/ |
| 75 | toInterpretation : FOInterpretation L L' Tag dim |
| 76 | /-- Yes-instances map exactly to yes-instances. -/ |
| 77 | correct : ∀ (A : Type) [L.Structure A] [Finite A] [Nonempty A], |
| 78 | P A ↔ Q (toInterpretation.Map A) |
| 79 | |
| 80 | section Ordered |
| 81 | |
| 82 | variable (L : Language.{0, 0}) (A : Type) [L.Structure A] [LE A] |
| 83 | |
| 84 | /-- A linearly ordered `L`-structure is a structure over the ordered expansion |
| 85 | `L.sum Language.order`, interpreting the order symbol as `≤`. -/ |
| 86 | instance sumOrderStructure : (L.sum Language.order).Structure A := |
| 87 | letI := orderStructure (M := A) |
| 88 | inferInstance |
| 89 | |
| 90 | instance sumOrderOrderedStructure : (L.sum Language.order).OrderedStructure A := |
| 91 | ⟨fun _ => Iff.rfl⟩ |
| 92 | |
| 93 | end Ordered |
| 94 | |
| 95 | /-- An ordered first-order reduction from `P` to `Q`: an interpretation over |
| 96 | the ordered expansion of `L` that maps yes-instances of `P` exactly to |
| 97 | yes-instances of `Q`, on every finite nonempty structure and for every linear |
| 98 | order on it. -/ |
| 99 | structure OrderedFOReduction {L L' : Language.{0, 0}} [L.IsRelational] [L'.IsRelational] |
| 100 | (P : DecisionProblem L) (Q : DecisionProblem L') where |
| 101 | /-- The tags: the copies of `A^dim` the interpretation uses. -/ |
| 102 | Tag : Type |
| 103 | /-- Finitely many tags, so that finite structures map to finite ones. -/ |
| 104 | [tagFinite : Finite Tag] |
| 105 | /-- At least one tag, so that nonempty structures map to nonempty ones. -/ |
| 106 | [tagNonempty : Nonempty Tag] |
| 107 | /-- The dimension of the interpretation. -/ |
| 108 | dim : ℕ |
| 109 | /-- The interpretation, over the ordered expansion of `L`. -/ |
| 110 | toInterpretation : FOInterpretation (L.sum Language.order) L' Tag dim |
| 111 | /-- Yes-instances map exactly to yes-instances, whatever the linear order. -/ |
| 112 | correct : ∀ (A : Type) [L.Structure A] [LinearOrder A] [Finite A] [Nonempty A], |
| 113 | P A ↔ Q (toInterpretation.Map A) |
| 114 | |
| 115 | end Lax904597.Interpretations |
| 116 |
Builds on
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments