reserve s for set,
  i,j for natural Number,
  k for Nat,
  x,x1,x2,x3 for Real,
  r,r1,r2,r3,r4 for Real,
  F,F1,F2,F3 for real-valued FinSequence,
  R,R1,R2 for Element of i-tuples_on REAL;

theorem
  Sum sqr R = 0 implies R = i |-> 0
proof
  assume
A1: Sum sqr R = 0;
A2: len R = i by CARD_1:def 7;
A3: len(i |-> 0) = i by CARD_1:def 7;
  assume R <> i |-> 0;
  then consider j be Nat such that
A4: j in dom R and
A5: R.j <> (i |-> 0).j by A2,A3,FINSEQ_2:9;
  set x = R.j,x9 = (sqr R).j;
A6: dom R = Seg len R by FINSEQ_1:def 3;
  x <> 0 by A5;
  then 0 < x^2 by SQUARE_1:12;
  then
A7: 0 < x9 by VALUED_1:11;
A8: now
    let k such that
    k in dom sqr R;
    set r = (sqr R).k;
    set x = R.k;
    0 <= x^2 by XREAL_1:63;
    hence 0 <= r by VALUED_1:11;
  end;
  dom sqr R = Seg len sqr R by FINSEQ_1:def 3;
  then j in dom sqr R by A4,A6,FINSEQ_2:33;
  hence thesis by A1,A8,A7,Th85;
end;
