reserve E,V for set, G,G1,G2 for _Graph, c,c1,c2 for Cardinal, n for Nat;
reserve f for VColoring of G;
reserve g for EColoring of G;
reserve t for TColoring of G;

theorem
  for v being Vertex of G2, e,w being object, G1 being addAdjVertex of G2,v,e,w
  st not e in the_Edges_of G2 & not w in the_Vertices_of G2 & v is endvertex
  holds G2 is c-tcolorable implies G1 is c-tcolorable
proof
  let v be Vertex of G2, e,w be object, G1 be addAdjVertex of G2,v,e,w;
  assume A1: not e in the_Edges_of G2 & not w in the_Vertices_of G2;
  assume A2: v is endvertex & G2 is c-tcolorable;
  then consider t2 being TColoring of G2 such that
    A3: t2 is proper & card((rng t2_V)\/rng t2_E) c= c;
  consider e9 being object such that
    A4: v.edgesInOut() = {e9} & not e9 Joins v,v,G2 by A2, GLIB_000:def 51;
  e9 in v.edgesInOut() by A4, TARSKI:def 1;
  then consider v9 being Vertex of G2 such that
    A5: e9 Joins v,v9,G2 by GLIB_000:64;
  set f = t2_V +* (w .--> t2_E.e9), g = t2_E +* (e .--> t2_V.v9);
  reconsider t1 = [f, g] as TColoring of G1 by A1, Th144;
  :: show that the coloring is proper
  now
    let e1,e2,u,w1,w2 be object;
    A6: e Joins v,w,G1 by A1, GLIB_006:131;
    A7: the_Edges_of G1 = the_Edges_of G2 \/ {e} by A1, GLIB_006:def 12;
    assume A8: e1 Joins u,w1,G1 & e2 Joins u,w2,G1;
    then per cases by GLIB_006:72;
    suppose A9: e1 Joins u,w1,G2 & e2 Joins u,w2,G2;
      then e1 in the_Edges_of G2 & e2 in the_Edges_of G2 by GLIB_000:def 13;
      then A10: t1_E.e1 = t2_E.e1 & t1_E.e2 = t2_E.e2 by A1, FUNCT_4:83;
      u in the_Vertices_of G2 & w1 in the_Vertices_of G2 by A9, GLIB_000:13;
      then t1_V.u = t2_V.u & t1_V.w1 = t2_V.w1 by A1, FUNCT_4:83;
      hence t1_V.u <> t1_V.w1 & t1_V.u <> t1_E.e1 by A3, A9, A10, Th148;
      thus e1 <> e2 implies t1_E.e1 <> t1_E.e2 by A3, A9, A10, Th148;
    end;
    suppose A11: e1 Joins u,w1,G2 & not e2 in the_Edges_of G2;
      e2 in the_Edges_of G1 by A8, GLIB_000:def 13;
      then e1 in the_Edges_of G2 & e2 in {e}
        by A7, A11, GLIB_000:def 13, XBOOLE_0:def 3;
      then A12: e1 <> e & e2 = e by A1, TARSKI:def 1;
      then A13: t1_E.e1=t2_E.e1 & t1_E.e2 = t2_V.v9 by FUNCT_4:83, FUNCT_4:113;
      u in the_Vertices_of G2 & w1 in the_Vertices_of G2 by A11, GLIB_000:13;
      then t1_V.u = t2_V.u & t1_V.w1 = t2_V.w1 by A1, FUNCT_4:83;
      hence t1_V.u <> t1_V.w1 & t1_V.u <> t1_E.e1 by A3, A11, A13, Th148;
      assume e1 <> e2 & t1_E.e1 = t1_E.e2;
      then A14: t2_E.e1 = t2_V.v9 & e9 Joins v9,v,G2 by A5, A13, GLIB_000:14;
      u in the_Vertices_of G2 by A11, GLIB_000:13;
      then u = v & w2 = w by A1, A6, A8, A12, GLIB_000:15;
      then e1 in v.edgesInOut() by A11, GLIB_000:62;
      then e1 = e9 by A4, TARSKI:def 1;
      hence contradiction by A3, A14, Th148;
    end;
    suppose A15: not e1 in the_Edges_of G2 & e2 Joins u,w2,G2;
      e1 in the_Edges_of G1 by A8, GLIB_000:def 13;
      then e2 in the_Edges_of G2 & e1 in {e}
        by A7, A15, GLIB_000:def 13, XBOOLE_0:def 3;
      then A16: e2 <> e & e1 = e by A1, TARSKI:def 1;
      then A17: t1_E.e2=t2_E.e2 & t1_E.e1 = t2_V.v9 by FUNCT_4:83, FUNCT_4:113;
      A18: u in the_Vertices_of G2 by A15, GLIB_000:13;
      then A19: t1_V.u = t2_V.u by A1, FUNCT_4:83;
      A20: u = v & w1 = w by A1, A6, A8, A16, A18, GLIB_000:15;
      then t1_V.w1 = t2_E.e9 by FUNCT_4:113;
      hence t1_V.u <> t1_V.w1 by A3, A5, A19, A20, Th148;
      thus t1_V.u <> t1_E.e1 by A3, A5, A17, A19, A20, Th148;
      assume e1 <> e2 & t1_E.e1 = t1_E.e2;
      then A21: t2_E.e2 = t2_V.v9 & e9 Joins v9,v,G2 by A5, A17, GLIB_000:14;
      e2 in v.edgesInOut() by A15, A20, GLIB_000:62;
      then e2 = e9 by A4, TARSKI:def 1;
      hence contradiction by A3, A21, Th148;
    end;
    suppose A22: not e1 in the_Edges_of G2 & not e2 in the_Edges_of G2;
      A23: v <> w by A1;
      e1 in the_Edges_of G1 & e2 in the_Edges_of G1 by A8, GLIB_000:def 13;
      then e1 in {e} & e2 in {e} by A7, A22, XBOOLE_0:def 3;
      then A24: e2 = e & e1 = e by TARSKI:def 1;
      then per cases by A6, A8, GLIB_000:15;
      suppose u = v & w1 = w;
        then A25: t1_V.u = t2_V.v & t1_V.w1 = t2_E.e9
          by A23, FUNCT_4:83, FUNCT_4:113;
        hence t1_V.u <> t1_V.w1 by A3, A5, Th148;
        t1_E.e1 = t2_V.v9 by A24, FUNCT_4:113;
        hence t1_V.u <> t1_E.e1 by A3, A5, A25, Th148;
        thus e1 <> e2 implies t1_E.e1 <> t1_E.e2 by A24;
      end;
      suppose u = w & w1 = v;
        then A26: t1_V.u = t2_E.e9 & t1_V.w1 = t2_V.v
          by A23, FUNCT_4:83, FUNCT_4:113;
        hence t1_V.u <> t1_V.w1 by A3, A5, Th148;
        t1_E.e1 = t2_V.v9 & e9 Joins v9,v,G2
          by A5, A24, FUNCT_4:113, GLIB_000:14;
        hence t1_V.u <> t1_E.e1 by A3, A26, Th148;
        thus e1 <> e2 implies t1_E.e1 <> t1_E.e2 by A24;
      end;
    end;
  end;
  then A27: t1 is proper by Th148;
  :: count the number of colors
  e9 in the_Edges_of G2 & v9 in the_Vertices_of G2 by A5, GLIB_000:def 13;
  then e9 in dom t2_E & v9 in dom t2_V by PARTFUN1:def 2;
  then t2_E.e9 in rng t2_E & t2_V.v9 in rng t2_V by FUNCT_1:3;
  then A28: {t2_E.e9} c= rng t2_E & {t2_V.v9} c= rng t2_V by ZFMISC_1:31;
  A29: rng t2_V \/ {t2_E.e9} \/ (rng t2_E \/{t2_V.v9})
     = rng t2_V \/ {t2_E.e9} \/ rng t2_E \/ {t2_V.v9} by XBOOLE_1:4
    .= ({t2_E.e9} \/ rng t2_E) \/ rng t2_V \/ {t2_V.v9} by XBOOLE_1:4
    .= rng t2_E \/ rng t2_V \/ {t2_V.v9} by A28, XBOOLE_1:12
    .= rng t2_E \/ (rng t2_V \/ {t2_V.v9}) by XBOOLE_1:4
    .= rng t2_V \/ rng t2_E by A28, XBOOLE_1:12;
  rng t1_V c= rng t2_V \/{t2_E.e9} & rng t1_E c= rng t2_E \/{t2_V.v9} by Lm19;
  then rng t1_V \/ rng t1_E c= rng t2_V \/ rng t2_E by A29, XBOOLE_1:13;
  then card(rng t1_V \/ rng t1_E) c= card(rng t2_V \/ rng t2_E) by CARD_1:11;
  hence thesis by A3, A27, XBOOLE_1:1;
end;
