
theorem
  for G2 being _Graph, v being object, V being Subset of the_Vertices_of G2
  for G1 being addAdjVertexAll of G2, v, V
  for v1 being Vertex of G1, v2 being Vertex of G2
  st not v in the_Vertices_of G2 & v1 = v2 & v2 in V holds
    v1.allNeighbors() = v2.allNeighbors() \/ {v} &
    v1.degree() = v2.degree() +` 1
proof
  let G2 be _Graph, v be object, V be Subset of the_Vertices_of G2;
  let G1 be addAdjVertexAll of G2, v, V;
  let v1 be Vertex of G1, v2 be Vertex of G2;
  A1: v is set by TARSKI:1;
  assume A2: not v in the_Vertices_of G2 & v1 = v2 & v2 in V;
  :: first we get the edge that connects v1 and v
  A3: G2 is Subgraph of G1 by GLIB_006:57;
  then A4: v2.allNeighbors() c= v1.allNeighbors() by A2, GLIB_000:82;
  consider E being set such that
    A5: card V = card E & E misses the_Edges_of G2 and
    the_Edges_of G1 = the_Edges_of G2 \/ E and
    A6: for w1 being object st w1 in V ex e1 being object st e1 in E &
      e1 Joins w1,v,G1 & for e2 being object
        st e2 Joins w1,v,G1 holds e1 = e2 by A2, GLIB_007:def 4;
  consider e1 being object such that
    A7: e1 in E & e1 Joins v2,v,G1 and
    A8: for e2 being object st e2 Joins v2,v,G1 holds e1 = e2 by A2, A6;
  e1 Joins v1,v,G1 & v is set by A2, A7, TARSKI:1;
  :: we conclude that v is the only new neighbor
  then {v} c= v1.allNeighbors() by GLIB_000:71, ZFMISC_1:31;
  then A9: v2.allNeighbors() \/ {v} c= v1.allNeighbors() by A4, XBOOLE_1:8;
  now
    let x be object;
    assume x in v1.allNeighbors();
    then consider e2 being object such that
      A10: e2 Joins v1,x,G1 by GLIB_000:71;
    per cases;
    suppose x <> v;
      then v1 <> v & x <> v by A2;
      then e2 Joins v2,x,G2 & x is set by A2, A10, GLIB_007:49, TARSKI:1;
      then x in v2.allNeighbors() by GLIB_000:71;
      hence x in v2.allNeighbors() \/ {v} by XBOOLE_0:def 3;
    end;
    suppose x = v;
      then x in {v} by TARSKI:def 1;
      hence x in v2.allNeighbors() \/ {v} by XBOOLE_0:def 3;
    end;
  end;
  then v1.allNeighbors() c= v2.allNeighbors() \/ {v} by TARSKI:def 3;
  hence v1.allNeighbors() = v2.allNeighbors() \/ {v} by A9, XBOOLE_0:def 10;
  :: and since e1 is the only new edge, the degree can only increase by 1
  A11: v2.edgesOut() c= v1.edgesOut() & v2.edgesIn() c= v1.edgesIn()
    by A2, A3, GLIB_000:78;
  A12: e1 is set by TARSKI:1;
  per cases by A7, GLIB_000:16;
  suppose A13: e1 DJoins v2,v,G1;
    then {e1} c= v1.edgesOut() by A1, A2, A12, GLIB_000:59, ZFMISC_1:31;
    then A14: v2.edgesOut() \/ {e1} c= v1.edgesOut() by A11, XBOOLE_1:8;
    now
      let e2 be object;
      assume e2 in v1.edgesOut();
      then consider x being set such that
        A15: e2 DJoins v1,x,G1 by GLIB_000:59;
      per cases;
      suppose x <> v;
        then A16: x <> v & v1 <> v & e2 is set by A2, TARSKI:1;
        then e2 DJoins v1,x,G2 by A2, A15, GLIB_007:def 4;
        then e2 in v2.edgesOut() by A2, A16, GLIB_000:59;
        hence e2 in v2.edgesOut() \/ {e1} by XBOOLE_0:def 3;
      end;
      suppose x = v;
        then e2 Joins v2,v,G1 by A2, A15, GLIB_000:16;
        then e1 = e2 by A8;
        then e2 in {e1} by TARSKI:def 1;
        hence e2 in v2.edgesOut() \/ {e1} by XBOOLE_0:def 3;
      end;
    end;
    then v1.edgesOut() c= v2.edgesOut() \/ {e1} by TARSKI:def 3;
    then A17: v1.edgesOut() = v2.edgesOut() \/ {e1} by A14, XBOOLE_0:def 10;
    now
      let e2 be object;
      assume e2 in v1.edgesIn();
      then consider x being set such that
        A18: e2 DJoins x,v1,G1 by GLIB_000:57;
      A19: e2 is set & v1 <> v by A2, TARSKI:1;
      x <> v
      proof
        assume A20: x = v;
        then e2 Joins v2,v,G1 by A2, A18, GLIB_000:16;
        then e1 = e2 by A8;
        then x = v1 by A2, A13, A18, GLIB_000:125;
        hence contradiction by A2, A20;
      end;
      then e2 DJoins x,v1,G2 by A2, A18, A19, GLIB_007:def 4;
      hence e2 in v2.edgesIn() by A2, A19, GLIB_000:57;
    end;
    then v1.edgesIn() c= v2.edgesIn() by TARSKI:def 3;
    then A21: v1.edgesIn() = v2.edgesIn() by A11, XBOOLE_0:def 10;
    not e1 in the_Edges_of G2
    proof
      assume e1 in the_Edges_of G2;
      then e1 in E /\ the_Edges_of G2 by A7, XBOOLE_0:def 4;
      hence contradiction by A5, XBOOLE_0:4;
    end;
    then not e1 in v2.edgesOut();
    then A22: {e1} misses v2.edgesOut() by ZFMISC_1:50;
    thus v1.degree()
       = v2.inDegree() +` (card(v2.edgesOut()) +` card {e1})
        by A17, A21, A22, CARD_2:35
      .= v2.inDegree() +` (v2.outDegree() +` 1) by CARD_1:30
      .= v2.degree() +` 1 by CARD_2:19;
  end;
  suppose A23: e1 DJoins v,v2,G1;
    then {e1} c= v1.edgesIn() by A1, A2, A12, GLIB_000:57, ZFMISC_1:31;
    then A24: v2.edgesIn() \/ {e1} c= v1.edgesIn() by A11, XBOOLE_1:8;
    now
      let e2 be object;
      assume e2 in v1.edgesIn();
      then consider x being set such that
        A25: e2 DJoins x,v1,G1 by GLIB_000:57;
      per cases;
      suppose x <> v;
        then A26: x <> v & v1 <> v & e2 is set by A2, TARSKI:1;
        then e2 DJoins x,v1,G2 by A2, A25, GLIB_007:def 4;
        then e2 in v2.edgesIn() by A2, A26, GLIB_000:57;
        hence e2 in v2.edgesIn() \/ {e1} by XBOOLE_0:def 3;
      end;
      suppose x = v;
        then e2 Joins v2,v,G1 by A2, A25, GLIB_000:16;
        then e1 = e2 by A8;
        then e2 in {e1} by TARSKI:def 1;
        hence e2 in v2.edgesIn() \/ {e1} by XBOOLE_0:def 3;
      end;
    end;
    then v1.edgesIn() c= v2.edgesIn() \/ {e1} by TARSKI:def 3;
    then A27: v1.edgesIn() = v2.edgesIn() \/ {e1} by A24, XBOOLE_0:def 10;
    now
      let e2 be object;
      assume e2 in v1.edgesOut();
      then consider x being set such that
        A28: e2 DJoins v1,x,G1 by GLIB_000:59;
      A29: e2 is set & v1 <> v by A2, TARSKI:1;
      x <> v
      proof
        assume A30: x = v;
        then e2 Joins v2,v,G1 by A2, A28, GLIB_000:16;
        then e1 = e2 by A8;
        then x = v1 by A2, A23, A28, GLIB_000:125;
        hence contradiction by A2, A30;
      end;
      then e2 DJoins v1,x,G2 by A2, A28, A29, GLIB_007:def 4;
      hence e2 in v2.edgesOut() by A2, A29, GLIB_000:59;
    end;
    then v1.edgesOut() c= v2.edgesOut() by TARSKI:def 3;
    then A31: v1.edgesOut() = v2.edgesOut() by A11, XBOOLE_0:def 10;
    not e1 in the_Edges_of G2
    proof
      assume e1 in the_Edges_of G2;
      then e1 in E /\ the_Edges_of G2 by A7, XBOOLE_0:def 4;
      hence contradiction by A5, XBOOLE_0:4;
    end;
    then not e1 in v2.edgesIn();
    then A32: {e1} misses v2.edgesIn() by ZFMISC_1:50;
    thus v1.degree()
       = v2.outDegree() +` (card(v2.edgesIn()) +` card {e1})
        by A27, A31, A32, CARD_2:35
      .= v2.outDegree() +` (v2.inDegree() +` 1) by CARD_1:30
      .= v2.degree() +` 1 by CARD_2:19;
  end;
end;
