Elements in Same Coset iff Product with Inverse in Subgroup

Theorem
Let $G$ be a group and let $H$ be a subgroup of $G$.

Let $x, y \in G$.

Then:
 * $(1): \quad x, y$ are in the same left coset of $H$ iff $x^{-1} y \in H$
 * $(2): \quad x, y$ are in the same right coset of $H$ iff $x y^{-1} \in H$.

Proof
Let:
 * $x H$ denote the left coset of $H$ by $x$
 * $H x$ denote the right coset of $H$ by $x$

First we note that, from Congruence Class Modulo Subgroup is Coset, we have that the left cosets of $G$ form a partition of $G$.

Similarly, from Congruence Class Modulo Subgroup is Coset, we have that the right cosets of $G$ also form a partition of $G$.

Sufficient Condition
Suppose $x, y$ are in the same left coset of $H$.

It follows from Congruence Class Modulo Subgroup is Coset that:
 * $x \in y H$ and $y \in x H$ iff $x H = y H$
 * if $x \in H y$ and $y \in H x$ iff $H x = H y$

From Equal Cosets iff Product with Inverse in Coset, we have that:
 * $x H = y H \iff x^{-1} y \in H$
 * $H x = H y \iff x y^{-1} \in H$

So:
 * if $x, y$ are in the same left coset of $H$ then $x^{-1} y \in H$
 * if $x, y$ are in the same right coset of $H$ then $x y^{-1} \in H$.

Necessary Condition
Suppose that $x y^{-1} \in H$.

From Equal Cosets iff Product with Inverse in Coset, we have that:
 * $x H = y H \iff x^{-1} y \in H$

Again, it follows from Congruence Class Modulo Subgroup is Coset that:
 * $x \in y H$ and $y \in x H$ iff $x H = y H$

and so:
 * $x, y$ are in the same left coset of $H$

Now suppose that $x^{-1} y \in H$.

From Equal Cosets iff Product with Inverse in Coset, we have that:
 * $H x = H y \iff x y^{-1} \in H$

Again, it follows from Congruence Class Modulo Subgroup is Coset that:
 * $x \in H y$ and $y \in H x$ iff $H x = H y$

and so:
 * $x, y$ are in the same left coset of $H$

Hence the results:
 * $x, y$ are in the same left coset of $H$ if $x^{-1} y \in H$
 * $x, y$ are in the same right coset of $H$ if $x y^{-1} \in H$

Thus we have implication two ways, and the proof is complete.