reserve i,n,m,k,x for Nat,
  i1,i2 for Integer;
reserve a for Tuple of n,k-SD;
reserve aSub for Tuple of n,k-SD_Sub;

theorem Th17:
  2 <= k & i in Seg (n+1) implies SD2SDSubDigit(a,i,k) is Element of k-SD_Sub
proof
  assume that
A1: 2 <= k and
A2: i in Seg (n+1);
  set SDD = SDSub_Add_Data(DigA(a,i), k) + SDSub_Add_Carry(DigA(a,i-'1), k);
  set SDC = SDSub_Add_Carry(DigA(a,i-'1), k);
  now
    per cases by A2,FINSEQ_2:7;
    suppose
A3:   i in Seg n;
      SDD in k-SD_Sub
      proof
     DigA(a,i) is Element of k-SD by A3,RADIX_1:16;
        hence thesis by A1,Th15;
      end;
      hence SD2SDSubDigit(a,i,k) in k-SD_Sub by A3,Def6;
    end;
    suppose
A4:   i = n + 1;
      SDSub_Add_Carry(DigA(a,i-'1),k) in k-SD_Sub_S & k-SD_Sub_S c= k
      -SD_Sub by A1,Th2,Th14;
      then SDC in k-SD_Sub;
      hence SD2SDSubDigit(a,i,k) in k-SD_Sub by A4,Def6;
    end;
  end;
  hence thesis;
end;
