reserve X for set;
reserve k,m,n for Nat;
reserve i for Integer;
reserve a,b,c,d,e,g,p,r,x,y for Real;
reserve z for Complex;

theorem
  Sum ((sqr x_r-seq(m))") = (2*m+1)^2 / (PI^2) * Sum(Basel-seq,m)
  proof
    set a = PI^2;
    set b = (2*m+1)^2;
    set B = Basel-seq;
    set S = Shift(B|Segm(m+1),1);
    set M = x_r-seq(m);
    set G = (sqr M)";
    set F = <*0*>^G;
A1: B.0 = 1/(0^2) by Th29;
A2: Sum(B,m) = Sum(S) by DBLSEQ_2:49;
A3: dom S = Seg(m+1) by DBLSEQ_2:45;
A4: len(G) = len(sqr M) by Lm3
    .= len(M) by CARD_1:def 7
    .= m by Th19;
A5: len F = len <*0*> + len G by FINSEQ_1:22;
A6: len <*0*> = 1 by FINSEQ_1:39;
A7: F = b/a(#)S
    proof
      thus len(F) = len(S) by A4,A5,A6,A3,FINSEQ_1:def 3
      .= len(b/a(#)S) by COMPLSP2:3;
      let k such that
A8:   1 <= k and
A9:   k <= len(F);
A10:  (b/a(#)S).k = b/a*(S.k) by VALUED_1:6;
      per cases by A8,XXREAL_0:1;
      suppose
A11:    k = 1;
        1 <= m+1 by NAT_1:11;
        then 0+1 in dom S by A3;
        then S.(0+1) = B.0 by DBLSEQ_2:47;
        hence (b/a(#)S).k = F.k by A1,A10,A11;
      end;
      suppose
A12:    1 < k;
        reconsider s = k-1 as Nat by A8;
A13:    k = s+1;
        k in dom S by A3,A4,A5,A6,A8,A9;
        then
A14:    S.k = B.s by A13,DBLSEQ_2:47
        .= 1/(s^2) by Th29;
A15:    (sqr M).s = (M.s)^2 by VALUED_1:11;
        1-1 < s by A12,XREAL_1:8;
        then
A16:    1 <= s by NAT_1:14;
        s <= m+1-1 by A4,A5,A6,A9,XREAL_1:9;
        then
A17:    M.s = s*PI/(2*m+1) by A16,Th19;
        thus F.k = G.s by A6,A9,A12,FINSEQ_1:24
        .= ((sqr M).s)" by VALUED_1:10
        .= ((s*PI)^2 / (2*m+1)^2)" by A15,A17,XCMPLX_1:76
        .= ((2*m+1)^2)*1 / ((PI^2)*(k-1)^2) by XCMPLX_1:213
        .= b/a*(S.k) by A14,XCMPLX_1:76
        .= (b/a(#)S).k by VALUED_1:6;
      end;
    end;
    Sum F = 0 + Sum G by RVSUM_1:76;
    hence thesis by A2,A7,RVSUM_1:87;
  end;
