reserve x,y for object,
        D,D1,D2 for non empty set,
        i,j,k,m,n for Nat,
        f,g for FinSequence of D*,
        f1 for FinSequence of D1*,
        f2 for FinSequence of D2*;
reserve f for complex-valued Function,
        g,h for complex-valued FinSequence;

theorem
  (g^h,k)+...+(g^h,n) =
    (g,k) +...+ (g,n)+ (h,k-'len g)+...+(h,n-'len g)
proof
  set gh=g^h;
  per cases;
  suppose A1:k >n;
    then A2:(g^h,k)+...+(g^h,n) = 0 &
    (g,k) +...+ (g,n)=0 by Def1;
    per cases by XXREAL_0:1;
    suppose k-'len g = n-'len g & k-'len g=0;
      then A3:(h,k-'len g)+...+(h,n-'len g) = h.0 by Th11;
      not 0 in dom h by FINSEQ_3:25;
      hence thesis by A3,A2,FUNCT_1:def 2;
    end;
    suppose A4: k-'len g = n-'len g & k-'len g > 0;
      then k-'len g = k- len g & n-'len g = n- len g by XREAL_0:def 2;
      hence thesis by A1,A4;
    end;
    suppose n-'len g < k-'len g;
      hence thesis by Def1,A2;
    end;
    suppose A5:n-'len g > k-'len g;
      then n-'len g=n-len g & n-len g >0 & 0 = len g- len g
        by XREAL_0:def 2;
      then n > len g by XREAL_1:6;
      hence thesis by A5,A1,NAT_D:56;
    end;
  end;
  suppose A6: k <= n;
    set w =the complex-valued FinSequence;
    per cases;
    suppose A7:n <= len g;
      then k <= len g by A6,XXREAL_0:2;
      then n - len g <= 0 & k-len g <= 0 by A7,XREAL_1:47;
      then n-'len g =0 & k-'len g =0 by XREAL_0:def 2;
      then A8: (h,k-'len g)+...+(h,n-'len g) = h.0 by Th11;
      not 0 in dom h by FINSEQ_3:25;
      then (h,k-'len g)+...+(h,n-'len g)=0 by FUNCT_1:def 2,A8;
      hence thesis by A7,Lm2,A6;
    end;
    suppose A9: k > len g;
      then (g,k) +...+ (g,n) = 0 by Th15;
      hence thesis by Lm3,A9,A6;
    end;
    suppose A10: n > len g & k <= len g;
      then A11:(g^h,k)+...+(g^h,len g) = (g,k)+...+(g,len g) by Lm2
        .= (g,k)+...+(g,n) by Th16,A10;
      k-len g <= len g - len g by A10,XREAL_1:7;
      then A12:k-'len g=0 by XREAL_0:def 2;
      A13:len g+1-'len g = len g+1-len g by NAT_D:37;
      len g+1 > len g & n>= len g+1 by A10,NAT_1:13;
      then (g^h,len g+1)+...+(g^h,n) = (h,len g+1-'len g)+...+(h,n-'len g)
        by Lm3
        .=(h,k-'len g)+...+(h,n-'len g) by A13,Th17,A12;
      hence thesis by A10,Th14,A11;
    end;
  end;
end;
