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

theorem ThmJ1:
  for A be non empty set,
  S be cap-finite-partition-closed Subset-Family of X,
  P1,P2 be a_partition of A st
  P1 is finite Subset of S & P2 is finite Subset of S
  ex P be a_partition of A st
  P is finite Subset of S &
  P '<' P1 '/\' P2
  proof
    let x be non empty set,
    S be cap-finite-partition-closed Subset-Family of X;
    let P1,P2 be a_partition of x;
    assume that
A1: P1 is finite Subset of S and
A2: P2 is finite Subset of S;
    defpred F[object,object] means
    $1 in P1 '/\' P2 & $2 is finite Subset of S &
    ex A be set st A = $1 & $2 is a_partition of A;
    set FOUT={y where y is finite Subset of S: ex t be set st
    t in P1 '/\' P2 & y is a_partition of t};
    FOUT c= bool bool x
    proof
      let u be object;
      assume u in FOUT;
      then consider y be finite Subset of S such that
A3:   u=y and
A4:   ex t be set st t in P1 '/\' P2 & y is a_partition of t;
      consider t0 be set such that
A5:   t0 in P1 '/\' P2 and
A6:   y is a_partition of t0 by A4;
      reconsider u as set by TARSKI:1;
      u c= bool x
      proof
        let v be object;
        assume
A7:     v in u;
A8:     v in bool t0 by A3,A6,A7;
        bool t0 c= bool x by A5,ZFMISC_1:67;
        hence thesis by A8;
      end;
      hence thesis;
    end;
    then
A9: union FOUT c= union bool bool x by ZFMISC_1:77;
A10: for u be object st u in P1 '/\' P2 ex v be object st v in FOUT & F[u,v]
    proof
      let u be object;
      assume
A11:  u in P1 '/\' P2;
      reconsider u as set by TARSKI:1;
      consider P be finite Subset of S such that
A12:  P is a_partition of u by A1,A2,A11,Th1;
A13:  P in FOUT by A11,A12;
      thus thesis by A11,A12,A13;
    end;
    consider f be Function such that
A14: dom f=P1 '/\' P2 & rng f c= FOUT and
A15: for x be object st x in P1 '/\' P2 holds F[x,f.x] from FUNCT_1:sch 6(A10);
A16: Union f is finite Subset of S
    proof
A17:  Union f c= S
      proof
        let u be object;
        assume u in Union f;
        then consider v be set such that
A18:    u in v and
A19:    v in rng f by TARSKI:def 4;
        consider w be object such that
A20:    w in P1 '/\' P2 & v=f.w by A14,A19,FUNCT_1:def 3;
        v is Subset of S by A15,A20;
        hence thesis by A18;
      end;
      Union f is finite
      proof
        for u be object st u in dom f holds f.u is finite by A14,A15;
        hence thesis by A1,A2,A14,CARD_2:88;
      end;
      hence thesis by A17;
    end;
A22: Union f is a_partition of x
    proof
A23: Union f c= bool x
      proof
A24:    Union f c= union FOUT by A14,ZFMISC_1:77;
        union FOUT c= bool x by A9,ZFMISC_1:81;
        hence thesis by A24,XBOOLE_1:1;
      end;
A25:  union Union f = x
      proof
        thus union Union f c= x
        proof
          union Union f c= union bool x by A23,ZFMISC_1:77;
          hence thesis by ZFMISC_1:81;
        end;
        thus x c= union Union f
        proof
          let a be object;
          assume a in x; then
A27:      a in union P1 & a in union P2 by EQREL_1:def 4;
          consider b1 be set such that
A28:      a in b1 and
A29:      b1 in P1 by A27,TARSKI:def 4;
          consider b2 be set such that
A30:      a in b2 and
A31:      b2 in P2 by A27,TARSKI:def 4;
A32:      b1/\b2 in INTERSECTION(P1,P2) by A29,A31,SETFAM_1:def 5;
          not b1/\b2 = {} by A28,A30,XBOOLE_0:def 4;
          then
          not b1/\b2 in {{}} by TARSKI:def 1;
          then
A33:      b1/\b2 in P1 '/\' P2 by A32,XBOOLE_0:def 5;
          then F[b1/\b2,f.(b1/\b2)] by A15;
          then union (f.(b1/\b2))=b1/\b2 by EQREL_1:def 4;
          then
A34:      a in union (f.(b1/\b2)) by A28,A30,XBOOLE_0:def 4;
A35:      f.(b1/\b2) in rng f by A14,A33,FUNCT_1:def 3;
          consider bb be set such that
A36:      a in bb and
A37:      bb in f.(b1/\b2) by A34,TARSKI:def 4;
          bb in Union f by A35,A37,TARSKI:def 4;
          hence thesis by A36,TARSKI:def 4;
        end;
      end;
      for A be Subset of x st A in Union f holds
      A <> {} &
      for B be Subset of x st B in Union f holds
      A = B or A misses B
      proof
        let A be Subset of x;
        assume A in Union f;
        then consider b be set such that
A38:    A in b & b in rng f by TARSKI:def 4;
        consider c be object such that
A39:    c in dom f and
A40:    b = f.c by A38,FUNCT_1:def 3;
        reconsider c as set by TARSKI:1;
A41:    F[c,f.c] by A14,A15,A39;
        for B be Subset of x st B in Union f holds A=B or A misses B
        proof
          let B be Subset of x;
          assume B in Union f;
          then consider b2 be set such that
A42:      B in b2 & b2 in rng f by TARSKI:def 4;
          consider c2 be object such that
A43:      c2 in dom f and
A44:      b2 = f.c2 by A42,FUNCT_1:def 3;
          per cases;
          suppose c = c2;
            hence thesis by A38,A40,A41,A42,A44,EQREL_1:def 4;
          end;
          suppose
A45:        not c = c2;
            consider p11,p21 be set such that
A46:        p11 in P1 and
A47:        p21 in P2 and
A48:        c = p11/\p21 by A14,A39,SETFAM_1:def 5;
            consider p12,p22 be set such that
A49:        p12 in P1 and
A50:        p22 in P2 and
A51:        c2 = p12/\p22 by A14,A43,SETFAM_1:def 5;
A52:        not p11/\p21 c= p12/\p22 implies A=B or A misses B
            proof
              assume not p11/\p21 c= p12/\p22;
              then consider u be object such that
A53:          u in p11/\p21 and
A54:          not u in p12/\p22 by TARSKI:def 3;
A55:          u in p11 & u in p21 & not u in p12 implies A=B or A misses B
              proof
                assume
A56:            u in p11 & u in p21 & not u in p12;
                F[c,f.c] & F[c2,f.c2] by A14,A15,A39,A43;
                then union (f.c) = p11/\p21 &
                union (f.c2) = p12/\p22 by A48,A51,EQREL_1:def 4; then
A57:            union (f.c) c= p11 & union (f.c2) c= p12 &
                p11 misses p12 by A46,A49,A56,EQREL_1:def 4,XBOOLE_1:17;
                A c= union (f.c) &
                B c= union (f.c2) by A38,A40,A42,A44,ZFMISC_1:74;
                then A c= p11 & B c= p12 & p11 misses p12 by A57,XBOOLE_1:1;
                hence thesis by XBOOLE_1:64;
              end;
              u in p11 & u in p21 & not u in p22 implies A=B or A misses B
              proof
                assume
A58:            u in p11 & u in p21 & not u in p22;
                F[c,f.c] & F[c2,f.c2] by A14,A15,A39,A43;
                then union (f.c) = p11/\p21 &
                union (f.c2) = p12/\p22 by A48,A51,EQREL_1:def 4; then
A59:            union (f.c) c= p21 & union (f.c2) c= p22 &
                p21 misses p22 by A47,A50,A58,EQREL_1:def 4,XBOOLE_1:17;
                A c= union (f.c) &
                B c= union (f.c2) by A38,A40,A42,A44,ZFMISC_1:74;
                then A c= p21 & B c= p22 & p21 misses p22 by A59,XBOOLE_1:1;
                hence thesis by XBOOLE_1:64;
              end;
              hence thesis by A53,A54,A55,XBOOLE_0:def 4;
            end;
            not p12/\p22 c= p11/\p21 implies A=B or A misses B
            proof
              assume not p12/\p22 c= p11/\p21;
              then consider u be object such that
A60:          u in p12/\p22 and
A61:          not u in p11/\p21 by TARSKI:def 3;
A62:          u in p12 & u in p22 & not u in p11 implies A=B or A misses B
              proof
                assume
A63:            u in p12 & u in p22 & not u in p11;
                F[c,f.c] & F[c2,f.c2] by A14,A15,A39,A43;
                then union (f.c) = p11/\p21 &
                union (f.c2) = p12/\p22 by A48,A51,EQREL_1:def 4; then
A64:            union (f.c) c= p11 & union (f.c2) c= p12 &
                p11 misses p12 by A46,A49,A63,EQREL_1:def 4,XBOOLE_1:17;
                A c= union (f.c) &
                B c= union (f.c2) by A38,A40,A42,A44,ZFMISC_1:74;
                then A c= p11 & B c= p12 & p11 misses p12 by A64,XBOOLE_1:1;
                hence thesis by XBOOLE_1:64;
              end;
              u in p12 & u in p22 & not u in p21 implies A=B or A misses B
              proof
                assume
A65:            u in p12 & u in p22 & not u in p21;
                F[c,f.c] & F[c2,f.c2] by A14,A15,A39,A43;
                then union (f.c) = p11/\p21 &
                union (f.c2) = p12/\p22 by A48,A51,EQREL_1:def 4;
                then
A66:            union (f.c) c= p21 & union (f.c2) c= p22 &
                p21 misses p22 by A47,A50,A65,EQREL_1:def 4,XBOOLE_1:17;
                A c= union (f.c) &
                B c= union (f.c2) by A38,A40,A42,A44,ZFMISC_1:74;
                then A c= p21 & B c= p22 & p21 misses p22 by A66,XBOOLE_1:1;
                hence thesis by XBOOLE_1:64;
              end;
              hence thesis by A60,A61,A62,XBOOLE_0:def 4;
            end;
            hence thesis by A45,A48,A51,A52,XBOOLE_0:def 10;
          end;
        end;
        hence thesis by A38,A40,A41;
      end;
      hence thesis by A23,A25,EQREL_1:def 4;
    end;
    Union f '<' P1 '/\' P2
    proof
      for a be set st a in Union f ex b be set st b in P1 '/\' P2 & a c= b
      proof
        let a be set;
        assume a in Union f;
        then consider b be set such that
A67:    a in b and
A68:    b in rng f by TARSKI:def 4;
        consider c be object such that
A69:    c in dom f and
A70:    b = f.c by A68,FUNCT_1:def 3;
        reconsider c as set by TARSKI:1;
        F[c,f.c] by A14,A15,A69;
        hence thesis by A67,A70;
      end;
      hence thesis by SETFAM_1:def 2;
    end;
     hence thesis by A16,A22;
  end;
