reserve X for set;
reserve S for Subset-Family of X;

theorem Thm87:
  for S be cap-finite-partition-closed diff-c=-finite-partition-closed
  Subset-Family of X, SM be finite Subset of S holds
  ex P be finite Subset of S st P is a_partition of union SM &
  for Y be Element of SM holds
  Y=union {s where s is Element of S:s in P & s c= Y}
  proof
    let S be cap-finite-partition-closed diff-c=-finite-partition-closed
    Subset-Family of X;
    let SM be finite Subset of S;
    per cases;
    suppose
A1:   SM is empty;
      for Y be Element of SM holds
      Y=union{s where s is Element of S:s in {} & s c= Y}
      proof
        let Y be Element of SM;
A2:     Y={} by A1,SUBSET_1:def 1;
        union{s where s is Element of S:s in {} & s c= Y} c= {}
        proof
          let x be object;
          assume x in union{s where s is Element of S:s in {} & s c= Y};
          then consider y be set such that
          x in y and
A3:       y in {s where s is Element of S:s in {} & s c= Y} by TARSKI:def 4;
          consider s be Element of S such that
          y=s and
A4:       s in {} and
          s c= Y by A3;
          thus thesis by A4;
        end;
        hence thesis by A2;
      end;
      hence thesis by A1,ZFMISC_1:2,EQREL_1:45;
    end;
    suppose
A5:   SM is non empty;
      consider FSM be FinSequence such that
A6:   SM=rng FSM by FINSEQ_1:52;
      FSM is FinSequence of S by A6,FINSEQ_1:def 4;
      then consider P be finite Subset of S such that
A7:   P is a_partition of Union FSM and
A8:   for n be Nat st n in dom FSM holds FSM.n=union{s where s is Element of S:
      s in P & s c= FSM.n} by Lem10;
      for Y be Element of SM holds
      Y=union{s where s is Element of S:s in P & s c= Y}
      proof
        let Y be Element of SM;
        consider i be object such that
A9:     i in dom FSM and
A10:    Y=FSM.i by A5,A6,FUNCT_1:def 3;
        thus Y c= union {s where s is Element of S:s in P & s c= Y}
        by A9,A10,A8;
        thus union {s where s is Element of S:s in P & s c= Y} c= Y
        by A9,A10,A8;
      end;
      hence thesis by A6,A7;
    end;
  end;
