:: RADIX_3 semantic presentation
Lemma1:
for b1 being Nat holds
( 1 <= b1 implies Radix b1 = (Radix (b1 -' 1)) + (Radix (b1 -' 1)) )
Lemma2:
for b1 being Nat holds
( 1 <= b1 implies (Radix b1) - (Radix (b1 -' 1)) = Radix (b1 -' 1) )
Lemma3:
for b1 being Nat holds
( 1 <= b1 implies (- (Radix b1)) + (Radix (b1 -' 1)) = - (Radix (b1 -' 1)) )
Lemma4:
for b1 being Nat holds
( 1 <= b1 implies 2 <= Radix b1 )
Lemma5:
for b1, b2, b3, b4 being Nat holds
( b4 in Seg b1 implies DigA (DecSD b2,(b1 + 1),b3),b4 = DigA (DecSD (b2 mod ((Radix b3) |^ b1)),b1,b3),b4 )
:: deftheorem Def1 defines -SD_Sub_S RADIX_3:def 1 :
:: deftheorem Def2 defines -SD_Sub RADIX_3:def 2 :
theorem Th1: :: RADIX_3:1
canceled;
theorem Th2: :: RADIX_3:2
theorem Th3: :: RADIX_3:3
theorem Th4: :: RADIX_3:4
theorem Th5: :: RADIX_3:5
theorem Th6: :: RADIX_3:6
theorem Th7: :: RADIX_3:7
theorem Th8: :: RADIX_3:8
theorem Th9: :: RADIX_3:9
theorem Th10: :: RADIX_3:10
theorem Th11: :: RADIX_3:11
theorem Th12: :: RADIX_3:12
:: deftheorem Def3 defines SDSub_Add_Carry RADIX_3:def 3 :
:: deftheorem Def4 defines SDSub_Add_Data RADIX_3:def 4 :
theorem Th13: :: RADIX_3:13
theorem Th14: :: RADIX_3:14
theorem Th15: :: RADIX_3:15
theorem Th16: :: RADIX_3:16
theorem Th17: :: RADIX_3:17
:: deftheorem Def5 defines DigA_SDSub RADIX_3:def 5 :
definition
let c
1, c
2, c
3 be
Nat;
let c
4 be
Tuple of c
3,
(c2 -SD );
func SD2SDSubDigit c
4,c
1,c
2 -> Integer equals :
Def6:
:: RADIX_3:def 6
(SDSub_Add_Data (DigA a4,a1),a2) + (SDSub_Add_Carry (DigA a4,(a1 -' 1)),a2) if a
1 in Seg a
3 SDSub_Add_Carry (DigA a4,(a1 -' 1)),a
2 if a
1 = a
3 + 1
otherwise 0;
coherence
( ( c1 in Seg c3 implies (SDSub_Add_Data (DigA c4,c1),c2) + (SDSub_Add_Carry (DigA c4,(c1 -' 1)),c2) is Integer ) & ( c1 = c3 + 1 implies SDSub_Add_Carry (DigA c4,(c1 -' 1)),c2 is Integer ) & ( not c1 in Seg c3 & not c1 = c3 + 1 implies 0 is Integer ) )
;
consistency
for b1 being Integer holds
( c1 in Seg c3 & c1 = c3 + 1 implies ( b1 = (SDSub_Add_Data (DigA c4,c1),c2) + (SDSub_Add_Carry (DigA c4,(c1 -' 1)),c2) iff b1 = SDSub_Add_Carry (DigA c4,(c1 -' 1)),c2 ) )
end;
:: deftheorem Def6 defines SD2SDSubDigit RADIX_3:def 6 :
for b
1, b
2, b
3 being
Natfor b
4 being
Tuple of b
3,
(b2 -SD ) holds
( ( b
1 in Seg b
3 implies
SD2SDSubDigit b
4,b
1,b
2 = (SDSub_Add_Data (DigA b4,b1),b2) + (SDSub_Add_Carry (DigA b4,(b1 -' 1)),b2) ) & ( b
1 = b
3 + 1 implies
SD2SDSubDigit b
4,b
1,b
2 = SDSub_Add_Carry (DigA b4,(b1 -' 1)),b
2 ) & ( not b
1 in Seg b
3 & not b
1 = b
3 + 1 implies
SD2SDSubDigit b
4,b
1,b
2 = 0 ) );
theorem Th18: :: RADIX_3:18
definition
let c
1, c
2, c
3 be
Nat;
let c
4 be
Tuple of c
3,
(c2 -SD );
assume E25:
( 2
<= c
2 & c
1 in Seg (c3 + 1) )
;
func SD2SDSubDigitS c
4,c
1,c
2 -> Element of a
2 -SD_Sub equals :
Def7:
:: RADIX_3:def 7
SD2SDSubDigit a
4,a
1,a
2;
coherence
SD2SDSubDigit c4,c1,c2 is Element of c2 -SD_Sub
by E25, Th18;
end;
:: deftheorem Def7 defines SD2SDSubDigitS RADIX_3:def 7 :
definition
let c
1, c
2 be
Nat;
let c
3 be
Tuple of c
1,
(c2 -SD );
func SD2SDSub c
3 -> Tuple of
(a1 + 1),
(a2 -SD_Sub ) means :
Def8:
:: RADIX_3:def 8
for b
1 being
Nat holds
( b
1 in Seg (a1 + 1) implies
DigA_SDSub a
4,b
1 = SD2SDSubDigitS a
3,b
1,a
2 );
existence
ex b1 being Tuple of (c1 + 1),(c2 -SD_Sub ) st
for b2 being Nat holds
( b2 in Seg (c1 + 1) implies DigA_SDSub b1,b2 = SD2SDSubDigitS c3,b2,c2 )
uniqueness
for b1, b2 being Tuple of (c1 + 1),(c2 -SD_Sub ) holds
( ( for b3 being Nat holds
( b3 in Seg (c1 + 1) implies DigA_SDSub b1,b3 = SD2SDSubDigitS c3,b3,c2 ) ) & ( for b3 being Nat holds
( b3 in Seg (c1 + 1) implies DigA_SDSub b2,b3 = SD2SDSubDigitS c3,b3,c2 ) ) implies b1 = b2 )
end;
:: deftheorem Def8 defines SD2SDSub RADIX_3:def 8 :
theorem Th19: :: RADIX_3:19
theorem Th20: :: RADIX_3:20
:: deftheorem Def9 defines DigB_SDSub RADIX_3:def 9 :
:: deftheorem Def10 defines SDSub2INTDigit RADIX_3:def 10 :
definition
let c
1, c
2 be
Nat;
let c
3 be
Tuple of c
1,
(c2 -SD_Sub );
func SDSub2INT c
3 -> Tuple of a
1,
INT means :
Def11:
:: RADIX_3:def 11
for b
1 being
Nat holds
( b
1 in Seg a
1 implies a
4 /. b
1 = SDSub2INTDigit a
3,b
1,a
2 );
existence
ex b1 being Tuple of c1,INT st
for b2 being Nat holds
( b2 in Seg c1 implies b1 /. b2 = SDSub2INTDigit c3,b2,c2 )
uniqueness
for b1, b2 being Tuple of c1,INT holds
( ( for b3 being Nat holds
( b3 in Seg c1 implies b1 /. b3 = SDSub2INTDigit c3,b3,c2 ) ) & ( for b3 being Nat holds
( b3 in Seg c1 implies b2 /. b3 = SDSub2INTDigit c3,b3,c2 ) ) implies b1 = b2 )
end;
:: deftheorem Def11 defines SDSub2INT RADIX_3:def 11 :
:: deftheorem Def12 defines SDSub2IntOut RADIX_3:def 12 :
theorem Th21: :: RADIX_3:21
theorem Th22: :: RADIX_3:22