 reserve x for object;
 reserve G for non empty 1-sorted;
 reserve A for Subset of G;
 reserve y,y1,y2,Y,Z for set;
 reserve k for Nat;
 reserve G for Group;
 reserve a,g,h for Element of G;
 reserve A for Subset of G;
reserve G for non empty multMagma,
  A,B,C for Subset of G;
reserve a,b,g,g1,g2,h,h1,h2 for Element of G;
reserve G for Group-like non empty multMagma;
reserve h,g,g1,g2 for Element of G;
reserve A for Subset of G;
reserve H for Subgroup of G;
reserve h,h1,h2 for Element of H;
reserve G,G1,G2,G3 for Group;
reserve a,a1,a2,b,b1,b2,g,g1,g2 for Element of G;
reserve A,B for Subset of G;
reserve H,H1,H2,H3 for Subgroup of G;
reserve h,h1,h2 for Element of H;

theorem Th78:
  (carr H1 * carr H2 = carr H2 * carr H1 implies
  ex H being strict Subgroup of G st
  the carrier of H = carr H1 * carr H2) &
  ((ex H st the carrier of H = carr H1 * carr H2) implies
    carr H1 * carr H2 = carr H2 * carr H1)
proof
  thus carr(H1) * carr(H2) = carr(H2) * carr(H1) implies ex H being strict
  Subgroup of G st the carrier of H = carr(H1) * carr(H2)
  proof
    assume
A1: carr H1 * carr H2 = carr H2 * carr H1;
A2: now
      let g;
      assume
A3:   g in carr H1 * carr H2;
      then consider a,b such that
A4:   g = a * b and
      a in carr H1 and
      b in carr H2;
      consider b1,a1 such that
A5:   a * b = b1 * a1 and
A6:   b1 in carr H2 & a1 in carr H1 by A1,A3,A4;
A7:   a1" in carr H1 & b1" in carr H2 by A6,Th75;
      g" = a1" * b1" by A4,A5,GROUP_1:17;
      hence g" in carr H1 * carr H2 by A7;
    end;
A8: now
      let g1,g2;
      assume that
A9:   g1 in carr(H1) * carr(H2) and
A10:  g2 in carr(H1) * carr(H2);
      consider a1,b1 such that
A11:  g1 = a1 * b1 and
A12:  a1 in carr(H1) and
A13:  b1 in carr(H2) by A9;
      consider a2,b2 such that
A14:  g2 = a2 * b2 and
A15:  a2 in carr H1 and
A16:  b2 in carr H2 by A10;
      b1 * a2 in carr H1 * carr H2 by A1,A13,A15;
      then consider a,b such that
A17:  b1 * a2 = a * b and
A18:  a in carr H1 and
A19:  b in carr H2;
A20:  b * b2 in carr H2 by A16,A19,Th74;
      g1 * g2 = a1 * b1 * a2 * b2 by A11,A14,GROUP_1:def 3
        .= a1 * (b1 * a2) * b2 by GROUP_1:def 3;
      then
A21:  g1 * g2 = a1 * a * b * b2 by A17,GROUP_1:def 3
        .= a1 * a * (b * b2) by GROUP_1:def 3;
      a1 * a in carr H1 by A12,A18,Th74;
      hence g1 * g2 in carr H1 * carr H2 by A21,A20;
    end;
    carr H1 * carr H2 <> {} by Th9;
    hence thesis by A8,A2,Th52;
  end;
  given H such that
A22: the carrier of H = carr H1 * carr H2;
  thus carr H1 * carr H2 c= carr H2 * carr H1
  proof
    let x be object;
    assume
A23: x in carr H1 * carr H2;
    then reconsider y = x as Element of G;
    y" in carr H by A22,A23,Th75;
    then consider a,b such that
A24: y" = a * b and
A25: a in carr H1 & b in carr H2 by A22;
A26: y = y"" .= b" * a" by A24,GROUP_1:17;
    a" in carr H1 & b" in carr H2 by A25,Th75;
    hence thesis by A26;
  end;
  let x be object;
  assume
A27: x in carr H2 * carr H1;
  then reconsider y = x as Element of G;
  consider a,b such that
A28: x = a * b & a in carr H2 and
A29: b in carr H1 by A27;
  now
A30: b" in carr H1 by A29,Th75;
    assume
A31: not y" in carr H;
    y" = b" * a" & a" in carr H2 by A28,Th75,GROUP_1:17;
    hence contradiction by A22,A31,A30;
  end;
  then y"" in carr H by Th75;
  hence thesis by A22;
end;
