reserve k,m,n for Nat;
reserve R for commutative Ring,
        p,q for Polynomial of R,
        z0,z1 for Element of R;

theorem Th9:
  (<%z0,z1%>`^0).0 = 1.R &
  (n >0 implies (<%0.R,z1%>`^n).n = z1|^n) &
  (k<>n implies (<%0.R,z1%>`^n).k = 0.R)
proof
  <%z0,z1%>`^0 = 1_.(R) by POLYNOM5:15;
  hence (<%z0,z1%>`^0).0 = 1.R by POLYNOM3:30;
  set P = <%0.R,z1%>;
  defpred P[Nat] means
  ($1 >0 implies (P`^$1).$1 = z1|^$1) &
  for k st k<>$1 holds (P`^$1).k = 0.R;
  A1: P[0]
  proof
    thus 0 >0 implies (<%0.R,z1%>`^0).0 = z1|^0;
    let k;
    assume A2: k<>0;
    P`^0 = 1_.(R) by POLYNOM5:15;
    hence thesis by A2,POLYNOM3:30;
  end;
  A3: for i be Nat st P[i] holds P[i+1]
  proof
    let i be Nat;set i1=i+1;
    assume A4:P[i];
    A5:P`^i1 = (P`^i)*'P by POLYNOM5:19;
    thus i+1 >0 implies (P`^i1).i1 = z1|^i1
    proof
      assume i+1 >0;
      per cases;
      suppose A6:i = 0;
        then P`^i1 = P by POLYNOM5:16;
        hence (P`^i1).i1 = z1 by A6,POLYNOM5:38
                        .= z1|^i1 by A6,BINOM:8;
      end;
      suppose A7:i>0;
        consider r be FinSequence of the carrier of R such that
        A8:len r = i1+1 & (P`^i1).i1 = Sum r and
        A9:for k be Element of NAT st k in dom r holds
           r.k = (P`^i).(k-'1) * P.(i1+1-'k) by A5,POLYNOM3:def 9;
        A10: 1<=i1 & i1 <= len r by A8,NAT_1:11;
        then A11: i1 in dom r by FINSEQ_3:25;
        for k be Element of NAT st k in dom r & k<>i1 holds r/.k = 0.R
        proof
          let k be Element of NAT such that A12: k in dom r & k<>i1;
          A13: k <= i1+1 by A8,A12,FINSEQ_3:25;
          A14:r/.k=r.k by PARTFUN1:def 6,A12;
          per cases by A12,XXREAL_0:1;
          suppose k > i1;
            then k >=i1+1 by NAT_1:13;
            then k = i1+1 by A13,XXREAL_0:1;
            then i1+1-'k=0 by XREAL_1:232;
            then P.(i1+1-'k) =0.R by POLYNOM5:38;
            then (P`^i).(k-'1) * P.(i1+1-'k) =0.R;
            hence thesis by A14,A12,A9;
          end;
          suppose A15:k <i1;
            then k < i1+1 by NAT_1:13;
            then A16: i1+1-'k = i1+1-k by XREAL_1:233;
            k <= i by A15,NAT_1:13;
            then i-k >=0 by XREAL_1:48;
            then i-k+2>= 0+2 by XREAL_1:6;
            then P.(i1+1-'k) =0.R by A16,POLYNOM5:38;
            then (P`^i).(k-'1) * P.(i1+1-'k) =0.R;
            hence thesis by A14,A12,A9;
          end;
        end;
        then A17: Sum r = r/.i1 by A10,FINSEQ_3:25,POLYNOM2:3;
        i1-'1=i1-1 & i1+1-'i1 = i1+1-i1 by NAT_1:11, XREAL_1:233;
        then (P`^i).(i1-'1) = z1|^i & P.(i1+1-'i1) = z1 by A7,A4,POLYNOM5:38;
        then r.i1 = (z1|^i) * z1 & z1 = z1|^1 by A9,A10,FINSEQ_3:25,BINOM:8;
        then r.i1 = z1|^i1 by BINOM:10;
        hence thesis by A17,A8,A11,PARTFUN1:def 6;
      end;
    end;
    let j be Nat such that A18: j <> i1;set j1=j+1;
    j in NAT by ORDINAL1:def 12;
    then consider r be FinSequence of the carrier of R such that
    A19:len r = j+1 & (P`^i1).j = Sum r and
    A20: for k be Element of NAT st k in dom r
      holds r.k = (P`^i).(k-'1) * P.(j1-'k) by A5,POLYNOM3:def 9;
    for k be Element of NAT st k in dom r holds r.k=0.R
    proof
      let k be Element of NAT such that A21:k in dom r;
      A22: 1<= k <= j1 by A19,A21,FINSEQ_3:25;
      per cases by XXREAL_0:1;
      suppose k =j;
        then k-'1 = j-1 by A22,XREAL_1:233;
        then k-'1 <> i by A18;
        then (P`^i).(k-'1) = 0.R by A4;
        then (P`^i).(k-'1) * P.(j+1-'k) =0.R;
        hence thesis by A21,A20;
      end;
      suppose k > j;
        then k >=j+1 by NAT_1:13;
        then k = j+1 by A22,XXREAL_0:1;
        then j+1-'k=0 by XREAL_1:232;
        then P.(j+1-'k) =0.R by POLYNOM5:38;
        then (P`^i).(k-'1) * P.(j+1-'k) =0.R;
        hence thesis by A21,A20;
      end;
      suppose A23:k <j;
        then k < j+1 by NAT_1:13;
        then A24: j+1-'k = j+1-k by XREAL_1:233;
        j-k > 0 by A23,XREAL_1:50;
        then j-k+1> 0+1 by XREAL_1:6;
        then j+1-'k >=1+1 by NAT_1:13,A24;
        then P.(j+1-'k) =0.R by POLYNOM5:38;
        then (P`^i).(k-'1) * P.(j+1-'k) =0.R;
        hence thesis by A21,A20;
      end;
    end;
    hence thesis by A19,POLYNOM3:1;
  end;
  for i be Nat holds P[i] from NAT_1:sch 2(A1,A3);
  hence thesis;
end;
