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 being set holds G.edgesInOut(X)
    = union {v.edgesInOut() where v is Vertex of G : v in X}
proof
  let G be _Graph, X be set;
  set S = {v.edgesInOut() where v is Vertex of G : v in X};
  now
    let e be object;
    hereby
      assume e in G.edgesInOut(X);
      then A1: e in the_Edges_of G & ((the_Source_of G).e in X
        or (the_Target_of G).e in X) by Th28;
      then A2: e Joins (the_Source_of G).e,(the_Target_of G).e,G;
      per cases by A1;
      suppose A3: (the_Source_of G).e in X;
        reconsider v = (the_Source_of G).e as Vertex of G by A2, FUNCT_2:5;
        A4: e in v.edgesInOut() by A1, Th61;
        v.edgesInOut() in S by A3;
        hence e in union S by A4, TARSKI:def 4;
      end;
      suppose A5: (the_Target_of G).e in X;
        reconsider v = (the_Target_of G).e as Vertex of G by A2, FUNCT_2:5;
        A6: e in v.edgesInOut() by A1, Th61;
        v.edgesInOut() in S by A5;
        hence e in union S by A6, TARSKI:def 4;
      end;
    end;
    assume e in union S;
    then consider E being set such that
      A7: e in E & E in S by TARSKI:def 4;
    consider v being Vertex of G such that
      A8: E = v.edgesInOut() & v in X by A7;
    e in the_Edges_of G & ((the_Source_of G).e = v or
      (the_Target_of G).e = v) by A7, A8, Th61;
    hence e in G.edgesInOut(X) by A8, Th28;
  end;
  hence thesis by TARSKI:2;
end;
