0% found this document useful (0 votes)
123 views

Wop Logic-Final

This document provides an introduction to first order logic. It begins with an overview of the syntax of first order logic, including predicates, functions, quantifiers, and signatures. It then discusses the semantics of first order logic, including how structures and assignments determine whether a formula is true or false. Finally, it provides three exercises for practice: 1) writing a formula that differentiates the natural numbers from the real numbers, 2) proving there is no bijection between the natural numbers and real numbers, and 3) writing a sentence that characterizes structures supporting mathematical induction based on a less-than relation. The document aims to provide background on first order logic as well as mathematical puzzles to solve.

Uploaded by

Mihir Vahanwala
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
123 views

Wop Logic-Final

This document provides an introduction to first order logic. It begins with an overview of the syntax of first order logic, including predicates, functions, quantifiers, and signatures. It then discusses the semantics of first order logic, including how structures and assignments determine whether a formula is true or false. Finally, it provides three exercises for practice: 1) writing a formula that differentiates the natural numbers from the real numbers, 2) proving there is no bijection between the natural numbers and real numbers, and 3) writing a sentence that characterizes structures supporting mathematical induction based on a less-than relation. The document aims to provide background on first order logic as well as mathematical puzzles to solve.

Uploaded by

Mihir Vahanwala
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Logic - Introduction Winter of Puzzles, 2021

Abstract
First order logic is an effective means to the end of knowledge representation and reasoning in
disciplines such as programming, database management, mathematics, and linguistics. However,
there are limits to the power of first order logic. This winter, we shall study Ehrenfreucht-
Fraissé Games: a procedure to prove whether a given property can be expressed using First
Order Logic. In this document, we will revise the basics of First Order Logic, and look at a few
puzzles. The concepts we discuss here will be not only useful going forward in the project, but
also mathematically instructive.

Logistics
It is highly preferred that you’re at least a little familiar with first order logic. If you haven’t
learnt about it in CS 207 - Discrete Structures, or CS 228 - Logic for CS, you might need to put
in extra effort to look up the background as you read this, and work on the winter project.
Depending on public interest in the topic, my convenience, and what the club management is
willing to allow, I will take 5-10 mentees for the winter project. The mentees will have to compile
a report over the winter in order to get certified, and I will do my best to give constructive feedback
about what you write.
The selection will be based on your response to the puzzles in this document (see Section 3). Write
your answers (typed, or neatly handwritten), make a PDF and upload it here. (access Google
form with IITB LDAP)
In any case, I plan to make most the material for this project public, so you can follow this even
if you’re not taken up as a mentee. Even if I don’t and you’re interested, feel free to contact me
later on. My email is vahanwala(at)cse.iitb.ac.in

1 First Order Logic: Overview and Syntax


In Propositional logic, there are propositional variables of Boolean type, and we build formulae
with negation (¬, English: not), conjunction (∧, English: and), disjunction (∨, English: or),
implication (→, English: implies, if p then q), etc. Here’s an example of a formula:

(p1 ∨ p2 ∨ p3 ) ∧ (¬p4 ∨ ¬p1 ∨ p5 ) ∧ (p5 → p3 )

First Order Logic extends propositional logic: we reason about an arbitrary Universe U, we allow
predicates (relations in U n ; P (t1 , . . . , tn ) returns true or false depending on whether elements
t1 , . . . , tn from U satisfy the relation), functions (from U n to U), and existential quantifiers (∃x.:
there exists x in U; ∀x.: for all x in U). Here, variables take values from U.
A formula F is either a predicate P , or F1 ∧ F2 , or F1 ∨ F2 , or F1 → F2 , or ¬F1 , or ∃x.F1 , or
∀x.F1
The above grammar recursively defines how a formula is supposed to be parsed. An example
formula:
∀x.∃y.(P (x) → Q(x, y, f (x)))
P and Q are predicates, f is a function. x and y are quantified variables. A first order formula is
called a sentence if every occurrence of a variable is in the scope of a quantifier, i.e. there is no
“free” occurrence of a variable. The above formula, is a sentence, the following is not, because z
is free:
P (z) ∧ ∀x.R(x, g(z))

But where do these functions and predicates come from?

Mihir J Vahanwala Page 1 MnP Club, IIT Bombay


Logic - Introduction Winter of Puzzles, 2021

In order to write syntactically valid formulae, we need a signature, which tells us what constant
symbols are available, predicate symbols we can use, what function symbols we can use, what is
their arity (i.e. number of arguments that need to be fed each of these predicate and function
symbols)
Definition 1.1 (Signature). A signature τ is a tuple (P, F, C) where
• P is a set of predicate symbols, annotated with the number of arguments the symbol requires
• F is a set of function symbols, annotated with the number of arguments the symbol requires
• C is a set of constant symbols. They can also be thought of as 0-ary functions
We have the binary equality predicate = included in the signature by default: there is no need to
mention it explicitly.
We also have the set X of variables.

2 First Order Logic: Semantics


A signature, like life, has no meaning apart from the one you give it.
A signature simply tells us the rules of writing syntactically valid formulae, but it is up to us to
decide what the predicates mean, what the functions return, what special elements of the universe
the constants denote. In C programming terms, the signature is the set of declarations in the
header file, we now need to implement stuff.
Definition 2.1 (Structure). Given a signature τ , a τ structure S consists of
• A universe U which is the set our constants and variables take values from
• For each k-ary predicate symbol P ∈ P, a relation PS ⊆ U k
• For each k-ary function symbol f ∈ F, a function fS : U k → U
• For each constant symbol c ∈ C, an element cS ∈ U
The truth value of a first order formula depends on the structure and the assignment
of values to the free variables in the formula.
The above definitions may seem abstract. If you’d like a concrete example, we often reason about
sets, number systems, and algebraic objects like groups or fields. Common binary predicates
include < and ⊂. Common binary functions include +, ·, ∪, ∩. The signature only gives us the
license to use these symbols.
It is the structure that tells us how to interpret these symbols, as denoting a less than, or as
implementing some kind of addition or product, etc. We omit the subscript S when it’s obvious
what the symbol means.
We say
S, A |= φ
This is to be read as Structure S and Assignment A model (or, satisfy) formula φ. This holds if φ
evaluates to true when the symbols in it get their meaning from S and the free variables get their
values as per A.
In this document, we will work with sentences: i.e. no free variables, so we won’t mention
Assignment A subsequently.

Mihir J Vahanwala Page 2 MnP Club, IIT Bombay


Logic - Introduction Winter of Puzzles, 2021

3 Exercises
Exercise 1. You are given a signature that only has one binary predicate < in addition to the
default =. Consider structures N , Z, Q and R, with universes N, Z, Q and R respectively (natural
numbers, integers, rationals and real numbers). The relation corresponding to < in each of these
structures is the usual “less than”. Write a first order logic sentence φ such that N |= φ holds,
but R |= φ does not. Try writing formulae for all permutations. Can you reuse the same formula?
Is it even possible to differentiate Q and R this way? Can we prove it?
This is easy once you use the fact that reals are “complete”.
The next exercise is related to this standard, but it’s nice to do, because:
• We will eventually describe a proof of the limitations of first order logic
• The techniques you will use are ubiquitous in showing limitations in mathematical and
computer scientific techniques
• Some of the side themes will also be seen later in the project
Exercise 2. Prove that there is no bijection from N to R
Hint. Read this if you’re stuck.
1. First, prove that there is no bijection from natural numbers to sets of natural numbers. Use
Cantor’s diagonal argument (look it up!)
2. Next, define a bijection from sets of natural numbers to real numbers in [0, 1]. The geometric
series of 21i should help. Be sure that you justify why this is indeed a bijection
3. Finally, use your favourite bijection from [0, 1] to R (JEE stuff suffices), and conclude.
The next two exercises are indeed formal, but also sort of open ended. Try to justify
as much as you can.
In the next exercise, we will take a closer look at what we usually take for granted: mathematical
induction.
Suppose we claim that something holds for all natural numbers Here’s what a proof by (strong)
mathematical induction looks like, for natural numbers.
Base Case:
n = 1. Proceed to show whatever.
Inductive Step:
Assume the claim holds for all n0 < n. Use the assumption to prove that the claim holds for n.
Conclude, by induction, that the claim does hold for all natural numbers.
Does this inductive reasoning work as it is for integers? Rationals? Reals? Non-negative rationals
or reals? Why?
To get an idea, let’s go backwards in the proof, i.e. consider the contrapositive.
Suppose, there exists a non-empty set S of natural numbers for which the claim is false. Let
n∈S
Use the proof in the inductive step to argue that there exists n0 < n such that the claim is false.
This is exactly the contrapositive of what was proved. Mathematical induction works on natural
numbers because given any non-empty set, we can choose n cleverly and get contradicted about
n0 being in the set.
Exercise 3. Consider the signature with equality =, the binary predicate <, and a unary predicate
P . Structure S is equipped with a universe U, and implementations <S and PS that correspond

Mihir J Vahanwala Page 3 MnP Club, IIT Bombay


Logic - Introduction Winter of Puzzles, 2021

to actual relations. Give a sentence φ such that S |= φ regardless of PS if and only if U supports
induction when the “less than” relation used is <S . Justify.
Try your best. Make sure you capture the desired properties of both the universe and the binary
“less than” relation. Naturals with the usual less than relation should satisfy this formula; integers,
rationals, reals should not. The hint here is that the unary predicate should somehow help you to
talk about a set.
One wonders if structures satisfying φ are somehow related. To this end, we define a homomor-
phism from structure A to structure B over the same signature as follows:
Definition 3.1 (Homomorphism). A homomorphism h is a function from UA to UB such that:
• For each k-ary P ∈ P, PB = {(h(a1 ), . . . , h(ak )) : (a1 , . . . , ak ) ∈ PA }
• For each k-ary f ∈ F, h(fA (a1 , . . . , ak )) = fB (h(a1 ), . . . , h(ak ))
• For each c ∈ C, h(cA ) = cB
If the function h is bijective, then it is an isomorphism.
Exercise 4 (Bonus). Consider a structure S that satisfies φ from the previous exercise. Must
there exist a PN such that there is a homomorphism from S to N = (N, <, PN )? Justify, even
informally with examples is fine.
Remark 3.1. Try to think of where else you can apply induction with an appropriate < relation.
Tuples of integers, directed acyclic graphs, arguments to recurisive functions, trees, etc. How does
the induction proceed? What might the homomorphism look like? Can you then generalise your
observations to be able to construct a homomorphism, if one exists?

Mihir J Vahanwala Page 4 MnP Club, IIT Bombay

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy