reserve m,n for Nat;
reserve r for Real;
reserve c for Element of F_Complex;

theorem Th18:
  for R being Ring, S being Subring of R
  for r being Element of R, s being Element of S
  for f being Polynomial of R, g being Polynomial of S
  st r = s & f = g & r is_a_root_of f holds s is_a_root_of g
  proof
    let R be Ring;
    let S be Subring of R;
    let r be Element of R, s be Element of S;
    let f be Polynomial of R, g be Polynomial of S;
    assume that
A1: r = s and
A2: f = g and
A3: eval(f,r) = 0.R;
    consider F being FinSequence of R such that
A4: eval(f,r) = Sum F and
A5: len F = len f and
A6: for n being Element of NAT st n in dom F
    holds F.n = f.(n-'1) * (power R).(r,n-'1) by POLYNOM4:def 2;
A7: for n being Element of NAT st n in dom F
    holds F.n = g.(n-'1) * (power S).(s,n-'1)
    proof
      let n be Element of NAT such that
A8:   n in dom F;
A9:   g.(n-'1)*(power S).(s,n-'1) is Element of R by Th7;
      thus F.n = f.(n-'1)*(power R).(r,n-'1) by A6,A8
      .= In(g.(n-'1),R)*(power R).(In(s,R),n-'1) by A1,A2
      .= In(g.(n-'1)*(power S).(s,n-'1),R) by ALGNUM_1:11
      .= g.(n-'1)*(power S).(s,n-'1) by A9;
    end;
    rng F c= the carrier of S
    proof
      let y be object;
      assume y in rng F;
      then consider n being object such that
A10:   n in dom F and
A11:   F.n = y by FUNCT_1:def 3;
      reconsider n as Element of NAT by A10;
      F.n = g.(n-'1) * (power S).(s,n-'1) by A7,A10;
      hence thesis by A11;
    end;
    then reconsider G = F as FinSequence of S by FINSEQ_1:def 4;
A12: len G = len g by A2,A5,Th9;
    Sum G is Element of R by Th7;
    then Sum G = In(Sum G,R)
    .= Sum F by ALGNUM_1:10
    .= 0.S by A3,A4,C0SP1:def 3;
    hence eval(g,s) = 0.S by A7,A12,POLYNOM4:def 2;
  end;
