 reserve i,j, k,v, w for Nat;
 reserve j1,j2, m, n, s, t, x, y for Integer;
 reserve p for odd Prime;
 reserve a for Real;
 reserve b for Integer;

theorem Lagrange4Squares:
  for n be Nat holds
    ex x1,x2,x3,x4 be Nat st n = x1^2 + x2^2 + x3^2 + x4^2
   proof
     let n be Nat;
     per cases;
     suppose n <> 0; then
       reconsider n as non zero Nat;
       consider x1,x2,x3,x4 be Nat such that
A1:    Product ppf n = x1^2 + x2^2 + x3^2 + x4^2 by Them8;
       n = x1^2 + x2^2 + x3^2 + x4^2 by A1,NAT_3:61;
       hence thesis;
     end;
     suppose
A2:    n = 0;
       set x1 = 0, x2 = 0, x3 = 0, x4 = 0;
       n = x1^2 + x2^2 + x3^2 + x4^2 by A2;
       hence thesis;
     end;
    end;
