You are on page 1of 116

Logic for Computer Science

Syntax, Semantics, Sound, & Complete


Syntax Semantics
• Context Free Grammar of Syntax • Meaning?
• Meta Syntax α • M: The Model/Universe/Interpretation
• Closure of Syntax • Free and Bound Variables
• Parsing of Syntax • Free Variables and Models
• Formulas Truth (Infinite Recursive Alg)
• Skolem/Auxiliary Functions y$(x)
• Deduction Reminding Variables x´
• Adding Meaning

Sound and Complete


• True vs Tautology vs Valid
• Proofs
• Sound and Complete
• Non-Logical Axioms Γ
• ⊧, ⊢, ⇒, and → are Interchangeable:
• Definitions
Jeff Edmonds
Lecture 3 York University
MATH1090
Syntax and Semantics
Syntax tells us which strings
of characters are well formed eg "x, $ y, y=x+1 well formed
Predicate logic formulas. x" =)(2 badly formed

Ok. What does


Semantics then adds meaning. "x, $ y, y=x+1
mean?

The integers: 0,1,2,3,4,…. No matter how many people


go on forever. are in the hottub you can
always fit one more.
Predicate Logic Syntax
Predicate logic syntax has  
• Terms that represent objects/elements
• Formula that evaluate to true/false.
Objects/Elements UM: Might be U={3,Bob,banana,…}
Terms (type object):
• Bound Variables: "x $y, z, x1, x2, x3, …
• Free Variables x, y, z, x1, x2, x3, …
• Constants M: c, d, c1, c2, c3, 0, 1, 2, ... Closed:
• Functions M: f, g, f1, f2, f3, +, -, , /…
f(t1,t2), t1+t2, …
• Skolem Functions y$, x$, z$, y$:α, y$:β, … y$(x) , …
• Deduction Reminding Variables: x´
R(t1,t2) and t1<t2, …
Formulas (type true/false):
• Relations/Predicates M: R, P, A, B , >, <, =, ... α1α2, …
"x α(x)
• Connectors: , , , , , iff, ,
‘,’
• Quantifiers: ", $
• Punctuation: ( )
Context Free Grammar of Syntax

In EECS2001 Theory of Computation


you will learn Context Free Grammars for expressing
which strings are well formed for the given language.
Context Free Grammar of Syntax
Formula: eg "x, $ y, y=x+1 evaluates to true/false
Term: eg x+1 evaluates to an object  Universe
• Formula  Relation | Connector | Quantifier
• Relation  Loves(Term,Term) | R(Term,Term) | P(Term) | …
 (Term > Term) | (Term ≥ Term) | (Term = Term) | ...
• Connector  (Formula  Formula ) | (Formula  Formula ) |
 (Formula iff Formula ) | (Formula  Formula ) | …
  Formula
• Quantifier  "Variable, Formula | $Variable, Formula
• Term  Variable | Constant | Function
• Variable  x | y | z | b | g | x1 | x2 | x3 | …
• Constant  c | d | c1 | c2 | c3 | …
 0 | 1 | 2 | ...
• Function  f (Term,Term) | g(Term,Term) | f1(Term,Term) | …
 (Term + Term) , (Term  Term)
Formula:
Context Free Grammar of Syntax
eg "x, $y, y=x+1 evaluates to true/false
Term: eg x+1 evaluates to an object  Universe
• Formula  Relation | Connector | Quantifier
• Relation  Loves(Term,Term) | R(Term,Term) | P(Term) | …
 (Term > Term) | (Term ≥ Term) | (Term = Term) | ...
• Connector  (Formula  Formula ) | (Formula  Formula ) |
 (Formula iff Formula ) | (Formula  Formula ) | …
  Formula
• Quantifier  "Variable, Formula | $Variable, Formula

• Term  Variable | Constant | Function


• Variable  x | y | z | b | g | x1 | x2 | x3 | …
• Constant  c | d | c1 | c2 | c3 | …
 0 | 1 | 2 | ...
• Function  f (Term,Term) | g(Term,Term) | f1(Term,Term) | …
 (Term + Term) , (Term  Term)

Parts of a Grammar:
• NonTerminal Turns into a string of the stated type
• Terminal Actual characters in the resulting string
•  “is a”
• | “or”
Formula:
Context Free Grammar of Syntax
eg "x, $y, y=x+1 evaluates to true/false
Formula
Term: eg x+1 evaluates to an object  Universe

     
Quantifier
• Formula  Relation | Connector | Quantifier
• Relation  Loves(Term,Term) | R(Term,Term) | P(Term) | … "Variable, Formula


 (Term > Term) | (Term ≥ Term) | (Term = Term) | ...
• Connector  (Formula  Formula ) | (Formula  Formula ) | b Quantifier
 (Formula iff Formula ) | (Formula  Formula ) | …
  Formula $ Variable, Formula


• Quantifier  "Variable, Formula | $Variable, Formula
g Connector
• Term  Variable | Constant | Function
• Variable  x | y | z | b | g | x1 | x2 | x3 | … (Formula  Formula )

 

 
• Constant  c | d | c1 | c2 | c3 | …
 0 | 1 | 2 | ...
Relation Relation
• Function  f (Term,Term) | g(Term,Term) | f1(Term,Term) | …
Loves(Term,Term) (Term > Term)
 (Term + Term) , (Term  Term)

 

 

 
 
VariableVariable Variable Variable
" b ,$ g ,(Loves( b , g )  ( x > y ) )

This context free grammar species which strings


eg "b, $ g, (Loves(b,g)  (x>y))
Are in the Predicate logic “language.”
The grammar can generate the well formed strings.
These strings can be parsed by the grammar.
Formula:
Context Free Grammar Formula
of Syntax
eg "x, $y, y=x+1 evaluates to true/false
Term: eg x+1 evaluates to an object  Universe


• Formula  Relation | Connector | Quantifier
• Relation  Loves(Term,Term) | R(Term,Term) | P(Term) | … Quantifier
 (Term > Term) | (Term ≥ Term) | (Term = Term) | ...

    
• Connector  (Formula  Formula ) | (Formula  Formula ) |
 (Formula iff Formula ) | (Formula  Formula ) | …
  Formula
"Variable, Formula


• Quantifier  "Variable, Formula | $Variable, Formula

• Term  Variable | Constant | Function b Quantifier


• Variable  x | y | z | b | g | x1 | x2 | x3 | …
• Constant  c | d | c1 | c2 | c3 | …
 0 | 1 | 2 | ... $ Variable, Formula
Function  f (Term,Term) | g(Term,Term) | f1(Term,Term) | …



 (Term + Term) , (Term  Term)
g Connector
"b, $ g, (Loves(b,g)  (x>y))
This is a formula. (Formula  Formula )

 

 
Lets prove it by parsing it with the
Relation Relation
context free grammar.
Loves(Term,Term) (Term > Term)




VariableVariable Variable Variable


" b ,$g , ( Loves( b , g )  ( x > y ) )


Context Free Grammar of Syntax
Formula: eg "x, $ y, y=x+1 evaluates to true/false
Term: eg x+1 evaluates to an object  Universe
• Formula  Relation | Connector | Quantifier
| Propositional Variables
A Predicate formula is either
• Relation: eg Loves(b,g), (x>y) A relation between terms
• Connector: eg Loves(b,g)  (x>y) Connecting two formulas
• Quantifier: eg "x, $ y, y=x+1 Quantified with " or $
• Propositional Variables: eg p, q, …
In propositional logic, these also take on true/false,
but not so much in Predicate logic.
Context Free Grammar of Syntax
Formula: eg "x, $ y, y=x+1 evaluates to true/false

• Formula  Relation | Connector | Quantifier


| Meta Variables
A Predicate formula is either
• Relation: eg Loves(b,g), (x>y) A relation between terms
• Connector: eg Loves(b,g)  (x>y) Connecting two formulas
• Quantifier: eg "x, $ y, y=x+1 Quantified with " or $
• Meta Variables: eg α, β, , …
In Predicate logic, we do use these to represent formulas.
But they are not a part of the language
But part of the “meta” language
with which we talk about the language
Context Free Grammar of Syntax
Formula: eg "x, $ y, y=x+1 evaluates to true/false
Term: eg x+1 evaluates to an object  Universe
• Formula  Relation | Connector | Quantifier
• Relation  Loves(Term,Term) | R(Term,Term) | P(Term) | …
 (Term > Term) | (Term ≥ Term) | (Term = Term) | ...
Relations eg Loves(b,g) map from a tuple of objects b,g
to true/false.
They tend to have two arguments, eg Edge(u,v).
One writes x>y and x=y instead of >(x,y) and =(x,y)
Predicates eg Old(b) tend to have one argument.

We define the set of syntactically allowed formulas as follows.


• If t1 and t2 are syntactically allowed terms,
then R(t1,t2) and (t1<t2) are syntactically allowed formulas.
Context Free Grammar of Syntax
Formula: eg "x, $ y, y=x+1 evaluates to true/false

• Formula  Relation | Connector | Quantifier


• Relation  Loves(Term,Term) | R(Term,Term) | P(Term) | …
 (Term > Term) | (Term ≥ Term) | (Term = Term) | ...
Model M: The model/universe/interpretation
defines many things.
• The universe U of objects
– Integers, or reals, or boys&girls, …
• How relations like Loves(b,g) are interpreted.

This is all semantics (meaning)


and not part of syntax.
Context Free Grammar of Syntax
Formula: eg "x, $ y, y=x+1 evaluates to true/false

• Formula  Relation | Connector | Quantifier


• Relation  Loves(Term,Term) | R(Term,Term) | P(Term) | …
 (Term > Term) | (Term ≥ Term) | (Term = Term) | ...
• Connector  (Formula  Formula ) | (Formula  Formula ) |
 (Formula iff Formula ) | (Formula  Formula ) | …
  Formula
These map {true,false} to {true,false}.

We define the set of syntactically allowed formulas recursively.


• If α1 and α2 are syntactically allowed formulas,
then so are (α1α2) and (α1α2), …
Context Free Grammar of Syntax
Formula: eg "x, $ y, y=x+1 evaluates to true/false

• Formula  Relation | Connector | Quantifier


• Relation  Loves(Term,Term) | R(Term,Term) | P(Term) | …
 (Term > Term) | (Term ≥ Term) | (Term = Term) | ...
• Connector  (Formula  Formula ) | (Formula  Formula ) |
 (Formula iff Formula ) | (Formula  Formula ) | …
  Formula
• Quantifier  "Variable, Formula | $Variable, Formula
• If α(x) is a syntactically allowed formula (with free variable x),
then so are "x α(x) and $x α(x)
x is said to be a bound variable in
"x α(x) & $x α(x)
Context Free Grammar of Syntax
Formula: eg "x, $ y, y=x+1 evaluates to true/false
Term: eg x+1 evaluates to an object  Universe
• Term  Variable | Constant | Function

A Predicate term is either


• Variable: eg x, y, z, b, g, … Takes on an object  Universe
• Constant: eg c, d, 0, 1, Jeff, … Takes on a fixed object  Universe
• Function: eg f(x), (x+y) Functions from objs to objs.
• Objects: eg 3, Bob, banana, …
The model specifies the objects in the universe.
These are not part of the syntax.
Context Free Grammar of Syntax
Formula: eg "x, $ y, y=x+1 evaluates to true/false
Term: eg x+1 evaluates to an object  Universe
• Term  Variable | Constant | Function
• Variable  x | y | z | b | g | x1 | x2 | x3 | …
• Bound Variables: "b $g, Loves(b,g)
• Free Variables: x, y , z , b, g, x1, x2, x3, …
Context Free Grammar of Syntax
Formula: eg "x, $ y, y=x+1 evaluates to true/false
Term: eg x+1 evaluates to an object  Universe
• Term  Variable | Constant | Function
• Variable  x | y | z | b | g | x1 | x2 | x3 | …
• Constant  c | d | c1 | c2 | c3 | …
 0 | 1 | 2 | ...
Context Free Grammar of Syntax
Formula: eg "x, $ y, y=x+1 evaluates to true/false
Term: eg x+1 evaluates to an object  Universe
• Term  Variable | Constant | Function
• Variable  x | y | z | b | g | x1 | x2 | x3 | …
• Constant  c | d | c1 | c2 | c3 | …
 0 | 1 | 2 | ...
• Function  f (Term,Term) | g(Term,Term) | f1(Term,Term) | …
 (Term + Term) , (Term  Term)
These map from a tuple of objects x,y
to an object f(x,y).
Example: f(x,y) = 3x+4, father(Jeff) = Jack.
One writes x+y instead of +(x,y).
Context Free Grammar of Syntax
Formula: eg "x, $ y, y=x+1 evaluates to true/false
Term: eg x+1 evaluates to an object  Universe
• Term  Variable | Constant | Function
• Variable  x | y | z | b | g | x1 | x2 | x3 | …
• Constant  c | d | c1 | c2 | c3 | …
 0 | 1 | 2 | ...
• Function  f (Term,Term) | g(Term,Term) | f1(Term,Term) | …
 (Term + Term) , (Term  Term)
We define the set of syntactically allowed terms recursively.
• x, y, z, …, c, d, … are syntactically allowed terms
• If t1 and t2 are syntactically allowed terms,
then so are f(t1,t2) and (t1+t2), …
Context Free Grammar of Syntax
Formula: eg "x, $ y, y=x+1 evaluates to true/false
Term: eg x+1 evaluates to an object  Universe
• Term  Variable | Constant | Function
• Variable  x | y | z | b | g | x1 | x2 | x3 | …
• Constant  c | d | c1 | c2 | c3 | …
 0 | 1 | 2 | ...
• Function  f (Term,Term) | g(Term,Term) | f1(Term,Term) | …
 (Term + Term) , (Term  Term)
We added lots of brackets to differentiate between
((xy)+z) and (x(y+z))
((PQ)R) and (P(QR))
Some can be dropped at the discretion of the user.
I stick commas in when I think it will help the reader.
Formula:
Context Free Grammar Formula
of Syntax
eg "x, $y, y=x+1 evaluates to true/false
Term: eg x+1 evaluates to an object  Universe


• Formula  Relation | Connector | Quantifier
• Relation  Loves(Term,Term) | R(Term,Term) | P(Term) | … Quantifier
 (Term > Term) | (Term ≥ Term) | (Term = Term) | ...

    
• Connector  (Formula  Formula ) | (Formula  Formula ) |
 (Formula iff Formula ) | (Formula  Formula ) | …
  Formula
"Variable, Formula


• Quantifier  "Variable, Formula | $Variable, Formula

• Term  Variable | Constant | Function b Quantifier


• Variable  x | y | z | b | g | x1 | x2 | x3 | …
• Constant  c | d | c1 | c2 | c3 | …
 0 | 1 | 2 | ... $ Variable, Formula
Function  f (Term,Term) | g(Term,Term) | f1(Term,Term) | …



 (Term + Term) , (Term  Term)
g Connector
"b, $ g, (Loves(b,g)  (x>y))
This is a formula. (Formula  Formula )

 

 
Lets prove it by parsing it with the
Relation Relation
context free grammar.
Loves(Term,Term) (Term > Term)




VariableVariable Variable Variable


" b ,$g , ( Loves( b , g )  ( x > y ) )


Meta Syntax α
Just to be clear!
Though α symbol is the one the most used in
our discussions and proofs,
it is not actually a legal part of the syntax.

It is Meta Syntax
We use α to talk about
an arbitrary Predicate logic formula.
We use α(x,y) to indicated that it has two
free variables x and y.
Closure of the Syntax
A set S is said to be closed
under an operation f iff Complex Numbers
"x,yS, f(x,y)  S
+    Reals
Integers Y Y N N
Rationals Y Y Y N
Reals Y Y Y Y/N x+y
Complex Y Y Y Y xy
x/y (y0) Rationals
x (x0)
x Integers

x,y 23
Closure of the Syntax
A set S is said to be closed
under an operation f iff Integers
"x,yS, f(x,y)  S ½
Suppose you want to make the integers.
• Start by adding zero
• Close it under successor
ie if x is in the set, then add x+1
-1,-2,-3,…
• Close it under addition
ie if x&y are in the set add x+y


This does not add non-integers 6
Neither does it add negative integers. 5
• Close it under subtraction
• Close it under division 4
oops not allowed. 3
2
1
0 24
Closure of the Syntax
A set S is said to be closed
under an operation f iff Wedding Party
"x,yS, f(x,y)  S
Suppose you want to make wedding list
• Start by adding the bride and groom.
• Close it under friend function
ie if x is invited,
then you must invite
every friend(x)
• It may be a big wedding.

25
Closure of the Syntax
A set S is said to be closed Well Formed Terms
under an operation f iff (type object):
"x,yS, f(x,y)  S
Suppose you want to make ((0+s(0))  s(s(0)))
the set of well formed terms (0+s(0))


• Start by adding
variables and constants 0 s(s(s(s(0))))
• Close it under functions s(s(s(0)))
f, g, f1, f2, f3, … s s(s(0))
+, -, , /… s(0)
ie if t1 and t2 are terms, 0
then so is f(t1,t2) and (t1+t2) (f(x,y) + g(x,y))
/c
• You might want ((x+y)z) (f(x,y) + g(x,y))
positive integers. f(x,y) g(x,y) (x+y)
c, d, c1, c2, c3, ...
x, y, z, x1, x2, x3, …
26
Closure of the Syntax
A set S is said to be closed Well Formed
under an operation f iff Formulas
"x,yS, f(x,y)  S (Type true/false)
Suppose you want to make
the set of well formed formulas
• Take each predicates/relations:
P, A, B, P1, P2, P3, =, >, <, …
Apply it to each well formed term.
ie if t1 and t2 are terms,
then P(t1,t2) and (t1<t2)
are formulas.
Well Formed Terms

s(s(s(s(s(0)))))
s(s(s(s(0))))
s(s(s(0)))
s(s(0))
((0+s(0))s(s(0))) = s(s(0)))
s(0)
0 (f(x,y)+g(x,y)) < z
(f(x,y) + g(x,y))
/c
((x+y)z) (f(x,y) + g(x,y))
f(x,y) g(x,y) (x+y)
P1(x3,z)
c, d, c1, c2, c3, ...
x, y, z, x1, x2, x3, …
P(x) 27
Closure of the Syntax
A set S is said to be closed Well Formed
under an operation f iff Formulas
"x,yS, f(x,y)  S (Type true/false)
Suppose you want to make
the set of well formed formulas $z "x ((P(x)  P1(x3,z))
• Take each predicates/relations:
"x (P(x)  P1(x3,z))
P, A, B, P1, P2, P3, =, >, <, …
Apply it to each well formed term. P(x) iff P1(x3,z)
• Close it under connectors ((P(x)  P1(x3,z))
, , , , iff, ,
 (f(x,y)+g(x,y))<z)
ie if P1 and P2 are formulas,
then so is (P1P2) (P(x)  P1(x3,z))
• Close it under quantifiers
((0+s(0))s(s(0))) = s(s(0)))
" and $
ie if P(x,y) is a formula, (f(x,y)+g(x,y)) < z
then so is "x P(x,y) & $x P(x,y) P1(x3,z)
P(x) 28
Parsing of the Syntax
Is it Well Formed?:
Given a string of characters
Determine if it is a well formed
Predicate logic formula.
$z "x ((P(x)  P1(x3,z))
Recall the Contest Free Grammar
"x (P(x)  P1(x3,z))
• S  $zS | "xS | (TT) | P1(T,T) | P(T) | …
• T  f(T,T) | (T+T) | x | x3 | z
Unambiguous:
This parsing (way of constructing)
must be unique. (P(x)  P1(x3,z))
So that meaning is well defined.
P1(x3,z)
Parsing (Compiling): (See EECS2001)
P(x)
Given a sting, build its parse tree.
x3 x z 29
Lets do an easier example.
Parsing of the Syntax
Input: A string of brackets.
Output: Each “(”, “{”, or “[” must be paired
with a matching “)”, “}”, or “[”.
Contest Free Grammar:
• S  [S] | (S) | {S} | SS | emptystring

[()(( )){( [() ] )}] [( )(( ))}{([( )])}]


incorrect
Parsing of the Syntax
Input: A string of brackets.
Output: Each “(”, “{”, or “[” must be paired
with a matching “)”, “}”, or “[”.
Loop Invariant: Prefix has been read.
• Matched brackets are matched and removed.
• Unmatched brackets are on the stack.

[()(( )

Stack
[(
Parsing of the Syntax
Input: A string of brackets.
Output: Each “(”, “{”, or “[” must be paired
with a matching “)”, “}”, or “[”.
Loop Invariant: Prefix has been read.
• Matched brackets are matched and removed.
• Unmatched brackets are on the stack.

[()(( )){ }]) Opening Bracket:


• Push on stack.
Stack Closing Bracket:
[{( ( • If matches that on stack
pop and match.
• else return(unmatched)
Semantics (Meaning?)
Ok. The syntax told us which
strings of characters are well Semantics then adds meaning.
formed Predicate logic formulas.

Ok. What does It means the values are


"x, $ y, xy = 1 closed under division.
mean?

No! True.
Who said anything But it does say that every value
about division? has a multiplicative inverse,
which can be used for divisions.

And I am assuming you mean the


reals because this is not true about
the integers.
Semantics (Meaning?)
I dare you! You caught me!
I don’t think you can Semantics begins with the
assign such a human parse tree of why the formula
“meaning” to all Predicate is well formed.
formulas. This in itself adds meaning.

Formula

     
Quantifier
"Variable, Formula


b Quantifier
$ Variable, Formula

g Connector
(Formula  Formula )
 

 
Relation Relation
Loves(Term,Term) (Term > Term)
 

 

 
 

VariableVariable Variable Variable


" b ,$ g ,(Loves( b , g )  ( x > y ) )
Semantics (Meaning?)
I dare you! Semantics then assigns
I don’t think you can objects and true/false.
assign such a human
“meaning” to all Predicate
formulas.
Semantic = Meaning Values
• Assign an object to each variable
– x = 3, y = “jeff”
• Assign a function to each function symbol We will
– f(x,y) = x+y define and
• Assign an object to each term algorithm
– f(x+f(2,y),g(h(x)) = 4 for doing
• Assign a relation to each relation symbol this.
– Love(b,g) = true – love all around
• Assign true/false to each formula
– "b $g Love(b,g) ≡ true
Semantics (Meaning?)
I dare you! You caught me!
It is undecidable My “algorithm” takes an
given a Predicate formula infinite amount of time.
to know whether it is true.
i.e. there is no algorithm!
Semantic = Meaning Values
• Assign an object to each variable
– x = 3, y = “jeff”
• Assign a function to each function symbol We will
– f(x,y) = x+y define and
• Assign an object to each term algorithm
– f(x+f(2,y),g(h(x)) = 4 for doing
• Assign a relation to each relation symbol this.
– Love(b,g) = true – love all around
• Assign true/false to each formula
– "b $g Love(b,g) ≡ true
Semantics (Meaning?)
I dare you! You caught me!
It is undecidable My “algorithm” takes an
given a Predicate formula infinite amount of time.
to know whether it is true.
i.e. there is no algorithm!
And understanding this infinite time
algorithm also adds meaning.

We will
define and
algorithm
for doing
this.
Semantics (Meaning?)
I dare you! We will also study
It is undecidable informal and formal
given a Predicate formula finite length proofs that
to know whether it is true. formulas are valid
i.e. there is no algorithm! (ie true in every universe)
This will add more meaning.
M: The Model/Universe/Interpretation

Model M: The model/universe/interpretation


defines many things.
• The universe U of objects
– Integers, or reals, or boys&girls, …
• How functions and relations like Loves(b,g) are interpreted.
M: The Model/Universe/Interpretation
The model M defines: M = {U, , }  
• Objects/Elements UM: Might be U={3,Bob,banana,…}
Example:
• Integers: U = {…,-3,-2,-1,0,1,2,3,...}
• Reals: U = {…, 5.39234516746708… , … }
• Ints/mod 5: U = {0,1,2,3,4}
M: The Model/Universe/Interpretation
The model M defines: M = {U, , }  
• Objects/Elements UM: Might be U={3,Bob,banana,…}
• Variables: x, y, z, x1, x2, x3, …
(Some have the model give free variables values, but we won’t.)
M: The Model/Universe/Interpretation
The model M defines: M = {U, , }  
• Objects/Elements UM: Might be U={3,Bob,banana,…}
• Variables: x, y, z, x1, x2, x3, …
• Constants M: c, d, c1, c2, c3
– π = 3.14.., prof = “jeff”
Here:  
• Orange is a symbol in the syntax.
• Green is the object from U given to it by the model.
• is the vector of all these assigned values.
M: The Model/Universe/Interpretation
The model M defines: M = {U, , }  
• Objects/Elements UM: Might be U={3,Bob,banana,…}
• Variables: x, y, z, x1, x2, x3, …
• Constants M: c, d, c1, c2, c3 , 0, 1, 2, ...
– π = 3.14.., prof = “jeff” , 0=0, 1=1, …, 5=5, ... vs 5=0 (mod 5)

You might think that the constant 5


is always represents the object 5,
but this too can be changed by the model.
Even 0 might have some strange object.
M: The Model/Universe/Interpretation
The model M defines: M = {U, , }  
• Objects/Elements UM: Might be U={3,Bob,banana,…}
• Variables: x, y, z, x1, x2, x3, …
• Constants M: c, d, c1, c2, c3 , 0, 1, 2, ...
– π = 3.14.., prof = “jeff” , 0=0, 1=1, …, 5=5, ... vs 5=0 (mod 5)
• Functions M: f, g, f1, f2
– f = f, f(3) = 4, …
The model allocates an actual function f
to the symbol f.
For every possible input x,
it must provide an output y = f(x).
Different models will do this differently.
M: The Model/Universe/Interpretation
The model M defines: M = {U, , }  
• Objects/Elements UM: Might be U={3,Bob,banana,…}
• Variables: x, y, z, x1, x2, x3, …
• Constants M: c, d, c1, c2, c3 , 0, 1, 2, ...
– π = 3.14.., prof = “jeff” , 0=0, 1=1, …, 5=5, ... vs 5=0 (mod 5)
• Functions M: f, g, f1, f2 , +, -, , /, …
– f = f, f(3) = 4, …
– father(b) = sperm donor
vs male identified person who is a primary caretaker.
– 2+3 = 5 vs 2+3 = 0 (mod 5)
• Relations/Predicates M: R, P, A, B , >, <, ...
– Love(Romio,Juliet) = true
– John Lennon > Paul McCartney
M: The Model/Universe/Interpretation
The model M does NOT define:
• Variables: x, y, z, x1, x2, x3, … (Defined by user or universally)
• Relations: =
– apple = apple ≠ orange
• Connectors: , , , , iff, 
(Standard Definition)
• Quantifiers: ", $
– “All of” & “At least one of”
• Punctuation: ( ) ,
Free and Bound Variables
• Variables: x, y, z, x1, x2, x3, … (Defined by user or universally)

•Variables take on values from the • Like variables in code!


universe U of objects/elements • The truth of the formula
– x = 3, y = “jeff” might depend on the values
of these variables.
Free and Bound Variables
• Variables: x, y, z, x1, x2, x3, … (Defined by user or universally)

• So who decides their values?

Three ways: • Individual values of the


• Bound: (local) bound variables don’t effect
– "x the truth of the formula.
– loop x=1..n
• Input: Value by user • The truth of the formula
• Free: implied "x depends on which values
the user gives.

• The formula must be true for


every setting of these variables.
Free and Bound Variables
• Bound Variables: "x $y, z, x1, x2, x3, …  
• Free Variables x, y, z, x1, x2, x3, …

Bound Free
Local variable Input Parameter
No specific value Value provide by user
[ "i $y R( y,i) x, ]
 A(x,y)
F(obj x, obj y)
A(x,y)
loop i  {objects} checking true for all
loop y  {objects} checking true for some
R(x,y,i)
"i α(i) is true iff α(i) is true for every value i.
$y α(y) is true iff α(y) is true for some value y.
Free and Bound Variables
 
• Free Variables x, y, z, x1, x2, x3, …

Free
Input Parameter
Value provide by user
α ≡ “[ "i $y R( y,i) x, ]
 A(x,y)
• The truth of a formula depends on ”these free values.
• Let α denote the Predicate formula.
Note ‘α’ is not in the syntax. It is in a “meta” language.
• We use α(x,y) to indicate that x and y are its free variables.
• We use α(5,6) to denote α with 5 and 6 replacing x and y.
α(5,6) ≡ ["i $y R(5,y,i)]  A(5, 6)
α(f(a)+b, ab) ≡ ["i $y R(f(a)+b,y,i)]  A(f(a)+b, ab)
• Another standard notation is
• A formula with no free variables is called a sentence/closed.
Free Variables and Models
 
• Free Variables x, y, z, x1, x2, x3, …

Free
Input Parameter
Value provide by user
α= “[ "i $y R( y,i) x, ]
 A(x,y)

Free Variables and Models
 
• Free Variables x, y, z, x1, x2, x3, …

Free
Input Parameter
Value provide by user
α = “[ "i $y R( y,i) x, ]
 that
• We use α(x,y) to indicate A(x,y)
x and y are its free variables.
” 6 replacing x and y.
• We use α(5, 6) to denote α with 5 and
= ["i $y R(5,y,i)]  A(5, 6)
• Another standard notation is
Free Variables and Models
 
• Free Variables x, y, z, x1, x2, x3, …

Free
Input Parameter
Value provide by user
α = “[ "i $y R( y,i) x, ]
 that
• We use α(x,y) to indicate A(x,y)
x and y are its free variables.
” f(a)+b and ab replacing x and y.
• We use α(f(a)+b, ab) to denote α with
= ["i $y R(f(a)+b,y,i)]  A(f(a)+b, ab)
• Another standard notation is
Free Variables and Models
 
• Free Variables x, y, z, x1, x2, x3, …

Free
Input Parameter
Value provide by user
" [ [ "i $y R( y,i) x, ]  
 A(x,y)
• A formula is said to be Valid ]
if it is true for every setting of the free values.
You can imagine a big forall over the values of the free variables.
Free Variables and Models
Back up a minute! The model M:
The model defines many things. decided three ways:
• The universe of objects • It might be understood that we are
– Integers, or reals, or … working over the integers and that
• How functions are 45=20 and ½=??
interpreted • Input: Set by user
– 4+5, “Hi”+“there” - Truth of ½=0.5 depends on M.
Who decides this? • Free: "M
- Formula needs to be true
for “every” model.
Free Variables and Models

"M [ " [ [ "i $y R( y,i) x, ]  


 A(x,y)
A formula is said to be Valid ] ]
• if it is true for every setting of the free values.
• and every choice of model.

I thought that That is only for propositional formula ( ⌐).


was a valid. For Predicate logic, it is a valid only if it can be
proved from valid lemmas.
Free Variables and Models
x=5  $x x4

Definitely true!
There is a value 5
and its bigger than 4
Don’t confuse this with
$x ( x=5  x4 )
Free Variables and Models
xx=5  $x
x xx4 x=5  $y y4
Free Bound
The two x are Equivalent and more
separate variables. clear formula.
Free Variables and Models
4
x  $y y4
"M [ " [ x=5 ]  
]
True only Always
when x is true.
given the
value 5. True only when
M defines  and 4
appropriately.
Formula Truth
(An Infinite Recursive Algorithm)
Semantic = Meaning Values
• Assign true/false to each formula
– "b $g Love(b,g) ≡ true

We will define and


algorithm for doing this.

I dare you! You caught me!


It is undecidable My “algorithm” takes an
given a Predicate formula infinite amount of time.
to know whether it is true.
i.e. there is no algorithm!
Formula Truth
(An Infinite Recursive Algorithm)
Precondition Postcondition

Truth Finding Algorithm: Pre & Postconditions  


• Input: Possibly the model M = {U, , }.
• Possibly values of free variables .
• A Predicate logic formula α (or term).
• Output: true/false (or object).

It can be difficult to understand


the entire computation at once.
I implored you to not to try
Formula Truth
(An Infinite Recursive Algorithm)
Truth Finding Algorithm: Viewed in different ways
• Strong Induction:
– Assume by way that we have evaluated every
formula/term that has fewer characters than ours.
– We then evaluate ours.
• Recursive Friends:
– Assume we can expect our recursive friends to
solve any instance that meets the precondition and
is smaller.
– We use their solutions to solve ours.
Formula Truth
(An Infinite Recursive Algorithm)
Truth Finding Algorithm: Pseudocode (Is input α true?)  
• if( input has form "M β, " β, or "x β ) then
– Loop over all possible values for M, , or x.
– Ask recursive friend to determine whether β is true
with these values.
– Answer true if EVERY friends answers true.
• if( input string has form $y β ) then
– Loop over all possible values for y.
– Ask recursive friend to determine whether β is true
with these values.
– Answer true if SOME friend answers true.

You caught me!


My “algorithm” takes an
infinite amount of time.
Formula Truth
(An Infinite Recursive Algorithm)
Truth Finding Algorithm: Pseudocode (Is input α true?)
• if( input has form
β1β2, β1 iff β2, Love(Term1,Term2), Term1<Term2,
f (Term1,Term2), Term1+Term2 ) then
– Get your recursive friend to determine
if β1 and β2 are true with these values
or what Term1 and Term2 evaluate to
– Answer result of the op applied to these values.
• if( input has form x, y, z, x1, x2, c, d, c1, c2, 0, 1, 2 ) then
– return the value of this variable/constant.
Formula Truth
(An Infinite Recursive Algorithm)
$z (P(x)  R(f(x),z))

This is not a valid


because there are models
in which is it not true.

Ok. Lets run the


algorithm and see.
xβThe
One
The
The is Minput
input
ainputforhas
free
input has
whichform
variable. β"βis"M
form β,false
1β
$z β,  
The tohas
has form
form 2.
β,
Formula Truth One
needs
Then
Then
so alg
witnesses
so
Lets
so
The alg
alg
"alg
z for
the
the
loops
loops
set it
loops
which
be
alg
alg
thatover
true βfor
"M
recurses
recurses
over all
all
universally.
β itrecurses
forwitnesses over
be that
β
all
is true
every
on
on
possible
is false
possible
possible
on ββ1is true.
true.$z
β.
β.  
andvalues
values
Same
values
and that
then for
for
with
forβon z.M.
.is βnot
the . a valid.
model M.
[ (P(x)  R(f(x),z)) = false 2
"M [ " $z  
M= false
] ] M sets:
true - P(12) = true
[ ((P(x)  R(f(x),z)) =  true
" $z - f(12) = 17
- R(17,9) = false
true =   true true true true true] true true true true true true
true sets:  
0 1 2 3 4 5 6 7 8 9 10 11 12 13true
14 15 16 17 18
- x = 12
$z (P(x)  R(f(x),z)) = true
sets:
z= -z=9
0 1 2 3 4 5 6 7 8 true 9 10 11 12 13 14 15 16 17 18
true false
(P(x)  R(f(x),z)) = true
12 17 9
P(x) = true R(f(x),z)
= false
12
f(x)
= 17
x = 12 z=9
Formula Truth
(An Infinite Recursive Algorithm)
$z (P(x)  R(f(x),z))

As I said,
this is not valid because
there are models in which
is it not true.

Indeed

Is what you did a formal proof?

No.
Proofs must be
finite in length.
Formula Truth
(An Infinite Recursive Algorithm)
P(x)  (P(x)  R(f(x),z))
A  ( A  B)

This should be valid.


• Let A denote the true/false value of P(x).
• Let B of R(f(x),z).

If A is true, then clearly so is (A or B ).


A B A B A  (AB)
T T T T
T F T T
F T T T
F F T T Indeed
Lets see what our
infinite algorithm does.
The
βxThen
isinput
a free
needs tohas
variable.
be form
true " β,
"M
for onβ,β.   
every
Formula Truth MsoThen
alg
Lets
for
the
theitβ
loops
set
"M
alg
alg
for " β it be true.
recurses
recurses
over
it be all
universally.
true. on β.
possible
values
Same withfor M.
. the model M.
"M [ " P(x) [  (P(x)  R(f(x),z)) = true  
M = ] ] M sets:
true true true true true true true true true true true true true
- Arbitrary
[  (P(x)  R(f(x),z)) = true
" P(x)  
true = ] true true true true true true true true
  true true true
true
sets:  
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 - Arbitrary
P(x)  (P(x)  R(f(x),z)) = true
A B A B A  (AB)
T T T T
T F T T (P(x)  R(f(x),z)) =?
F T T T
F F T T
P(x) = true/false R(f(x),z)
= true/false
?
= ?f(x)
x =? z=?
Skolem Functions y$(x)
Predicate logic syntax has  
• Terms that represent objects/elements
• Formulas/formula that evaluate to true/false.
Objects/Elements UM: Might be U={3,Bob,banana,…}
Terms (type object):
• Bound Variables: "x $y, z, x1, x2, x3, …
• Free Variables x, y, z, x1, x2, x3, …
• Constants M: c, d, c1, c2, c3, 0, 1, 2, ... Closed:
• Functions M: f, g, f1, f2, f3, +, -, , /…
f(t1,t2), t1+t2, …
• Skolem Functions y$, x$, z$, y$:α, y$:β, … y$(x) , …

R(t1,t2) and t1<t2, …


Formulas/Formulas (type true/false):
• Relations/Predicates M: R, P, A, B , >, <, =, ... α1α2, …
"x α(x)
• Connectors: , , , ,This
‘,’ , iff, is a,
little non-standard,
", $Jeff uses this a lot in his formal proof system.
• Quantifiers: but
• Punctuation: ( ) https://en.wikipedia.org/wiki/Skolem_normal_form
Skolem Functions y$(x)
$y, "x, α(x, y) "x, $y, α(x, y)
What might the following mean?
α(x, y$)
“arbitrary value” “fixed”

If y$ is really fixed,
it should work for every x.

y y

T T
T T
x x
T T
T T
Skolem Functions y$(x)
$y, "x, α(x, y) "x, $y, α(x, y)
α(x, y$)

If y$ is really fixed,
it should work for every x.

y y

T T
T T
x x
T T
T T
Skolem Functions y$(x)
$y, "x, α(x, y) "x, $y, α(x, y)
α(x, y$) α(x, y$(x))
What about here?

Here which value y$ is “fixed” to


can depends on the value of the “arbitrary” x.
Here y$(x) is called a Skolem function.
y y

T T
T T
x x
T T
T T
Skolem Functions y$(x)
$y, "x, α(x, y) "x, $y, α(x, y)
≡ ≡
$ [ "   α(x, y$)   ] $ ["   α(x, y$ (x))  
Implied
single fixed value fixed function
These Skolem same value/function
must work for every x.
y y

T T
T T
x x
T T
T T
Skolem Functions y$(x)
$y, "x, α(x, y) "x, $y, α(x, y)
≡ ≡
"M $ [ "   α(x, y$)   ] $
"M ["   α(x, y$ (x))  
Implied
single fixed value fixed function

These Skolem values


can depend on the model M
y y

T T
T T
x x
T T
T T
Skolem Functions y$(x)
Predicate logic syntax has  
• Terms that represent objects/elements
• Formulas/formula that evaluate to true/false.
Objects/Elements UM: Might be U={3,Bob,banana,…}
Terms (type object):
• Bound Variables: "x $y, z, x1, x2, x3, …
• Free Variables x, y, z, x1, x2, x3, …
• Constants M: c, d, c1, c2, c3, 0, 1, 2, ... Closed:
• Functions M: f, g, f1, f2, f3, +, -, , /…
f(t1,t2), t1+t2, …
• Skolem Functions y$, x$, z$, y$:α, y$:β, … y$(x) , …

R(t1,t2) and t1<t2, …


Formulas/Formulas (type true/false):
• Relations/Predicates M: R, P, A, B , >, <, =, ... α1α2, …
"x α(x)
• Connectors: , , , ,This
‘,’ , iff, is a,
little non-standard,
", $Jeff uses this a lot in his formal proof system.
• Quantifiers: but
• Punctuation: ( ) https://en.wikipedia.org/wiki/Skolem_normal_form
Deduction Reminding Variables x´
Predicate logic syntax has  
• Terms that represent objects/elements
• Formulas/formula that evaluate to true/false.
Objects/Elements UM: Might be U={3,Bob,banana,…}
Terms (type object):
• Bound Variables: "x $y, z, x1, x2, x3, …
• Free Variables x, y, z, x1, x2, x3, …
• Constants M: c, d, c1, c2, c3, 0, 1, 2, ... Closed:
• Functions M: f, g, f1, f2, f3, +, -, , /…
f(t1,t2), t1+t2, …
• Skolem Functions y$, x$, z$, y$:α, y$:β, … y$(x) , …
• Deduction Reminding Variables: x´
R(t1,t2) and t1<t2, …
Formulas/Formulas (type true/false): α1α2, …
• Relations/Predicates M: R, P, A, B , >, <, =, ... "x α(x)
• Connectors: , , ‘,’
, , , iff, ,
• Quantifiers: ", $
• Punctuation: ( )
Deduction Reminding Variables x´
How would you prove I would assume α(x)
α(x)β(x) and then prove β(x)
This is called and then conclude
Deduction. α(x)β(x)

Formal Proof: Each line in the block


Goal is to prove α(x)β(x) from α(x) to β(x)
______ α(x) assumption needs to follow logically
______ … from the previous lines
______ β(x) and from previously
α(x)β(x) conclusion known things.
Except for the first line α(x), which is just assumed.

The convention is to indent this block.


The conclusion α(x)β(x) is stated after the block.
Deduction Reminding Variables x´
Formal Proof:
Goal is to prove α(x)β(x)
______ α(x) assumption
______ …
______ β(x)
α(x)β(x) conclusion

The problem is that a Hilbert Proof must be


a sequence of true statements.
But α(x) is only assumed and hence in itself not necessarily true.
The same with β(x).
Hence, we call this a Meta-Proof.
Deduction Reminding Variables x´
Formal Proof:
Goal is to prove α(x)β(x)
______
α(x) α(x) assumption
______
α(x) …
______
α(x) β(x)
α(x)β(x) conclusion

In order to make it into a Hilbert Proof,


we assume “α(x)” in font of each line.
α(x)α(x) is clearly a true statements in itself.
If β(x) can be proved from α(x),
then α(x)β(x) is can be proved from α(x)α(x).
Deduction Reminding Variables x´
Formal Proof:
Goal is to prove α(x)β(x)
"x [ α(x) α(x) ] assumption
______
"x [ α(x) … ]
______
"x [ α(x) β(x) ]
______
"x [ α(x)β(x) ] conclusion

The fact that x is a free variable complicates things.


Recall that there is an assumed "x in front.
No problem, this is still a fine proof.
Deduction Reminding Variables x´
Formal Proof:
Goal is to prove α(x)β(x)
"x [ ______ α(x) ] assumption
"x [ ______ … ]
"x [ ______ β(x) ]
"x [ α(x)β(x) ] conclusion

The problem is that without the “α(x)”, it is not a good proof.


["x α(x)]  ["x β(x)] proved
are different.
"x [α(x)β(x) ] concluded
Deduction Reminding Variables x´
Formal Proof:
Goal is to prove α(x)β(x)
"x [ ______ α(x) ] assumption
"x [ ______ … ]
"x [ ______ β(x) ]
"x [ α(x)β(x) ] conclusion

Assume "x α(x)  "x β(x) Goal: Prove "x (α(x)β(x))

α(0) β(0) α(0)  β(0)


α(1) β(1)
α(2)  β(2) No.
α(3) β(3) Maybe α(1)β(0) .
α(4) β(4)
Deduction Reminding Variables x´
Formal Proof:
Goal is to prove α(x)β(x)
"x [ α(x) α(x) ] assumption
______
"x [ α(x) … ]
______
"x [ α(x) β(x) ]
______
"x [ α(x)β(x) ] conclusion

The solution is that we much remember that


the "x includes all of [ α(x) β(x) ]
Deduction Reminding Variables x´
Formal Proof:
Goal is to prove α(x)β(x)
"x´ [α(x´)
______ α(x´)] assumption
"x´ [α(x´)
______ … ]
"x´ [α(x´)
______ β(x´)]
"x [ α(x)β(x) ] conclusion

The solution is that we much remember that


the "x includes all of [ α(x) β(x) ]

As a reminder, let’s add a ´


on the free variable x

But practically, does this change the proof at all?

Yes the rules of going from one line to the next with x´
is different than that with x.
Deduction Reminding Variables x´
Formal Proof:
Goal is to prove α(x)β(x) In the indented block,
______ α(x´) assumption
______ … x´ is a fixed but
______ β(x´) arbitrary value.
α(x)β(x) conclusion In the conclusion,
x is free variable.
ie. implied "x
Deduction Reminding Variables x´
Formal Proof:
Goal is to prove α(x)β(x)
______ α(x´) assumption
______ …
______ β(x´)
α(x)β(x) conclusion

The proof then reads as follows:


• Let x´ denote an arbitrary but fixed value.
• Assume α(x´) is true for this value x´.
• From this prove that β(x´) is true for this value x´.
• Deduce α(x´)β(x´) .
• But because we did this for an arbitrary value x´,
we can generalize to "x [α(x)β(x)]
• With a free variable, we can write α(x)β(x).
Adding Meaning
In order to make the proof a “Hilbert” proof,
we need each line standing alone to state something valid.

Proof systems generally assume:


"x on the entire formula.

It is call the Universal Closure.


Toniann Pitassi

We will extend this can call it


Quantifier Closure QC().
Adding Meaning
In order to make the proof a “Hilbert” proof,
we need each line standing alone to state something valid.
The “mean” of a line of our proof is
what we define as its Quantifier Closure.

Line  in proof Implied Meaning QC()


 "M $" "x´ [α(x´)].  
α(x,y$(x)) "α $y"α(x,y$(x))  
______ β(x´) "β "x´[α(x´)β(x´)]

I prove QC() is true As your adversary


by constructing the $objects I give you hard
and proving the final statement. "objects.
Adding Meaning
In order to make the proof a “Hilbert” proof,
we need each line standing alone to state something valid.
The “mean” of a line of our proof is
what we define as its Quantifier Closure.

Line  in proof Implied Meaning QC()


 "M $" "x´ [α(x´)].  
α(x,y$(x)) "α $y"α(x,y$(x))  
______ β(x´) "β "x´[α(x´)β(x´)]
Here M is the model specifying:
• the universe U of objects,
• the functions f and relations R. Even +&.
It is certainly not mentioned in Predicate syntax.
Often we don’t mention it.
Adding Meaning
In order to make the proof a “Hilbert” proof,
we need each line standing alone to state something valid.
The “mean” of a line of our proof is
what we define as its Quantifier Closure.

Line  in proof Implied Meaning QC()


 "M $" "x´ [α(x´)].  
α(x,y$(x)) "α $y"α(x,y$(x))  
______ β(x´) "β "x´[α(x´)β(x´)]
Here y$(x) is called a Skolem function.
It is a “fixed” value/function.
Because of the game, it can depend on
• on the model M.
Adding Meaning
In order to make the proof a “Hilbert” proof,
we need each line standing alone to state something valid.
The “mean” of a line of our proof is
what we define as its Quantifier Closure.

Line  in proof Implied Meaning QC()


 "M $" "x´ [α(x´)].  
α(x,y$(x)) "α $y"α(x,y$(x))  
______ β(x´) "β "x´[α(x´)β(x´)]
Here y$(x) is called a Skolem function.
It is a “fixed” value/function.
When it is a function it can depend on
• the value of the free variables x.
Adding Meaning
In order to make the proof a “Hilbert” proof,
we need each line standing alone to state something valid.
The “mean” of a line of our proof is
what we define as its Quantifier Closure.

Line  in proof Implied Meaning QC()


 "M $" "x´ [α(x´)].  
α(x,y$(x)) "α $y"α(x,y$(x))  
______ β(x´) "β "x´[α(x´)β(x´)]
Here y$(x) is called a Skolem function.
Being a function, it is really second order logic.
Adding Meaning
In order to make the proof a “Hilbert” proof,
we need each line standing alone to state something valid.
The “mean” of a line of our proof is
what we define as its Quantifier Closure.

Line  in proof Implied Meaning QC()


 "M $" "x´ [α(x´)].  
α(x,y$(x)) "α $y"α(x,y$(x))  
______ β(x´) "β "x´[α(x´)β(x´)]
Here specifies the vector of all free variables x.  
If these have not been specified by a user,
then for  to be valid,
 must be true for every setting of values of .
Adding Meaning
In order to make the proof a “Hilbert” proof,
we need each line standing alone to state something valid.
The “mean” of a line of our proof is
what we define as its Quantifier Closure.

Line  in proof Implied Meaning QC()


 "M $" "x´ [α(x´)].  
α(x,y$(x)) "α $y"α(x,y$(x))  
______ β(x´) "β "x´[α(x´)β(x´)]
Goal is to prove α(x) β(x) x´ is a
α(x´)
______ α(x´) assumption fixed but
______ … arbitrary
α(x´)
______ (x´) value.
______ …
Adding Meaning
In order to make the proof a “Hilbert” proof,
we need each line standing alone to state something valid.
The “mean” of a line of our proof is
what we define as its Quantifier Closure.

Line  in proof Implied Meaning QC()


 "M $" "x´ [α(x´)].  
α(x,y$(x)) "α $y"α(x,y$(x))  
______ β(x´) "β "x´[α(x´)β(x´)]
Sound and Complete
Syntax Model/Interpretation/Universe A Proof System
Values of all symbols.
Which  are Which  are
well defined. Which  are true/valid. proved.
⊧ ⊢
Aaaaah! I always get ⊧ and ⊢ mixed
up.
Me too.
Sound and Complete
Syntax Model/Interpretation/Universe A Proof System
Values of all symbols.
Which  are Which  are
well defined. Which  are true/valid. proved.
⊧ ⊢

How about π for Pi for Proof?

Except that it is backwards

And T for truth?


and sideways.
Sound and Complete
True vs Tautology vs Valid:
y>x That depends on
Is this true? the values of x and y.
6>5 That depends on the
Is this true? interpretation
of 5, 6, and >,
If I tell you that the ie it depends on the model M.
model is the integers
and that x=5 and y=6, Then I can tell you that y>x is true.

We write
M[a]⊧
to mean that formula 
is true in model M
and assignment a.
Sound and Complete
True vs Tautology vs Valid:
A Tautology is a formula that evaluates to true
under setting of the variables.
Eg: (PQ)  P.
Namely if P and Q are true then P is true.

Why does in not depend Because we decided that their


on the interpretation interpretations are fixed.
of  and ? Same for ".

["x α(x)]  α(y) For Predicate logic sentences,


Is this a tautology? we use the word valid.
It is true in every model
M[a] and every setting (["x α(x)]  β(y))  ["x α(x)]
of the free variable y. is still said to be a tautology
because it arises from a tautology.
Sound and Complete
True vs Tautology vs Valid:
A Tautology is a formula that evaluates to true
under setting of the variables.
Eg: (PQ)  P.
Namely if P and Q are true then P is true.

Why does in not depend Because we decided that their


on the interpretation interpretations are fixed.
of  and ? Same for ".

["x α(x)]  α(y) For Predicate logic sentences,


Is this a tautology? we use the word valid.
It is true in every model
M[a] and every setting We write
of the free variable y. ⊧
to mean that formula  is valid,
ie is true in every model/ass M[a].
Proofs:
Sound and Complete
Suppose we have We denote that with ⊢.
a proof of ? We call  a Theorem.

Does this prove The truth of  depends on the


that  is true? model/ass M[a].

The proof system does not specify the model M.


If there is even a single model in which  is not true,
then you should not be able to prove .
A proof of  should mean that  is true in
every model/ass M[a], ie valid.
Sound and Complete
Syntax Model/Interpretation/Universe A Proof System
Values of all symbols.
Which  are Which  are
well defined. Which  are true/valid. proved.
⊧ ⊢
A proof system is
• Sound iff
 has a proof  it is valid
⊢  ⊨
• Proof Requires: Proof uses induction and is covered in said section.
Rule “If i-2 and i-1 are lines in your proof, then you can add line i”
requires “If i-2 and i-1 are valid, then so is i”
ie (i-2i-1)⇒i requires (i-2i-1)i
• Complete iff Proof: (Hard Proof)
 is valid  it has a proof Gödel’s
⊨  ⊢ Completeness Theorem
Sound and Complete
Non-Logical Axioms Γ:
Not too many formulas are It is hard to say that we are
true in every model/ass M[a]! taking about the integers,
because we don’t know exactly
We care about specific models, what is true for them.
like the integers.
Instead, let Γ={γ1,γ2,..} denote a set of formulas.
These are called Non-logical Axioms.

For example Γ could include: "a,b,c


• Associative: a+(b+c) = (a+b)+c & a×(b×c) = (a×b)×c
• Commutative: a+b = b+a & a×b = b×a
• Distributive: a×(b+c) = (a×b) + (a×c)
• + Inverse: "a $ b a+b=0, i.e. b=-a
• × Inverse: "a≠0 $b a×b=1, i.e. b=a-1
Sound and Complete
Non-Logical Axioms Γ:
Not too many formulas are It is hard to say that we are
true in every model/ass M[a]! taking about the integers,
because we don’t know exactly
We care about specific models, what is true for them.
like the integers.
Instead, let Γ={γ1,γ2,..} denote a set of formulas.
These are called Non-logical Axioms.
Then we will only care about models/ass
for which all formulas Γ in are true, ie M[a]⊧Γ.
We write Γ⊧ We write Γ⊢
to mean that formula  is true to mean that formula  can be proved
in every model/ass M[a] when we add Γ to our set of
for which Γ is true. axiom/assumptions.
We say that  is a We say that  is a
Logical Consequence of Γ. Syntactic Consequence of Γ.
Sound and Complete
Syntax Model/Interpretation/Universe A Proof System
Values of all symbols.
Which  are Which  are
well defined. Which  are true/valid. proved.
⊧ ⊢
A proof system is
• Sound iff
 has a proof starting with Γ   is valid when Γ is valid
Γ⊢  Γ⊨
• Proof Requires:
Rule “If i-2 and i-1 are lines in your proof, then you can add line i”
requires “If i-2 and i-1 are valid, then so is i”
ie (i-2i-1)⇒i requires (i-2i-1)i
• Complete iff Proof: (Hard Proof)
 is valid when Γ is valid   has a proof starting with Γ. Gödel’s
Γ⊨  Γ⊢ Completeness Theorem
Sound and Complete
⊧, ⊢, ⇒, and → are Interchangeable:
So Γ⊧ means that the truth of 
follows from that of Γ.
Why don’t state Γ is valid?

A small issue is that Γ is


not a single formula but a set of them.
But I am not formal enough to care.
Another issue is that Γ is itself a formula,
while Γ⊧ is a “meta statement” about formulas.

And you are right.


Γ⊧ iff Γ is valid
iff Γ is true in every model/ass M[a]
iff  is true in every model/ass M[a] for which Γ is true.
Sound and Complete
⊧, ⊢, ⇒, and → are Interchangeable:
So Γ⊢ means that a proof of 
follows from that of Γ.
Why don’t we prove Γ?

A small issue is that Γ is


not a single formula but a set of them.
But I am not formal enough to care.
Another issue is that Γ is itself a formula,
while Γ⊢ is a “meta statement” about
formulas.
And you are right.
Γ⊢ iff Γ can be proved
Deduction: Prove Γ by assuming Γ and proving .
Modus Ponens: From Γ and Γ, conclude .
Sound and Complete
⊧, ⊢, ⇒, and → are Interchangeable:
• Proofs:
(i-2i-1)⇒i:
If i-2 and i-1 are lines in your proof,
then you can add line i.

Γ⊢: If Γ is added to your axioms,


then you can add  as a line.
How is this different than Γ⇒?

Same except
generally, (i-2i-1)⇒i
involves a single (or few) steps
while Γ⊢ could be a long proof.
Sound and Complete
Quantifier Closure:
• Sound Requires:
Rule “If i-2 and i-1 are lines in your proof, then you can add line i”
requires “If i-2 and i-1 are valid, then so is i”
ie (i-2i-1)⇒i requires (i-2i-1)i
Careful! homework

In our proof system:


From line α(x), include line ∀xα(x),
even though α(x)→∀xα(x) is not true.
But when α(x) is interpreted as ∀x α(x)
∀x α(x) → ∀xα(x) is quite reasonable.

Recall that the meaning of each line  of the proof is its  


Quantifier Closure: Φ ≡ QC() ≡ "M $" "x´ [α(x´)].
Require: “From line , include line ´”  QC()QC(´)
Sound and Complete
Syntax Model/Interpretation/Universe A Proof System
Values of all symbols.
Which  are Which  are
well defined. Which  are true/valid. proved.
A proof system is
• Sound iff
 has a proof starting with Γ   is valid when Γ is valid
and when interpreted correctly
Γ⊢  Γ⊨QC( )
• Proof Requires:
Rule “If i-2 and i-1 are lines in your proof, then you can add line i”
requires “If QC(i-2 ) and QC(i-1 )are valid, then so is QC(i )”
?? ieQC( ) QC( )⇒ QC( ) requires QC( ) QC( ) QC( )
i-2 i-1 i i-2 i-1 i
• Complete iff Proof: (Hard Proof)
 is valid when Γ is & interpreted   has a proof starting with Γ
Γ⊨QC( )  Γ⊢
Sound and Complete
Quantifier Closure:

 has a proof starting with Γ   is valid when Γ is valid


and when interpreted correctly
Γ⊢  Γ⊨QC( )
If you remove the y$ and x´ notation before the end of the proof,
then QC will have no effect and  is valid theorem.
Sound and Complete
Overview:
Let Φ ≡ QC().
True/Valid:
• M[a]⊧Φ: Φ is true under variable assignment a in universe/model M.
• ⊧Φ: Φ is valid, ie Φ is true under every model/ass M[a].
• Γ⊧Φ: Φ is a Logical Consequence of Γ,
ie Γ→Φ is valid,
ie Φ is true under every model/ass M[a] under which is Γ true.
Proofs:
• Γ⊢Φ: Φ is a Theorem or Syntactic Consequence of Γ,
ie From formulas in Axiomsfixed  Γ, one can prove .
For example, the line appearing in the proof may be
 ≡ α(x),
but the theorem proved to be valid is its interpretation
Φ ≡ QC() ≡ ∀x α(x).
Sound and Complete
Overview:
Let Φ ≡ QC().
True/Valid:
• M[a]⊧Φ: Φ is true under variable assignment a in universe/model M.
• ⊧Φ: Φ is valid, ie Φ is true under every model/ass M[a].
• Γ⊧Φ: Φ is a Logical Consequence of Γ,
ie Γ→Φ is valid,
ie Φ is true under every model/ass M[a] under which is Γ true.
Proofs:
• Γ⊢Φ: Φ is a Theorem or Syntactic Consequence of Γ,
ie From formulas in Axiomsfixed  Γ, one can prove .
• (Φi-2Φi-1)⇒Φi: If i-2 & i-1 are lines in your proof,
then you can add i as a line.
ie (Φi-2Φi-1)→Φi can be proved.
• ⊧, ⊢, ⇒, and → are interchangeable when interpreted with QC.
Sound and Complete
Overview:
Let Φ ≡ QC().
Sound:
• A Proof system is Sound if Γ⊧ ensures Γ⊢Φ,
ie A proof of  from Γ ensures that Φ is valid when Γ is valid.
• Proof Requires:
Rule “If i-2 and i-1 are lines in your proof, then you can add line i”
requires “If QC(i-2) and QC(i-1) are valid, then so is QC(i)”
ie Φi-2Φi-1⇒Φi requires Φi-2Φi-1Φi.
Complete:
• A Proof system is Complete if Γ⊢Φ ensures Γ⊧,
ie is valid when Γ is ensures that  can be proved from Γ.
End

You might also like