
theorem sq1:
for R being ordered domRing,
    O being Ordering of R,
    a,b being non O-negative Element of R holds a <=O, b iff a^2 <=O, b^2
proof
let R be ordered domRing, P be Ordering of R,
    a,b be non P-negative Element of R;
the carrier of R = P \/ -P by REALALG1:def 8;
then A: a is P-ordered & b is P-ordered;
then AS: 0.R <=P, a & 0.R <=P, b by x1a;
per cases;
suppose K: a = 0.R;
  SQ R c= P & b^2 in SQ R by REALALG1:def 14;
  hence thesis by A,x1a,K;
  end;
suppose K: a <> 0.R;
hereby assume a <=P, b;
   then a * a <= P, b * a & a * b <= P, b * b by AS,c5;
   hence a^2 <= P, b^2 by c3;
   end;
C: P * (-P) c= -P & P + P c= P by v2,REALALG1:def 14;
B: a + b in P + P by AS;
D: the carrier of R = P \/ -P by REALALG1:def 8;
assume a^2 <=P, b^2;
  then A: (b + a) * (b - a) in P by P4a;
  per cases by D,XBOOLE_0:def 3;
  suppose b - a in -P;
    then (b + a) * (b - a) in P * (-P) by B,C;
    then (b + a) * (b - a) in P /\ -P by A,C;
    then (b + a) * (b - a) in {0.R} by REALALG1:def 7;
    then D: (b + a) * (b - a) = 0.R by TARSKI:def 1;
    per cases by D,VECTSP_2:def 1;
    suppose b + a = 0.R;
      then a = -b by RLVECT_1:6;
      then a in -P by AS;
      then a in P /\ -P by AS;
      then a in {0.R} by REALALG1:def 7;
      hence a <=P, b by K,TARSKI:def 1;
      end;
    suppose b - a = 0.R;
      hence a <=P, b by REALALG1:25;
      end;
    end;
  suppose b - a in P;
    hence a <=P, b;
    end;
  end;
end;
