In this article, semiring and semialgebra of sets are formalized so as to construct a measure of a given set in the next step. Although a semiring of sets has already been formalized in , that is, strictly speaking, a definition of a quasi semiring of sets suggested in the last few decades . We adopt a classical definition of a semiring of sets here to avoid such a confusion. Ring of sets and algebra of sets have been formalized as non empty preboolean set  and field of subsets , respectively. In the second section, definitions of a ring and a σ-ring of sets, which are based on a semiring and a ring of sets respectively, are formalized and their related theorems are proved. In the third section, definitions of an algebra and a σ-algebra of sets, which are based on a semialgebra and an algebra of sets respectively, are formalized and their related theorems are proved. In the last section, mutual relationships between σ-ring and σ-algebra of sets are formalized and some related examples are given. The formalization is based on , and also referred to  and .