
theorem Th114:
  for G2, H being _Graph, F being PGraphMapping of G2, H
  st F is directed weak_SG-embedding
  ex G1 being Supergraph of G2 st G1 is H-Disomorphic
proof
  :: The basic idea is to replace the vertices of edges
  :: in H that correspond to G2 by the actual vertices and edges of G2.
  :: However, H could contain actual vertices and edges of G2 in other places,
  :: so we have to relabel the vertices and edges of H, too.
  let G2, H be _Graph, F be PGraphMapping of G2, H;
  assume A1: F is directed weak_SG-embedding;
  then reconsider F as one-to-one PGraphMapping of G2, H;
  :: construct the vertex map
  set c = the_Vertices_of H --> the_Vertices_of G2;
  set V = <: c, id the_Vertices_of H :> +* F_V";
  A2: dom <: c, id the_Vertices_of H :>
     = dom c /\ dom id the_Vertices_of H by FUNCT_3:def 7
    .= (the_Vertices_of H) /\ the_Vertices_of H;
  dom(F_V") = rng F_V by FUNCT_1:33;
  then A3: dom(F_V") c= the_Vertices_of H;
  A4: dom V = (the_Vertices_of H) \/ dom(F_V") by A2, FUNCT_4:def 1
    .= the_Vertices_of H by A3, XBOOLE_1:12;
  then reconsider V as ManySortedSet of the_Vertices_of H
    by RELAT_1:def 18, PARTFUN1:def 2;
  A5: V is non empty by A4;
  A6: rng(<: c, id the_Vertices_of H :>) /\ rng(F_V") = {}
  proof
    assume A7: rng(<: c, id the_Vertices_of H :>) /\ rng(F_V") <> {};
    set y = the Element of rng(<: c, id the_Vertices_of H :>) /\ rng(F_V");
    reconsider Y = y as set;
    A8: y in rng(<: c, id the_Vertices_of H :>) & y in rng(F_V")
      by A7, XBOOLE_0:def 4;
    then consider x being object such that
      A9: x in dom <: c, id the_Vertices_of H :> and
      A10: <: c, id the_Vertices_of H :>.x = y by FUNCT_1:def 3;
    A11: y = [c.x,(id the_Vertices_of H).x] by A9, A10, FUNCT_3:def 7
      .= [c.x,x] by A9, FUNCT_1:18
      .= [the_Vertices_of G2,x] by A9, FUNCOP_1:7;
    y in dom F_V by A8, FUNCT_1:33;
    then A12: y in the_Vertices_of G2;
    A13: the_Vertices_of G2 in {the_Vertices_of G2} by TARSKI:def 1;
    {the_Vertices_of G2} in {{the_Vertices_of G2,x},{the_Vertices_of G2}}
      by TARSKI:def 2;
    then {the_Vertices_of G2} in Y by A11, TARSKI:def 5;
    hence contradiction by A12, A13, XREGULAR:7;
  end;
  reconsider V as non empty one-to-one ManySortedSet of the_Vertices_of H
    by A5, A6, FUNCT_4:92, XBOOLE_0:def 7;
  :: construct the edge map
  set d = the_Edges_of H --> the_Edges_of G2;
  set E = <: d, id the_Edges_of H :> +* F_E";
  A14: dom <: d, id the_Edges_of H :>
     = dom d /\ dom id the_Edges_of H by FUNCT_3:def 7
    .= (the_Edges_of H) /\ the_Edges_of H;
  dom(F_E") = rng F_E by FUNCT_1:33;
  then A15: dom(F_E") c= the_Edges_of H;
  dom E = (the_Edges_of H) \/ dom(F_E") by A14, FUNCT_4:def 1
    .= the_Edges_of H by A15, XBOOLE_1:12;
  then reconsider E as ManySortedSet of the_Edges_of H
    by RELAT_1:def 18, PARTFUN1:def 2;
  A16: rng(<: d, id the_Edges_of H :>) /\ rng(F_E") = {}
  proof
    assume A17: rng(<: d, id the_Edges_of H :>) /\ rng(F_E") <> {};
    set y = the Element of rng(<: d, id the_Edges_of H :>) /\ rng(F_E");
    reconsider Y = y as set;
    A18: y in rng(<: d, id the_Edges_of H :>) & y in rng(F_E")
      by A17, XBOOLE_0:def 4;
    then consider x being object such that
      A19: x in dom <: d, id the_Edges_of H :> and
      A20: <: d, id the_Edges_of H :>.x = y by FUNCT_1:def 3;
    A21: x in the_Edges_of H by A14, A19;
    A22: y = [d.x,(id the_Edges_of H).x] by A19, A20, FUNCT_3:def 7
      .= [d.x,x] by A21, FUNCT_1:18
      .= [the_Edges_of G2,x] by A21, FUNCOP_1:7;
    A23: y in dom F_E by A18, FUNCT_1:33;
    A24: the_Edges_of G2 in {the_Edges_of G2} by TARSKI:def 1;
    {the_Edges_of G2} in {{the_Edges_of G2,x},{the_Edges_of G2}}
      by TARSKI:def 2;
    then {the_Edges_of G2} in Y by A22, TARSKI:def 5;
    hence contradiction by A23, A24, XREGULAR:7;
  end;
  reconsider E as one-to-one ManySortedSet of the_Edges_of H
    by A16, FUNCT_4:92, XBOOLE_0:def 7;
  :: show that the graph with vertices and edges replaced is a supergraph of G2
  set G1 = replaceVerticesEdges(V,E);
  now
    the_Vertices_of G2 = dom(F_V) by A1, GLIB_010:def 11
      .= rng(F_V") by FUNCT_1:33;
    then the_Vertices_of G2 c= rng V by FUNCT_4:18;
    hence the_Vertices_of G2 c= the_Vertices_of G1 by Th1;
    the_Edges_of G2 = dom(F_E) by A1, GLIB_010:def 11
      .= rng(F_E") by FUNCT_1:33;
    then the_Edges_of G2 c= rng E by FUNCT_4:18;
    hence the_Edges_of G2 c= the_Edges_of G1 by Th1;
    let e be set;
    assume A25: e in the_Edges_of G2;
    then A26: e in dom the_Source_of G2 by FUNCT_2:def 1;
    A27: e in dom the_Target_of G2 by A25, FUNCT_2:def 1;
    A28: e in dom(F_E) by A1, A25, GLIB_010:def 11;
    then A29: e in rng(F_E") by FUNCT_1:33;
    then e in rng E by TARSKI:def 3, FUNCT_4:18;
    then A30: e in dom(E") by FUNCT_1:33;
    A31: dom F_V = dom id rng(F_V") by FUNCT_1:33;
    A32: (the_Source_of G2).e in dom id rng(F_V") by A28, A31, GLIB_010:5;
    A33: (the_Target_of G2).e in dom id rng(F_V") by A28, A31, GLIB_010:5;
    thus (the_Source_of G2).e
       = (id rng(F_V")).((the_Source_of G2).e) by A32, FUNCT_1:18
      .= (V*F_V"").((the_Source_of G2).e) by GLIBPRE1:9
      .= (V*F_V""*(the_Source_of G2)).e by A26, FUNCT_1:13
      .= (V*F_V*(the_Source_of G2)).e by FUNCT_1:43
      .= (V*(F_V*((the_Source_of G2)|the_Edges_of G2))).e by RELAT_1:36
      .= (V*(F_V*((the_Source_of G2)|dom F_E))).e by A1, GLIB_010:def 11
      .= (V*((the_Source_of H)*F_E)).e by A1, GLIB_010:14
      .= ((V*the_Source_of H)*F_E).e by RELAT_1:36
      .= (V*the_Source_of H).(F_E.e) by A28, FUNCT_1:13
      .= (V*the_Source_of H).((F_E")".e) by FUNCT_1:43
      .= (V*the_Source_of H).((E"|rng(F_E")).e) by GLIBPRE1:7
      .= (V*the_Source_of H).(E".e) by A29, FUNCT_1:49
      .= (V*(the_Source_of H)*(E")).e by A30, FUNCT_1:13
      .= (the_Source_of G1).e by Th1;
    thus (the_Target_of G2).e
       = (id rng(F_V")).((the_Target_of G2).e) by A33, FUNCT_1:18
      .= (V*F_V"").((the_Target_of G2).e) by GLIBPRE1:9
      .= (V*F_V""*(the_Target_of G2)).e by A27, FUNCT_1:13
      .= (V*F_V*(the_Target_of G2)).e by FUNCT_1:43
      .= (V*(F_V*((the_Target_of G2)|the_Edges_of G2))).e by RELAT_1:36
      .= (V*(F_V*((the_Target_of G2)|dom F_E))).e by A1, GLIB_010:def 11
      .= (V*((the_Target_of H)*F_E)).e by A1, GLIB_010:14
      .= ((V*the_Target_of H)*F_E).e by RELAT_1:36
      .= (V*the_Target_of H).(F_E.e) by A28, FUNCT_1:13
      .= (V*the_Target_of H).((F_E")".e) by FUNCT_1:43
      .= (V*the_Target_of H).((E"|rng(F_E")).e) by GLIBPRE1:7
      .= (V*the_Target_of H).(E".e) by A29, FUNCT_1:49
      .= (V*(the_Target_of H)*(E")).e by A30, FUNCT_1:13
      .= (the_Target_of G1).e by Th1;
  end;
  then reconsider G1 as Supergraph of G2 by GLIB_006:def 9;
  take G1;
  thus thesis by Th17;
end;
