reserve S for non empty non void ManySortedSign,
  V for non-empty ManySortedSet of the carrier of S,
  A for non-empty MSAlgebra over S,
  X for non empty Subset of S-Terms V,
  t for Element of X;
reserve S for non empty non void ManySortedSign,
  A for non-empty finite-yielding MSAlgebra over S,
  V for Variables of A,
  X for SetWithCompoundTerm of S,V;
reserve G1, G2 for Circuit-like non void non empty ManySortedSign,
  f, g for Function,
  C1 for non-empty Circuit of G1,
  C2 for non-empty Circuit of G2;

theorem Th51:
  C1, C2 are_similar_wrt f, g implies
  for s1 being State of C1, s2 being State of C2
  holds s1 = s2*f iff s2 = s1*f"
proof
  assume that
A1: f, g form_embedding_of C1, C2 and
A2: f", g" form_embedding_of C2, C1;
A3: f is one-to-one by A1;
  let s1 be State of C1;
  let s2 be State of C2;
  f, g form_morphism_between G1, G2 by A1;
  then
A4: dom f = the carrier of G1;
A5: dom s1 = the carrier of G1 by CIRCUIT1:3;
A6: s1*f"*f = s1*(f"*f) by RELAT_1:36
    .= s1*id dom f by A3,FUNCT_1:39
    .= s1 by A4,A5,RELAT_1:52;
  f", g" form_morphism_between G2, G1 by A2;
  then
A7: dom (f") = the carrier of G2;
A8: dom s2 = the carrier of G2 by CIRCUIT1:3;
  s2*f*(f") = s2*(f*(f")) by RELAT_1:36
    .= s2*((f" ")*(f")) by A3,FUNCT_1:43
    .= s2*id dom (f") by A3,FUNCT_1:39;
  hence thesis by A6,A7,A8,RELAT_1:52;
end;
