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 Th39:
  for G being _Graph, v being Vertex of G holds v.edgesIn() = G
  .edgesDBetween(the_Vertices_of G, {v}) & v.edgesOut() = G.edgesDBetween({v},
  the_Vertices_of G)
proof
  let G be _Graph, v be Vertex of G;
  now
    let e be object;
    hereby
      assume
A1:   e in v.edgesIn();
      then (the_Target_of G).e = v by Lm7;
      then
A2:   (the_Target_of G).e in {v} by TARSKI:def 1;
      (the_Source_of G).e in the_Vertices_of G by A1,FUNCT_2:5;
      then e DSJoins the_Vertices_of G,{v},G by A1,A2;
      hence e in G.edgesDBetween(the_Vertices_of G, {v}) by Def31;
    end;
    assume
A3: e in G.edgesDBetween(the_Vertices_of G, {v});
    then e DSJoins the_Vertices_of G, {v}, G by Def31;
    then (the_Target_of G).e = v by TARSKI:def 1;
    hence e in v.edgesIn() by A3,Lm7;
  end;
  hence v.edgesIn() = G.edgesDBetween(the_Vertices_of G, {v}) by TARSKI:2;
  now
    let e be object;
    hereby
      assume
A4:   e in v.edgesOut();
      then (the_Source_of G).e = v by Lm8;
      then
A5:   (the_Source_of G).e in {v} by TARSKI:def 1;
      (the_Target_of G).e in the_Vertices_of G by A4,FUNCT_2:5;
      then e DSJoins {v},the_Vertices_of G,G by A4,A5;
      hence e in G.edgesDBetween({v},the_Vertices_of G) by Def31;
    end;
    assume
A6: e in G.edgesDBetween({v},the_Vertices_of G);
    then e DSJoins {v},the_Vertices_of G, G by Def31;
    then (the_Source_of G).e = v by TARSKI:def 1;
    hence e in v.edgesOut() by A6,Lm8;
  end;
  hence thesis by TARSKI:2;
end;
