reserve G,G1,G2 for _Graph;
reserve e,x,y for set;
reserve v,v1,v2 for Vertex of G;
reserve W for Walk of G;

theorem
  G.edgesBetween(G.reachableFrom(v)) = G.edgesInOut(G.reachableFrom(v))
proof
  set R = G.reachableFrom(v);
  now
    let x be object;
    set Sx = (the_Source_of G).x, Tx = (the_Target_of G).x;
    assume
A1: x in G.edgesInOut(R);
    then reconsider Sx, Tx as Vertex of G by FUNCT_2:5;
    now
      per cases by A1,GLIB_000:28;
      suppose
A2:     Sx in R;
        then consider W being Walk of G such that
A3:     W is_Walk_from v,Sx by Def5;
        now
          W.last() = Sx by A3,GLIB_001:def 23;
          then
A4:       x Joins W.last(), Tx,G by A1,GLIB_000:def 13;
          assume
A5:       not Tx in R;
          W.first() = v by A3,GLIB_001:def 23;
          then W.addEdge(x) is_Walk_from v, Tx by A4,GLIB_001:63;
          hence contradiction by A5,Def5;
        end;
        then
A6:     x in G.edgesInto(R) by A1,GLIB_000:def 26;
        x in G.edgesOutOf(R) by A1,A2,GLIB_000:def 27;
        then x in G.edgesInto(R) /\ G.edgesOutOf(R) by A6,XBOOLE_0:def 4;
        hence x in G.edgesBetween(R) by GLIB_000:def 29;
      end;
      suppose
A7:     Tx in R;
        then consider W being Walk of G such that
A8:     W is_Walk_from v,Tx by Def5;
        now
          W.last() = Tx by A8,GLIB_001:def 23;
          then
A9:       x Joins W.last(), Sx,G by A1,GLIB_000:def 13;
          assume
A10:      not Sx in R;
          W.first() = v by A8,GLIB_001:def 23;
          then W.addEdge(x) is_Walk_from v, Sx by A9,GLIB_001:63;
          hence contradiction by A10,Def5;
        end;
        then
A11:    x in G.edgesOutOf(R) by A1,GLIB_000:def 27;
        x in G.edgesInto(R) by A1,A7,GLIB_000:def 26;
        then x in G.edgesInto(R) /\ G.edgesOutOf(R) by A11,XBOOLE_0:def 4;
        hence x in G.edgesBetween(R) by GLIB_000:def 29;
      end;
    end;
    hence x in G.edgesBetween(R);
  end;
  then G.edgesBetween(R) c= G.edgesInOut(R) & G.edgesInOut(R) c= G
  .edgesBetween(R) by GLIB_000:33;
  hence thesis by XBOOLE_0:def 10;
end;
