:: O_RING_1 semantic presentation

Lemma20: for n being Element of NAT st n < 1 holds
n = 0
proof end;

Lemma21: for n being Element of NAT holds
( not n <= 1 or n = 0 or n = 1 )
proof end;

Lemma28: for R being non empty doubleLoopStr
for h, f, g being FinSequence of the carrier of R holds
( h = f ^ g iff ( dom h = Seg ((len f) + (len g)) & ( for k being Element of NAT st k in dom f holds
h /. k = f /. k ) & ( for k being Element of NAT st k in dom g holds
h /. ((len f) + k) = g /. k ) ) )
proof end;

Lemma45: for R being non empty doubleLoopStr
for x being Scalar of R
for f being FinSequence of the carrier of R holds
( f = <*x*> iff ( len f = 1 & f /. 1 = x ) )
proof end;

Lemma46: for R being non empty doubleLoopStr
for x being Scalar of R
for f being FinSequence of the carrier of R holds (f ^ <*x*>) /. ((len f) + 1) = x
proof end;

Lemma47: for i being Element of NAT
for R being non empty doubleLoopStr
for f, g being FinSequence of the carrier of R st i <> 0 & i <= len f holds
(f ^ g) /. i = f /. i
proof end;

definition
let R be non empty doubleLoopStr ;
let x be Scalar of R;
canceled;
func c2 ^2 -> Scalar of a1 equals :: O_RING_1:def 2
x * x;
coherence
x * x is Scalar of R
;
end;

:: deftheorem Def1 O_RING_1:def 1 :
canceled;

:: deftheorem Def2 defines ^2 O_RING_1:def 2 :
for R being non empty doubleLoopStr
for x being Scalar of R holds x ^2 = x * x;

definition
let R be non empty doubleLoopStr ;
let x be Scalar of R;
attr a2 is being_a_square means :: O_RING_1:def 3
ex y being Scalar of R st x = y ^2 ;
end;

:: deftheorem Def3 defines being_a_square O_RING_1:def 3 :
for R being non empty doubleLoopStr
for x being Scalar of R holds
( x is being_a_square iff ex y being Scalar of R st x = y ^2 );

notation
let R be non empty doubleLoopStr ;
let x be Scalar of R;
synonym c2 is_a_square for being_a_square c2;
end;

definition
let R be non empty doubleLoopStr ;
let f be FinSequence of the carrier of R;
attr a2 is being_a_Sum_of_squares means :Def4: :: O_RING_1:def 4
( len f <> 0 & f /. 1 is_a_square & ( for n being Element of NAT st n <> 0 & n < len f holds
ex y being Scalar of R st
( y is_a_square & f /. (n + 1) = (f /. n) + y ) ) );
end;

:: deftheorem Def4 defines being_a_Sum_of_squares O_RING_1:def 4 :
for R being non empty doubleLoopStr
for f being FinSequence of the carrier of R holds
( f is being_a_Sum_of_squares iff ( len f <> 0 & f /. 1 is_a_square & ( for n being Element of NAT st n <> 0 & n < len f holds
ex y being Scalar of R st
( y is_a_square & f /. (n + 1) = (f /. n) + y ) ) ) );

notation
let R be non empty doubleLoopStr ;
let f be FinSequence of the carrier of R;
synonym c2 is_a_Sum_of_squares for being_a_Sum_of_squares c2;
end;

definition
let R be non empty doubleLoopStr ;
let x be Scalar of R;
attr a2 is being_a_sum_of_squares means :Def5: :: O_RING_1:def 5
ex f being FinSequence of the carrier of R st
( f is_a_Sum_of_squares & x = f /. (len f) );
end;

:: deftheorem Def5 defines being_a_sum_of_squares O_RING_1:def 5 :
for R being non empty doubleLoopStr
for x being Scalar of R holds
( x is being_a_sum_of_squares iff ex f being FinSequence of the carrier of R st
( f is_a_Sum_of_squares & x = f /. (len f) ) );

notation
let R be non empty doubleLoopStr ;
let x be Scalar of R;
synonym c2 is_a_sum_of_squares for being_a_sum_of_squares c2;
end;

Lemma50: for R being non empty doubleLoopStr
for x being Scalar of R st x is_a_square holds
<*x*> is_a_Sum_of_squares
proof end;

Lemma51: for R being non empty doubleLoopStr
for x being Scalar of R st x is_a_square holds
x is_a_sum_of_squares
proof end;

definition
let R be non empty doubleLoopStr ;
let f be FinSequence of the carrier of R;
attr a2 is being_a_Product_of_squares means :Def6: :: O_RING_1:def 6
( len f <> 0 & f /. 1 is_a_square & ( for n being Element of NAT st n <> 0 & n < len f holds
ex y being Scalar of R st
( y is_a_square & f /. (n + 1) = (f /. n) * y ) ) );
end;

:: deftheorem Def6 defines being_a_Product_of_squares O_RING_1:def 6 :
for R being non empty doubleLoopStr
for f being FinSequence of the carrier of R holds
( f is being_a_Product_of_squares iff ( len f <> 0 & f /. 1 is_a_square & ( for n being Element of NAT st n <> 0 & n < len f holds
ex y being Scalar of R st
( y is_a_square & f /. (n + 1) = (f /. n) * y ) ) ) );

notation
let R be non empty doubleLoopStr ;
let f be FinSequence of the carrier of R;
synonym c2 is_a_Product_of_squares for being_a_Product_of_squares c2;
end;

definition
let R be non empty doubleLoopStr ;
let x be Scalar of R;
attr a2 is being_a_product_of_squares means :Def7: :: O_RING_1:def 7
ex f being FinSequence of the carrier of R st
( f is_a_Product_of_squares & x = f /. (len f) );
end;

:: deftheorem Def7 defines being_a_product_of_squares O_RING_1:def 7 :
for R being non empty doubleLoopStr
for x being Scalar of R holds
( x is being_a_product_of_squares iff ex f being FinSequence of the carrier of R st
( f is_a_Product_of_squares & x = f /. (len f) ) );

notation
let R be non empty doubleLoopStr ;
let x be Scalar of R;
synonym c2 is_a_product_of_squares for being_a_product_of_squares c2;
end;

Lemma54: for R being non empty doubleLoopStr
for x being Scalar of R st x is_a_square holds
<*x*> is_a_Product_of_squares
proof end;

Lemma55: for R being non empty doubleLoopStr
for x being Scalar of R st x is_a_square holds
x is_a_product_of_squares
proof end;

definition
let R be non empty doubleLoopStr ;
let f be FinSequence of the carrier of R;
attr a2 is being_a_Sum_of_products_of_squares means :Def8: :: O_RING_1:def 8
( len f <> 0 & f /. 1 is_a_product_of_squares & ( for n being Element of NAT st n <> 0 & n < len f holds
ex y being Scalar of R st
( y is_a_product_of_squares & f /. (n + 1) = (f /. n) + y ) ) );
end;

:: deftheorem Def8 defines being_a_Sum_of_products_of_squares O_RING_1:def 8 :
for R being non empty doubleLoopStr
for f being FinSequence of the carrier of R holds
( f is being_a_Sum_of_products_of_squares iff ( len f <> 0 & f /. 1 is_a_product_of_squares & ( for n being Element of NAT st n <> 0 & n < len f holds
ex y being Scalar of R st
( y is_a_product_of_squares & f /. (n + 1) = (f /. n) + y ) ) ) );

notation
let R be non empty doubleLoopStr ;
let f be FinSequence of the carrier of R;
synonym c2 is_a_Sum_of_products_of_squares for being_a_Sum_of_products_of_squares c2;
end;

definition
let R be non empty doubleLoopStr ;
let x be Scalar of R;
attr a2 is being_a_sum_of_products_of_squares means :Def9: :: O_RING_1:def 9
ex f being FinSequence of the carrier of R st
( f is_a_Sum_of_products_of_squares & x = f /. (len f) );
end;

:: deftheorem Def9 defines being_a_sum_of_products_of_squares O_RING_1:def 9 :
for R being non empty doubleLoopStr
for x being Scalar of R holds
( x is being_a_sum_of_products_of_squares iff ex f being FinSequence of the carrier of R st
( f is_a_Sum_of_products_of_squares & x = f /. (len f) ) );

notation
let R be non empty doubleLoopStr ;
let x be Scalar of R;
synonym c2 is_a_sum_of_products_of_squares for being_a_sum_of_products_of_squares c2;
end;

Lemma58: for R being non empty doubleLoopStr
for x being Scalar of R st x is_a_square holds
<*x*> is_a_Sum_of_products_of_squares
proof end;

Lemma59: for R being non empty doubleLoopStr
for x being Scalar of R st x is_a_square holds
x is_a_sum_of_products_of_squares
proof end;

Lemma60: for R being non empty doubleLoopStr
for x being Scalar of R st x is_a_product_of_squares holds
<*x*> is_a_Sum_of_products_of_squares
proof end;

Lemma61: for R being non empty doubleLoopStr
for x being Scalar of R st x is_a_product_of_squares holds
x is_a_sum_of_products_of_squares
proof end;

Lemma62: for R being non empty doubleLoopStr
for f being FinSequence of the carrier of R st f is_a_Sum_of_squares holds
f is_a_Sum_of_products_of_squares
proof end;

Lemma63: for R being non empty doubleLoopStr
for x being Scalar of R st x is_a_sum_of_squares holds
x is_a_sum_of_products_of_squares
proof end;

definition
let R be non empty doubleLoopStr ;
let f be FinSequence of the carrier of R;
attr a2 is being_an_Amalgam_of_squares means :Def10: :: O_RING_1:def 10
( len f <> 0 & ( for n being Element of NAT st n <> 0 & n <= len f & not f /. n is_a_product_of_squares holds
ex i, j being Element of NAT st
( f /. n = (f /. i) * (f /. j) & i <> 0 & i < n & j <> 0 & j < n ) ) );
end;

:: deftheorem Def10 defines being_an_Amalgam_of_squares O_RING_1:def 10 :
for R being non empty doubleLoopStr
for f being FinSequence of the carrier of R holds
( f is being_an_Amalgam_of_squares iff ( len f <> 0 & ( for n being Element of NAT st n <> 0 & n <= len f & not f /. n is_a_product_of_squares holds
ex i, j being Element of NAT st
( f /. n = (f /. i) * (f /. j) & i <> 0 & i < n & j <> 0 & j < n ) ) ) );

notation
let R be non empty doubleLoopStr ;
let f be FinSequence of the carrier of R;
synonym c2 is_an_Amalgam_of_squares for being_an_Amalgam_of_squares c2;
end;

definition
let R be non empty doubleLoopStr ;
let x be Scalar of R;
attr a2 is being_an_amalgam_of_squares means :Def11: :: O_RING_1:def 11
ex f being FinSequence of the carrier of R st
( f is_an_Amalgam_of_squares & x = f /. (len f) );
end;

:: deftheorem Def11 defines being_an_amalgam_of_squares O_RING_1:def 11 :
for R being non empty doubleLoopStr
for x being Scalar of R holds
( x is being_an_amalgam_of_squares iff ex f being FinSequence of the carrier of R st
( f is_an_Amalgam_of_squares & x = f /. (len f) ) );

notation
let R be non empty doubleLoopStr ;
let x be Scalar of R;
synonym c2 is_an_amalgam_of_squares for being_an_amalgam_of_squares c2;
end;

Lemma66: for R being non empty doubleLoopStr
for x being Scalar of R st x is_a_square holds
<*x*> is_an_Amalgam_of_squares
proof end;

Lemma67: for R being non empty doubleLoopStr
for x being Scalar of R st x is_a_square holds
x is_an_amalgam_of_squares
proof end;

Lemma68: for R being non empty doubleLoopStr
for x being Scalar of R st x is_a_product_of_squares holds
<*x*> is_an_Amalgam_of_squares
proof end;

Lemma69: for R being non empty doubleLoopStr
for x being Scalar of R st x is_a_product_of_squares holds
x is_an_amalgam_of_squares
proof end;

definition
let R be non empty doubleLoopStr ;
let f be FinSequence of the carrier of R;
attr a2 is being_a_Sum_of_amalgams_of_squares means :Def12: :: O_RING_1:def 12
( len f <> 0 & f /. 1 is_an_amalgam_of_squares & ( for n being Element of NAT st n <> 0 & n < len f holds
ex y being Scalar of R st
( y is_an_amalgam_of_squares & f /. (n + 1) = (f /. n) + y ) ) );
end;

:: deftheorem Def12 defines being_a_Sum_of_amalgams_of_squares O_RING_1:def 12 :
for R being non empty doubleLoopStr
for f being FinSequence of the carrier of R holds
( f is being_a_Sum_of_amalgams_of_squares iff ( len f <> 0 & f /. 1 is_an_amalgam_of_squares & ( for n being Element of NAT st n <> 0 & n < len f holds
ex y being Scalar of R st
( y is_an_amalgam_of_squares & f /. (n + 1) = (f /. n) + y ) ) ) );

notation
let R be non empty doubleLoopStr ;
let f be FinSequence of the carrier of R;
synonym c2 is_a_Sum_of_amalgams_of_squares for being_a_Sum_of_amalgams_of_squares c2;
end;

definition
let R be non empty doubleLoopStr ;
let x be Scalar of R;
attr a2 is being_a_sum_of_amalgams_of_squares means :Def13: :: O_RING_1:def 13
ex f being FinSequence of the carrier of R st
( f is_a_Sum_of_amalgams_of_squares & x = f /. (len f) );
end;

:: deftheorem Def13 defines being_a_sum_of_amalgams_of_squares O_RING_1:def 13 :
for R being non empty doubleLoopStr
for x being Scalar of R holds
( x is being_a_sum_of_amalgams_of_squares iff ex f being FinSequence of the carrier of R st
( f is_a_Sum_of_amalgams_of_squares & x = f /. (len f) ) );

notation
let R be non empty doubleLoopStr ;
let x be Scalar of R;
synonym c2 is_a_sum_of_amalgams_of_squares for being_a_sum_of_amalgams_of_squares c2;
end;

Lemma72: for R being non empty doubleLoopStr
for x being Scalar of R st x is_a_square holds
<*x*> is_a_Sum_of_amalgams_of_squares
proof end;

Lemma73: for R being non empty doubleLoopStr
for x being Scalar of R st x is_a_square holds
x is_a_sum_of_amalgams_of_squares
proof end;

Lemma74: for R being non empty doubleLoopStr
for f being FinSequence of the carrier of R st f is_a_Sum_of_squares holds
f is_a_Sum_of_amalgams_of_squares
proof end;

Lemma75: for R being non empty doubleLoopStr
for x being Scalar of R st x is_a_sum_of_squares holds
x is_a_sum_of_amalgams_of_squares
proof end;

Lemma76: for R being non empty doubleLoopStr
for x being Scalar of R st x is_a_product_of_squares holds
<*x*> is_a_Sum_of_amalgams_of_squares
proof end;

Lemma77: for R being non empty doubleLoopStr
for x being Scalar of R st x is_a_product_of_squares holds
x is_a_sum_of_amalgams_of_squares
proof end;

Lemma78: for R being non empty doubleLoopStr
for f being FinSequence of the carrier of R st f is_a_Sum_of_products_of_squares holds
f is_a_Sum_of_amalgams_of_squares
proof end;

Lemma79: for R being non empty doubleLoopStr
for x being Scalar of R st x is_a_sum_of_products_of_squares holds
x is_a_sum_of_amalgams_of_squares
proof end;

Lemma80: for R being non empty doubleLoopStr
for x being Scalar of R st x is_an_amalgam_of_squares holds
<*x*> is_a_Sum_of_amalgams_of_squares
proof end;

Lemma81: for R being non empty doubleLoopStr
for x being Scalar of R st x is_an_amalgam_of_squares holds
x is_a_sum_of_amalgams_of_squares
proof end;

definition
let R be non empty doubleLoopStr ;
let f be FinSequence of the carrier of R;
attr a2 is being_a_generation_from_squares means :Def14: :: O_RING_1:def 14
( len f <> 0 & ( for n being Element of NAT st n <> 0 & n <= len f & not f /. n is_an_amalgam_of_squares holds
ex i, j being Element of NAT st
( ( f /. n = (f /. i) * (f /. j) or f /. n = (f /. i) + (f /. j) ) & i <> 0 & i < n & j <> 0 & j < n ) ) );
end;

:: deftheorem Def14 defines being_a_generation_from_squares O_RING_1:def 14 :
for R being non empty doubleLoopStr
for f being FinSequence of the carrier of R holds
( f is being_a_generation_from_squares iff ( len f <> 0 & ( for n being Element of NAT st n <> 0 & n <= len f & not f /. n is_an_amalgam_of_squares holds
ex i, j being Element of NAT st
( ( f /. n = (f /. i) * (f /. j) or f /. n = (f /. i) + (f /. j) ) & i <> 0 & i < n & j <> 0 & j < n ) ) ) );

notation
let R be non empty doubleLoopStr ;
let f be FinSequence of the carrier of R;
synonym c2 is_a_generation_from_squares for being_a_generation_from_squares c2;
end;

definition
let R be non empty doubleLoopStr ;
let x be Scalar of R;
attr a2 is generated_from_squares means :Def15: :: O_RING_1:def 15
ex f being FinSequence of the carrier of R st
( f is_a_generation_from_squares & x = f /. (len f) );
end;

:: deftheorem Def15 defines generated_from_squares O_RING_1:def 15 :
for R being non empty doubleLoopStr
for x being Scalar of R holds
( x is generated_from_squares iff ex f being FinSequence of the carrier of R st
( f is_a_generation_from_squares & x = f /. (len f) ) );

notation
let R be non empty doubleLoopStr ;
let x be Scalar of R;
synonym c2 is_generated_from_squares for generated_from_squares c2;
end;

Lemma84: for R being non empty doubleLoopStr
for x being Scalar of R st x is_a_square holds
<*x*> is_a_generation_from_squares
proof end;

Lemma85: for R being non empty doubleLoopStr
for x being Scalar of R st x is_a_square holds
x is_generated_from_squares
proof end;

Lemma86: for R being non empty doubleLoopStr
for x being Scalar of R
for f being FinSequence of the carrier of R st f is_a_generation_from_squares & x is_an_amalgam_of_squares holds
f ^ <*x*> is_a_generation_from_squares
proof end;

Lemma87: for i, j being Element of NAT
for R being non empty doubleLoopStr
for f being FinSequence of the carrier of R st f is_a_generation_from_squares & i <> 0 & i <= len f & j <> 0 & j <= len f holds
f ^ <*((f /. i) + (f /. j))*> is_a_generation_from_squares
proof end;

Lemma88: for R being non empty doubleLoopStr
for x being Scalar of R
for f being FinSequence of the carrier of R st f is_a_generation_from_squares & x is_a_square holds
f ^ <*x*> is_a_generation_from_squares
proof end;

Lemma89: for R being non empty doubleLoopStr
for x being Scalar of R
for f being FinSequence of the carrier of R st f is_a_generation_from_squares & x is_a_square holds
(f ^ <*x*>) ^ <*((f /. (len f)) + x)*> is_a_generation_from_squares
proof end;

Lemma90: for R being non empty doubleLoopStr
for x, y being Scalar of R st x is_generated_from_squares & y is_a_square holds
x + y is_generated_from_squares
proof end;

Lemma91: for i being Element of NAT
for R being non empty doubleLoopStr
for f being FinSequence of the carrier of R st f is_a_Sum_of_squares & 0 <> i & i <= len f holds
f /. i is_generated_from_squares
proof end;

Lemma93: for R being non empty doubleLoopStr
for x being Scalar of R st x is_a_sum_of_squares holds
x is_generated_from_squares
proof end;

Lemma94: for R being non empty doubleLoopStr
for x being Scalar of R
for f being FinSequence of the carrier of R st f is_a_generation_from_squares & x is_an_amalgam_of_squares holds
(f ^ <*x*>) ^ <*((f /. (len f)) + x)*> is_a_generation_from_squares
proof end;

Lemma95: for R being non empty doubleLoopStr
for x, y being Scalar of R st x is_generated_from_squares & y is_an_amalgam_of_squares holds
x + y is_generated_from_squares
proof end;

Lemma96: for R being non empty doubleLoopStr
for f being FinSequence of the carrier of R st f is_an_Amalgam_of_squares holds
f is_a_generation_from_squares
proof end;

Lemma97: for R being non empty doubleLoopStr
for x being Scalar of R st x is_an_amalgam_of_squares holds
x is_generated_from_squares
proof end;

Lemma98: for i, j being Element of NAT
for R being non empty doubleLoopStr
for f being FinSequence of the carrier of R st f is_a_generation_from_squares & i <> 0 & i <= len f & j <> 0 & j <= len f holds
f ^ <*((f /. i) * (f /. j))*> is_a_generation_from_squares
proof end;

Lemma99: for R being non empty doubleLoopStr
for x being Scalar of R
for f being FinSequence of the carrier of R st f is_a_generation_from_squares & x is_a_square holds
(f ^ <*x*>) ^ <*((f /. (len f)) * x)*> is_a_generation_from_squares
proof end;

Lemma100: for R being non empty doubleLoopStr
for x, y being Scalar of R st x is_generated_from_squares & y is_a_square holds
x * y is_generated_from_squares
proof end;

Lemma101: for i being Element of NAT
for R being non empty doubleLoopStr
for f being FinSequence of the carrier of R st f is_a_Product_of_squares & 0 <> i & i <= len f holds
f /. i is_generated_from_squares
proof end;

Lemma102: for R being non empty doubleLoopStr
for x being Scalar of R st x is_a_product_of_squares holds
x is_generated_from_squares
proof end;

Lemma103: for R being non empty doubleLoopStr
for x being Scalar of R
for f being FinSequence of the carrier of R st f is_a_generation_from_squares & x is_a_product_of_squares holds
f ^ <*x*> is_a_generation_from_squares
proof end;

Lemma104: for R being non empty doubleLoopStr
for x being Scalar of R
for f being FinSequence of the carrier of R st f is_a_generation_from_squares & x is_a_product_of_squares holds
(f ^ <*x*>) ^ <*((f /. (len f)) + x)*> is_a_generation_from_squares
proof end;

Lemma105: for R being non empty doubleLoopStr
for x, y being Scalar of R st x is_generated_from_squares & y is_a_product_of_squares holds
x + y is_generated_from_squares
proof end;

Lemma106: for i being Element of NAT
for R being non empty doubleLoopStr
for f being FinSequence of the carrier of R st f is_a_Sum_of_products_of_squares & 0 <> i & i <= len f holds
f /. i is_generated_from_squares
proof end;

Lemma107: for R being non empty doubleLoopStr
for x being Scalar of R st x is_a_sum_of_products_of_squares holds
x is_generated_from_squares
proof end;

theorem Th1: :: O_RING_1:1
for R being non empty doubleLoopStr
for x being Scalar of R st x is_a_square holds
( x is_a_sum_of_squares & x is_a_product_of_squares & x is_a_sum_of_products_of_squares & x is_an_amalgam_of_squares & x is_a_sum_of_amalgams_of_squares & x is_generated_from_squares ) by , , , , , ;

theorem Th2: :: O_RING_1:2
for R being non empty doubleLoopStr
for x being Scalar of R st x is_a_sum_of_squares holds
( x is_a_sum_of_products_of_squares & x is_a_sum_of_amalgams_of_squares & x is_generated_from_squares ) by , , Lemma51;

theorem Th3: :: O_RING_1:3
for R being non empty doubleLoopStr
for x being Scalar of R st x is_a_product_of_squares holds
( x is_a_sum_of_products_of_squares & x is_an_amalgam_of_squares & x is_a_sum_of_amalgams_of_squares & x is_generated_from_squares ) by Lemma20, Lemma28, , Lemma60;

theorem Th4: :: O_RING_1:4
for R being non empty doubleLoopStr
for x being Scalar of R st x is_a_sum_of_products_of_squares holds
( x is_a_sum_of_amalgams_of_squares & x is_generated_from_squares ) by , Def11;

theorem Th5: :: O_RING_1:5
for R being non empty doubleLoopStr
for x being Scalar of R st x is_an_amalgam_of_squares holds
( x is_a_sum_of_amalgams_of_squares & x is_generated_from_squares ) by , Lemma55;

Lemma108: for R being non empty doubleLoopStr
for f being FinSequence of the carrier of R st f is_a_Sum_of_amalgams_of_squares holds
for i being Element of NAT st i <> 0 & i <= len f holds
f /. i is_generated_from_squares
proof end;

theorem Th6: :: O_RING_1:6
for R being non empty doubleLoopStr
for x being Scalar of R st x is_a_sum_of_amalgams_of_squares holds
x is_generated_from_squares
proof end;