
theorem ringext:
for R being non degenerated comRing
for S being comRingExtension of R
for n being Ordinal
holds Polynom-Ring(n,S) is comRingExtension of Polynom-Ring(n,R)
proof
let R be non degenerated comRing, S be comRingExtension of R, n be Ordinal;
A1:  R is Subring of S by FIELD_4:def 1; then
A2:  the carrier of R c= the carrier of S by C0SP1:def 3;
A3:  0.S = 0.R by A1,C0SP1:def 3;
X1: for p being Polynomial of n,R holds p is Polynomial of n,S
    proof
     let p be Polynomial of n,R;
     rng p c= the carrier of R by RELAT_1:def 19; then
     rng p c= the carrier of S by A2; then
     reconsider p1 = p as Series of n,S by FUNCT_2:6;
     now let o be object;
       assume
A5:    o in Support p1; then
       reconsider b = o as Element of Bags n;
A6:    0.R <> p.b by A3,A5,POLYNOM1:def 3;
       dom p = Bags n by FUNCT_2:def 1;
       hence o in Support p by A6,POLYNOM1:def 3;
     end; then
     Support p1 c= Support p;
     hence thesis by POLYNOM1:def 5;
    end;
X2: the carrier of Polynom-Ring(n,R) c= the carrier of Polynom-Ring(n,S)
    proof
     now let o be object;
       assume o in the carrier of Polynom-Ring(n,R); then
       o is Polynomial of n,R by POLYNOM1:def 11; then
       o is Polynomial of n,S by X1;
       hence o in the carrier of Polynom-Ring(n,S) by POLYNOM1:def 11;
     end;
     hence thesis;
    end;
X3:  0.(Polynom-Ring(n,R)) = 0_(n,R) by POLYNOM1:def 11
     .= (Bags n) --> 0.R by POLYNOM1:def 8
     .= (Bags n) --> 0.S by A1,C0SP1:def 3
     .= 0_(n,S) by POLYNOM1:def 8
     .= 0.(Polynom-Ring(n,S)) by POLYNOM1:def 11;
H:   0_(n,R) = (Bags n) --> 0.R by POLYNOM1:def 8
     .= (Bags n) --> 0.S by A1,C0SP1:def 3
     .= 0_(n,S) by POLYNOM1:def 8;
X4:  1.(Polynom-Ring(n,R)) = 1_(n,R) by POLYNOM1:def 11
     .= 0_(n,R)+*(EmptyBag n,1.R) by POLYNOM1:def 9
     .= 0_(n,S)+*(EmptyBag n,1.S) by H,A1,C0SP1:def 3
     .= 1_(n,S) by POLYNOM1:def 9
     .= 1.(Polynom-Ring(n,S)) by POLYNOM1:def 11;
X5: for p,q being Polynomial of n,R
    for p1,q1 being Polynomial of n,S st p = p1 & q = q1 holds p + q = p1 + q1
    proof
     let p,q be Polynomial of n,R; let p1,q2 be Polynomial of n,S;
     assume
A1:  p = p1 & q = q2;
A2:  R is Subring of S by FIELD_4:def 1;
     now let b be Element of Bags n;
       p.b = p1.b & q.b = q2.b by A1; then
A3:    [p1.b,q2.b] in [:the carrier of R,the carrier of R:] by ZFMISC_1:def 2;
       thus (p+q).b = p.b + q.b by POLYNOM1:15
       .= ((the addF of S)||the carrier of R).(p1.b,q2.b) by A1,A2,C0SP1:def 3
       .= p1.b + q2.b by A3,FUNCT_1:49
       .= (p1+q2).b by POLYNOM1:15;
     end;
     hence thesis;
    end;
X6: the addF of Polynom-Ring(n,R)
   = (the addF of Polynom-Ring(n,S))||the carrier of Polynom-Ring(n,R)
    proof
     set aR = the addF of Polynom-Ring(n,R),
     aS = (the addF of Polynom-Ring(n,S))||the carrier of Polynom-Ring(n,R);
     set cR = the carrier of Polynom-Ring(n,R),
     cS = the carrier of Polynom-Ring(n,S);
A2:  dom aS = dom(the addF of Polynom-Ring(n,S)) /\ [:cR,cR:] by RELAT_1:61
     .= [:cS,cS:] /\ [:cR,cR:] by FUNCT_2:def 1
     .= [:cR,cR:] by X2,ZFMISC_1:96,XBOOLE_1:28
     .= dom aR by FUNCT_2:def 1;
     now let o be object;
       assume
A3:    o in dom aR; then
       consider p,q being object such that
A4:    p in the carrier of Polynom-Ring(n,R) &
       q in the carrier of Polynom-Ring(n,R) & o = [p,q] by ZFMISC_1:def 2;
       reconsider p,q as Element of cR by A4;
       reconsider p1 = p, q1 = q as Element of cS by X2;
       reconsider p2 = p, q2 = q as Polynomial of n,R by POLYNOM1:def 11;
       reconsider p3 = p1, q3 = q1 as Polynomial of n,S by POLYNOM1:def 11;
       thus
       aR.o = p + q by A4
       .= p2 + q2 by POLYNOM1:def 11
       .= p3 + q3 by X5
       .= p1 + q1 by POLYNOM1:def 11
       .= aS.o by A2,A3,A4,FUNCT_1:47;
     end;
     hence thesis by A2;
    end;
X7: for p,q being Polynomial of n,R
    for p1,q1 being Polynomial of n,S st p = p1 & q = q1 holds p*'q = p1*'q1
    proof
     let p,q be Polynomial of n,R; let p1,qq be Polynomial of n,S;
     assume
A1:  p = p1 & q = qq;
A2:  R is Subring of S by FIELD_4:def 1;
     now let b be bag of n;
       consider r being FinSequence of the carrier of R such that
A3:    (p*'q).b = Sum r & len r = len decomp b &
       for k being Element of NAT st k in dom r ex b1, b2 being bag of n st
       (decomp b)/.k = <*b1,b2*> & r/.k = p.b1*q.b2 by POLYNOM1:def 10;
       consider r1 being FinSequence of the carrier of S such that
A4:    (p1*'qq).b = Sum r1 & len r1 = len decomp b &
       for k being Element of NAT st k in dom r1 ex b1, b2 being bag of n st
       (decomp b)/.k = <*b1,b2*> & r1/.k = (p1.b1)*(qq.b2) by POLYNOM1:def 10;
A5:    dom r1 = Seg(len r) by A3,A4,FINSEQ_1:def 3
       .= dom r by FINSEQ_1:def 3;
       now let m be Nat;
         assume
A6:      m in dom r; then
         consider b1, b2 being bag of n such that
B1:      (decomp b)/.m = <*b1,b2*> & r/.m = p.b1*q.b2 by A3;
         consider b11, b22 being bag of n such that
B2:      (decomp b)/.m = <*b11,b22*> & r1/.m = p1.b11*qq.b22 by A5,A6,A4;
B3:      b11 = <*b1,b2*>.1 by B1,B2,FINSEQ_1:44 .= b1;
B4:      b22 = <*b1,b2*>.2 by B1,B2,FINSEQ_1:44 .= b2;
         p.b1 = p1.b1 & q.b2 = qq.b2 by A1; then
A7:      [p1.b1,qq.b2] in [:the carrier of R,the carrier of R:]
         by ZFMISC_1:def 2;
         thus
         r.m = p.b1 * q.b2 by B1,A6,PARTFUN1:def 6
         .= ((the multF of S)||the carrier of R).(p1.b1,qq.b2)
            by A1,A2,C0SP1:def 3
         .= p1.b11 * qq.b22 by B3,B4,A7,FUNCT_1:49
         .= r1.m by B2,A6,A5,PARTFUN1:def 6;
       end; then
       r = r1 by A5;
       hence (p*'q).b = (p1*'qq).b by A4,A3,A2,FIELD_4:2;
     end;
     hence thesis;
   end;
X8: the multF of Polynom-Ring(n,R)
  = (the multF of Polynom-Ring(n,S))||the carrier of Polynom-Ring(n,R)
    proof
     set mR = the multF of Polynom-Ring(n,R),
     mS = (the multF of Polynom-Ring(n,S))||the carrier of Polynom-Ring(n,R);
     set cR = the carrier of Polynom-Ring(n,R),
     cS = the carrier of Polynom-Ring(n,S);
A2:  dom mS = dom(the multF of Polynom-Ring(n,S)) /\ [:cR,cR:] by RELAT_1:61
     .= [:cS,cS:] /\ [:cR,cR:] by FUNCT_2:def 1
     .= [:cR,cR:] by X2,ZFMISC_1:96,XBOOLE_1:28
     .= dom mR by FUNCT_2:def 1;
     now let o be object;
       assume
A3:    o in dom mR; then
       consider p,q being object such that
A4:    p in cR & q in cR & o = [p,q] by ZFMISC_1:def 2;
       reconsider p,q as Element of cR by A4;
       reconsider p1 = p, q1 = q as Element of cS by X2;
       reconsider p2 = p, q2 = q as Polynomial of n,R by POLYNOM1:def 11;
       reconsider p3 = p1, q3 = q1 as Polynomial of n,S by POLYNOM1:def 11;
       thus
       mR.o = p * q by A4
       .= p2 *' q2 by POLYNOM1:def 11
       .= p3 *' q3 by X7
       .= p1 * q1 by POLYNOM1:def 11
       .= mS.o by A2,A3,A4,FUNCT_1:47;
     end;
     hence thesis by A2;
   end;
(Polynom-Ring(n,R)) is Subring of (Polynom-Ring(n,S))
   by X2,X3,X4,X6,X8,C0SP1:def 3;
hence thesis by FIELD_4:def 1;
end;
