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

theorem Th18:
  for G1,G2 being RelStr st the carrier of G1 misses the carrier
of G2 holds ComplRelStr sum_of(G1,G2) = union_of(ComplRelStr G1, ComplRelStr G2
  )
proof
  let G1,G2 be RelStr;
  assume
A1: the carrier of G1 misses the carrier of G2;
  set P = the InternalRel of ComplRelStr sum_of(G1,G2), R = the InternalRel of
union_of(ComplRelStr G1,ComplRelStr G2), X1 = the InternalRel of ComplRelStr G1
, X2 = the InternalRel of ComplRelStr G2, X5 = [:the carrier of G1, the carrier
  of G1:], X6 = [:the carrier of G2, the carrier of G2:], X7 = [:the carrier of
  G1, the carrier of G2:], X8 = [:the carrier of G2, the carrier of G1:];
A2: [:the carrier of sum_of(G1,G2),the carrier of sum_of(G1,G2):] = [:(the
carrier of G1) \/ the carrier of G2, the carrier of sum_of(G1,G2):] by
NECKLA_2:def 3
    .= [:(the carrier of G1) \/ the carrier of G2, (the carrier of G1) \/
  the carrier of G2:] by NECKLA_2:def 3
    .= X5 \/ X7 \/ X8 \/ X6 by ZFMISC_1:98;
A3: for a,b being object holds [a,b] in P iff [a,b] in R
  proof
    let a,b be object;
    set x = [a,b];
    thus x in P implies x in R
    proof
      assume x in P;
      then
A4:   x in (the InternalRel of sum_of(G1,G2))` \ id (the carrier of sum_of
      (G1,G2)) by NECKLACE:def 8;
      then x in X5 \/ X7 \/ X8 or x in X6 by A2,XBOOLE_0:def 3;
      then
A5:   x in X5 \/ X7 or x in X8 or x in X6 by XBOOLE_0:def 3;
      x in (the InternalRel of sum_of(G1,G2))` by A4,XBOOLE_0:def 5;
      then
      x in [:the carrier of sum_of(G1,G2),the carrier of sum_of(G1,G2) :]
      \ (the InternalRel of sum_of(G1,G2)) by SUBSET_1:def 4;
      then not x in the InternalRel of sum_of(G1,G2) by XBOOLE_0:def 5;
      then
A6:   not x in (the InternalRel of G1) \/ (the InternalRel of G2) \/ [:
the carrier of G1,the carrier of G2:] \/ [:the carrier of G2,the carrier of G1
      :] by NECKLA_2:def 3;
A7:   not x in the InternalRel of G1 & not x in the InternalRel of G2 &
not x in [:the carrier of G1,the carrier of G2:] & not x in [:the carrier of G2
      ,the carrier of G1:]
      proof
        assume not thesis;
        then x in (the InternalRel of G1) \/ the InternalRel of G2 or x in [:
the carrier of G1,the carrier of G2:] or x in [:the carrier of G2,the carrier
        of G1:] by XBOOLE_0:def 3;
        then x in (the InternalRel of G1) \/ (the InternalRel of G2) \/ [:the
carrier of G1,the carrier of G2:] or x in [:the carrier of G2,the carrier of G1
        :] by XBOOLE_0:def 3;
        hence contradiction by A6,XBOOLE_0:def 3;
      end;
      not x in id (the carrier of sum_of(G1,G2)) by A4,XBOOLE_0:def 5;
      then not x in id ((the carrier of G1) \/ the carrier of G2) by
NECKLA_2:def 3;
      then
A8:   not x in id (the carrier of G1) \/ id the carrier of G2 by SYSREL:14;
      then
A9:   not x in id the carrier of G1 by XBOOLE_0:def 3;
A10:  not x in id the carrier of G2 by A8,XBOOLE_0:def 3;
      per cases by A5,XBOOLE_0:def 3;
      suppose
        x in X5;
        then x in X5 \ (the InternalRel of G1) by A7,XBOOLE_0:def 5;
        then x in (the InternalRel of G1)` by SUBSET_1:def 4;
        then x in (the InternalRel of G1)` \ id the carrier of G1 by A9,
XBOOLE_0:def 5;
        then x in X1 by NECKLACE:def 8;
        then x in X1 \/ X2 by XBOOLE_0:def 3;
        hence thesis by NECKLA_2:def 2;
      end;
      suppose
        x in X7;
        hence thesis by A7;
      end;
      suppose
        x in X8;
        hence thesis by A7;
      end;
      suppose
        x in X6;
        then x in X6 \ (the InternalRel of G2) by A7,XBOOLE_0:def 5;
        then x in (the InternalRel of G2)` by SUBSET_1:def 4;
        then x in (the InternalRel of G2)` \ id the carrier of G2 by A10,
XBOOLE_0:def 5;
        then x in X2 by NECKLACE:def 8;
        then x in X1 \/ X2 by XBOOLE_0:def 3;
        hence thesis by NECKLA_2:def 2;
      end;
    end;
    assume x in R;
    then
A11: x in (the InternalRel of ComplRelStr G1) \/ the InternalRel of
    ComplRelStr G2 by NECKLA_2:def 2;
    per cases by A11,XBOOLE_0:def 3;
    suppose
      x in the InternalRel of ComplRelStr G1;
      then
A12:  x in (the InternalRel of G1)` \ id the carrier of G1 by NECKLACE:def 8;
      then
A13:  not x in id the carrier of G1 by XBOOLE_0:def 5;
A14:  not x in id (the carrier of sum_of(G1,G2))
      proof
        assume not thesis;
        then x in id ((the carrier of G1) \/ the carrier of G2) by
NECKLA_2:def 3;
        then x in id (the carrier of G1) \/ id the carrier of G2 by SYSREL:14;
        then x in id the carrier of G2 by A13,XBOOLE_0:def 3;
        then
A15:    a in the carrier of G2 by ZFMISC_1:87;
        a in the carrier of G1 by A12,ZFMISC_1:87;
        then (the carrier of G1) /\ the carrier of G2 is non empty by A15,
XBOOLE_0:def 4;
        hence contradiction by A1;
      end;
      x in (the InternalRel of G1)` by A12,XBOOLE_0:def 5;
      then x in [:the carrier of G1,the carrier of G1:] \ the InternalRel of
      G1 by SUBSET_1:def 4;
      then
A16:  not x in the InternalRel of G1 by XBOOLE_0:def 5;
A17:  not x in the InternalRel of sum_of(G1,G2)
      proof
        assume not thesis;
        then x in (the InternalRel of G1) \/ (the InternalRel of G2) \/ X7 \/
        X8 by NECKLA_2:def 3;
        then x in (the InternalRel of G1) \/ (the InternalRel of G2) \/ X7 or
        x in X8 by XBOOLE_0:def 3;
        then
A18:    x in (the InternalRel of G1) \/ the InternalRel of G2 or x in X7
        or x in X8 by XBOOLE_0:def 3;
        per cases by A16,A18,XBOOLE_0:def 3;
        suppose
A19:      x in the InternalRel of G2;
A20:      a in the carrier of G1 by A12,ZFMISC_1:87;
          a in the carrier of G2 by A19,ZFMISC_1:87;
          then (the carrier of G1) /\ the carrier of G2 is non empty by A20,
XBOOLE_0:def 4;
          hence contradiction by A1;
        end;
        suppose
A21:      x in X7;
A22:      b in the carrier of G1 by A12,ZFMISC_1:87;
          b in the carrier of G2 by A21,ZFMISC_1:87;
          then (the carrier of G1) /\ the carrier of G2 is non empty by A22,
XBOOLE_0:def 4;
          hence contradiction by A1;
        end;
        suppose
A23:      x in X8;
A24:      a in the carrier of G1 by A12,ZFMISC_1:87;
          a in the carrier of G2 by A23,ZFMISC_1:87;
          then (the carrier of G1) /\ the carrier of G2 is non empty by A24,
XBOOLE_0:def 4;
          hence contradiction by A1;
        end;
      end;
      x in X5 \/ (X7 \/ X8 \/ X6) by A12,XBOOLE_0:def 3;
      then
      x in [:the carrier of sum_of(G1,G2),the carrier of sum_of(G1,G2) :]
      by A2,XBOOLE_1:113;
      then
      x in [:the carrier of sum_of(G1,G2),the carrier of sum_of(G1,G2) :]
      \ (the InternalRel of sum_of(G1,G2)) by A17,XBOOLE_0:def 5;
      then x in (the InternalRel of sum_of(G1,G2))` by SUBSET_1:def 4;
      then x in (the InternalRel of sum_of(G1,G2))` \ id (the carrier of
      sum_of(G1,G2)) by A14,XBOOLE_0:def 5;
      hence thesis by NECKLACE:def 8;
    end;
    suppose
      x in the InternalRel of ComplRelStr G2;
      then
A25:  x in (the InternalRel of G2)` \ id the carrier of G2 by NECKLACE:def 8;
      then
A26:  not x in id the carrier of G2 by XBOOLE_0:def 5;
A27:  not x in id (the carrier of sum_of(G1,G2))
      proof
        assume not thesis;
        then x in id ((the carrier of G1) \/ the carrier of G2) by
NECKLA_2:def 3;
        then x in id (the carrier of G1) \/ id the carrier of G2 by SYSREL:14;
        then x in id the carrier of G1 by A26,XBOOLE_0:def 3;
        then
A28:    b in the carrier of G1 by ZFMISC_1:87;
        b in the carrier of G2 by A25,ZFMISC_1:87;
        then (the carrier of G1) /\ the carrier of G2 is non empty by A28,
XBOOLE_0:def 4;
        hence contradiction by A1;
      end;
      x in (the InternalRel of G2)` by A25,XBOOLE_0:def 5;
      then x in [:the carrier of G2,the carrier of G2:] \ the InternalRel of
      G2 by SUBSET_1:def 4;
      then
A29:  not x in the InternalRel of G2 by XBOOLE_0:def 5;
A30:  not x in the InternalRel of sum_of(G1,G2)
      proof
        assume not thesis;
        then x in (the InternalRel of G1) \/ (the InternalRel of G2) \/ X7 \/
        X8 by NECKLA_2:def 3;
        then x in (the InternalRel of G1) \/ (the InternalRel of G2) \/ X7 or
        x in X8 by XBOOLE_0:def 3;
        then
A31:    x in (the InternalRel of G1) \/ the InternalRel of G2 or x in X7
        or x in X8 by XBOOLE_0:def 3;
        per cases by A29,A31,XBOOLE_0:def 3;
        suppose
A32:      x in the InternalRel of G1;
A33:      a in the carrier of G2 by A25,ZFMISC_1:87;
          a in the carrier of G1 by A32,ZFMISC_1:87;
          then (the carrier of G1) /\ the carrier of G2 is non empty by A33,
XBOOLE_0:def 4;
          hence contradiction by A1;
        end;
        suppose
A34:      x in X7;
A35:      a in the carrier of G2 by A25,ZFMISC_1:87;
          a in the carrier of G1 by A34,ZFMISC_1:87;
          then (the carrier of G1) /\ the carrier of G2 is non empty by A35,
XBOOLE_0:def 4;
          hence contradiction by A1;
        end;
        suppose
A36:      x in X8;
A37:      b in the carrier of G2 by A25,ZFMISC_1:87;
          b in the carrier of G1 by A36,ZFMISC_1:87;
          then (the carrier of G1) /\ the carrier of G2 is non empty by A37,
XBOOLE_0:def 4;
          hence contradiction by A1;
        end;
      end;
      x in [:the carrier of sum_of(G1,G2),the carrier of sum_of(G1,G2):]
      by A2,A25,XBOOLE_0:def 3;
      then x in [:the carrier of sum_of(G1,G2),the carrier of sum_of(G1,G2 )
      :] \ (the InternalRel of sum_of(G1,G2)) by A30,XBOOLE_0:def 5;
      then x in (the InternalRel of sum_of(G1,G2))` by SUBSET_1:def 4;
      then x in (the InternalRel of sum_of(G1,G2))` \ id (the carrier of
      sum_of(G1,G2)) by A27,XBOOLE_0:def 5;
      hence thesis by NECKLACE:def 8;
    end;
  end;
A38: the carrier of union_of(ComplRelStr G1, ComplRelStr G2) = (the carrier
  of ComplRelStr G1) \/ (the carrier of ComplRelStr G2) by NECKLA_2:def 2
    .= (the carrier of G1) \/ the carrier of ComplRelStr G2 by NECKLACE:def 8
    .= (the carrier of G1) \/ the carrier of G2 by NECKLACE:def 8;
  the carrier of ComplRelStr sum_of(G1,G2) = the carrier of sum_of(G1,G2)
  by NECKLACE:def 8
    .= (the carrier of G1) \/ the carrier of G2 by NECKLA_2:def 3;
  hence thesis by A38,A3,RELAT_1:def 2;
end;
