AC⁰ as first-order logic with arithmetic
Lax895169.ArithmeticLogic · concepts/Lax895169/ArithmeticLogic.lean · lax-895169
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Definition
The arithmetic vocabulary has a binary symbol and two ternary symbols for addition and multiplication. Every finite linear order interprets it canonically through the ranks of its elements: is the order, holds when the ranks satisfy and when . The two are graphs, hence truncated: a sum or a product that is not the rank of an element is related to nothing.
A decision problem over a relational vocabulary is AC⁰ definable when there is a first-order sentence over and the arithmetic vocabulary such that, for every nonempty finite -structure and every linear order on , is a yes-instance of if and only if holds in with the canonical arithmetic of that order. This is the logic FO(), which defines the problems of uniform AC⁰ by theorems of Barrington, Immerman and Straubing; no circuit model is introduced here.
Concept map
Lean source view on GitHub
| 1 | import Mathlib.ModelTheory.Order |
| 2 | import Mathlib.ModelTheory.Semantics |
| 3 | import Lax904597.Problems |
| 4 | import Lax895169.BitPredicate |
| 5 | |
| 6 | /-! |
| 7 | --- |
| 8 | title: AC⁰ as first-order logic with arithmetic |
| 9 | type: definition |
| 10 | --- |
| 11 | The arithmetic vocabulary has a binary symbol and two ternary symbols |
| 12 | for addition and multiplication. Every finite linear order interprets it |
| 13 | canonically through the ranks of its elements: is the order, |
| 14 | holds when the ranks satisfy |
| 15 | and when |
| 16 | . The two are graphs, hence truncated: a sum or a |
| 17 | product that is not the rank of an element is related to nothing. |
| 18 | |
| 19 | A decision problem over a relational vocabulary is AC⁰ definable |
| 20 | when there is a first-order sentence over and the arithmetic |
| 21 | vocabulary such that, for every nonempty finite -structure and every |
| 22 | linear order on , is a yes-instance of if and only if |
| 23 | holds in with the canonical arithmetic of that order. This is |
| 24 | the logic FO(), which defines the problems of uniform AC⁰ |
| 25 | by theorems of Barrington, Immerman and Straubing; no circuit model is |
| 26 | introduced here. |
| 27 | -/ |
| 28 | |
| 29 | namespace Lax895169.ArithmeticLogic |
| 30 | |
| 31 | open Lax895169.BitPredicate Lax904597.Problems |
| 32 | |
| 33 | open FirstOrder |
| 34 | |
| 35 | open FirstOrder.Language |
| 36 | |
| 37 | /-- Relation symbols of the arithmetic vocabulary. -/ |
| 38 | inductive arithRel : ℕ → Type |
| 39 | /-- `le x y`: the rank of `x` is at most the rank of `y`, i.e., `x ≤ y`. -/ |
| 40 | | le : arithRel 2 |
| 41 | /-- `plus x y z`: the ranks satisfy `orank x + orank y = orank z`. -/ |
| 42 | | plus : arithRel 3 |
| 43 | /-- `times x y z`: the ranks satisfy `orank x * orank y = orank z`. -/ |
| 44 | | times : arithRel 3 |
| 45 | deriving DecidableEq |
| 46 | |
| 47 | /-- The relational vocabulary of the numeric predicates: a linear order and the |
| 48 | graphs of addition and multiplication of ranks. Interpreted canonically on every |
| 49 | finite linear order by `arithStructure`. -/ |
| 50 | def arith : Language := |
| 51 | ⟨fun _ => Empty, arithRel⟩ |
| 52 | |
| 53 | instance instIsRelationalArith : IsRelational arith := fun _ => |
| 54 | (inferInstance : IsEmpty Empty) |
| 55 | |
| 56 | open FirstOrder |
| 57 | |
| 58 | open Language Structure |
| 59 | |
| 60 | section Structures |
| 61 | |
| 62 | variable (A : Type) [LinearOrder A] [Finite A] |
| 63 | |
| 64 | /-- **The numeric predicates of a finite linear order**: `≤` is the order, and |
| 65 | `plus`/`times` are the graphs of addition and multiplication of ranks. Both are |
| 66 | truncated: a value that is not the rank of an element of `A` is not related to |
| 67 | anything. -/ |
| 68 | instance arithStructure : arith.Structure A where |
| 69 | funMap f := isEmptyElim f |
| 70 | RelMap {n} R := |
| 71 | match n, R with |
| 72 | | _, .le => fun x => x 0 ≤ x 1 |
| 73 | | _, .plus => fun x => orank (x 0) + orank (x 1) = orank (x 2) |
| 74 | | _, .times => fun x => orank (x 0) * orank (x 1) = orank (x 2) |
| 75 | |
| 76 | end Structures |
| 77 | |
| 78 | open FirstOrder |
| 79 | |
| 80 | open Language |
| 81 | |
| 82 | /-- A decision problem is **AC⁰ definable** if a single sentence over the |
| 83 | arithmetic expansion of its vocabulary decides it on nonempty finite ordered |
| 84 | structures. The equivalence is required for *every* linear order, so the notion |
| 85 | is order-invariant: the sentence sees `≤`, `+` and `×`, the problem does not. |
| 86 | There is no order-free variant: the numeric predicates are computed from the |
| 87 | order, so without one there is nothing for them to mean. -/ |
| 88 | def AC0Definable {L : Language.{0, 0}} [L.IsRelational] (P : DecisionProblem L) : Prop := |
| 89 | ∃ φ : (L.sum arith).Sentence, |
| 90 | ∀ (A : Type) [L.Structure A] [LinearOrder A] [Finite A] [Nonempty A], P A ↔ A ⊨ φ |
| 91 | |
| 92 | end Lax895169.ArithmeticLogic |
| 93 |
Used by
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments