Parikh’s theorem

Parikh’s theorem

Let

Σ

be an

alphabet

. Fix an order on elements of

Σ

, so that they are

a

1

,

…

,

a

n

. For each word

w

over

Σ

, we can form an

n

-tuple

(

w

1

,

…

,

w

n

)

so that each

w

i

is the number of

occurrences

of

a

i

in

w

. The

function

Ψ

:

Σ

*

→

ℕ

n

such that

Ψ

⁢

(

w

)

=

(

w

1

,

…

,

w

n

)

is called the

Parikh mapping

(over the alphabet

Σ

). Here,

ℕ

is the set of non-negative integers.

Two

languages

L

1

and

L

2

over some

Σ

are called

letter-equivalent

if

Ψ

⁢

(

L

1

)

=

Ψ

⁢

(

L

2

)

.

For example,

L

1

:=

{

a

n

⁢

b

n

∣

n

≥

0

}

is letter-equivalent to the

L

2

:=

{

(

a

⁢

b

)

n

∣

n

≥

0

}

, as both are mapped to the set

{

(

n

,

n

)

∣

n

≥

0

}

by

Ψ

. Note that

L

1

is

context-free

, while

L

2

is

regular

. In fact, we have the following:

Theorem 1

(Parikh).

Every context-free language is letter-equivalent to a

regular language

.

Like the

pumping lemma

, Parikh’s

theorem

can be used to show that certain languages are not context-free. But in order to apply Parikh’s theorem above, one needs to know more about the

structure

of the set

Ψ

⁢

(

L

)

for a given context-free language

L

.

First, note that

ℕ

n

is a

commutative monoid

under

addition

. For any

element

x

and subset

S

of

ℕ

n

, define

x

+

S

in the obvious manner. Next, let

x

1

,

…

,

x

m

be elements of

ℕ

n

. Denote

⟨

x

1

,

…

,

x

m

⟩

the

submonoid

generated by

x

1

,

…

,

x

m

.

A subset

S

of

ℕ

n

is said to be

linear

if it has the form

x

0

+

⟨

x

1

,

…

,

x

m

⟩

,

for some

x

0

,

…

,

x

m

∈

ℕ

n

. It is not hard to see that every linear set is the image of some regular language under

Ψ

. For example,

(

1

,

0

,

0

)

+

⟨

(

2

,

1

,

0

)

,

(

0

,

3

,

2

)

⟩

=

Ψ

⁢

(

{

a

⁢

(

a

2

⁢

b

)

m

⁢

(

b

3

⁢

c

2

)

n

∣

m

,

n

≥

0

}

)

.

The example can be easily generalized.

A subset of

ℕ

n

is said to be

semilinear

if it is the union of finitely many linear sets. Since regular languages are

closed under

union, every semilinear set is the image of a regular language under

Ψ

. As a result, Parikh’s theorem can be restated as

Theorem 2

(Theorem 1 restated).

If

L

is context-free, then

Ψ

⁢

(

L

)

is semilinear.

Using this theorem, one easily sees that the language

{

a

p

∣

p

⁢

is a prime number

}

is not context-free, and neither is the language

{

a

m

⁢

b

n

∣

either

⁢

m

⁢

is prime, and

⁢

n

≥

m

,

or

⁢

n

⁢

is prime, and

⁢

m

≥

n

}

,

which can not be proved by the pumping lemma in a straightforward manner.

Remarks

.

•

The

converse

of Theorem 2 above is false. For example, let

L

=

{

a

n

⁢

b

n

⁢

c

n

∣

n

≥

0

}

. Then

L

is not context-free by the pumping lemma. However,

Ψ

⁢

(

L

)

=

⟨

(

1

,

1

,

1

)

⟩

, which is clearly linear.

•

In the literature, a lanugage

L

such that

Ψ

⁢

(

L

)

is semilinear is often called a

slip-language

. It can be shown that for a slip-language

L

over an alphabet consisting of two symbols, the language

Ψ

-

1

∘

Ψ

⁢

(

L

)

is context-free.

References

1

H.R. Lewis, C.H. Papadimitriou,

Elements of the Theory of Computation

. Prentice-Hall, Englewood Cliffs, New Jersey (1981).

2

D. C. Kozen,

Automata

and Computability

, Springer, New York (1997).

3

R.J. Parikh,

On Context-Free Languages, Journal of the Association for Computing Machinery, 4

(1966), 570-581.

4

M. Latteux,

Cônes rationnels commutatifs

, J. Comput. Systems Sci. 18 (1979), 307-333.

Title

Parikh’s theorem

Canonical name

ParikhsTheorem

Date of creation

2013-03-22 18:55:49

Last modified on

2013-03-22 18:55:49

Owner

CWoo (3771)

Last modified by

CWoo (3771)

Numerical id

9

Author

CWoo (3771)

Entry type

Theorem

Classification

msc 68Q42

Classification

msc 68Q45

Defines

Parikh mapping

Defines

linear set

Defines

semilinear set

Defines

letter-equivalent

Defines

slip-language

Generated on Sat Feb 10 12:44:28 2018 by

LaTeXML