reserve X for RealUnitarySpace;
reserve x for Point of X;
reserve i, n for Nat;

theorem Th4:
  for L be linear-Functional of X for p be FinSequence of the
carrier of X st len p >=1 for q be FinSequence of REAL st dom p = dom q & (for
  i st i in dom q holds q.i = L.(p.i) ) holds L.((the addF of X) "**" p) =
  addreal "**" q
proof
  let L be linear-Functional of X;
  let p be FinSequence of the carrier of X such that
A1: len p >= 1;
  consider f be sequence of the carrier of X such that
A2: f.1 = p.1 and
A3: for n be Nat st 0 <> n & n < len p holds f.(n + 1) = (the
  addF of X).(f.n,p.(n + 1)) and
A4: (the addF of X) "**" p = f.(len p) by A1,FINSOP_1:1;
  let q be FinSequence of REAL such that
A5: dom p = dom q and
A6: for i st i in dom q holds q.i = L.(p.i);
  Seg (len q) = dom p by A5,FINSEQ_1:def 3
    .= Seg (len p) by FINSEQ_1:def 3;
  then
A7: len q = len p by FINSEQ_1:6;
  then consider g be sequence of  REAL such that
A8: g.1 = q.1 and
A9: for n be Nat st 0 <> n & n < len q holds g.(n + 1) =
  addreal.(g.n,q.(n + 1)) and
A10: addreal "**" q = g.(len q) by A1,FINSOP_1:1;
  defpred P[Nat] means 1 <= $1 & $1 <= len q implies g.$1 = L.(f.$1);
A11: now
    let n;
A12:  n in NAT by ORDINAL1:def 12;
    assume
A13: P[n];
    now
A14:  n <= n+1 by NAT_1:11;
      assume that
A15:  1 <=n+1 and
A16:  n+1 <= len q;
      per cases;
      suppose
A17:    n=0;
        1 in dom p by A1,FINSEQ_3:25;
        hence g.(n+1) = L.(f.(n+1)) by A5,A6,A2,A8,A17;
      end;
      suppose
A18:    n<>0;
        then
A19:    0+1 <= n by INT_1:7,A12;
        reconsider z=f.n as Element of X;
        reconsider z1=z as VECTOR of X;
A20:    n+1 in dom q by A15,A16,FINSEQ_3:25;
        then p.(n+1) in rng p by A5,FUNCT_1:3;
        then reconsider y=p.(n+1) as Element of X;
        reconsider y1=y as VECTOR of X;
        set Lz=L.z1, Ly=L.y1;
A21:    n+1-1 < len q-0 by A16,XREAL_1:15;
        hence g.(n+1) = addreal.(g.n,q.(n + 1)) by A9,A18
          .= addreal.(L.(f.n), L.y) by A6,A13,A16,A14,A19,A20,XXREAL_0:2
          .= Lz + Ly by BINOP_2:def 9
          .= L .(z1+y1) by HAHNBAN:def 2
          .= L.(f.(n + 1)) by A3,A7,A18,A21;
      end;
    end;
    hence P[n+1];
  end;
A22: P[0];
  for n holds P[n] from NAT_1:sch 2(A22,A11);
  hence thesis by A1,A4,A7,A10;
end;
