Cancellation of Direct Products Given a finite group $G$ and its subgroups $H,K$ such that $$G \times H \cong G \times K$$ does it imply that $H=K$.
Clearly, one can see that this doesn't work out for all subgroups. Is there any condition by which this can remain true.
 A: Here's an entry point into the literature, from the introduction to Lam's paper [1]:
In the study of any algebraic system in which there is a notion of a direct sum, the  theme of cancellation arises very naturally: if $A \oplus B \cong A\oplus C$ in the given system, can we conclude that $B \cong  C$? (For an early treatment of this problem, see the work of Jonsson  and Tarski [JT] in 1947.) The answer is, perhaps not surprisingly, sometimes "yes" and  sometimes "no": it all depends on the algebraic system, and it depends heavily on the  choice of A as well.
Starting with a simple example, we all know that, by the Fundamental Theorem of  Abelian Groups, the category of finitely generated abelian groups satisfies cancellation.  But a little more is true, which solved what would have been the "Third Test Problem"  for §6 in Kaplansky's book [Ka 1] (see the Notes in [Ka_1:§20]): if A is a f.g. (finitely  generated) abelian group, then for any abelian groups $B$ and $C$, $A\oplus B \cong  A\oplus C$ still implies $B \cong C$. Thus, f.g. abelian groups A remain "cancellable" (with respect  to direct sums) in the category of all abelian groups. This takes a proof, which was  first given, independently, by P. M.Cohn [Co] and E. A. Walker [W]. And yet, there exist  many torsionfree abelian groups of rank 1 (that is, nonzero subgroups of the rational  numbers Q ) that are not cancellable in the category of torsionfree abelian groups of  finite rank, according to B. Jonsson [Jo].
[1] T.Y. Lam. A Crash Course on Stable Range, Cancellation, Substitution, and Exchange
University of California, Berkeley, Ca 94720
http://math.berkeley.edu/~lam/ohio.ps
A: Concerning Steve D's interpretation of the question, here is a partial answer.
Consider the following property (P) of a group: for any two subgroups $H$ and $K$ of $G$, if $H \cong K$, then $H = K$.
Claim: For a finite group $G$, the following are equivalent:
(i) $G$ has property (P).
(ii) $G$ is cyclic.
Cyclic groups are characterized among finite groups by having at most one subgroup of any given order, so certainly (ii) $\implies$ (i).
Conversely, assume $G$ has property (P).  Then it is a Dedekind group: all of its subgroups are normal (for otherwise it has two subgroups which are conjugate -- hence isomorphic -- but unequal).
Case 1: $G$ is abelian, of exponent $N$.  Then $G$ is isomorphic to $C_N \times G'$ for some subgroup $G'$ (this is a step in the classification of finite abelian groups; it also follows easily from the theorem).  If $G'$ is not cyclic, then $G'$ is not trivial hence contains an element of order $p | N$ and thus over all $G$ contains at least two subgroups of order $p$.
Case 2: $G$ is a nonabelian Dedekind group, i.e., a Hamiltonian group.  As Dedekind showed, a Hamiltonian group (finite or otherwise!) must contain a subgroup isomorphic to the quaternion group $Q_8$.  But $Q_8$ contains three cyclic subgroups of order $4$, namely those generated by the elements $i$, $j$ and $k$.
There are some noncyclic infinite abelian groups with property (P), e.g. $\mathbb{Q}/\mathbb{Z}$, but probably one can classify them as well: I haven't thought much about it.
A: Yes.  This is an easy consequence of the Krull-Schmidt theorem:
https://planetmath.org/krullschmidttheorem
Edit: To be clear, what I am claiming is that if one has finite groups $H,K,G$ such that $G \times H \cong G \times K$, then $H \cong K$.  As Steve D points out below, the hypothesis and conclusion of the OP's literal question are a bit different than this.  But because of the Krull-Schmidt theorem, the OP's literal question becomes: let $H$ and $K$ be isomorphic subgroups of a finite group $G$.  When do we have $H = K$?  It is quite clear that the answer is "not always", and I find implausible that there would be a clean necessary and sufficient condition for this.  But let's see what transpires...
