reserve X for set;

theorem Th28:
  for X being non empty set, G being SimpleGraph of X, v being set
  holds ex ww being finite set st ww = {w where w is Element of X : w in the
  carrier of G & {v,w} in the SEdges of G} & degree(G,v) = card ww
proof
  let X be non empty set, G be SimpleGraph of X, v be set;
  set ww={w where w is Element of X: w in (the carrier of G) & {v,w} in (the
  SEdges of G)};
  consider Y being finite set such that
A1: for z being set holds (z in Y iff z in (the SEdges of G) & v in z) and
A2: degree(G,v) = card(Y) by Def8;
A3: for z being set holds (z in ww iff z in (the carrier of G) & {v,z} in (
  the SEdges of G) )
  proof
    let z be set;
    hereby
      assume z in ww;
      then
      ex w being Element of X st z=w & w in (the carrier of G) & {v,w} in (
      the SEdges of G);
      hence z in (the carrier of G) & {v,z} in (the SEdges of G);
    end;
    thus z in (the carrier of G) & {v,z} in (the SEdges of G) implies z in ww
    proof
      assume
A4:   z in (the carrier of G) & {v,z} in (the SEdges of G);
      (the carrier of G) is finite Subset of X by Th21;
      hence thesis by A4;
    end;
  end;
A5: ww c= the carrier of G by A3;
  the carrier of G is finite by Th21;
  then reconsider ww as finite set by A5;
  take ww;
  ww,Y are_equipotent
  proof
    set wwY = {[w,{v,w}] where w is Element of X : w in ww & {v,w} in Y};
    take wwY;
A6: for x,y,z,u being object st [x,y] in wwY & [z,u] in wwY holds (x = z iff
    y = u)
    proof
      let x,y,z,u be object;
      assume that
A7:   [x,y] in wwY and
A8:   [z,u] in wwY;
      consider w1 being Element of X such that
A9:   [x,y]=[w1,{v,w1}] and
      w1 in ww and
A10:  {v,w1} in Y by A7;
      consider w2 being Element of X such that
A11:  [z,u]=[w2,{v,w2}] and
      w2 in ww and
      {v,w2} in Y by A8;
      hereby
        assume
A12:    x=z;
        w1 = [w1,{v,w1}]`1
          .= [x,y]`1 by A9
          .= z by A12
          .= [w2,{v,w2}]`1 by A11
          .= w2;
        hence y = [w2,{v,w2}]`2 by A9
          .= u by A11;
      end;
      hereby
        {v,w1} in (the SEdges of G) by A1,A10;
        then
A13:    v<>w1 by Th10;
        assume
A14:    y=u;
        {v,w1} = [w1,{v,w1}]`2
          .= [x,y]`2 by A9
          .= u by A14
          .= [w2,{v,w2}]`2 by A11
          .= {v,w2};
        then w1=w2 by A13,ZFMISC_1:6;
        hence x = [z,u]`1 by A9,A11
          .= z;
      end;
    end;
A15: for w being set holds ([w,{v,w}] in wwY iff w in ww & {v,w} in Y)
    proof
      let w be set;
      hereby
        assume [w,{v,w}] in wwY;
        then consider w9 being Element of X such that
A16:    [w,{v,w}]=[w9,{v,w9}] and
A17:    w9 in ww & {v,w9} in Y;
        w = [w9,{v,w9}]`1 by A16
          .= w9;
        hence w in ww & {v,w} in Y by A17;
      end;
      thus w in ww & {v,w} in Y implies [w,{v,w}] in wwY
      proof
        assume that
A18:    w in ww and
A19:    {v,w} in Y;
A20:    w in the carrier of G by A3,A18;
        (the carrier of G) is finite Subset of X by Th21;
        then reconsider w as Element of X by A20;
        ex z being Element of X st [w,{v,w}]=[z,{v,z}] & z in ww & {v,z}
        in Y by A18,A19;
        hence thesis;
      end;
    end;
A21: for y being object st y in Y ex x being object st x in ww & [x,y] in wwY
    proof
      let y be object;
      assume
A22:  y in Y;
      then
A23:  y in (the SEdges of G) by A1;
      reconsider yy = y as set by TARSKI:1;
A24:  v in yy by A1,A22;
      ex w being set st w in (the carrier of G) & y={v,w}
      proof
        consider v1,v2 being object such that
A25:    v1 in (the carrier of G) and
A26:    v2 in (the carrier of G) and
        v1<>v2 and
A27:    y={v1,v2} by A23,Th8;
        per cases by A24,A27,TARSKI:def 2;
        suppose
A28:      v=v1;
          take v2;
          thus thesis by A26,A27,A28;
        end;
        suppose
A29:      v=v2;
          take v1;
          thus thesis by A27,A29,A25;
        end;
      end;
      then consider w being set such that
A30:  w in (the carrier of G) and
A31:  y={v,w};
      take w;
      thus w in ww by A3,A23,A30,A31;
      hence thesis by A15,A22,A31;
    end;
    for x being object st x in ww ex y being object st y in Y & [x,y] in wwY
    proof
      let x be object;
      assume
A32:  x in ww;
      take {v,x};
A33:  v in {v,x} by TARSKI:def 2;
      {v,x} in (the SEdges of G) by A3,A32;
      hence {v,x} in Y by A1,A33;
      hence thesis by A15,A32;
    end;
    hence thesis by A21,A6;
  end;
  hence thesis by A2,CARD_1:5;
end;
