 reserve X,Y for set,
         n,m,k,i for Nat,
         r for Real,
         R for Element of F_Real,
         K for Field,
         f,f1,f2,g1,g2 for FinSequence,
         rf,rf1,rf2 for real-valued FinSequence,
         cf,cf1,cf2 for complex-valued FinSequence,
         F for Function;

theorem Th4:
  sqrt(rf^2)=abs rf
proof
  set F=rf^2;
  set S=sqrt F;
A1: dom S=dom F by PARTFUN3:def 5;
A2: dom abs rf=dom rf & dom F=dom rf by VALUED_1:11,def 11;
  now let x be object;
    reconsider fx=rf.x as Real;
A3:   fx>=0 or fx<0;
    assume
A4:   x in dom abs rf;
    then F.x=fx^2 & S.x=sqrt(F.x) by A2,A1,PARTFUN3:def 5,VALUED_1:11;
    then
A5:   S.x=fx & fx>=0 or S.x=-fx & fx<0 by A3,SQUARE_1:22,23;
    (abs rf).x=|.fx.| by A4,VALUED_1:def 11;
    hence (abs rf).x=S.x by A5,ABSVALUE:def 1;
  end;
  hence thesis by A2,A1,FUNCT_1:2;
end;
