
theorem Th9: :: Tpart1:
for X being set, P being finite a_partition of X, S being Subset of X
 holds (for p being set st p in P holds p meets S)
   iff card (P | S) = card P
proof
 let X be set, P be finite a_partition of X, S be Subset of X;
 per cases;
 suppose X = {};
   hence thesis;
 end;
 suppose A2: X <> {};
   set PS = P | S;
   reconsider Pp1 = P as finite non empty set by A2;
   hereby
     assume A3: for p being set st p in P holds p meets S;
     set p = the Element of P;
     p in Pp1;
     then p meets S by A3;
     then p /\ S in PS;
     then reconsider PSp1 = PS as non empty finite set;
     defpred P[object,object] means
      ex D1 being set st D1 = $1 & $1 in P & $2 = D1 /\ S;
A4: for x being object st x in P ex y being object st y in PSp1 & P[x,y]
      proof
       let x be object;
       assume A5: x in P;
        reconsider xx=x as set by TARSKI:1;
       take xx /\ S;
         xx meets S by A5,A3;
         hence thesis by A5;
      end;
      consider f being Function of P,PSp1 such that
   A6: for x being object st x in P holds P[x,f.x] from FUNCT_2:sch 1(A4);
      now
       let x1,x2 be object such that
      A7: x1 in P and
      A8: x2 in P and
      A9: f.x1 = f.x2;
        reconsider xx1=x1, xx2=x2 as set by TARSKI:1;
        P[x1,f.x1] by A7,A6;
        then
    A10: f.x1 = xx1 /\ S;
        P[x2,f.x2] by A8,A6;
        then
      A11: f.x2 = xx2 /\ S;
          xx1 meets S by A7,A3;
          then f.x1 in PS by A10,A7;
          then f.x1 <> {};
          then consider x being object such that
      A12: x in f.x1 by XBOOLE_0:def 1;
          x in xx1 & x in xx2 by A12,A9,A10,A11,XBOOLE_0:def 4;
          then  xx1 meets xx2 by XBOOLE_0:3;
       hence x1 = x2 by A7,A8,EQREL_1:def 4;
      end;
      then A13: f is one-to-one by FUNCT_2:19;
      rng f = PSp1 proof
       thus rng f c= PSp1 proof
        let y be object;
        assume y in rng f;
        then consider x being object such that
       A14: x in P and
       A15: f.x = y by FUNCT_2:11;
        reconsider x as set by TARSKI:1;
A16:      x meets S by A3,A14;
         P[x,f.x] by A14,A6;
         then consider D1 being set such that
A17:        D1 = x & x in P & f.x = D1 /\ S;
        thus y in PSp1 by A15,A17,A16;
       end;
       thus PSp1 c= rng f proof
         let y be object;
         assume y in PSp1;
         then consider p being Element of P such that
       A18: y = p /\ S and p meets S;
       A19: p in Pp1;
          P[p,f.p] by A6,A19;
           then f.p = p /\ S;
         hence y in rng f by A18,A19,FUNCT_2:4;
       end;
      end;
      then f is onto by FUNCT_2:def 3;
     hence card (P | S) = card P by A13,EULER_1:11;
   end;
   assume A20: card (P | S) = card P;
     defpred P[object,object] means
    ex D2 being set st D2 = $2 &    $1 in PS & $2 in Pp1 & $1 = D2 /\ S;
   A21: for x being object st x in PS
ex y being object st y in Pp1 & P[x,y]
proof
       let x be object;
       assume A22: x in PS;
       then consider p being Element of P such that
      A23: x = p /\ S and p meets S;
        take p;
        thus thesis by A22,A23;
      end;
      consider f being Function of PS,Pp1 such that
   A24: for x being object st x in PS holds P[x,f.x] from FUNCT_2:sch 1(A21);
   A25: f is one-to-one proof
        let x1,x2 be object such that
      A26: x1 in dom f and
      A27: x2 in dom f and
      A28: f.x1 = f.x2;
A29:     P[x2,f.x2] by A27,A24;
       P[x1,f.x1] by A26,A24;
       then x1 = f.x1 /\ S;
     hence x1 = x2 by A28,A29;
   end;
   f is onto by A20,A25,FINSEQ_4:63; then
   A30: rng f = P by FUNCT_2:def 3;
   let p be set;
   assume p in P;
     then consider ps being object such that
   A31: ps in dom f and
   A32: p = f.ps by A30,FUNCT_1:def 3;
       P[ps,f.ps] by A31,A24;
       then
   A33: ps = p /\ S by A32;
     reconsider ps as set by TARSKI:1;
       ps is non empty by A31;
       then ex x being object st x in ps;
   hence p meets S by A33;
 end;
end;
