reserve k for Nat;

theorem Th12:
  for n,k be Nat, x be Tuple of n,NAT, y be Tuple of n,k-SD st x = y
  holds DigitSD2(x,k) = DigitSD(y)
proof
  let n,k be Nat;
  let x be Tuple of n,NAT;
  let y be Tuple of n,k-SD;
A1: len DigitSD(y) = n by CARD_1:def 7;
A2: len DigitSD2(x,k) = n by CARD_1:def 7;
  then
A3: dom DigitSD2(x,k) = Seg n by FINSEQ_1:def 3;
  assume
A4: x=y;
A5: now
    let i be Element of NAT;
    assume i in Seg n;
    then x.i = DigA(y,i) by A4,RADIX_1:def 3
      .= DigB(y,i) by RADIX_1:def 4;
    hence x.i = DigB(y,i);
  end;
  now
    let j be Nat;
    assume
A6: j in dom DigitSD2(x,k);
    then
A7: j in dom DigitSD(y) by A1,A3,FINSEQ_1:def 3;
    DigitSD2(x,k).j = (DigitSD2(x,k))/.j by A6,PARTFUN1:def 6
      .= SubDigit2(x,j,k) by A3,A6,Def2
      .= (Radix(k) |^ (j -'1))*DigB(y,j) by A5,A3,A6
      .= SubDigit(y,j,k) by RADIX_1:def 5
      .= (DigitSD(y))/.j by A3,A6,RADIX_1:def 6
      .= DigitSD(y).j by A7,PARTFUN1:def 6;
    hence DigitSD2(x,k).j = DigitSD(y).j;
  end;
  hence thesis by A2,A1,FINSEQ_2:9;
end;
