reserve A,B,a,b,c,d,e,f,g,h for set;

theorem Th10:
  for G being non empty RelStr, H1,H2 being RelStr st the carrier
  of H1 misses the carrier of H2 & ( the RelStr of G = union_of(H1,H2) or the
  RelStr of G = sum_of(H1,H2) ) holds H1 is full SubRelStr of G & H2 is full
  SubRelStr of G
proof
  let G be non empty RelStr;
  let H1,H2 be RelStr;
  assume that
A1: the carrier of H1 misses the carrier of H2 and
A2: the RelStr of G = union_of(H1,H2) or the RelStr of G = sum_of(H1,H2);
  set cH1 = the carrier of H1, cH2 = the carrier of H2, IH1 = the InternalRel
  of H1, IH2 = the InternalRel of H2, H1H2 = [:cH1,cH2:], H2H1 = [:cH2,cH1:];
  per cases by A2;
  suppose
A3: the RelStr of G = union_of(H1,H2);
A4: IH2 = (the InternalRel of G)|_2 cH2
    proof
      thus IH2 c= (the InternalRel of G)|_2 cH2
      proof
        let a be object;
        the InternalRel of G = IH1 \/ IH2 by A3,NECKLA_2:def 2;
        then
A5:     IH2 c= the InternalRel of G by XBOOLE_1:7;
        assume a in IH2;
        hence thesis by A5,XBOOLE_0:def 4;
      end;
      let a be object;
      assume
A6:   a in (the InternalRel of G)|_2 cH2;
      then
A7:   a in [:cH2,cH2:] by XBOOLE_0:def 4;
      a in the InternalRel of G by A6,XBOOLE_0:def 4;
      then
A8:   a in IH1 \/ IH2 by A3,NECKLA_2:def 2;
      per cases by A8,XBOOLE_0:def 3;
      suppose
        a in IH1;
        then consider x,y being object such that
A9:     a = [x,y] and
A10:    x in cH1 and
        y in cH1 by RELSET_1:2;
        consider x1,y1 being object such that
A11:    x1 in cH2 and
        y1 in cH2 and
A12:    a = [x1,y1] by A7,ZFMISC_1:def 2;
        x = x1 by A9,A12,XTUPLE_0:1;
        then cH1 /\ cH2 <> {} by A10,A11,XBOOLE_0:def 4;
        hence thesis by A1;
      end;
      suppose
        a in IH2;
        hence thesis;
      end;
    end;
A13: IH1 = (the InternalRel of G)|_2 cH1
    proof
      thus IH1 c= (the InternalRel of G)|_2 cH1
      proof
        let a be object;
        the InternalRel of G = IH1 \/ IH2 by A3,NECKLA_2:def 2;
        then
A14:    IH1 c= the InternalRel of G by XBOOLE_1:7;
        assume a in IH1;
        hence thesis by A14,XBOOLE_0:def 4;
      end;
      let a be object;
      assume
A15:  a in (the InternalRel of G)|_2 cH1;
      then
A16:  a in [:cH1,cH1:] by XBOOLE_0:def 4;
      a in the InternalRel of G by A15,XBOOLE_0:def 4;
      then
A17:  a in IH1 \/ IH2 by A3,NECKLA_2:def 2;
      per cases by A17,XBOOLE_0:def 3;
      suppose
        a in IH1;
        hence thesis;
      end;
      suppose
        a in IH2;
        then consider x,y being object such that
A18:    a = [x,y] and
A19:    x in cH2 and
        y in cH2 by RELSET_1:2;
        ex x1,y1 being object st x1 in cH1 & y1 in cH1 & a = [x1,y1 ] by A16,
ZFMISC_1:def 2;
        then x in cH1 by A18,XTUPLE_0:1;
        hence thesis by A1,A19,XBOOLE_0:3;
      end;
    end;
    the carrier of G = (the carrier of H1) \/ (the carrier of H2) by A3,
NECKLA_2:def 2;
    then
A20: the carrier of H1 c= the carrier of G & the carrier of H2 c= the
    carrier of G by XBOOLE_1:7;
    the InternalRel of G = IH1 \/ IH2 by A3,NECKLA_2:def 2;
    then
    IH1 c= the InternalRel of G & the InternalRel of H2 c= the InternalRel
    of G by XBOOLE_1:7;
    hence thesis by A20,A13,A4,YELLOW_0:def 13,def 14;
  end;
  suppose
A21: the RelStr of G = sum_of(H1,H2);
A22: IH2 = (the InternalRel of G)|_2 cH2
    proof
      thus IH2 c= (the InternalRel of G)|_2 cH2
      proof
        let a be object;
        the InternalRel of G = IH1 \/ IH2 \/ H1H2 \/ H2H1 by A21,NECKLA_2:def 3
;
        then the InternalRel of G = IH2 \/ (IH1 \/ H1H2 \/ H2H1) by
XBOOLE_1:113;
        then
A23:    IH2 c= the InternalRel of G by XBOOLE_1:7;
        assume a in IH2;
        hence thesis by A23,XBOOLE_0:def 4;
      end;
      let a be object;
      assume
A24:  a in (the InternalRel of G)|_2 cH2;
      then
A25:  a in [:cH2,cH2:] by XBOOLE_0:def 4;
      a in the InternalRel of G by A24,XBOOLE_0:def 4;
      then a in IH1 \/ IH2 \/ H1H2 \/ H2H1 by A21,NECKLA_2:def 3;
      then a in IH1 \/ (IH2 \/ H1H2 \/ H2H1) by XBOOLE_1:113;
      then a in IH1 or a in IH2 \/ H1H2 \/ H2H1 by XBOOLE_0:def 3;
      then a in IH1 or a in IH2 \/ (H1H2 \/ H2H1) by XBOOLE_1:4;
      then
A26:  a in IH1 or a in IH2 or a in H1H2 \/ H2H1 by XBOOLE_0:def 3;
      per cases by A26,XBOOLE_0:def 3;
      suppose
        a in IH1;
        then consider x,y being object such that
A27:    a = [x,y] and
A28:    x in cH1 and
        y in cH1 by RELSET_1:2;
        consider x1,y1 being object such that
A29:    x1 in cH2 and
        y1 in cH2 and
A30:    a = [x1,y1] by A25,ZFMISC_1:def 2;
        x = x1 by A27,A30,XTUPLE_0:1;
        then cH1 /\ cH2 <> {} by A28,A29,XBOOLE_0:def 4;
        hence thesis by A1;
      end;
      suppose
        a in IH2;
        hence thesis;
      end;
      suppose
        a in H1H2;
        then consider x,y being object such that
A31:    x in cH1 and
        y in cH2 and
A32:    a = [x,y] by ZFMISC_1:def 2;
        consider x1,y1 being object such that
A33:    x1 in cH2 and
        y1 in cH2 and
A34:    a = [x1,y1] by A25,ZFMISC_1:def 2;
        x = x1 by A32,A34,XTUPLE_0:1;
        then cH1 /\ cH2 <> {} by A31,A33,XBOOLE_0:def 4;
        hence thesis by A1;
      end;
      suppose
        a in H2H1;
        then consider x,y being object such that
        x in cH2 and
A35:    y in cH1 and
A36:    a = [x,y] by ZFMISC_1:def 2;
        consider x1,y1 being object such that
        x1 in cH2 and
A37:    y1 in cH2 and
A38:    a = [x1,y1] by A25,ZFMISC_1:def 2;
        y = y1 by A36,A38,XTUPLE_0:1;
        then cH1 /\ cH2 <> {} by A35,A37,XBOOLE_0:def 4;
        hence thesis by A1;
      end;
    end;
    IH2 c= IH1 \/ IH2 \/ [:cH1, cH2:] by XBOOLE_1:7,10;
    then
A39: IH2 c= IH1 \/ IH2 \/ [:cH1, cH2:] \/ [:cH2, cH1:] by XBOOLE_1:10;
A40: IH1 = (the InternalRel of G)|_2 cH1
    proof
      thus IH1 c= (the InternalRel of G)|_2 cH1
      proof
        let a be object;
        the InternalRel of G = IH1 \/ IH2 \/ H1H2 \/ H2H1 by A21,NECKLA_2:def 3
          .= IH1 \/ (IH2 \/ H1H2 \/ H2H1) by XBOOLE_1:113;
        then
A41:    IH1 c= the InternalRel of G by XBOOLE_1:7;
        assume a in IH1;
        hence thesis by A41,XBOOLE_0:def 4;
      end;
      let a be object;
      assume
A42:  a in (the InternalRel of G)|_2 cH1;
      then
A43:  a in [:cH1,cH1:] by XBOOLE_0:def 4;
      a in the InternalRel of G by A42,XBOOLE_0:def 4;
      then a in IH1 \/ IH2 \/ H1H2 \/ H2H1 by A21,NECKLA_2:def 3;
      then a in IH1 \/ (IH2 \/ H1H2 \/ H2H1) by XBOOLE_1:113;
      then a in IH1 or a in IH2 \/ H1H2 \/ H2H1 by XBOOLE_0:def 3;
      then a in IH1 or a in IH2 \/ (H1H2 \/ H2H1) by XBOOLE_1:4;
      then
A44:  a in IH1 or a in IH2 or a in H1H2 \/ H2H1 by XBOOLE_0:def 3;
      per cases by A44,XBOOLE_0:def 3;
      suppose
        a in IH1;
        hence thesis;
      end;
      suppose
        a in IH2;
        then consider x,y being object such that
A45:    a = [x,y] and
A46:    x in cH2 and
        y in cH2 by RELSET_1:2;
        consider x1,y1 being object such that
A47:    x1 in cH1 and
        y1 in cH1 and
A48:    a = [x1,y1] by A43,ZFMISC_1:def 2;
        x = x1 by A45,A48,XTUPLE_0:1;
        then cH1 /\ cH2 <> {} by A46,A47,XBOOLE_0:def 4;
        hence thesis by A1;
      end;
      suppose
        a in H1H2;
        then consider x,y being object such that
        x in cH1 and
A49:    y in cH2 and
A50:    a = [x,y] by ZFMISC_1:def 2;
        consider x1,y1 being object such that
        x1 in cH1 and
A51:    y1 in cH1 and
A52:    a = [x1,y1] by A43,ZFMISC_1:def 2;
        y = y1 by A50,A52,XTUPLE_0:1;
        then cH1 /\ cH2 <> {} by A49,A51,XBOOLE_0:def 4;
        hence thesis by A1;
      end;
      suppose
        a in H2H1;
        then consider x,y being object such that
A53:    x in cH2 and
        y in cH1 and
A54:    a = [x,y] by ZFMISC_1:def 2;
        consider x1,y1 being object such that
A55:    x1 in cH1 and
        y1 in cH1 and
A56:    a = [x1,y1] by A43,ZFMISC_1:def 2;
        x = x1 by A54,A56,XTUPLE_0:1;
        then cH1 /\ cH2 <> {} by A53,A55,XBOOLE_0:def 4;
        hence thesis by A1;
      end;
    end;
    IH1 c= IH1 \/ (IH2 \/ [:cH1, cH2:]) by XBOOLE_1:7;
    then
A57: IH1 c= IH1 \/ IH2 \/ [:cH1, cH2:] by XBOOLE_1:4;
    the carrier of G = (the carrier of H1) \/ (the carrier of H2) by A21,
NECKLA_2:def 3;
    then
A58: the carrier of H1 c= the carrier of G & the carrier of H2 c= the
    carrier of G by XBOOLE_1:7;
A59: the InternalRel of G = IH1 \/ IH2 \/ [:cH1, cH2:] \/ [:cH2, cH1:] by A21,
NECKLA_2:def 3;
    then IH1 \/ IH2 \/ [:cH1, cH2:] c= the InternalRel of G by XBOOLE_1:7;
    then IH1 c= the InternalRel of G by A57;
    hence thesis by A59,A58,A39,A40,A22,YELLOW_0:def 13,def 14;
  end;
end;
