reserve a,b,i,j,k,l,m,n for Nat;

theorem SAN:
  for a,b be Real, n be Nat holds
    (a,b) Subnomial (n+1) = <*a|^(n+1)*>^(b*(a,b) Subnomial n)
  proof
    let a,b be Real, n be Nat;
    A0: dom ((a,b)Subnomial n) = dom (b*((a,b)Subnomial n)) by VALUED_1:def 5;
    A1: dom (a,b)Subnomial (n+1) = dom (<*a|^(n+1)*>^(b*(a,b) Subnomial n))
    proof
      len (a,b)Subnomial ((n+1)+1-1) = 1 + len ((a,b) Subnomial (n+1-1))
      .= 1*(len <*a|^(n+1)*>) + len ((a,b)Subnomial n)
      .= (len <*a|^(n+1)*>) + len (b*((a,b)Subnomial n)) by A0,FINSEQ_3:29
      .= len  (<*a|^(n+1)*>^(b*(a,b) Subnomial n)) by FINSEQ_1:22;
      hence thesis by FINSEQ_3:29;
    end;
    for i be object st i in dom (a,b) Subnomial (n+1) holds
    ((a,b) Subnomial (n+1)).i = (<*a|^(n+1)*>^(b*(a,b) Subnomial n)).i
    proof
      let i be object such that
      B1: i in dom (a,b)Subnomial (n+1);
      reconsider i as non zero Nat by B1,FINSEQ_3:25;
      B2: 1 <= i <= len ((a,b)Subnomial ((n+1)+1-1)) by B1,FINSEQ_3:25;
      reconsider j = i - 1 as Nat;
      B3: j+1 <= (n+1)+1 by B2; then
      ex k be Nat st n+1 = j+k by XREAL_1:6,NAT_1:10; then
      reconsider k = n+1-j as Nat;
      set m = n+1;
      per cases;
      suppose
        C1: j = 0; then
        C2: len ((a,b)Subnomial (m+1-1)) - 1 = m & j = 1 - 1 & m - j = m;
        1+0 <= 1+m by XREAL_1:6; then
        1 <= len  ((a,b) Subnomial (m+1-1)); then
        1 in dom ((a,b) Subnomial m) by FINSEQ_3:25; then
        ((a,b) Subnomial m).1 = a|^(n+1)*(1*b|^0) by C2,Def2
        .= (<*a|^(n+1)*>^(b*(a,b) Subnomial n)).1;
        hence thesis by C1;
      end;
      suppose
        C0: j > 0; then
        len ((a,b)Subnomial (n+1-1)) >= j >= 0 + 1
          by B3,XREAL_1:6,NAT_1:13; then
        C1: j in dom ((a,b) Subnomial (n+1-1)) by FINSEQ_3:25; then
        C2: j in dom (b*(a,b) Subnomial (n+1-1)) by VALUED_1:def 5; then
        C3: len (b*(a,b)Subnomial (n+1-1)) >= j >= 1 by FINSEQ_3:25;
        reconsider x = j-1 as Nat by C0;
        C5: n = x+k & k = n-x;
        1*len <*a|^(n+1)*> = 1; then
        (<*a|^(n+1)*>^(b*(a,b) Subnomial n)).(1+j) = (b*(a,b) Subnomial n).j
          by C3, FINSEQ_1:65
        .= b*(((a,b)Subnomial (n+1-1)).j) by C2,VALUED_1:def 5
        .= b*(a|^k*b|^x) by C1,C5,Def2
        .= a|^k*(b*b|^x)
        .= a|^k*b|^(x+1) by NEWTON:6
        .= ((a,b) Subnomial ((n+1)+1-1)).i by B1,Def2;
        hence thesis;
      end;
    end;
    hence thesis by A1,FUNCT_1:2;
  end;
