Open In App

Semantic difference between Set and Type

Introduction :
Etymologically a set is a collection of distinct elements that may have something particular in common and type means-“of a particular kind”.

These two terms are vital in terms of mathematics as they give rise to set theory and type theory. This article provides semantic difference between set and type in terms of mathematics.



1. SET :
Overview of set –

Set theory

Ideology –



Features of set –

Applications of set – 

Example – 
N is a set of all natural numbers such that N={1,2,3,4,..} .Z is a set of all integers such that Z={-3,-2,-1,0,1,2,3,..}. A set B={true, false} is a set of Boolean values.

2. TYPE :

Type theory 

Overview of type –

Ideology –

Features of type –

Applications of type –

Examples –
If 3 is of type nat, then there exists a term of type I nat 3 3. 3+(7∗8)5   is also of type Nat. (In sets this can be represented by expressions 3∈{n∈N∣∀x,y,z∈N+(xn+yn≠zn)} ). M:A in type theory is evaluated as M is a term of data type A.

Short  and basic examples

Conclusion –
Though sets and types are different yet they are  distinctly related. Each type gives rise to a set of entities of that type. In fact roots of type theory lie in set theory. Sets can also be regarded as type if considered in an extension. Different types may give rise to the same set.

Article Tags :