If G is a group, H is a subgroup and a be any element in G then the set

\left\{  {ha:h \in H} \right\}

is called the right coset generated by a and H is denoted by Ha.
Similarly, the set

\left\{  {ah:h \in H} \right\}

is called left coset generated by a and H is denoted by aH.
Since eH = He = H, we see that H itself is a right as well as left coset. Moreover, since e \in H, it is evident that a \in aH.
If the group operation is addition, we define the right coset of H in G by

H +  a = \left\{ {h + a:h \in H} \right\}

Similarly, left coset of H in G is defined by

a +  H = \left\{ {a + h:h \in H} \right\}

It must be noticed that cosets are not necessarily subgroups of G. They are only special types of complexes which sometimes called residue classes modulo subgroup.
In general aH \ne Ha. In case of an abelian group each right coset coincides with the corresponding left coset.

Example: Let G = \left\{ {a,{a^2},{a^3},{a^4} = 1}  \right\}, and o\left( G \right) = 4, H = \left\{ {1,{a^2}} \right\} is a group of G. Find all the cosets of H in G and prove that G is equal to union of all these cosets and also establish that any two cosets are either disjoint or identical.

Solution: We have

1  \cdot H = \left\{ {1,{a^2}} \right\} = H

a  \cdot H = \left\{ {a,{a^3}} \right\}

{a^2}  \cdot H = \left\{ {{a^2},{a^4}} \right\} = \left\{ {{a^2},1} \right\} = H

{a^3}  \cdot H = \left\{ {{a^3},{a^5}} \right\} = \left\{ {{a^3},a} \right\} = \left\{  {a,{a^3}} \right\} = a \cdot H

Thus there are only distinct cosets namely H and aH which is disjoint. Also H is identical with {a^2}H and aH is identical with {a^3}H.

\begin{gathered} H \cup aH = \left\{ {1,{a^2}} \right\} \cup \left\{  {a,{a^3}} \right\} \\ \,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\, =  \left\{ {1,a,{a^2},{a^3}} \right\} = G \\ \end{gathered}