
theorem Th5:
  for n,b being Nat st b > 1 holds value(digits(n,b),b)=n
proof
  let n,b be Nat;
  assume
A1: b>1;
  per cases;
  suppose
    n<>0;
    hence thesis by A1,Def2;
  end;
  suppose
A2: n=0;
    then
A3: digits(n,b)= <%0%> by A1,Def2;
    now
      let i be Nat;
      assume i in dom <%0%>;
      then i in {0} by AFINSQ_1:def 4,CARD_1:49;
      then
A4:   i=0 by TARSKI:def 1;
      hence <%0%>.i = 0*(b|^i)
        .= (digits(n,b).i)*(b|^i) by A3,A4;
    end;
    then
 value(digits(n,b),b)=Sum <%0%> by A3,Def1;
    hence thesis by A2,AFINSQ_2:53;
  end;
end;
