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
  for G being _Graph, X, Y being set holds G.edgesDBetween(X,Y)
    = union {v.edgesOut() /\ w.edgesIn()
      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.edgesOut() /\ w.edgesIn()
    where v, w is Vertex of G : v in X & w in Y};
  now
    let e be object;
    hereby
      assume e in G.edgesDBetween(X,Y);
      then e DSJoins X,Y,G by Def31;
      then A1: e in the_Edges_of G & (the_Source_of G).e in X &
        (the_Target_of G).e in Y;
      then A2: e DJoins (the_Source_of G).e, (the_Target_of G).e, G;
      then 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 DJoins v,w,G & e is set by A2;
      then e in v.edgesOut() & e in w.edgesIn() by Th57, Th59;
      then A3: e in v.edgesOut() /\ w.edgesIn() by XBOOLE_0:def 4;
      v.edgesOut() /\ w.edgesIn() in S by A1;
      hence e in union S by A3, TARSKI:def 4;
    end;
    assume e in union S;
    then consider E being set such that
      A4: e in E & E in S by TARSKI:def 4;
    consider v,w being Vertex of G such that
      A5: E = v.edgesOut() /\ w.edgesIn() & v in X & w in Y by A4;
    e in v.edgesOut() & e in w.edgesIn() by A4, A5, XBOOLE_0:def 4;
    then e in the_Edges_of G & (the_Source_of G).e = v &
      (the_Target_of G).e = w by Lm7, Lm8;
    then e DJoins v,w,G;
    then e DSJoins X,Y,G by A5;
    hence e in G.edgesDBetween(X,Y) by Def31;
  end;
  hence thesis by TARSKI:2;
end;
