
theorem Th54:
  for n, ni being non zero Element of NAT st ni < n & ni divides
  n ex f being FinSequence of (the carrier of Polynom-Ring F_Complex), p being
  Polynomial of F_Complex st p = Product(f) & dom f = Seg n & (for i being non
zero Element of NAT st i in Seg n holds (not i divides n or i divides ni or i
  = n implies f.i = <%1_F_Complex%>) & (i divides n & not i divides ni & i <> n
  implies f.i = cyclotomic_poly(i))) & unital_poly(F_Complex,n) = unital_poly(
  F_Complex,ni)*'(cyclotomic_poly n)*'p
proof
  set cMGFC = the carrier of MultGroup F_Complex;
  set cPRFC = the carrier of Polynom-Ring F_Complex;
  let n, ni being non zero Element of NAT such that
A1: ni < n and
A2: ni divides n;
  set rbp = {y where y is Element of cMGFC: ord y divides n & not ord y
  divides ni & ord y <> n};
  rbp c= n-roots_of_1
  proof
    let x be object;
    assume x in rbp;
    then ex y being Element of cMGFC st x = y & ord y divides n & not ord y
    divides ni & ord y <> n;
    hence thesis by Th34;
  end;
  then reconsider rbp as finite Subset of F_Complex by XBOOLE_1:1;
A3: n-roots_of_1 c= cMGFC by Th32;
  set bp = (rbp,1)-bag;
  defpred P[set,set] means ex d being non zero Nat st $1 = d & (not d divides
n or d divides ni or d = n implies $2 = <%1_F_Complex%>) & (d divides n & not d
  divides ni & d <> n implies $2 = cyclotomic_poly(d));
A4: now
    let i be Nat;
    assume
A5: i in Seg n;
    then
A6: i is non zero by FINSEQ_1:1;
    per cases;
    suppose
A7:   not i divides n or i divides ni or i = n;
      <%1_F_Complex%> is Element of cPRFC by POLYNOM3:def 10;
      hence ex x being Element of cPRFC st P[i,x] by A6,A7;
    end;
    suppose
A8:   i divides n & not i divides ni & i <> n;
      reconsider i9 = i as non zero Element of NAT by A5,FINSEQ_1:1;
      cyclotomic_poly(i9) is Element of cPRFC by POLYNOM3:def 10;
      hence ex x being Element of cPRFC st P[i,x] by A8;
    end;
  end;
  consider f being FinSequence of cPRFC such that
A9: dom f = Seg n and
A10: for i being Nat st i in Seg n holds P[i,f.i] from FINSEQ_1:sch 5(A4
  );
A11: now
    let i be non zero Element of NAT;
    assume i in Seg n;
    then ex d being non zero Nat st i = d & (not d divides n or d divides ni
or d = n implies f.i = <%1_F_Complex%>) & (d divides n & not d divides ni & d<>
    n implies f.i = cyclotomic_poly(d)) by A10;
    hence
    (not i divides n or i divides ni or i = n implies f.i = <%1_F_Complex
%>) & (i divides n & not i divides ni & i <> n implies f.i = cyclotomic_poly(i)
    );
  end;
  then Product(f) = poly_with_roots(bp) by A9,Th53;
  then reconsider p = Product(f) as Polynomial of F_Complex;
  take f;
  take p;
  thus p = Product(f);
  thus dom f = Seg n by A9;
  thus for i being non zero Element of NAT st i in Seg n holds (not i divides
n or i divides ni or i = n implies f.i = <%1_F_Complex%>) & (i divides n & not
  i divides ni & i <> n implies f.i = cyclotomic_poly(i)) by A11;
  set b = (n-roots_of_1, 1)-bag, bi = (ni-roots_of_1, 1)-bag;
  consider rbn being non empty finite Subset of F_Complex such that
A12: rbn = {y where y is Element of cMGFC: ord y = n } and
A13: cyclotomic_poly(n) = poly_with_roots((rbn,1)-bag) by Def5;
  set bn = (rbn,1)-bag;
  ni-roots_of_1 misses rbn
  proof
    assume ni-roots_of_1 /\ rbn <> {};
    then consider x being object such that
A14: x in ni-roots_of_1 /\ rbn by XBOOLE_0:def 1;
    x in rbn by A14,XBOOLE_0:def 4;
    then
A15: ex y1 being Element of cMGFC st x = y1 & ord y1 = n by A12;
    x in ni-roots_of_1 by A14,XBOOLE_0:def 4;
    then ex y being Element of cMGFC st x = y & ord y divides ni by Th36;
    hence contradiction by A1,A15,NAT_D:7;
  end;
  then
A16: bi + bn = (ni-roots_of_1 \/ rbn, 1)-bag by UPROOTS:10;
  set rbibn = (ni-roots_of_1) \/ rbn;
  reconsider rbibn as finite Subset of F_Complex;
A17: ni-roots_of_1 c= n-roots_of_1 by A2,Th28;
  now
    let x be object;
    hereby
      assume
A18:  x in n-roots_of_1;
      then reconsider y = x as Element of cMGFC by A3;
A19:  ord y divides n by A18,Th34;
      per cases;
      suppose
        ord y = n;
        then y in rbn by A12;
        then y in rbibn by XBOOLE_0:def 3;
        hence x in rbibn \/ rbp by XBOOLE_0:def 3;
      end;
      suppose
        ord y <> n & not ord y divides ni;
        then y in rbp by A19;
        hence x in rbibn \/ rbp by XBOOLE_0:def 3;
      end;
      suppose
        ord y <> n & ord y divides ni;
        then x in ni-roots_of_1 by Th34;
        then x in rbibn by XBOOLE_0:def 3;
        hence x in rbibn \/ rbp by XBOOLE_0:def 3;
      end;
    end;
    assume x in rbibn \/ rbp;
    then
A20: x in rbibn or x in rbp by XBOOLE_0:def 3;
    per cases by A20,XBOOLE_0:def 3;
    suppose
      x in ni-roots_of_1;
      hence x in n-roots_of_1 by A17;
    end;
    suppose
      x in rbn;
      then ex y being Element of cMGFC st x = y & ord y = n by A12;
      hence x in n-roots_of_1 by Th34;
    end;
    suppose
      x in rbp;
      then
      ex y being Element of cMGFC st x = y & ord y divides n & ( not ord y
      divides ni)& ord y <> n;
      hence x in n-roots_of_1 by Th34;
    end;
  end;
  then
A21: n-roots_of_1 = rbibn \/ rbp by TARSKI:2;
  set bibn = (rbibn, 1)-bag;
A22: unital_poly(F_Complex,ni) = poly_with_roots(bi) by Th46;
  rbibn misses rbp
  proof
    assume rbibn /\ rbp <> {};
    then consider x being object such that
A23: x in rbibn /\ rbp by XBOOLE_0:def 1;
    x in rbp by A23,XBOOLE_0:def 4;
    then
A24: ex y being Element of cMGFC st x = y & ord y divides n & ( not ord y
    divides ni)& ord y <> n;
A25: x in rbibn by A23,XBOOLE_0:def 4;
    per cases by A25,XBOOLE_0:def 3;
    suppose
      x in ni-roots_of_1;
      then ex y being Element of cMGFC st x = y & ord y divides ni by Th36;
      hence contradiction by A24;
    end;
    suppose
      x in rbn;
      then ex y being Element of cMGFC st x = y & ord y = n by A12;
      hence contradiction by A24;
    end;
  end;
  then
A26: b = bibn+bp by A21,UPROOTS:10;
  unital_poly(F_Complex,n) = poly_with_roots(b) by Th46
    .= (poly_with_roots bibn) *' poly_with_roots(bp) by A26,UPROOTS:64
    .= unital_poly(F_Complex,ni)*'(cyclotomic_poly n)*'poly_with_roots(bp)
  by A13,A16,A22,UPROOTS:64;
  hence thesis by A9,A11,Th53;
end;
