reserve rseq, rseq1, rseq2 for Real_Sequence;
reserve seq, seq1, seq2 for Complex_Sequence;
reserve k, n, n1, n2, m for Nat;
reserve p, r for Real;
reserve z for Complex;
reserve Nseq,Nseq1 for increasing sequence of NAT;

theorem Th38:
  for a, b being Real_Sequence, c being Complex_Sequence st (for n
holds Re (c.n) = a.n & Im (c.n) = b.n) holds a is convergent & b is convergent
  iff c is convergent
proof
  let a, b be Real_Sequence, c be Complex_Sequence such that
A1: for n holds Re(c.n) = a.n & Im(c.n) = b.n;
  thus a is convergent & b is convergent implies c is convergent
  proof
    assume that
A2: a is convergent and
A3: b is convergent;
    consider a1 being Real such that
A4: for p being Real st 0<p ex n st for m st n<=m holds |.a.m
    -a1.| < p by A2,SEQ_2:def 6;
    consider b1 being Real such that
A5: for p being Real st 0<p ex n st for m st n<=m holds |.b.m
    -b1.|<p by A3,SEQ_2:def 6;
    reconsider a1,b1 as Real;
    reconsider g=a1+b1*<i> as Element of COMPLEX by XCMPLX_0:def 2;
    take g;
    for p st 0<p holds ex n st for m st n <= m holds |.c.m-g.|< p
    proof
      let p;
      assume
A6:   0 < p;
      then consider n1 such that
A7:   for m st n1<=m holds |.a.m-a1.|< p/2 by A4;
      consider n2 such that
A8:   for m st n2<=m holds |.b.m-b1.|< p/2 by A5,A6;
      n1 <= (n1+n2) & n2 <= (n1+n2) by NAT_1:11;
      then consider n such that
A9:   n1 <= n and
A10:  n2 <= n;
      take n;
      for m st n <= m holds |.c.m-g.|< p
      proof
        let m;
        Re(c.m)=a.m & Re g =a1 by A1,COMPLEX1:12;
        then
A11:    Re(c.m-g)=a.m-a1 by COMPLEX1:19;
        Im(c.m)=b.m & Im g =b1 by A1,COMPLEX1:12;
        then
A12:    Im(c.m-g)=b.m-b1 by COMPLEX1:19;
        assume
A13:    n <= m;
        then n2 <= m by A10,XXREAL_0:2;
        then
A14:    |.b.m-b1.|< p/2 by A8;
        n1 <= m by A9,A13,XXREAL_0:2;
        then |.a.m-a1.|< p/2 by A7;
        then
A15:    |.a.m-a1.| + |.b.m-b1.|< p/2+ p/2 by A14,XREAL_1:8;
        |.c.m-g.| <= |.Re(c.m-g).| + |.Im(c.m-g).| by Th12;
        hence thesis by A15,A11,A12,XXREAL_0:2;
      end;
      hence thesis;
    end;
    hence thesis;
  end;
  assume c is convergent;
  then consider z being Complex such that
A16: for p being Real st 0<p ex n st for m st n <= m holds |.c.m-z.| < p;
  thus a is convergent
  proof
    reconsider z as Element of COMPLEX by XCMPLX_0:def 2;
    take Re z;
    let p be Real;
    assume
A17: 0<p;
    consider n such that
A18: for m st n <= m holds |.c.m-z.| < p by A16,A17;
    take n;
    let m;
    assume n <= m;
    then
A19: |.c.m-z.| < p by A18;
    Re(c.m) =a.m & Re(c.m-z)=Re(c.m)-Re(z) by A1,COMPLEX1:19;
    then |.a.m-Re(z).| <= |.c.m-z.| by Th13;
    hence thesis by A19,XXREAL_0:2;
  end;
  take Im z;
  let p be Real;
  assume
A20: p>0;
  consider n such that
A21: for m st n <= m holds |.c.m-z.| < p by A16,A20;
  take n;
  let m;
  assume n <= m;
  then
A22: |.c.m-z.| < p by A21;
A23: Im(c.m-z)=Im(c.m)-Im(z) by COMPLEX1:19;
  Im(c.m) =b.m by A1;
  then |.b.m-Im(z) .| <= |.c.m-z.| by A23,Th13;
  hence thesis by A22,XXREAL_0:2;
end;
