:: RADIX_4 semantic presentation
theorem Th1: :: RADIX_4:1
for b
1 being
Nat holds
not ( 2
<= b
1 & not 2
< Radix b
1 )
Lemma2:
for b1 being Nat
for b2 being Integer holds
( b2 in b1 -SD_Sub_S implies ( b2 >= - (Radix (b1 -' 1)) & b2 <= (Radix (b1 -' 1)) - 1 ) )
Lemma3:
for b1, b2, b3, b4 being Nat holds
( b4 in Seg b1 implies DigA (DecSD b2,(b1 + 1),b3),b4 = DigA (DecSD b2,b1,b3),b4 )
Lemma4:
for b1, b2, b3 being Nat holds
( b3 >= 1 & b2 is_represented_by b3 + 1,b1 implies DigA (DecSD (b2 mod ((Radix b1) |^ b3)),b3,b1),b3 = DigA (DecSD b2,b3,b1),b3 )
theorem Th2: :: RADIX_4:2
theorem Th3: :: RADIX_4:3
theorem Th4: :: RADIX_4:4
theorem Th5: :: RADIX_4:5
for b
1, b
2, b
3 being
Nat holds
( b
3 >= 1 & b
1 >= 3 & b
2 is_represented_by b
3 + 1,b
1 implies
DigA_SDSub (SD2SDSub (DecSD (b2 mod ((Radix b1) |^ b3)),b3,b1)),
(b3 + 1) = SDSub_Add_Carry (DigA (DecSD b2,b3,b1),b3),b
1 )
theorem Th6: :: RADIX_4:6
theorem Th7: :: RADIX_4:7
for b
1, b
2, b
3 being
Nat holds
( b
3 >= 1 & b
1 >= 2 & b
2 is_represented_by b
3 + 1,b
1 implies
((Radix b1) |^ b3) * (DigA_SDSub (SD2SDSub (DecSD b2,(b3 + 1),b1)),(b3 + 1)) = ((((Radix b1) |^ b3) * (DigA (DecSD b2,(b3 + 1),b1),(b3 + 1))) - (((Radix b1) |^ (b3 + 1)) * (SDSub_Add_Carry (DigA (DecSD b2,(b3 + 1),b1),(b3 + 1)),b1))) + (((Radix b1) |^ b3) * (SDSub_Add_Carry (DigA (DecSD b2,(b3 + 1),b1),b3),b1)) )
definition
let c
1, c
2, c
3 be
Nat;
let c
4, c
5 be
Tuple of c
2,
(c3 -SD_Sub );
assume E11:
( c
1 in Seg c
2 & c
3 >= 2 )
;
func SDSubAddDigit c
4,c
5,c
1,c
3 -> Element of a
3 -SD_Sub equals :
Def1:
:: RADIX_4:def 1
(SDSub_Add_Data ((DigA_SDSub a4,a1) + (DigA_SDSub a5,a1)),a3) + (SDSub_Add_Carry ((DigA_SDSub a4,(a1 -' 1)) + (DigA_SDSub a5,(a1 -' 1))),a3);
coherence
(SDSub_Add_Data ((DigA_SDSub c4,c1) + (DigA_SDSub c5,c1)),c3) + (SDSub_Add_Carry ((DigA_SDSub c4,(c1 -' 1)) + (DigA_SDSub c5,(c1 -' 1))),c3) is Element of c3 -SD_Sub
end;
:: deftheorem Def1 defines SDSubAddDigit RADIX_4:def 1 :
for b
1, b
2, b
3 being
Natfor b
4, b
5 being
Tuple of b
2,
(b3 -SD_Sub ) holds
( b
1 in Seg b
2 & b
3 >= 2 implies
SDSubAddDigit b
4,b
5,b
1,b
3 = (SDSub_Add_Data ((DigA_SDSub b4,b1) + (DigA_SDSub b5,b1)),b3) + (SDSub_Add_Carry ((DigA_SDSub b4,(b1 -' 1)) + (DigA_SDSub b5,(b1 -' 1))),b3) );
definition
let c
1, c
2 be
Nat;
let c
3, c
4 be
Tuple of c
1,
(c2 -SD_Sub );
func c
3 '+' c
4 -> Tuple of a
1,
(a2 -SD_Sub ) means :
Def2:
:: RADIX_4:def 2
for b
1 being
Nat holds
( b
1 in Seg a
1 implies
DigA_SDSub a
5,b
1 = SDSubAddDigit a
3,a
4,b
1,a
2 );
existence
ex b1 being Tuple of c1,(c2 -SD_Sub ) st
for b2 being Nat holds
( b2 in Seg c1 implies DigA_SDSub b1,b2 = SDSubAddDigit c3,c4,b2,c2 )
uniqueness
for b1, b2 being Tuple of c1,(c2 -SD_Sub ) holds
( ( for b3 being Nat holds
( b3 in Seg c1 implies DigA_SDSub b1,b3 = SDSubAddDigit c3,c4,b3,c2 ) ) & ( for b3 being Nat holds
( b3 in Seg c1 implies DigA_SDSub b2,b3 = SDSubAddDigit c3,c4,b3,c2 ) ) implies b1 = b2 )
end;
:: deftheorem Def2 defines '+' RADIX_4:def 2 :
theorem Th8: :: RADIX_4:8
for b
1, b
2, b
3, b
4, b
5 being
Nat holds
( b
5 in Seg b
1 & 2
<= b
2 implies
SDSubAddDigit (SD2SDSub (DecSD b3,(b1 + 1),b2)),
(SD2SDSub (DecSD b4,(b1 + 1),b2)),b
5,b
2 = SDSubAddDigit (SD2SDSub (DecSD (b3 mod ((Radix b2) |^ b1)),b1,b2)),
(SD2SDSub (DecSD (b4 mod ((Radix b2) |^ b1)),b1,b2)),b
5,b
2 )
theorem Th9: :: RADIX_4:9