Logic: Lecture 17, 16 October 2012 ---------------------------------- NT_< = ({<}, {S}, {0}) ----------------------- Not categorical for any infinite cardinality, but finitely axiomatizable (S3) Ay (y =/= 0 -> Ex y = S(x)) (L1) AxAy (x < S(y) <-> x <= y) (L2) Ax ~(x < 0) (L3) AxAy (x < y or x = y or y < x) (L4) AxAy (x < y -> ~(y < x)) (L5) AxAyAz (x < y -> y < z -> x < z) It can be verified that axioms (S1), (S2), (S4.n) for all n from the axioms A_S can be derived from (S3), (L1)-(L5) (see Enderton), so any model of A_< is also a model of A_S. Hence, any model of A_< looks like a copy of Nat plus some Z-chains. Unlike NT_S, here all Z-chains must be ordered with respect to each other. Since we don't specify anything, the order among Z-chains may be discrete or dense or a mixture. Hence, at any fixed cardinality we can construct models that are not order isomorphic, so we don't have categoricity. Quantifier elimination: Again suffices to consider Ex (a_1 and ... and a_n), each a_i atomic or negation of atomic Atomic formulas are either S^i(u) = S^j(v) or S^i(u) < S^j(v) 1. Eliminate negation ~(t < t') is (t' < t or t = t') ~(t = t') is (t' < t or t < t') 2. Assume x occurs in each atomic formula 3. Eliminate quantifiers Case 1: There is at least one equality. Use same technique as NT_S. Case 2: Each a_i is an inequality. Separate into conjunctions of upper and lower bounds: i.e, formula is of the form OR t_i < S^{m_i}(x) or OR S^{n_j}(x) < u_j i < l j < k |---------------------| |-----------------------| Lower bounds Upper bounds No upper bounds => formula reduces 0 = 0. No lower bounds => x has a valid assignment iff 0 satisfies the upper bounds, so replace x by 0. Otherwise, pair up lower and upper bounds. OR t_i < S^{m_i}(x) and S^{n_j}(x) < u_j i < l j < k Convert into intervals OR S^{n_j}(t_i) < S^{m_i+n_j}(x) and i < l S^{m_i+n_j}(x) < S^{m_i}(u_j) j < k i.e., for some i < l, j < k S^{n_j}(t_i) < S^{m_i+n_j}(x) < S^{m_i}(u_j) Need to check that some interval is feasible. Replace by two checks: S_{n_j+1}(t_i) < S^{m_i}(u_j) [Interval is nonempty] S^{m_i+n_j}(0) < S^{m_i}(u_j) [Upper bound is feasible] Corollary: a. Con(A_<) is complete (by quantifier elimination) b. Con(A_<) = Th(MN_<) (inclusion + completeness of Con(A_<)) c. Th(MN_<) is decidable - Completeness plus axiomatization - More directly, by quantifier elimination Definability Subsets of Nat: finite or cofinite, like NT_S Binary relations: + is not definable (else we can define evenness, which is neither finite nor cofinite) NT_+ = ({<}, {S,+}, {0}) ----------------------- Presburger arithmetic Models are what we saw earlier: Copy of Nat plus countable Z-chains densely ordered. Will not axiomatize, just prove quantifier elimination. Cannot eliminate quantifiers directly Ex y = x + x has no equivalent without quantifiers Instead, replace by (mod m) relations for all m and show quantifier elimination for that. For instance, the earlier formula is equivalent to y = 0 (mod 2) As usual, suffices to consider formulast Ey (a_1 and ... and a_n), each a_i atomic or negation of atomic Terms are of the form S^k(0) + n_1 x_1 + ... + n_k x_k, where nx abbreviates x + ... + x, n times. Atomic formulas are t = t', t < t', t = t' mod m 1. Eliminate negation ~(t < t') is (t' < t or t = t') ~(t = t') is (t' < t or t < t') ~(t = t' mod m) is t = t'+ 1 mod m or ... or t = t'+ (m-1) mod m Now atomic formulas are of the form ny + t = u ny + t = u mod m ny + t < u u < ny + t Rewrite, for convenience, as ny < t - u ny = t - u mod m ny < t - u u - t < ny 2. Take LCM to make coefficients of y uniform. Use the fact that a = b mod m iff ka = kb mod km 3. All y terms now have a common coefficient p. Eliminate the coefficent. Replace all py by x and add conjunct "x = 0 mod p". 4. Special case: If one of the atomic formulas is x + t = u, replace x by (u - t) everywhere and add conjunct t <= u. 5. No occurrence of = Formulas consist of lower bounds, upper bounds and congruences. a. If no congruences, proceed as for NT_< b. If there are congruences modulo m1, m2, ... mn, let M = lcm of (m1,...,mn). Observe that residues (r0,...,rn) modulo (m1,...,mn) are preserved modulo (M,....,M). Let lower bounds be L1 to Ll. Suffices to search for valid solutions within L1, L1+1, ... , L1+(M-1) L2, L2+1, ... , L2+(M-1) .. Ll, Ll+1, ... , Ll+(M-1) In case all Lj's are negative add a constraint x >= 0. Express this as an additional lower bound 0 < x + 1. Rewrite the constraints as quantifier free formula by taking disjuntion over (all lower bounds, all q in 1 to M) See Enderton for details. Decidability: Quantifier elimination translates sentences to sentences. For sentences, no variables, so the resulting formula can be checked one atomic formula at a time. Note that quantifier elimination blows up the formula: the complexity is double exponential, so this procedure is not computationally feasible in general, but it still used in modern verification tools! Theorem: A set of numbers is definable in MN_+ iff it is ultimately periodic. Periodic: Ep such that for all n, n in X iff n+p in X Ultimately periodic: EN such for all n > N, n in x iff n+p in D. Corollary: Set of perfect squares is not definable. ======================================================================