:: RADIX_1 semantic presentation
theorem Th1: :: RADIX_1:1
canceled;
theorem Th2: :: RADIX_1:2
theorem Th3: :: RADIX_1:3
theorem Th4: :: RADIX_1:4
theorem Th5: :: RADIX_1:5
theorem Th6: :: RADIX_1:6
theorem Th7: :: RADIX_1:7
theorem Th8: :: RADIX_1:8
:: deftheorem Def1 defines Radix RADIX_1:def 1 :
:: deftheorem Def2 defines -SD RADIX_1:def 2 :
theorem Th9: :: RADIX_1:9
Lemma54:
for k being Element of NAT st k >= 2 holds
Radix k >= 2 + 2
theorem Th10: :: RADIX_1:10
for
e being
set holds
(
e in 0
-SD iff
e = 0 )
theorem Th11: :: RADIX_1:11
theorem Th12: :: RADIX_1:12
theorem Th13: :: RADIX_1:13
theorem Th14: :: RADIX_1:14
theorem Th15: :: RADIX_1:15
theorem Th16: :: RADIX_1:16
theorem Th17: :: RADIX_1:17
canceled;
theorem Th18: :: RADIX_1:18
:: deftheorem Def3 defines DigA RADIX_1:def 3 :
:: deftheorem Def4 defines DigB RADIX_1:def 4 :
theorem Th19: :: RADIX_1:19
theorem Th20: :: RADIX_1:20
:: deftheorem Def5 defines SubDigit RADIX_1:def 5 :
definition
let n be
Element of
NAT ,
k be
Element of
NAT ;
let x be
Tuple of
n,
(k -SD );
func DigitSD c3 -> Tuple of
a1,
INT means :
Def6:
:: RADIX_1:def 6
for
i being
Element of
NAT st
i in Seg n holds
it /. i = SubDigit x,
i,
k;
existence
ex b1 being Tuple of n,INT st
for i being Element of NAT st i in Seg n holds
b1 /. i = SubDigit x,i,k
uniqueness
for b1, b2 being Tuple of n,INT st ( for i being Element of NAT st i in Seg n holds
b1 /. i = SubDigit x,i,k ) & ( for i being Element of NAT st i in Seg n holds
b2 /. i = SubDigit x,i,k ) holds
b1 = b2
end;
:: deftheorem Def6 defines DigitSD RADIX_1:def 6 :
:: deftheorem Def7 defines SDDec RADIX_1:def 7 :
:: deftheorem Def8 defines DigitDC RADIX_1:def 8 :
definition
let k be
Element of
NAT ,
n be
Element of
NAT ,
x be
Element of
NAT ;
func DecSD c3,
c2,
c1 -> Tuple of
a2,
(a1 -SD ) means :
Def9:
:: RADIX_1:def 9
for
i being
Element of
NAT st
i in Seg n holds
DigA it,
i = DigitDC x,
i,
k;
existence
ex b1 being Tuple of n,(k -SD ) st
for i being Element of NAT st i in Seg n holds
DigA b1,i = DigitDC x,i,k
uniqueness
for b1, b2 being Tuple of n,(k -SD ) st ( for i being Element of NAT st i in Seg n holds
DigA b1,i = DigitDC x,i,k ) & ( for i being Element of NAT st i in Seg n holds
DigA b2,i = DigitDC x,i,k ) holds
b1 = b2
end;
:: deftheorem Def9 defines DecSD RADIX_1:def 9 :
:: deftheorem Def10 defines SD_Add_Carry RADIX_1:def 10 :
theorem Th21: :: RADIX_1:21
Lemma86:
for x being Integer holds
( - 1 <= SD_Add_Carry x & SD_Add_Carry x <= 1 )
:: deftheorem Def11 defines SD_Add_Data RADIX_1:def 11 :
theorem Th22: :: RADIX_1:22
theorem Th23: :: RADIX_1:23
:: deftheorem Def12 defines is_represented_by RADIX_1:def 12 :
theorem Th24: :: RADIX_1:24
theorem Th25: :: RADIX_1:25
theorem Th26: :: RADIX_1:26
for
k,
m,
n being
Element of
NAT st
k >= 2 &
m is_represented_by 1,
k &
n is_represented_by 1,
k holds
SD_Add_Carry ((DigA (DecSD m,1,k),1) + (DigA (DecSD n,1,k),1)) = SD_Add_Carry (m + n)
Lemma120:
for n, m, k, i being Element of NAT st i in Seg n holds
DigA (DecSD m,(n + 1),k),i = DigA (DecSD (m mod ((Radix k) |^ n)),n,k),i
theorem Th27: :: RADIX_1:27
definition
let k be
Element of
NAT ,
i be
Element of
NAT ,
n be
Element of
NAT ;
let x be
Tuple of
n,
(k -SD ),
y be
Tuple of
n,
(k -SD );
assume E29:
(
i in Seg n &
k >= 2 )
;
func Add c4,
c5,
c2,
c1 -> Element of
a1 -SD equals :
Def13:
:: RADIX_1:def 13
(SD_Add_Data ((DigA x,i) + (DigA y,i)),k) + (SD_Add_Carry ((DigA x,(i -' 1)) + (DigA y,(i -' 1))));
coherence
(SD_Add_Data ((DigA x,i) + (DigA y,i)),k) + (SD_Add_Carry ((DigA x,(i -' 1)) + (DigA y,(i -' 1)))) is Element of k -SD
end;
:: deftheorem Def13 defines Add RADIX_1:def 13 :
for
k,
i,
n being
Element of
NAT for
x,
y being
Tuple of
n,
(k -SD ) st
i in Seg n &
k >= 2 holds
Add x,
y,
i,
k = (SD_Add_Data ((DigA x,i) + (DigA y,i)),k) + (SD_Add_Carry ((DigA x,(i -' 1)) + (DigA y,(i -' 1))));
definition
let n be
Element of
NAT ,
k be
Element of
NAT ;
let x be
Tuple of
n,
(k -SD ),
y be
Tuple of
n,
(k -SD );
func c3 '+' c4 -> Tuple of
a1,
(a2 -SD ) means :
Def14:
:: RADIX_1:def 14
for
i being
Element of
NAT st
i in Seg n holds
DigA it,
i = Add x,
y,
i,
k;
existence
ex b1 being Tuple of n,(k -SD ) st
for i being Element of NAT st i in Seg n holds
DigA b1,i = Add x,y,i,k
uniqueness
for b1, b2 being Tuple of n,(k -SD ) st ( for i being Element of NAT st i in Seg n holds
DigA b1,i = Add x,y,i,k ) & ( for i being Element of NAT st i in Seg n holds
DigA b2,i = Add x,y,i,k ) holds
b1 = b2
end;
:: deftheorem Def14 defines '+' RADIX_1:def 14 :
theorem Th28: :: RADIX_1:28
theorem Th29: :: RADIX_1:29
for
n being
Element of
NAT st
n >= 1 holds
for
k,
x,
y being
Element of
NAT st
k >= 2 &
x is_represented_by n,
k &
y is_represented_by n,
k holds
x + y = (SDDec ((DecSD x,n,k) '+' (DecSD y,n,k))) + (((Radix k) |^ n) * (SD_Add_Carry ((DigA (DecSD x,n,k),n) + (DigA (DecSD y,n,k),n))))