symmetric difference on a finite number of sets

symmetric difference on a finite number of sets

Recall that the

symmetric difference

operation

on sets is

commutative

and

associative

. Therefore, one can speak of the symmetric difference of a finite

collection

of sets. More precisely, let

A

1

,

A

2

,

…

,

A

n

be sets, not necessarily pairwise distinct. The set

A

:=

n

Δ

i

=

1

⁢

A

i

,

the symmetric difference of the sets

A

i

, is

well-defined

.

Let

A

,

A

1

,

…

,

A

n

be defined as above. There is a curious

property

on

A

:

Proposition 1

.

x

∈

A

iff

x

belongs to an

odd number

of the sets

A

i

.

Before proving this fact, let us make some quick observations. If there are two sets

A

1

,

A

2

, then

A

=

A

1

⁢

Δ

⁢

A

2

=

(

A

1

∩

A

2

′

)

∪

(

A

1

′

∩

A

2

)

(here we are assuming that

A

1

and

A

2

are subsets of some

universe

U

, so the the

complement

makes sense). So

x

∈

A

iff

x

∈

A

1

∩

A

2

′

or

x

∈

A

1

′

∩

A

2

iff

x

∈

A

1

or

x

∈

A

2

, which conforms with the statement of the

proposition

above. If

n

=

3

, then

A

has

conjunctive normal form

A

1

⁢

Δ

⁢

A

2

⁢

Δ

⁢

A

3

=

(

A

1

∩

A

2

∩

A

3

)

∪

(

A

1

∩

A

2

′

∩

A

3

′

)

∪

(

A

1

′

∩

A

2

∩

A

3

′

)

∪

(

A

1

′

∩

A

2

′

∩

A

3

)

,

(for a proof of this, see here (

http://planetmath.org/ProofOfTheAssociativityOfTheSymmetricDifferenceOperator

)). Then

x

∈

A

iff

x

belongs any one of the four

intersections

in the CNF above. In each of the four cases,

x

belongs to an odd number of sets. For example, if

x

∈

A

1

∩

A

2

′

∩

A

3

′

, then

x

∈

A

1

.

From the two examples above, it seems that the approach to proving the proposition is to express the symmetric difference in CNF, and this is indeed the case.

To facilitate with the proof, let us introduce some notations. Start with sets

A

1

,

…

,

A

n

, which are assumed to be subsets of some set

U

. Let

I

and

C

be the

identity

and

complementation

operations taking

A

⊆

U

to

A

and

A

′

respectively. Let

𝐧

be the set

{

1

,

…

,

n

}

. Let

F

n

be the set of all

functions

from

𝐧

into

{

I

,

C

}

. For every

f

∈

F

n

, we write

f

i

for

f

⁢

(

i

)

. Finally, we

partition

F

n

into two sets

E

n

and

O

n

, where

E

n

(

O

n

) consists of all functions

f

such that

|

f

-

1

⁢

(

I

)

|

is even (odd), respectively.

The proposition can now be restated as a single

equation

:

n

Δ

i

=

1

⁢

A

i

=

⋃

f

∈

O

n

⋂

i

=

1

n

f

i

⁢

(

A

i

)

Proof.

We prove this equation by

induction

on

n

, for

n

≥

2

. The case when

n

=

2

is already discussed above. Now,

n

+

1

Δ

i

=

1

⁢

A

i

=

(

n

Δ

i

=

1

⁢

A

i

)

⁢

Δ

⁢

A

n

+

1

=

X

∪

Y

,

where

X

=

(

n

Δ

i

=

1

⁢

A

i

)

∩

A

n

+

1

′

and

Y

=

A

n

+

1

∩

(

n

Δ

i

=

1

⁢

A

i

)

′

.

By the

induction hypothesis

,

n

Δ

i

=

1

⁢

A

i

=

⋃

f

∈

O

n

⋂

i

=

1

n

f

i

⁢

(

A

i

)

,

so that

X

=

(

⋃

f

∈

O

n

⋂

i

=

1

n

f

i

⁢

(

A

i

)

)

∩

A

n

+

1

′

=

⋃

f

∈

O

n

⋂

i

=

1

n

+

1

f

^

i

⁢

(

A

i

)

,

where

f

^

:

(

𝐧

+

𝟏

)

→

{

I

,

C

}

is given by

f

^

i

=

f

i

if

i

∈

𝐧

, and

f

^

n

+

1

=

C

.

Now, for any

x

∈

U

,

x

is either in an even number of

A

i

’s, or an odd number of

A

i

’s. This means that

x

∈

⋃

f

∈

E

n

⋂

i

=

1

n

f

i

⁢

(

A

i

)

or

x

∈

⋃

f

∈

O

n

⋂

i

=

1

n

f

i

⁢

(

A

i

)

and never both. This shows that

U

can be partitioned into the two sets above. In other words,

(

⋃

f

∈

O

n

⋂

i

=

1

n

f

i

⁢

(

A

i

)

)

′

=

⋃

f

∈

E

n

⋂

i

=

1

n

f

i

⁢

(

A

i

)

.

As a result,

Y

=

A

n

+

1

∩

(

⋃

f

∈

E

n

⋂

i

=

1

n

f

i

⁢

(

A

i

)

)

=

⋃

f

∈

E

n

⋂

i

=

1

n

+

1

f

¯

i

⁢

(

A

i

)

,

where

f

¯

:

(

𝐧

+

𝟏

)

→

{

I

,

C

}

is given by

f

¯

i

=

f

i

if

i

∈

𝐧

, and

f

^

n

+

1

=

I

.

Every function

g

∈

O

n

+

1

can be obtained from a function in

f

∈

F

n

so that

g

i

=

f

i

for

i

∈

𝐧

. If

f

∈

O

n

, then

g

n

+

1

=

C

, and if

f

∈

E

n

, then

g

n

+

1

=

I

. This means that

O

n

+

1

can be partitioned into two sets

O

and

E

, where

O

(or

E

) contains all functions whose

restriction

to

𝐧

are in

O

n

(or

E

n

).

Therefore,

⋃

g

∈

O

n

+

1

⋂

i

=

1

n

+

1

g

i

⁢

(

A

i

)

=

(

⋃

g

∈

O

⋂

i

=

1

n

+

1

g

i

⁢

(

A

i

)

)

∪

(

⋃

g

∈

E

⋂

i

=

1

n

+

1

g

i

⁢

(

A

i

)

)

=

(

⋃

f

∈

O

n

⋂

i

=

1

n

+

1

f

^

i

⁢

(

A

i

)

)

∪

(

⋃

f

∈

E

n

⋂

i

=

1

n

+

1

f

¯

i

⁢

(

A

i

)

)

=

X

∪

Y

=

n

+

1

Δ

i

=

1

⁢

A

i

.

∎

Title

symmetric difference on a finite number of sets

Canonical

name

SymmetricDifferenceOnAFiniteNumberOfSets

Date of creation

2013-03-22 18:02:24

Last modified on

2013-03-22 18:02:24

Owner

CWoo (3771)

Last modified by

CWoo (3771)

Numerical id

8

Author

CWoo (3771)

Entry type

Derivation

Classification

msc 03E20

Generated on Thu Feb 8 20:15:38 2018 by

LaTeXML