reserve GS for GraphStruct;
reserve G,G1,G2,G3 for _Graph;
reserve e,x,x1,x2,y,y1,y2,E,V,X,Y for set;
reserve n,n1,n2 for Nat;
reserve v,v1,v2 for Vertex of G;

theorem Th162:
  for G being _Graph, X, Y being set holds G.edgesBetween(X,Y)
    c= union {v.edgesInOut() /\ w.edgesInOut()
      where v, w is Vertex of G : v in X & w in Y}
proof
  let G be _Graph, X,Y be set;
  set S = {v.edgesInOut() /\ w.edgesInOut()
    where v, w is Vertex of G : v in X & w in Y};
  now
    let e be object;
    assume e in G.edgesBetween(X,Y);
    then e SJoins X,Y,G by Def30;
    then A1: e in the_Edges_of G & ((the_Source_of G).e in X &
      (the_Target_of G).e in Y or (the_Source_of G).e in Y &
      (the_Target_of G).e in X);
    then A2: e Joins (the_Source_of G).e, (the_Target_of G).e, G;
    then reconsider v = (the_Source_of G).e, w = (the_Target_of G).e
      as Vertex of G by FUNCT_2:5;
    e Joins v,w,G & e Joins w,v,G & e is set by A2;
    then e in v.edgesInOut() & e in w.edgesInOut() by Th64;
    then A3: e in v.edgesInOut() /\ w.edgesInOut() by XBOOLE_0:def 4;
    v.edgesInOut() /\ w.edgesInOut() in S by A1;
    hence e in union S by A3, TARSKI:def 4;
  end;
  hence thesis;
end;
