first order language
A first order language L is an infinite collection of distinct symbols, no one of which is contained in another, separated into the following categories
  • Parenthesis: ( , )
  • Connectives: , ¬
  • Quantifier:
  • Variables, one for each i N 1 : v i
  • Equality symbol: =
  • Constant symbols: A set of symbols
  • Function symbols, for each n N 1 : A set of n -ary function symbols
  • Relation symbols, for each n N 1 : A set of n -ary relation symbols

Since the only thing differing from language to language are its constants, variables, functions and relations then we can denote the language L by ( C L , F L , R L ) , we can denote the set of variables by V L

term
If L is a language, a term of L is a nonempty finite string t of symbols from L such that
  • t is a variable
  • t is a constant
  • t f t 1 t 2 t n is a constant where f is an n -ary function symbol if L and each t i is a term of L
formula
If L is a first order language, then a formula of L is a non-empty finite string ϕ of symbols from L such that:
  1. ϕ :≡= t 1 t 2 where t 1 , t 2 are terms of L
  2. ϕ :≡ R t 1 t 2 t n where R is an n -ary relation symbol of L and t 1 , t 2 are terms of L
  3. ϕ :≡ ( ¬ α ) where α is a formula of L
  4. ϕ :≡ ( α β ) where α , β are formulas of L
  5. ϕ :≡ ( v ) ( α ) where v is a variable and α is a formula of L
Atomic Formula
The atomic formulas of L are formulas that satisfy clause 1 or 2 of their definition
language of number theory
We define the language L N T = ( { 0 } , { S , + , , E } , { < } ) as the language of number theory.
L -Structure
Fix a language L . An L -structure A is a non-empty set A , called the universe of A , such that the following holds:
  • For each constant symbol c of L , we have an element c A of A
  • For each n -ary function symbol f of L , we have a function f A : A n A
  • For each n -ary relation symbol R of L , we have an n -ary relation R A on A
Similar to a language we may denote it by ( A , { c A : c C L } , { f A : f F L } , { R A : R R L } )
standard number theory structure
Given L N T , we define the structure N := ( N 0 , { 0 } , { S , + , , E } , { < } ) , where the constant symbol 0 maps to 0 (the element of N 0 ), S is the successor function S ( 2 ) = 3 , + is usual addition 3 + 3 = 6 , multiplication 2 4 = 8 , E for exponentiation E ( 3 , 2 ) = 9
variable assignment function
If A is an L -structure, a variable assignment function is any function of the form s : V L A
x -modification of an assignment function
If s is a variable assigment function into A and x V L and a A , then s [ x a ] is the variable assigment function defined as follows
s [ x a ] ( v ) := { s ( v ) if  v  is a variable other than  x a if  v  is the variable  x
and we say that s [ x a ] is an x -modification of the assigment function s
An x -modification of s is just like s , except we bind the variable x to the element a of A 's universe
term assignment function
Suppose that A is an L -structure and s is a variable assigment function into A . The function s ¯ , called the term assigment function generated by s , is the function with domain consisting of the set of L terms and codomain A defined as follows
  • if t is a variable then s ¯ ( t ) = s ( t )
  • if t is the constant c then s ¯ ( t ) = c A
  • if t :≡ f t 1 t 2 t n then s ¯ ( t ) = f A ( s ¯ ( t 1 ) , s ¯ ( t 2 ) , , s ¯ ( t n ) )
interpretation of a term
Given an L -structure A , and a term t from L , we say that it's interpretation in A is s ¯ ( t )
numbers in the number theory structure
What is the interpretation in N of the term t defined as E S S S 0 S S 0

The interpretation is s ¯ ( E S S S 0 S S 0 ) which is equal to E A ( s ¯ ( S S S 0 ) , s ¯ ( s s 0 ) ) , we know that E A = E (the exponentiation function).

Now considering s ¯ ( S S 0 ) it becomes S ( s ¯ ( S 0 ) ) which becomes S ( S ( s ¯ ( 0 ) ) ) and since s ¯ ( 0 ) = 0 A = 0 (the natural number 0), then s ¯ ( S S 0 ) = 0 + 1 + 1 = 2 , similarly we can find that s ¯ ( S S S 0 ) = 3

From the above paragrpah we know that E ( s ¯ ( S S S 0 ) , s ¯ ( s s 0 ) ) becomes E ( 3 , 2 ) which equals 9 , so therefore the interpretation of E S S S 0 S S 0 in N is 9 .

A Free Varaible in a Formula
Suppose that v is a varaible and ϕ is a formula, then v is free in ϕ iff exactly one of the following holds:
  1. ϕ is atomic and v occurs in α
  2. ϕ :≡ ( ¬ α ) and v is free in α
  3. ϕ :≡ ( α β ) and v is free in at least one of α or β
  4. ϕ :≡ ( u ) ( α ) and v is not u and v is free in α
For All Makes a Variable not Free
Free Variable For All Easy
Show that x is not free in ϕ :≡ ( x ) ( x = x )
Free Variable For All Medium
Show that in the following formula ϕ defined as ( v 2 ) ( ¬ ( ( v 3 ) ( ( v 1 = S ( v 2 ) v 3 = v 2 ) ) ) ) v 1 is free in ϕ , but v 2 and v 3 are not

We'll start by showing that v 2 is free in p h i