
theorem
  for G1 being _Graph, E being Subset of the_Edges_of G1
  for G2 being reverseEdgeDirections of G1, E
  holds G1 tolerates G2 iff E c= G1.loops()
proof
  let G1 be _Graph, E be Subset of the_Edges_of G1;
  let G2 be reverseEdgeDirections of G1, E;
  hereby
    assume A1: G1 tolerates G2;
    assume not E c= G1.loops();
    then E \ G1.loops() <> {} by XBOOLE_1:37;
    then consider e being object such that
      A2: e in E \ G1.loops() by XBOOLE_0:def 1;
    set v = (the_Source_of G1).e, w = (the_Target_of G1).e;
    A3: e in E by A2, XBOOLE_0:def 5;
    then A4: e DJoins v,w,G1 by GLIB_000:def 14;
    then e DJoins w,v,G2 by A3, GLIB_007:7;
    then v = w by A1, A4, Th17;
    then e in G1.loops() by A4, GLIB_009:45;
    hence contradiction by A2, XBOOLE_0:def 5;
  end;
  assume A5: E c= G1.loops();
  now
    let e,v1,w1,v2,w2 be object;
    assume A6: e DJoins v1,w1,G1 & e DJoins v2,w2,G2;
    per cases;
    suppose A7: e in E;
      then consider u being object such that
        A8: e DJoins u,u,G1 by A5, GLIB_009:45;
      A9: v1 = u & w1 = u by A6, A8, GLIB_000:125;
      e DJoins w1,v1,G2 by A6, A7, GLIB_007:7;
      hence v1 = v2 & w1 = w2 by A6, A9, GLIB_000:125;
    end;
    suppose not e in E;
      then e DJoins v1,w1,G2 by A6, GLIB_007:8;
      hence v1 = v2 & w1 = w2 by A6, GLIB_000:125;
    end;
  end;
  hence thesis by Th17;
end;
