com sfwr 707: formal specification techniques€¦ · com sfwr 707: formal specification...
TRANSCRIPT
COM SFWR 707:Formal
SpecificationTechniques
Dr. R. Khedri
Outline
Introduction
Basic Definitions
L-terms,Interpretation,L-formulas, andSatisfiability
Constructions
ElementaryEquivalence andIsomorphism
Theories
COM SFWR 707: Formal SpecificationTechniques
Dr. Ridha Khedri
Department of Computing and Software, McMaster UniversityCanada L8S 4L7, Hamilton, Ontario
COM SFWR 707:Formal
SpecificationTechniques
Dr. R. Khedri
Outline
Introduction
Basic Definitions
L-terms,Interpretation,L-formulas, andSatisfiability
Constructions
ElementaryEquivalence andIsomorphism
Theories
1 Introduction
2 Basic DefinitionsMaps that preserve the interpretation of L
3 L-terms, Interpretation, L-formulas, and Satisfiability
4 ConstructionsL-Substructure (revisited)L–Quotient StructureDirect Product Structure
5 Elementary Equivalence and Isomorphism
6 TheoriesLogical Consequence
COM SFWR 707:Formal
SpecificationTechniques
Dr. R. Khedri
Outline
Introduction
Basic Definitions
L-terms,Interpretation,L-formulas, andSatisfiability
Constructions
ElementaryEquivalence andIsomorphism
Theories
Structures and Theories Introduction
In mathematical logic, we use first-order languages todescribe mathematical structures
Intuitively, a structure is a set that we wish to studyequipped with a collection of distinguished functions,relations, and elements
After that, we choose a language where we can talkabout them (Funct., rel., and elements) and nothingmore
COM SFWR 707:Formal
SpecificationTechniques
Dr. R. Khedri
Outline
Introduction
Basic Definitions
L-terms,Interpretation,L-formulas, andSatisfiability
Constructions
ElementaryEquivalence andIsomorphism
Theories
Structures and Theories Introduction
Example
When we study the ordered field of real numbers withthe exponential function
We study the structure 〈R,+, ·, exp, <, 0, 1〉What are the components of this structure?
We would use a language where we have symbols for+, ·, exp, <, 0, 1We can write statements such as:
∀(x , y | x , y ∈ R : exp(x) · exp(y) = exp(x + y) )
That we interpret as the assertion: exey = e(x+y) forall x and y in real numbers.
COM SFWR 707:Formal
SpecificationTechniques
Dr. R. Khedri
Outline
Introduction
Basic Definitions
Maps
L-terms,Interpretation,L-formulas, andSatisfiability
Constructions
ElementaryEquivalence andIsomorphism
Theories
Structures and Theories Basic Definitions
Definition (Language)
A language L is given by specifying the following data:
1 a set of function symbols F and positive integers nf foreach f ∈ F
2 a set of relation symbols R and positive integers nR foreach R ∈ R
3 a set of constant symbols C.
τ = 〈F ,R, C, nF , nR〉
The numbers nf and nR tell us that f is a function ofnf variables and R is an nR -ary relation
Any or all of the sets F ,R and C may be empty
COM SFWR 707:Formal
SpecificationTechniques
Dr. R. Khedri
Outline
Introduction
Basic Definitions
Maps
L-terms,Interpretation,L-formulas, andSatisfiability
Constructions
ElementaryEquivalence andIsomorphism
Theories
Structures and Theories Basic Definitions
Example (Language)
〈{+,−, ·}, {}, {0, 1}, {(+, 2), (−, 2), (·, 2)}, {}〉 is thelanguage of rings Lr
〈{+,−, ·}, {<}, {0, 1}, {(+, 2), (−, 2), (·, 2)}, {(<, 2)}〉is the language of ordered rings Lor
The smallest language is that of pure indentity L=, inwhich no function, relation, or constant occur
It means τ = 〈{}, {}, {}, {}, {}〉
COM SFWR 707:Formal
SpecificationTechniques
Dr. R. Khedri
Outline
Introduction
Basic Definitions
Maps
L-terms,Interpretation,L-formulas, andSatisfiability
Constructions
ElementaryEquivalence andIsomorphism
Theories
Structures and Theories Basic Definitions
Definition (L-structure)
An L-structure M is given by the following data:
a nonempty set M called the universe, domain, orunderlying set of M;
a function f M : Mnf −→ M for each f ∈ F ;
a set RM ⊆ MnR for each R ∈ R;
an element cM ∈ M for each c ∈ C.
COM SFWR 707:Formal
SpecificationTechniques
Dr. R. Khedri
Outline
Introduction
Basic Definitions
Maps
L-terms,Interpretation,L-formulas, andSatisfiability
Constructions
ElementaryEquivalence andIsomorphism
Theories
Structures and Theories Basic Definitions
We refer to f M,RM, and cM as the interpretations ofthe symbols f ,R, and c
We often write the structure as
M = 〈M, f M,RM, cM : f ∈ F ,R ∈ R, andc ∈ C〉
We will use the notation A,B,M,N, · · · to refer to theunderlying sets of the structures A,B,M,N , · · ·
COM SFWR 707:Formal
SpecificationTechniques
Dr. R. Khedri
Outline
Introduction
Basic Definitions
Maps
L-terms,Interpretation,L-formulas, andSatisfiability
Constructions
ElementaryEquivalence andIsomorphism
Theories
Structures and Theories Basic Definitions
Example
Suppose that we are studying groups
We might use the language Lg = {·, e}F = {·}n(·) = 2C = {e}
An Lg -structure G = (G , ·G , eG)G = (R, ·, 1) is a Lg -structure
G = (N,+, 0) is a Lg -structureG = (N,+, 0) is NOT a group, but it is a Lg -structure
COM SFWR 707:Formal
SpecificationTechniques
Dr. R. Khedri
Outline
Introduction
Basic Definitions
Maps
L-terms,Interpretation,L-formulas, andSatisfiability
Constructions
ElementaryEquivalence andIsomorphism
Theories
Structures and Theories Basic DefinitionsMaps that preserve the interpretation of L
Definition (L-embedding)
Suppose that M and N are L-structures with universes M,and N, respectively. An L-embedding η : M−→ N is aone-to-one map (i.e., injective) η : M −→ N that preservesthe interpretation of all the symbols of L.
Which means that:À ∀
(f , a1, · · · , anf
| f ∈ F ∧ a1, · · · , anf∈ M :
η(f M(a1, · · · , anf
))
= f N (η(a1), · · · , η(anf))
)Á ∀
(R, a1, · · · , amR
| R ∈ R ∧ a1, · · · , amR∈ M :
(a1, · · · , amR) ∈ RM ⇐⇒ (η(a1), · · · , η(amR
)) ∈ RN)
 ∀(c | c ∈ C : η(cM) = cN
)
COM SFWR 707:Formal
SpecificationTechniques
Dr. R. Khedri
Outline
Introduction
Basic Definitions
Maps
L-terms,Interpretation,L-formulas, andSatisfiability
Constructions
ElementaryEquivalence andIsomorphism
Theories
Structures and Theories Basic DefinitionsMaps that preserve the interpretation of L
Definition (L-isomorphism)
A bijective L-embedding is called an L-isomorphism.
Definition (Substructure/Extension)
If M ⊆ N and the inclusion map is an L-embedding, we sayeither that M is a substructure of N or that N is anextension of M.
Example
Z def= (Z,+Z , 0Z) is a substructure of
R def= (R,+R, 0R)
If η : Z −→ R is the function η(x)def= exp x , then η is
an L-embedding of (Z,+, 0) into (R, ·, 1).
COM SFWR 707:Formal
SpecificationTechniques
Dr. R. Khedri
Outline
Introduction
Basic Definitions
Maps
L-terms,Interpretation,L-formulas, andSatisfiability
Constructions
ElementaryEquivalence andIsomorphism
Theories
Structures and Theories Basic DefinitionsMaps that preserve the interpretation of L
Recall– Cardinal Numbers:
Definition
Two sets, A and B, are said to be equipollent, if there existsa bijective map A −→ B. In this case we write A ∼ B.
Theorem
Equipollence is an equivalence relation on the class of allsets.
Let I0 = ∅ and ∀(n | n ∈ N∗ : Indef= {1, 2, · · · , n} )
In ∼ Im ⇐⇒ n = m
To say that a set A has n elements means that A ∼ InWhen A ∼ In for some unique n ≥ 0, we say that A isfinite
A set that is not finite is infinite
COM SFWR 707:Formal
SpecificationTechniques
Dr. R. Khedri
Outline
Introduction
Basic Definitions
Maps
L-terms,Interpretation,L-formulas, andSatisfiability
Constructions
ElementaryEquivalence andIsomorphism
Theories
Structures and Theories Basic DefinitionsMaps that preserve the interpretation of L
Definition
The cardinal number (or cardinality) of a set A, denoted by|A|, is the equivalence class of A under the equivalencerelation of equipollence. |A| is an infinite or finite cardinalaccording as A is an infinite or finite set.
We shall identify the integer n ≥ 0 with the cardinalnumber |In| and write |In| = n
So, the cardinal number of a finite set is precisely thenumber of elements in the setWhat about the cardinality of a structure?
The cardinality of M is |M|, the cardinality of theuniverse of M
If η : M−→ N is an embedding then the cardinality ofN is at least the cardinality of M.
COM SFWR 707:Formal
SpecificationTechniques
Dr. R. Khedri
Outline
Introduction
Basic Definitions
Maps
L-terms,Interpretation,L-formulas, andSatisfiability
Constructions
ElementaryEquivalence andIsomorphism
Theories
Structures and Theories Basic DefinitionsMaps that preserve the interpretation of L
Definition
Let α and β be cardinal numbers. The sum α+ β is definedto be the cardinal number |A ∪ B|, where A and B aredisjoint sets such that |A| = α and |B| = β. The productαβ is defined to be the cardinal number |A× B|.
Theorem
If A is a set and P(A) its power, then |A| < |P(A)|.[Schroeder-Bernstein] If A and B are sets such that|A| ≤ |B| and |B| ≤ |A|, the |A| = |B|.The class of all cardinal numbers is linearly ordered by≤. If α and β are cardinal numbers, then exactly oneof the following is true:
α < β; α = β; β < α (Trichotomy Law)
COM SFWR 707:Formal
SpecificationTechniques
Dr. R. Khedri
Outline
Introduction
Basic Definitions
Maps
L-terms,Interpretation,L-formulas, andSatisfiability
Constructions
ElementaryEquivalence andIsomorphism
Theories
Structures and Theories Basic DefinitionsMaps that preserve the interpretation of L
What about the cardinality of a structure M?
The cardinality of M is |M|, i.e., the cardinality of theuniverse of M.
If η : M−→ N is an embedding, then the cardinalityof N is at least the cardinality of M.
COM SFWR 707:Formal
SpecificationTechniques
Dr. R. Khedri
Outline
Introduction
Basic Definitions
L-terms,Interpretation,L-formulas, andSatisfiability
Constructions
ElementaryEquivalence andIsomorphism
Theories
Structures and Theories L-terms,Interpretation, L-formulas, and Satisfiability
We use the language L to create formulas describingproperties of L-structures
Formulas will be strings of symbols built using
the symbols of L
variable symbols v1, v2, · · · , vn
the equality symbol =
the Boolean connectives ∧ ,Or ,¬
the quantifiers: ∃ and ∀
and parentheses ( , )
COM SFWR 707:Formal
SpecificationTechniques
Dr. R. Khedri
Outline
Introduction
Basic Definitions
L-terms,Interpretation,L-formulas, andSatisfiability
Constructions
ElementaryEquivalence andIsomorphism
Theories
Structures and Theories L-terms,Interpretation, L-formulas, and Satisfiability
Definition (L-terms)
The set of L-terms is the smallest set T such that
1 ∀(c | c ∈ C : c ∈ T )
2 ∀(i | i ∈ N : vi ∈ T )
3 ∀(f , t1, · · · , tn | f ∈ F ∧ t1, · · · , tn ∈ T :f (t1, · · · , tn) ∈ T )
Example
·(v1,−(v3, 1)), and · (+(v1, v2),+(v3, 1)) are Lr -terms
In the Lr -Structure (Z,+, ·, 0, 1), we think of the term
1 + (1 + (1 + 1)) as a name for the element 4(v1 + v2)(v3 + 1) is a name for the function(x , y , z) 7−→ (x + y)(z + 1)
Defining functions in this way can be done in any L-structure
COM SFWR 707:Formal
SpecificationTechniques
Dr. R. Khedri
Outline
Introduction
Basic Definitions
L-terms,Interpretation,L-formulas, andSatisfiability
Constructions
ElementaryEquivalence andIsomorphism
Theories
Structures and Theories L-terms,Interpretation, L-formulas, and Satisfiability
Interpretation of an L-term
Let M be an L-structure and that t is a term builtusing variables from v = (vi1 , · · · , vim)
We want to interpret t as a function tM : Mm −→ M
For s a subterm of t and a = (ai1 , · · · , aim) ∈ Mm, weinductively define sM(a) as follows.
1 If s is a constant symbol c , then sM(a) = cM.2 If s is the variable vij , then sM(a) = aij .3 If s is the term f (t1, · · · , tnf
), where f is a functionsymbol of L and t1, · · · , tn are terms, thensM(a) = fM
(tM1 (a), · · · , tMnf
(a)).
The function tM is defined by a 7−→ tM(a).
COM SFWR 707:Formal
SpecificationTechniques
Dr. R. Khedri
Outline
Introduction
Basic Definitions
L-terms,Interpretation,L-formulas, andSatisfiability
Constructions
ElementaryEquivalence andIsomorphism
Theories
Structures and Theories L-terms,Interpretation, L-formulas, and Satisfiability
Example
Let L = {f , g , c}, where n(f ) = 1, n(g) = 2, and c is aconstant symbol
take the L-terms t1 = g(v1, c), t2 =f (g(c , f (v1))), and t3 = g(f (g(v1, v2)), g(v1, f (v2)))
Let M be the structure (R, exp,+, 1); that is
fM = expgM = +cM = 1
Give the following
tM1 (a1)tM2 (a1)tM3 (a1, a2)
COM SFWR 707:Formal
SpecificationTechniques
Dr. R. Khedri
Outline
Introduction
Basic Definitions
L-terms,Interpretation,L-formulas, andSatisfiability
Constructions
ElementaryEquivalence andIsomorphism
Theories
Structures and Theories L-terms,Interpretation, L-formulas, and Satisfiability
Example
In breeding a strain of cattle, which can be black or brown,monochromatic or spotted , it is known that black isdominant and brown recessive and that monochromatic isdominant over spotted.
1 Give the possible types of cattle in this herd.
2 Due to dominance, in crossing a black spotted one witha brown monochromatic one, we expect a blackmonochromatic one. Give the “operation” ∗ thatsymbolizes this phenomenon.
3 Define the structure C def= (C , ∗).
COM SFWR 707:Formal
SpecificationTechniques
Dr. R. Khedri
Outline
Introduction
Basic Definitions
L-terms,Interpretation,L-formulas, andSatisfiability
Constructions
ElementaryEquivalence andIsomorphism
Theories
Structures and Theories L-terms,Interpretation, L-formulas, and Satisfiability
Definition (L-formula)
We say that φ is an atomic L-formla if φ is either
1 t1 = t2, where t1 and t2 are terms, or
2 R(t1, · · · , tnR), where R ∈ R and t1, · · · , tnR
are terms.
Definition
The set of L-formulas is the smallest set W containing theatomic formulas such that
1 if φ is in W, then¬φ is in W,
2 if φ and ψ are in W, then φ ∧ ψ and φ ∨ ψ are in W,and
3 if φ is in W, then ∃(vi |: φ ) and ∀(vi |: φ ) are inW.
COM SFWR 707:Formal
SpecificationTechniques
Dr. R. Khedri
Outline
Introduction
Basic Definitions
L-terms,Interpretation,L-formulas, andSatisfiability
Constructions
ElementaryEquivalence andIsomorphism
Theories
Structures and Theories L-terms,Interpretation, L-formulas, and Satisfiability
Definition (sentence)
We call a formula a sentence if it has no free variables.
Definition (Satisfiability)
Let φ be a formula with free variables fromv = (vi1 , · · · , vim) and let a = (ai1 , · · · , qim) ∈ Mm. Weinductively define M |= φ(a) as follows.
If φ is t1 = t2, then M |= φ(a) if tM1 (a) = tM2 (a)
If φ is R(t1, · · · , tnR), then M |= φ(a) if
(tM1 , · · · , tMnR) ∈ RR
If φ is ¬ψ, then M |= φ(a) if M 6|= ψ(a)
COM SFWR 707:Formal
SpecificationTechniques
Dr. R. Khedri
Outline
Introduction
Basic Definitions
L-terms,Interpretation,L-formulas, andSatisfiability
Constructions
ElementaryEquivalence andIsomorphism
Theories
Structures and Theories L-terms,Interpretation, L-formulas, and Satisfiability
Definition (Satisfiability–Continued–)
If φ is ψ ∧ θ, then M |= φ(a) if M |= ψ(a) andM |= θ(a)
If φ is ψ ∨ θ, then M |= φ(a) if M |= ψ(a) orM |= θ(a)
If φ is ∃(vj |: ψ(v , vj) ), then M |= φ(a) if there isb ∈ M such that M |= φ(a, b)
If φ is ∀(vj |: ψ(v , vj) ), if∀(b | b ∈ M : M |= φ(a, b) )
If M |= φ(a) we say that M satisfies φ(a) or φ(a) is true inM.
COM SFWR 707:Formal
SpecificationTechniques
Dr. R. Khedri
Outline
Introduction
Basic Definitions
L-terms,Interpretation,L-formulas, andSatisfiability
Constructions
ElementaryEquivalence andIsomorphism
Theories
Structures and Theories L-terms,Interpretation, L-formulas, and Satisfiability
Proposition
Suppose that M is a substructure of N , a ∈ M, and φ(v) isa quantifier-free formula. Then, M |= φ(a) if and only ifN |= φ(a).
Proof.
Claim:If t(v) is a term and b ∈ M, then tM(b) = tN (b). This isproved by induction on terms.Then, we prove the proposition by induction on formulas(atomic ones and then for composite ones)
COM SFWR 707:Formal
SpecificationTechniques
Dr. R. Khedri
Outline
Introduction
Basic Definitions
L-terms,Interpretation,L-formulas, andSatisfiability
Constructions
L-Substructure
L-Quotient Structure
Direct ProductStructure
ElementaryEquivalence andIsomorphism
Theories
Structures and Theories ConstructionsL-Substructure (revisited)
Definition
Let M and N be L-structures with M ⊆ N. Then M is a
(L-)substructure of N , noted by M⊆ N , if
∀(f ,R | f ∈ F ∧ R ∈ R :
f M = (f N ∩Mnf +1)
∧ RM = (RN ∩MnR ))
COM SFWR 707:Formal
SpecificationTechniques
Dr. R. Khedri
Outline
Introduction
Basic Definitions
L-terms,Interpretation,L-formulas, andSatisfiability
Constructions
L-Substructure
L-Quotient Structure
Direct ProductStructure
ElementaryEquivalence andIsomorphism
Theories
Structures and Theories ConstructionsL–Quotient Structure
Consider an L-structure M and an equivalence relation θ.
Definition (Compatibility with a structure)
We say that θ is compatible with M if, given f ∈ F , andboth a and b in Mnf such that∀(i | 1 ≤ i ≤ nf : (ai , bi ) ∈ θ ), THEN(f M(a), f M(b)
)∈ θ.
A compatible equivalence relation on M is also calledcongruence on M and sometimes said to be congruentto M
NOTE: The compatibitity condition for a congruencepertains only to the algebraic part of the structure M
COM SFWR 707:Formal
SpecificationTechniques
Dr. R. Khedri
Outline
Introduction
Basic Definitions
L-terms,Interpretation,L-formulas, andSatisfiability
Constructions
L-Substructure
L-Quotient Structure
Direct ProductStructure
ElementaryEquivalence andIsomorphism
Theories
Structures and Theories ConstructionsL–Quotient Structure
Theorem
Let θ be an equivalence relation on a monoid G def= (G , ·, e)
such that (a1, a2) ∈ θ and (b1, b2) ∈ θ implies(a1 · b1, a2 · b2) ∈ θ for all ai , bi ∈ G. Then the structureG/θ = (G/θ, ·/θ, e) is a monoid, where
G/θ is is the set of all equivalence classes of G over θ
·/θ is the binary operation defined by a ·/θ bdef= a · b,
where x denotes the equivalence class of x ∈ G.
e is the equivalence class of the identity element e
COM SFWR 707:Formal
SpecificationTechniques
Dr. R. Khedri
Outline
Introduction
Basic Definitions
L-terms,Interpretation,L-formulas, andSatisfiability
Constructions
L-Substructure
L-Quotient Structure
Direct ProductStructure
ElementaryEquivalence andIsomorphism
Theories
Structures and Theories ConstructionsL–Quotient Structure
Definition
Given an L-structure M and an equivalence relation θ onM compatible with M, then we define the quotientstructure M/θ of M by θ as follows:
The support set of M/θ is M/θ. The equivalenceequivalence class x = {y | (x , y) ∈ θ}.For every f ∈ F , the corresponding L-operation f M/θ
on M/θ, which we denote f θ, is defined by
f θ(a1, · · · , anf
) def= f M
(a1, · · · , anf
)For every relation R ∈ R,
(a1, · · · , anR
)∈ Rθ if the
following holds:
∀(i | 1 ≤ i ≤ nR : ∃(bi | bi ∈ ai : (b1, · · · , bmR) ∈ RM ) )
COM SFWR 707:Formal
SpecificationTechniques
Dr. R. Khedri
Outline
Introduction
Basic Definitions
L-terms,Interpretation,L-formulas, andSatisfiability
Constructions
L-Substructure
L-Quotient Structure
Direct ProductStructure
ElementaryEquivalence andIsomorphism
Theories
Structures and Theories ConstructionsL–Quotient Structure
The compatibility of θ with M insures that theoperation F θ is well-defined on equivalence classes
The properties of equivalence relations (transitivity inparticular) assure that Rθ is well-defined relation onM/θ
Thus, the quotient structure is an L-structure
COM SFWR 707:Formal
SpecificationTechniques
Dr. R. Khedri
Outline
Introduction
Basic Definitions
L-terms,Interpretation,L-formulas, andSatisfiability
Constructions
L-Substructure
L-Quotient Structure
Direct ProductStructure
ElementaryEquivalence andIsomorphism
Theories
Structures and Theories ConstructionsL–Quotient Structure
Associated with the construction, from M and θ, ofM/θ is the quotient morphism (or, quotient map)
qθ : M −→ M/θ
which puts every element x ∈ M in its equivalence
class modulo θ (i.e., qθ(x)def= xθ)
Exercise
Show that qθ is surjective morphism.
COM SFWR 707:Formal
SpecificationTechniques
Dr. R. Khedri
Outline
Introduction
Basic Definitions
L-terms,Interpretation,L-formulas, andSatisfiability
Constructions
L-Substructure
L-Quotient Structure
Direct ProductStructure
ElementaryEquivalence andIsomorphism
Theories
Structures and Theories ConstructionsL–Quotient Structure
Definition (Kernel)
Let η : M−→ N be a homorphism of the L-structures Mand N .By the kernel of η, noted ker(η), we mean the equivalencerelation θη on M defined by
(x , y) ∈ θη ⇐⇒ η(x) = η(y)
COM SFWR 707:Formal
SpecificationTechniques
Dr. R. Khedri
Outline
Introduction
Basic Definitions
L-terms,Interpretation,L-formulas, andSatisfiability
Constructions
L-Substructure
L-Quotient Structure
Direct ProductStructure
ElementaryEquivalence andIsomorphism
Theories
Structures and Theories Constructions DirectProduct Structure
Definition (Direct Product)
Let {Mi}I ={(
Mi , {f i}f ∈F , {R i}R∈R)
| i ∈ I}, be an
I -indexed family of L-structures. The direct product ΠIMi
of the family is defined as follows:
The support set if ΠIMi (i.e., the Cartesian Product ofMi )
Operations on the product are defined componentwise
Given R ∈ R, the relation RΠ on ΠIMi is defined as
follows:
(x1, · · · , xm) ∈ RΠ
⇐⇒ ∀(i | i ∈ I : (x1(i), · · · , xm(i)) ∈ R i ),
where m is the arity m(R) of R and(x1, · · · , xm) ∈ (ΠIAi )
m.
COM SFWR 707:Formal
SpecificationTechniques
Dr. R. Khedri
Outline
Introduction
Basic Definitions
L-terms,Interpretation,L-formulas, andSatisfiability
Constructions
L-Substructure
L-Quotient Structure
Direct ProductStructure
ElementaryEquivalence andIsomorphism
Theories
Structures and Theories Constructions DirectProduct Structure
Clearly, ΠIMi =(ΠIMi , {f Π}f ∈F , {RΠ}R∈R
)as it is
defined has the same language as L as each of thestructures in the family {Mi}I .
The set I can be empty: the empty product Π∅ has asupport with one element e.
R∅ = {(e, · · · , e)}
If ∀(i , j | i , j ∈ I : Mi = N = Mj ), thenΠIMi = N |I | denoted N I .
N I def= ΠIMi is called I -direct power of the
L-structure N .
COM SFWR 707:Formal
SpecificationTechniques
Dr. R. Khedri
Outline
Introduction
Basic Definitions
L-terms,Interpretation,L-formulas, andSatisfiability
Constructions
L-Substructure
L-Quotient Structure
Direct ProductStructure
ElementaryEquivalence andIsomorphism
Theories
Structures and Theories Constructions DirectProduct Structure
Exercise
Show that the projections
Πi : ΠIMi −→ Mi
are surjective homomorphisms.
Note: ∀(x , i | x ∈ ΠIMi ∧ i ∈ I : Πi (x) = xi )
Πi is said to the ith-projection of ΠIMi onto Mi
COM SFWR 707:Formal
SpecificationTechniques
Dr. R. Khedri
Outline
Introduction
Basic Definitions
L-terms,Interpretation,L-formulas, andSatisfiability
Constructions
ElementaryEquivalence andIsomorphism
Theories
Structures and Theories ElementaryEquivalence and Isomorphism
We next consider structures that satisfy the same sentences
Definition
We say that two L-structures M and N are elementarilyequivalent and write M≡ N if
∀(φ | φ is an L-sentence : M |= φ ⇐⇒ N |= φ ).
We let Th(M), the full theory of M, be the set ofL-sentences φ such that M |= φ
It is easy to see that M≡ N if and only ifTh(M) = Th(N)
Our next result shows that Th(M) is an isomorphisminvariant of M
COM SFWR 707:Formal
SpecificationTechniques
Dr. R. Khedri
Outline
Introduction
Basic Definitions
L-terms,Interpretation,L-formulas, andSatisfiability
Constructions
ElementaryEquivalence andIsomorphism
Theories
Structures and Theories ElementaryEquivalence and Isomorphism
Theorem
Suppose that j : M−→ N is an isomorphism. Then,M≡ N .
Proof highlights.
We show by induction on formulas thatM |= φ(a1, · · · , an) if and only ifN |= φ
(j(a1), · · · , j(an)
)for all formulas φ.
We first must show that terms behave well
Suppose that t is a term and the free variables in t arefrom v = (v1, · · · , vn). For a = (a1, · · · , an) ∈ M, welet j(a) denote (j(a1), · · · , j(an)). Thenj(tM(a)) = tN (j(a))We prove this by induction on terms.
Then, we proceed by induction on formulas.
COM SFWR 707:Formal
SpecificationTechniques
Dr. R. Khedri
Outline
Introduction
Basic Definitions
L-terms,Interpretation,L-formulas, andSatisfiability
Constructions
ElementaryEquivalence andIsomorphism
Theories
Logical Consequence
Structures and Theories Theories
Definition (Theory)
Let L be a language. An L-theory T is simply a set ofL-sentences. We say that M is a model of T and writeM |= T if
∀(φ | φ ∈ T : M |= φ )
Example
The set T = { ∀(x |: x = 0 ), ∃(x |: x 6= 0 )} is a theory.
Definition (Satisfiable Theory)
We say that a theory is satisfiable if it has a model.
COM SFWR 707:Formal
SpecificationTechniques
Dr. R. Khedri
Outline
Introduction
Basic Definitions
L-terms,Interpretation,L-formulas, andSatisfiability
Constructions
ElementaryEquivalence andIsomorphism
Theories
Logical Consequence
Structures and Theories Theories
Definition (Elementary class)
We say that a class of L-structures K is an elementary classif there is an L-theory T such that K = {M | M |= T}.
One way to get a theory is to take Th(M), the fulltheory of an L-structure MIn this case, the elementary class of models of Th(M)is exactly the class of L-structures elementarilyequivalent to MMore typically, we have a class of structures in mindand try to write a set of properties T describing thesestructures
We call these sentences axioms for the elementary class
COM SFWR 707:Formal
SpecificationTechniques
Dr. R. Khedri
Outline
Introduction
Basic Definitions
L-terms,Interpretation,L-formulas, andSatisfiability
Constructions
ElementaryEquivalence andIsomorphism
Theories
Logical Consequence
Structures and Theories Theories
Example (Infinite Sets)
Let L = ∅Consider the L-theory where we have, for each n, thesentence φn given by∃(x1 |: ∃(x2 |: · · · ∃(xn |:∧(i , j | i < j ≤ n : xi 6= xj ) ) ) · · · )
The sentence φn asserts that there are at least ndistinct elements
An L-structure M with universe M is a model of T ifand only if M is infinite
COM SFWR 707:Formal
SpecificationTechniques
Dr. R. Khedri
Outline
Introduction
Basic Definitions
L-terms,Interpretation,L-formulas, andSatisfiability
Constructions
ElementaryEquivalence andIsomorphism
Theories
Logical Consequence
Structures and Theories Theories
Example (Linear Orders)
Let L = {<} where < is a binary relation symbol
The class of linear orders is axiomatized by theL-sentences
1 ∀(x |: ¬(x < x) )2 ∀(x , y , z |: (x < y ∧ y < z) =⇒ x < z )3 ∀(x , y |: x < y ∨ x = y ∨ y < x )
To get the theory of dense linear orders, we could add:
∀(x , y | x < y : ∃(z |: x < z ∧ z < y ) )
To get the theory of linear orders where every elementhas a unique successor, we could add:
∀(x |: ∃(y |: x < y ∧ ∀(z | x < z : z = y ∨ y < z ) ) )
COM SFWR 707:Formal
SpecificationTechniques
Dr. R. Khedri
Outline
Introduction
Basic Definitions
L-terms,Interpretation,L-formulas, andSatisfiability
Constructions
ElementaryEquivalence andIsomorphism
Theories
Logical Consequence
Structures and Theories Theories
Example (Equivalence Relations)
Let L = {θ} where θ is a binary relation symbol
The theory of equivalence relations is given by thesentences
1 ∀(x |: (x , x) ∈ θ )2 ∀(x , y | (x , y) ∈ θ : (y , x) ∈ θ )3 ∀(x , y , z | (x , y) ∈ θ ∧ (y , z) ∈ θ : (x , z) ∈ θ )
To get the theory of equivalence relations where every
equivalence class has exactly two elements, we add
∀(x |: ∃
(y | x 6= y ∧ (x , y) ∈ θ
: ∀(z | (x , y) ∈ θ : z = x ∨ z = y )) )
COM SFWR 707:Formal
SpecificationTechniques
Dr. R. Khedri
Outline
Introduction
Basic Definitions
L-terms,Interpretation,L-formulas, andSatisfiability
Constructions
ElementaryEquivalence andIsomorphism
Theories
Logical Consequence
Structures and Theories Theories
Example (Graphs)
Let L = {R} where R is a binary relation symbol
The theory of irreflexive graphs is axiomatized by1 ∀(x |: (x , x) 6∈ R )2 ∀(x , y | (x , y) ∈ R : (y , x) ∈ R )
Example (Groups)
Let L = {·, e}The class of groups is axiomatized by
1 ∀(x |: e · x = x · e = x )2 ∀(x , y , z |: x · (y · z) = (x · y) · z )3 ∀(x |: ∃(y |: x · y = y · x = e ) )
COM SFWR 707:Formal
SpecificationTechniques
Dr. R. Khedri
Outline
Introduction
Basic Definitions
L-terms,Interpretation,L-formulas, andSatisfiability
Constructions
ElementaryEquivalence andIsomorphism
Theories
Logical Consequence
Structures and Theories Theories
Example (Ordered Abelian Groups)
Let L = {+, <, 0}The axioms for ordered groups are:
1 The axioms for additive groups
2 The axioms for linear orders
3 ∀(x , y , z | x < y : x + z < y + z )
The literature is full of theories given by their axioms: Rings,Semi-modules, Modules, Fields, Peano Arithmetic, etc.
COM SFWR 707:Formal
SpecificationTechniques
Dr. R. Khedri
Outline
Introduction
Basic Definitions
L-terms,Interpretation,L-formulas, andSatisfiability
Constructions
ElementaryEquivalence andIsomorphism
Theories
Logical Consequence
Structures and Theories Theories LogicalConsequence
Definition (Logical Consequence)
Let T be an L-theory and φ an L-sentence. We say that φis a logical consequence of T and write T |= φ if M |= φwhenever M |= T .
Example
Let L = {+, <, 0} and let T be the theory of OrderedAbelian Groups
∀(x | x 6= 0 : x + x 6= 0 ) is a logical consequence ofT
To show that T |= φ1 we find a model of T (i.e., M |= T )2 we show that M |= φ
To show that T 6|= φwe usually construct a couterexample
COM SFWR 707:Formal
SpecificationTechniques
Dr. R. Khedri
Outline
Introduction
Basic Definitions
L-terms,Interpretation,L-formulas, andSatisfiability
Constructions
ElementaryEquivalence andIsomorphism
Theories
Logical Consequence