 reserve x,y,z for object, X for set,
         i,k,n,m for Nat,
         R for Relation,
         P for finite Relation,
         p,q for FinSequence;
reserve FSG for Friendship_Graph;

theorem Th8:
 2 divides card Im(FSG,x)
proof
  set I=Im(FSG,x);
  defpred Q[object,object] means
   ex y st [$1,y] in FSG & y in I & $2={$1,y};
  A1:for x being object st x in I ex y being object st Q[x,y]
  proof
    let y be object;
    assume y in I;
    then A2:[x,y] in FSG by RELAT_1:169;
    then A3: x<>y & x in field FSG by Lm2,RELAT_1:15;
    y in field FSG by A2,RELAT_1:15;
    then consider z being object such that
      A4: I/\Coim(FSG,y)={z} by A3,Def3;
    take {y,z};
    A5: z in {z} by TARSKI:def 1;
    Coim(FSG,y) =Im(FSG,y) by Th2;
    then z in Im(FSG,y) by A5,A4,XBOOLE_0:def 4;
    then A6: [y,z] in FSG by RELAT_1:169;
    z in I by A5,A4,XBOOLE_0:def 4;
    hence thesis by A6;
  end;
  consider h be Function such that
A7:dom h=I & for x being object st x in I holds Q[x,h.x]
       from CLASSES1:sch 1( A1 );
  reconsider R=rng h as finite set by A7,FINSET_1:8;
  set H=h~;
  for x st x in R holds card Im(H,x)=2
  proof
    let y;
    assume y in R;
    then consider z be object such that
          A8: z in dom h
      and A9: h.z=y by FUNCT_1:def 3;
    consider w be object such that
          A10: [z,w] in FSG
      and A11: w in I
      and A12: y ={z,w} by A7,A8,A9;
    consider t be object such that
          A13: [w,t] in FSG
      and A14: t in I
      and A15: h.w={w,t} by A11,A7;
    t=z
    proof
      A16:[x,w] in FSG by A11,RELAT_1:169;
      then A17: x<>w & x in field FSG by Lm2,RELAT_1:15;
      w in field FSG by A16,RELAT_1:15;
      then consider r be object such that
        A18: Im(FSG,x)/\Coim(FSG,w)={r} by A17,Def3;
      A19: Coim(FSG,w)=Im(FSG,w) by Th2;
      then t in Coim(FSG,w) by RELAT_1:169,A13;
      then t in {r} by A14,A18,XBOOLE_0:def 4;
      then A20: t=r by TARSKI:def 1;
      [w,z] in FSG by A10,Lm3;
      then z in Coim(FSG,w) by A19,RELAT_1:169;
      then z in {r} by A7,A8,A18,XBOOLE_0:def 4;
      hence thesis by A20,TARSKI:def 1;
    end;
    then [w,y] in h by A12,A15,A11,A7,FUNCT_1:def 2;
    then [y,w] in H by RELAT_1:def 7;
    then A21:w in Im(H,y) by RELAT_1:169;
     reconsider y as set by TARSKI:1;
    A22:Im(H,y) c= y
    proof
      let u be object;
      assume u in Im(H,y);
      then [y,u] in H by RELAT_1:169;
      then A23:[u,y] in h by RELAT_1:def 7;
      then A24: u in dom h by XTUPLE_0:def 12;
      then h.u = y by FUNCT_1:def 2,A23;
      then ex r be object st [u,r] in FSG & r in I & y={u,r} by A24, A7;
      hence thesis by TARSKI:def 2;
     end;
     [z,y] in h by A8,A9,FUNCT_1:def 2;
     then [y,z] in H by RELAT_1:def 7;
     then z in Im(H,y) by RELAT_1:169;
     then y c= Im(H,y) by A12,A21,ZFMISC_1:32;
     then A25: y = Im(H,y) by A22;
     z<>w by A10,Lm2;
     hence thesis by A25, A12, CARD_2:57;
   end;
   then A26:card H = card (H| (dom H\R)) +` 2*`card R by SIMPLEX1:1;
   dom H = R by RELAT_1:20;
   then dom H\R={} by XBOOLE_1:37;
   then card (H| (dom H\R))=0;
   then card H = 2 *`card R by A26,CARD_2:18;
   then 2 *card R =card H by Lm1
         .= card h by Th1
         .=card I by A7,CARD_1:62;
   hence thesis by INT_1:def 3;
end;
