
theorem
  for G be Group,
      I1, I2 be non empty set,
      F1 be internal DirectSumComponents of G,I1,
      F2 be Subgroup-Family of I2,G
  st I1 misses I2 & F2 = I2 --> (1).G
  holds
  F1 +* F2 is internal DirectSumComponents of G,I1 \/ I2
  proof
    let G be Group,
        I1, I2 be non empty set,
        F1 be internal DirectSumComponents of G,I1,
        F2 be Subgroup-Family of I2,G;
    assume that
    A1: I1 misses I2 and
    A2: F2 = I2 --> (1).G;
    reconsider I = {1,2} as non empty set;
    set J = {[1,I1], [2,I2]};
    for x,y1,y2 be object
    st [x,y1] in J & [x,y2] in J holds y1 = y2
    proof
      let x,y1,y2 be object;
      assume
      [x,y1] in J & [x,y2] in J; then
      A3: ([x,y1] = [1,I1] or [x,y1] = [2,I2])
        & ([x,y2] = [1,I1] or [x,y2] = [2,I2]) by TARSKI:def 2; then
      per cases by XTUPLE_0:1;
      suppose
        x=1 & y1=I1;
        hence y1=y2 by A3,XTUPLE_0:1;
      end;
      suppose
        x=2 & y1=I2;
        hence y1=y2 by A3,XTUPLE_0:1;
      end;
    end; then
    reconsider J as Function by FUNCT_1:def 1;
    dom J = I by RELAT_1:10; then
    reconsider J as ManySortedSet of I by PARTFUN1:def 2,RELAT_1:def 18;
    A4: rng J = {I1,I2} by RELAT_1:10;
    [1,I1] in J & [2,I2] in J by TARSKI:def 2; then
    A5: 1 in dom J & J.1=I1 & 2 in dom J & J.2=I2 by FUNCT_1:1;
    not {} in rng J
    proof
      assume {} in rng J; then
      consider x being object such that
      A6: x in dom J & {} = J.x by FUNCT_1:def 3;
      thus contradiction by A5,A6,TARSKI:def 2;
    end; then
    J is non-empty; then
    reconsider J as non-empty ManySortedSet of I;
    for i,j be object st i<>j holds J.i misses J.j
    proof
      let i,j be object;
      assume
      A7: i<>j;
      per cases;
      suppose
        not i in dom J or not j in dom J; then
        J.i = {} or J.j = {} by FUNCT_1:def 2; then
        J.i /\ J.j = {};
        hence J.i misses J.j by XBOOLE_0:def 7;
      end;
      suppose
        i in dom J & j in dom J; then
        (i=1 or i=2) & (j=1 or j=2) by TARSKI:def 2;
        hence J.i misses J.j by A1,A5,A7;
      end;
    end; then
    J is disjoint_valued; then
    reconsider J as non-empty disjoint_valued ManySortedSet of I;
    reconsider M = <* G, (1).G *> as Group-Family of I;
    A8: for x,y be Function
         st x in [#] product M & y in [#] product M & x.1 = y.1
         holds x = y
    proof
      let x,y be Function;
      assume that
      A9: x in [#] product M and
      A10: y in [#] product M and
      A11: x.1 = y.1;
      A12: dom x = I & dom y = I by A9,A10,GROUP_19:3;
      for i be object st i in dom x holds x.i = y.i
      proof
        let i be object;
        assume i in dom x; then
        A13: i=1 or i=2 by A12,TARSKI:def 2;
        A14: x in product M & y in product M by A9,A10;
        reconsider p = x,q = y as Function;
B4:     2 is Element of I by TARSKI:def 2;
        reconsider M2 = M.2 as Group;
        p.2 in M2 & q.2 in M2 by A14,B4,GROUP_19:5; then
        p.2 in (1).G & q.2 in (1).G; then
        p.2 in {1_G} & q.2 in {1_G} by GROUP_2:def 7; then
        p.2 = 1_G & q.2 = 1_G by TARSKI:def 1;
        hence thesis by A11,A13;
      end;
      hence thesis by A12;
    end;
    set h1 = id the carrier of G;
    for a,b be Element of G holds h1.(a*b) = h1.a * h1.b; then
    reconsider h1 as Homomorphism of G,G by GROUP_6:def 6;
    set CS1 = the carrier of product M;
    set CS2 = the carrier of G;
    defpred P[Element of CS1,Element of CS2] means
    $2 = h1.($1.1);
    A15: for x being Element of CS1
         ex y being Element of CS2 st P[x,y]
    proof
      let x be Element of CS1;
      A16: x in product M;
      reconsider z = x as Function;
B5:   1 is Element of I by TARSKI:def 2;
      reconsider M1 = M.1 as Group;
      z.1 in M1 by A16,B5,GROUP_19:5; then
      z.1 in G; then
      h1.(z.1) in CS2 by FUNCT_2:5;
      hence thesis;
    end;
    consider h being Function of CS1,CS2 such that
    A17: for x being Element of CS1 holds P[x,h.x] from FUNCT_2:sch 3(A15);
    reconsider h as Function of CS1,CS2;
    A18: for x1,x2 being object st x1 in CS1 & x2 in CS1 & h.x1 = h.x2
        holds x1 = x2
    proof
      let x1,x2 be object;
      assume
      A19: x1 in CS1 & x2 in CS1 & h.x1 = h.x2; then
      reconsider x10=x1, x20=x2 as Element of CS1;
      A20: h.x10 = h1.(x10.1) & h.x20 = h1.(x20.1) by A17;
      A21: x1 in product M by A19;
      reconsider z1 = x1 as Function by A19;
B6:   1 is Element of I by TARSKI:def 2;
      reconsider M1 = M.1 as Group;
      z1.1 in M1 by A21,B6,GROUP_19:5; then
      A22: x10.1 in the carrier of G;
      A23: x2 in product M by A19;
      reconsider z2 = x2 as Function by A19;
      z2.1 in M1 by A23,B6,GROUP_19:5; then
      A24: x20.1 in the carrier of G;
      x10.1 = x20.1 by A19,A20,A22,A24,FUNCT_2:19;
      hence x1 = x2 by A8;
    end; then
    A25: h is one-to-one by FUNCT_2:19;
    for y being object st y in CS2
    ex x being object st x in CS1 & y = h.x
    proof
      let y be object;
      assume y in CS2; then
      y in rng h1; then
      consider x1 be object such that
      A26: x1 in the carrier of G & y = h1.x1 by FUNCT_2:11;
      reconsider x1 as Element of G by A26;
      set z1 = the Element of the carrier of (1).G;
      reconsider x = <*x1,z1*> as Element of CS1;
      take x;
      h.x = h1.(x.1) by A17
         .= y by A26;
      hence thesis;
    end; then
    rng h = CS2 by FUNCT_2:10; then
    A27: h is onto by FUNCT_2:def 3;
    A28: for a,b be Element of CS1 holds h.(a * b) = h.a * h.b
    proof
      let a,b be Element of CS1;
      A29: h.a = h1.(a.1) & h.b = h1.(b.1) by A17;
      A30: 1 in I by TARSKI:def 2;
      A31: M.1 = G;
      A32: a in product M & b in product M;
      reconsider a1 = a, b1 = b as Function;
B8:   1 is Element of I by TARSKI:def 2;
      reconsider M1 = M.1 as Group;
      a1.1 in M1 & b1.1 in M1 by A32,B8,GROUP_19:5; then
      reconsider a1 = a.1, b1 = b.1 as Element of G;
      thus h.(a * b) = h1.((a*b).1) by A17
                    .= h1.(a1*b1) by A30,A31,GROUP_7:1
                    .= (h.a) * (h.b) by A29;
    end;
    product M = sum M by GROUP_7:9; then
    A33: h is Homomorphism of sum M, G by A28,GROUP_6:def 6; then
    reconsider M = <* G, (1).G *> as DirectSumComponents of G,I
      by A25,A27,GROUP_19:def 8;
    A34: for i be Element of I holds M.i is Subgroup of G
    proof
      let i be Element of I;
      i = 1 or i = 2 by TARSKI:def 2;
      hence thesis by GROUP_2:54;
    end;
    for x be finite-support Function of I,G st x in sum M holds h.x = Product x
    proof
      let x be finite-support Function of I,G;
      assume NN:x in sum M; then
      A36: x in product M by GROUP_7:9;
      reconsider x0 = x as Element of CS1 by GROUP_7:9,NN;
B10:  1 in I by TARSKI:def 2;
      reconsider M1 = M.1 as Group;
      x0.1 in M1 by A36,B10,GROUP_19:5; then
      reconsider x01=x0.1 as Element of G;
      1_G in {1_G} by TARSKI:def 1; then
      reconsider z1 = 1_G as Element of (1).G by GROUP_2:def 7;
      reconsider xx = <*x01,z1*> as Element of CS1;
      A37: h.xx = h1.(xx.1) by A17
              .= h1.x01
              .= x01;
      h.x = h1.(x0.1) by A17
         .= x01; then
      A38: x = <*x01,1_G*> by A18,A37;
      thus h.x = h1.(x0.1) by A17
              .= Product x by A38,Th45;
    end; then
    reconsider M as internal DirectSumComponents of G,I
      by A25,A27,A33,A34,GROUP_19:def 9;
    set N = <* F1, F2 *>;
    len N = 2 by FINSEQ_1:44; then
    dom N = I by FINSEQ_1:2,def 3; then
    reconsider N as ManySortedSet of I by PARTFUN1:def 2,RELAT_1:def 18;
    A39: for i be Element of I holds N.i is Group-Family of J.i
    proof
      let i be Element of I;
      per cases by TARSKI:def 2;
      suppose
        i = 1;
        hence N.i is Group-Family of J.i by A5;
      end;
      suppose
        i = 2;
        hence N.i is Group-Family of J.i by A5;
      end;
    end; then
    for i be Element of I holds N.i is multMagma-Family of J.i; then
    reconsider N as multMagma-Family of I,J by Def4;
    reconsider N as Group-Family of I,J by A39,Def5;
    A40: for i be Element of I holds
        N.i is internal DirectSumComponents of M.i,J.i
    proof
      let i be Element of I;
      per cases by TARSKI:def 2;
      suppose i=1;
        hence thesis by A5;
      end;
      suppose
        A42: i=2;
        for i be Element of I2 holds card(F2.i) = 1
        proof
          let i be Element of I2;
          the carrier of (F2.i) = the carrier of ((1).G) by A2,FUNCOP_1:7
                               .= {1_G} by GROUP_2:def 7;
          hence thesis by CARD_1:30;
        end; then
        A43: card(the carrier of sum F2) = 1 by Th43;
        card { 0 } = 1 by CARD_1:30; then
        consider a being object such that
        A44: the carrier of sum F2 = { a } by A43,CARD_1:29;
        A45: the carrier of sum F2 = {1_(sum F2)} by A44,TARSKI:def 1;
        reconsider Z = the carrier of sum F2 as non empty set;
        set h = Z --> 1_G;
        A46:  dom h = the carrier of sum F2 & rng h c= {1_G} by FUNCOP_1:13;
        {1_G} = the carrier of (1).G by GROUP_2:def 7; then
        reconsider h as Function of the carrier of sum F2,the carrier of (1).G
          by A46,FUNCT_2:2;
        for a,b be Element of the carrier of sum F2
        holds h.(a * b) = h.a * h.b
        proof
          let a,b be Element of the carrier of sum F2;
          A47: 1_G = 1_((1).G) by GROUP_2:44;
          thus h.(a * b) = 1_G by FUNCOP_1:7
          .= 1_((1).G) * 1_((1).G) by A47,GROUP_1:def 4
          .= (h.a) * 1_((1).G) by A47,FUNCOP_1:7
          .= (h.a) * (h.b) by A47,FUNCOP_1:7;
        end; then
        reconsider h as Homomorphism of sum F2, (1).G by GROUP_6:def 6;
        for x1,x2 being object
             st x1 in the carrier of sum F2
              & x2 in the carrier of sum F2
              & h.x1 = h.x2 holds x1 = x2
        proof
          let x1,x2 be object;
          assume
          A48: x1 in the carrier of sum F2
            & x2 in the carrier of sum F2 & h.x1 = h.x2;
          hence x1 = 1_(sum F2) by A45,TARSKI:def 1
                  .= x2 by A45,A48,TARSKI:def 1;
        end; then
        A49: h is one-to-one by FUNCT_2:19;
        for y being object st y in the carrier of (1).G
        ex x being object st x in the carrier of sum F2 & y = h.x
        proof
          let y be object;
          assume y in the carrier of (1).G; then
          y in {1_G} by GROUP_2:def 7; then
          A50: y = 1_G by TARSKI:def 1;
          set x = 1_(sum F2);
          take x;
          thus x in the carrier of sum F2;
          thus thesis by A50,FUNCOP_1:7;
        end; then
        rng h = the carrier of (1).G by FUNCT_2:10; then
        A51: h is onto by FUNCT_2:def 3;
        A52:N.i= F2 & M.i = (1).G by A42;
        reconsider h as Homomorphism of sum (N.i), M.i by A5,A42;
        reconsider Ni = N.i as DirectSumComponents of M.i,J.i
          by A5,A42,A49,A51,GROUP_19:def 8;
        A53: for j be Element of J.i holds Ni.j is Subgroup of M.i
        proof
          let j be Element of J.i;
          F2.j = (1).G by A2,A5,A42,FUNCOP_1:7;
          hence Ni.j is Subgroup of M.i by A52,GROUP_2:54;
        end;
        A54: for x be finite-support Function of J.i,M.i st x in sum Ni
            holds h.x = Product x
        proof
          let x be finite-support Function of J.i,M.i;
          assume
          A55: x in sum Ni;
          for k be object st k in J.i holds x.k = 1_M.i
          proof
            let k be object;
            assume
            A56: k in J.i; then
            reconsider k0 = k as Element of J.i;
            reconsider N = F2.k0 as Group by A2,A5,A42,FUNCOP_1:7;
            A57: F2.k = (1).G by A2,A5,A42,A56,FUNCOP_1:7;
            x in sum F2 by A5,A42,A55; then
            x in product F2 by GROUP_2:40; then
            x.k0 in N by A5,A42,GROUP_19:5; then
            A58:x.k in {1_G} by A57,GROUP_2:def 7;
            1_G = 1_((1).G) by GROUP_2:44
               .= 1_(M.i) by A42;
            hence thesis by A58,TARSKI:def 1;
          end; then
          Product x = 1_M.i by Th44
                   .= 1_((1).G) by A42
                   .= 1_G by GROUP_2:44;
          hence thesis by A5,A42,A55,FUNCOP_1:7;
        end;
        Ni is internal by A49,A51,A52,A53,A54;
        hence thesis;
      end;
    end;
    A59: I1 \/ I2 = Union J by A4,ZFMISC_1:75;
    A60: dom (Union N) = Union J by PARTFUN1:def 2
                      .= (dom F1) \/ I2 by A59,PARTFUN1:def 2
                      .= (dom F1) \/ (dom F2) by PARTFUN1:def 2;
    for x being object st x in dom F1 \/ dom F2 holds
      (x in dom F2 implies (Union N).x = F2.x)
    & (not x in dom F2 implies (Union N).x = F1.x)
    proof
      let x be object;
      assume x in dom F1 \/ dom F2; then
      A61: x in I1 \/ dom F2 by PARTFUN1:def 2; then
      A62: x in I1 \/ I2 by PARTFUN1:def 2;
      thus x in dom F2 implies (Union N).x = F2.x
      proof
        assume B32:x in dom F2; then
        reconsider i=x as Element of Union J by A59,XBOOLE_0:def 3;
        reconsider j=2 as Element of I by TARSKI:def 2;
        (Union N).i = (N.j).i by A5,B32,Th19
                   .= F2.i;
        hence thesis;
      end;
      thus not x in dom F2 implies (Union N).x = F1.x
      proof
        assume not x in dom F2; then
        A63: not x in I2 by PARTFUN1:def 2;
        reconsider i=x as Element of Union J by A59,A61,PARTFUN1:def 2;
        reconsider j=1 as Element of I by TARSKI:def 2;
        i in J.j by A5,A62,A63,XBOOLE_0:def 3; then
        (Union N).i = (N.j).i by Th19
                   .= F1.i;
        hence thesis;
      end;
    end; then
    F1 +* F2 = Union N by A60,FUNCT_4:def 1;
    hence thesis by A40,A59,Th40;
  end;
