reserve V for Universe,
  a,b,x,y,z,x9,y9 for Element of V,
  X for Subclass of V,
  o,p,q,r,s,t,u,a1,a2,a3,A,B,C,D for set,
  K,L,M for Ordinal,
  n for Element of omega,
  fs for finite Subset of omega,
  e,g,h for Function,
  E for non empty set,
  f for Function of VAR,E,
  k,k1 for Element of NAT,
  v1,v2,v3 for Element of VAR,
  H,H9 for ZF-formula;

theorem Th20:
  X is closed_wrt_A1-A7 & E in X implies for H,H9 st Diagram(H,E)
  in X & Diagram(H9,E) in X holds Diagram(H '&' H9,E) in X
proof
  assume that
A1: X is closed_wrt_A1-A7 and
A2: E in X;
  reconsider E9=E as Element of V by A2;
  let H,H9 such that
A3: Diagram(H,E) in X and
A4: Diagram(H9,E) in X;
  set fs=code Free(H), fs9=code Free(H9);
  reconsider D1=Diagram(H,E),D2=Diagram(H9,E) as Element of V by A3,A4;
A5: (Funcs(fs9\fs,E9)) in X by A1,A2,Th9;
  then reconsider F1=Funcs(fs9\fs,E9) as Element of V;
A6: (Funcs(fs\fs9,E9)) in X by A1,A2,Th9;
  then reconsider F2=Funcs(fs\fs9,E9) as Element of V;
  set A={x \/ y : x in D1 & y in F1}, B={x \/ y : x in D2 & y in F2};
A7: X is closed_wrt_A5 by A1;
  then
A8: B in X by A4,A6;
  now

    let p be object;
    assume
A9: p in A /\ B;
    then p in A by XBOOLE_0:def 4;
    then consider x,y such that
A10: p=x \/ y and
A11: x in D1 and
A12: y in F1;
    p in B by A9,XBOOLE_0:def 4;
    then consider x9,y9 such that
A13: p=x9 \/ y9 and
A14: x9 in D2 and
A15: y9 in F2;
    consider g being Function of VAR,E such that
A16: x9=(g*decode)|fs9 and
A17: g in St(H9,E) by A14,Def4;
    consider e such that
A18: y=e and
A19: dom e=fs9\fs and
A20: rng e c= E by A12,FUNCT_2:def 2;
    consider f being Function of VAR,E such that
A21: x=(f*decode)|fs and
A22: f in St(H,E) by A11,Def4;
A23: dom((f*decode)|fs)=fs by Lm3;
    then reconsider gg=((f*decode)|fs) \/ e as Function by A19,GRFUNC_1:13
,XBOOLE_1:79;
    rng gg=rng((f*decode)|fs) \/ rng e by RELAT_1:12;
    then
A24: rng gg c= E by A20,XBOOLE_1:8;
    dom gg=fs \/ (fs9\fs) by A19,A23,XTUPLE_0:23;
    then dom gg=fs \/ fs9 by XBOOLE_1:39;
    then gg in Funcs(fs \/ fs9,E) by A24,FUNCT_2:def 2;
    then consider ff being Function of VAR,E such that
A25: gg=(ff*decode)|(fs \/ fs9) by Lm11;
    now
      thus
A26:  fs=dom((ff*decode)|fs) & dom((f*decode)|fs)=fs by Lm3;
      let q being object such that
A27:  q in fs;
      ((ff*decode)|(fs \/ fs9))= ((ff*decode)|fs) \/ ((ff*decode)|fs9) by
RELAT_1:78;
      hence ((ff*decode)|fs).q=((ff*decode)|(fs \/ fs9)).q by A26,A27,
GRFUNC_1:15
        .=((f*decode)|fs).q by A25,A26,A27,GRFUNC_1:15;
    end;
    then
A28: ff in St(H,E) by A22,Lm10,FUNCT_1:2;
    now
      thus
A29:  fs9=dom((ff*decode)|fs9) & dom((g*decode)|fs9)=fs9 by Lm3;
      let q being object such that
A30:  q in fs9;
      ((ff*decode)|(fs \/ fs9)) =((ff*decode)|fs) \/ ((ff*decode)|fs9) by
RELAT_1:78;
      hence ((ff*decode)|fs9).q=((ff*decode)|(fs \/ fs9)).q by A29,A30,
GRFUNC_1:15
        .=((g*decode)|fs9).q by A10,A13,A15,A21,A16,A18,A25,A29,A30,GRFUNC_1:15
;
    end;
    then ff in St(H9,E) by A17,Lm10,FUNCT_1:2;
    then
A31: ff in St(H '&' H9,E) by A28,ZF_MODEL:5;
    p=(ff*decode)|code (Free H \/ Free H9) by A10,A21,A18,A25,RELAT_1:120
      .=(ff*decode)|code Free(H '&' H9) by ZF_LANG1:61;
    hence p in Diagram(H '&' H9,E) by A31,Def4;
  end;
  then
A32: A /\ B c= Diagram(H '&' H9,E);
  Diagram(H '&' H9,E) c= A /\ B
  proof
    let p be object;
    assume p in Diagram(H '&' H9,E);
    then consider f being Function of VAR,E such that
A33: p=(f*decode)|code Free(H '&' H9) and
A34: f in St(H '&' H9,E) by Def4;
    f in St(H9,E) by A34,ZF_MODEL:5;
    then
A35: ((f*decode)|fs9) in D2 by Def4;
    then reconsider z=((f*decode)|fs9) as Element of V by A4,Th1;
    (f*decode)|(fs\fs9) is Function of fs\fs9,E by FUNCT_2:32;
    then
A36: ((f*decode)|(fs\fs9)) in F2 by FUNCT_2:8;
    then reconsider t=((f*decode)|(fs\fs9)) as Element of V by A6,Th1;
A37: Free(H '&' H9)=Free(H) \/ Free(H9) by ZF_LANG1:61;
    then p=(f*decode)|(fs9 \/ fs) by A33,RELAT_1:120
      .=((f*decode)|(fs9 \/ (fs\fs9))) by XBOOLE_1:39
      .=((f*decode)|fs9) \/ ((f*decode)|(fs\fs9)) by RELAT_1:78;
    then p=z \/ t;
    then
A38: p in B by A35,A36;
    f in St(H,E) by A34,ZF_MODEL:5;
    then
A39: ((f*decode)|fs) in D1 by Def4;
    then reconsider x=((f*decode)|fs) as Element of V by A3,Th1;
    (f*decode)|(fs9\fs) is Function of fs9\fs,E by FUNCT_2:32;
    then
A40: ((f*decode)|(fs9\fs)) in F1 by FUNCT_2:8;
    then reconsider y=((f*decode)|(fs9\fs)) as Element of V by A5,Th1;
    p=(f*decode)|(fs \/ fs9) by A33,A37,RELAT_1:120
      .=((f*decode)|(fs \/ (fs9\fs))) by XBOOLE_1:39
      .=((f*decode)|fs) \/ ((f*decode)|(fs9\fs)) by RELAT_1:78;
    then p=x \/ y;
    then p in A by A39,A40;
    hence thesis by A38,XBOOLE_0:def 4;
  end;
  then
A41: A /\ B = Diagram(H '&' H9,E) by A32;
  A in X by A3,A5,A7;
  hence thesis by A1,A8,A41,Th5;
end;
