reserve x,y,X for set,
        r for Real,
        n,k for Nat;

theorem Th2:
  for Y be non empty finite set st card X = card Y+1
    for f be Function of X,Y st f is onto
      ex y st y in Y & card(f"{y}) = 2 &
              for x st x in Y & x <> y holds card (f"{x})=1
 proof
  let Y be non empty finite set such that
   A1: card X=card Y+1;
  reconsider XX=X as non empty finite set by A1;
  card Y>0;
  then reconsider c1=card Y-1 as Element of NAT by NAT_1:20;
  let f be Function of X,Y such that
   A2: f is onto;
  A3: rng f=Y by A2,FUNCT_2:def 3;
  reconsider F=f as Function of XX,Y;
  A4: dom f=X by FUNCT_2:def 1;
  ex y st y in Y & card(F"{y})>1
  proof
   assume A5: for y st y in Y holds card(F"{y})<=1;
   now let y be object;
    set fy=F"{y};
    assume A6: y in Y;
    then fy<>{} by A3,FUNCT_1:72;
    then card fy=1 by A5,A6,NAT_1:25;
    hence ex x being object st fy={x} by CARD_2:42;
   end;
   then f is one-to-one by A3,FUNCT_1:74;
   then X,Y are_equipotent by A3,A4,WELLORD2:def 4;
   then card X=card Y by CARD_1:5;
   hence contradiction by A1;
  end;
  then consider y such that
   A7: y in Y and
   A8: card(F"{y})>1;
  set fy=F"{y};
  set fD=F|(dom f\fy);
  take y;
  A9: 1+1<=card fy by A8,NAT_1:13;
  dom fD=dom f\fy by RELAT_1:62,XBOOLE_1:36;
  then A10: card dom fD=card XX-card fy by A4,CARD_2:44;
  set Yy=Y\{y};
  A11: rng fD=Yy by A3,STIRL2_1:54;
  then reconsider FD=fD as Function of dom fD,Yy by FUNCT_2:1;
  card Y=c1+1;
  then A12: card Yy=c1 by A7,STIRL2_1:55;
  then Segm c1 c= Segm card dom fD by A11,CARD_1:12;
  then card Y+-1<=card Y+(1-card fy) by A1,A10,NAT_1:39;
  then -1<=1-card fy by XREAL_1:6;
  then card fy<=1--1 by XREAL_1:11;
  hence A13: y in Y & card(f"{y})=2 by A7,A9,XXREAL_0:1;
  let x such that
   A14: x in Y and
   A15: x<>y;
  A16: x in rng FD by A11,A14,A15,ZFMISC_1:56;
  FD is onto by A11,FUNCT_2:def 3;
  then FD is one-to-one by A1,A10,A12,A13,FINSEQ_4:63;
  then A17: ex z be object st FD"{x}={z} by A16,FUNCT_1:74;
  FD"{x}=f"{x} by A15,STIRL2_1:54;
  hence thesis by A17,CARD_1:30;
 end;
