 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 Th9:
   x in field FSG & y in field FSG &
   not [x,y] in FSG implies card Im(FSG,x) = card Im(FSG,y)
proof
  set cx = card Im(FSG,x), cy = card Im(FSG,y);
  A1: for x,y st x in field FSG & y in field FSG & x<>y & not [x,y] in FSG
    holds card Im(FSG,x)-1 <= card Im(FSG,y)
  proof
    let x,y;
    assume that
          A2:x in field FSG
      and A3:y in field FSG
      and A4: x<>y
      and A5: not [x,y] in FSG;
    consider z being object such that
      A6: Im(FSG,x)/\Coim(FSG,y) = {z} by A2,A3,A4,Def3;
    defpred Q[object,object] means [$1,$2] in FSG & [$2,y] in FSG;
    set Ix=Im(FSG,x),Iy=Im(FSG,y);
    A7:for r be object st r in Ix\{z} ex t be object st Q[r,t]
    proof
      let r be object;
      assume r in Ix\{z};
      then A8:[x,r] in FSG by RELAT_1:169;
      then r in field FSG by RELAT_1:15;
      then consider t be object such that
        A9: Im(FSG,r) /\ Coim(FSG,y) ={t} by A8,A5,A3,Def3;
      take t;
      A10: t in {t} by TARSKI:def 1;
       Coim(FSG,y)=Iy by Th2;
      then t in Iy by A10,A9,XBOOLE_0:def 4;
      then A11: [y,t] in FSG by RELAT_1:169;
      t in Im(FSG,r) by A10,A9,XBOOLE_0:def 4;
      hence thesis by RELAT_1:169, A11,Lm3;
    end;
    consider h be Function such that
A12:dom h=Ix\{z} & for w be object st w in Ix\{z} holds Q[w,h.w]
      from CLASSES1:sch 1(A7);
    A13: rng h c= Iy
    proof
      let t be object;
      assume t in rng h;
      then ex r be object st r in dom h & h.r=t by FUNCT_1:def 3;
      then [t,y] in FSG by A12;
      then [y,t] in FSG by Lm3;
      hence thesis by RELAT_1:169;
    end;
    z in {z} by TARSKI:def 1;
    then A14:z in Ix by A6,XBOOLE_0:def 4;
    not z in Ix\{z} by ZFMISC_1:56;
    then A15: 1+ card (Ix\{z}) = card ((Ix\{z})\/{z}) by CARD_2:41
          .= card Ix by ZFMISC_1:116,A14;
    for x1,x2 be object st x1 in dom h & x2 in dom h & h.x1=h.x2 holds x1=x2
    proof
      let x1,x2 be object such that
            A16: x1 in dom h
        and A17: x2 in dom h
        and A18: h.x1=h.x2;
      A19: [x1,h.x1] in FSG & [x2,h.x1] in FSG by A12,A16,A17,A18;
      A20: h.x1 <> x & [x,x1] in FSG by A12,A16,A5,RELAT_1:169;
      [x,x2] in FSG by A12,A17,RELAT_1:169;
      hence thesis by A20,Lm5,A19;
    end;
    then Segm card (Ix\{z}) c= Segm card Iy by A13,FUNCT_1:def 4,A12,CARD_1:10;
    hence thesis by A15,NAT_1:39;
  end;
  assume that
        A21: x in field FSG & y in field FSG
    and A22: not [x,y] in FSG;
  A23:not [y,x] in FSG by A22,Lm3;
  per cases;
    suppose x=y or cx=cy;
      hence thesis;
    end;
    suppose A24:x<>y & cx<>cy;
      A25: cx+1-1=cx;
      cy -1 <=cx by A24,A1,A21,A23;
      then A26: cy <= cx+1 by A25,XREAL_1:9;
      A27:not 2 divides 1 by INT_2:13;
      A28: cy+1-1=cy;
       cx-1 <= cy by A24,A1,A21,A22;
      then A29: cx <= cy+1 by A28,XREAL_1:9;
      A30: 2 divides cx & 2 divides cy by Th8;
      per cases by XXREAL_0:1,A26;
        suppose cy < cx+1;
          then cy <= cx by NAT_1:13;
          then cy < cx by A24,XXREAL_0:1;
          then cy+1 <= cx by NAT_1:13;
          then cy+1 = cx by A29,XXREAL_0:1;
          hence thesis by A27, A30,INT_2:1;
        end;
        suppose cy = cx+1;
          hence thesis by A30,A27,INT_2:1;
        end;
    end;
end;
