:: MOD_2  semantic presentation
E1:  op0  = 
 {} 
by TARSKI:def 1
.= 
 Extract {} 
by ALGSTR_1:def 3
;
Lemma2: 
for b1 being  Ring holds   VectSpStr(# {{} },op2 ,op0 ,(pr2 the carrier of b1,{{} }) #) is  strict LeftMod of b1
 
:: deftheorem Def1  MOD_2:def 1 : 
canceled; 
:: deftheorem Def2   defines TrivialLMod MOD_2:def 2 : 
theorem Th1: :: MOD_2:1
:: deftheorem Def3  MOD_2:def 3 : 
canceled; 
:: deftheorem Def4  MOD_2:def 4 : 
canceled; 
:: deftheorem Def5   defines linear MOD_2:def 5 : 
theorem Th2: :: MOD_2:2
canceled; 
theorem Th3: :: MOD_2:3
canceled; 
theorem Th4: :: MOD_2:4
theorem Th5: :: MOD_2:5
canceled; 
theorem Th6: :: MOD_2:6
theorem Th7: :: MOD_2:7
canceled; 
theorem Th8: :: MOD_2:8
:: deftheorem Def6   defines dom MOD_2:def 6 : 
:: deftheorem Def7   defines cod MOD_2:def 7 : 
:: deftheorem Def8   defines fun MOD_2:def 8 : 
theorem Th9: :: MOD_2:9
:: deftheorem Def9   defines ZERO MOD_2:def 9 : 
:: deftheorem Def10   defines LModMorphism-like MOD_2:def 10 : 
theorem Th10: :: MOD_2:10
:: deftheorem Def11   defines Morphism MOD_2:def 11 : 
theorem Th11: :: MOD_2:11
theorem Th12: :: MOD_2:12
theorem Th13: :: MOD_2:13
:: deftheorem Def12   defines ID MOD_2:def 12 : 
theorem Th14: :: MOD_2:14
theorem Th15: :: MOD_2:15
theorem Th16: :: MOD_2:16
theorem Th17: :: MOD_2:17
theorem Th18: :: MOD_2:18
definition
let c1 be   
Ring;
let c2, 
c3 be   
LModMorphism of 
c1;
assume E17: 
 
dom c2 =  cod c3
 ;
func c2 * c3 ->  strict LModMorphism of 
a1 means :
Def13: 
:: MOD_2:def 13
for 
b1, 
b2, 
b3 being  
LeftMod of 
a1 for 
b4 being  
Function of 
b2,
b3 for 
b5 being  
Function of 
b1,
b2  st  
LModMorphismStr(# the 
Dom of 
a2,the 
Cod of 
a2,the 
Fun of 
a2 #) 
=  LModMorphismStr(# 
b2,
b3,
b4 #) &  
LModMorphismStr(# the 
Dom of 
a3,the 
Cod of 
a3,the 
Fun of 
a3 #) 
=  LModMorphismStr(# 
b1,
b2,
b5 #) holds 
a4 =  LModMorphismStr(# 
b1,
b3,
(b4 * b5) #);
existence 
ex b1 being strict LModMorphism of c1 st 
for b2, b3, b4 being  LeftMod of c1
 for b5 being  Function of b3,b4
 for b6 being  Function of b2,b3  st  LModMorphismStr(# the Dom of c2,the Cod of c2,the Fun of c2 #) =  LModMorphismStr(# b3,b4,b5 #) &  LModMorphismStr(# the Dom of c3,the Cod of c3,the Fun of c3 #) =  LModMorphismStr(# b2,b3,b6 #) holds 
b1 =  LModMorphismStr(# b2,b4,(b5 * b6) #)
 
uniqueness 
for b1, b2 being strict LModMorphism of c1  st ( for b3, b4, b5 being  LeftMod of c1
 for b6 being  Function of b4,b5
 for b7 being  Function of b3,b4  st  LModMorphismStr(# the Dom of c2,the Cod of c2,the Fun of c2 #) =  LModMorphismStr(# b4,b5,b6 #) &  LModMorphismStr(# the Dom of c3,the Cod of c3,the Fun of c3 #) =  LModMorphismStr(# b3,b4,b7 #) holds 
b1 =  LModMorphismStr(# b3,b5,(b6 * b7) #) ) & ( for b3, b4, b5 being  LeftMod of c1
 for b6 being  Function of b4,b5
 for b7 being  Function of b3,b4  st  LModMorphismStr(# the Dom of c2,the Cod of c2,the Fun of c2 #) =  LModMorphismStr(# b4,b5,b6 #) &  LModMorphismStr(# the Dom of c3,the Cod of c3,the Fun of c3 #) =  LModMorphismStr(# b3,b4,b7 #) holds 
b2 =  LModMorphismStr(# b3,b5,(b6 * b7) #) ) holds 
b1 = b2
 
 
end;
 
:: deftheorem Def13   defines * MOD_2:def 13 : 
for 
b1 being  
Ring for 
b2, 
b3 being  
LModMorphism of 
b1  st  
dom b2 =  cod b3 holds 
for 
b4 being 
strict LModMorphism of 
b1 holds 
 ( 
b4 = b2 * b3 iff for 
b5, 
b6, 
b7 being  
LeftMod of 
b1 for 
b8 being  
Function of 
b6,
b7 for 
b9 being  
Function of 
b5,
b6  st  
LModMorphismStr(# the 
Dom of 
b2,the 
Cod of 
b2,the 
Fun of 
b2 #) 
=  LModMorphismStr(# 
b6,
b7,
b8 #) &  
LModMorphismStr(# the 
Dom of 
b3,the 
Cod of 
b3,the 
Fun of 
b3 #) 
=  LModMorphismStr(# 
b5,
b6,
b9 #) holds 
b4 =  LModMorphismStr(# 
b5,
b7,
(b8 * b9) #) );
theorem Th19: :: MOD_2:19
canceled; 
theorem Th20: :: MOD_2:20
:: deftheorem Def14   defines *' MOD_2:def 14 : 
theorem Th21: :: MOD_2:21
for 
b1 being  
Ring for 
b2, 
b3, 
b4 being  
LeftMod of 
b1 for 
b5 being   
Morphism of 
b2,
b3 for 
b6 being   
Morphism of 
b4,
b2 for 
b7 being  
Function of 
b2,
b3 for 
b8 being  
Function of 
b4,
b2  st 
b5 =  LModMorphismStr(# 
b2,
b3,
b7 #) & 
b6 =  LModMorphismStr(# 
b4,
b2,
b8 #) holds 
( 
b5 *' b6 =  LModMorphismStr(# 
b4,
b3,
(b7 * b8) #) & 
b5 * b6 =  LModMorphismStr(# 
b4,
b3,
(b7 * b8) #) )
theorem Th22: :: MOD_2:22
for 
b1 being  
Ring for 
b2, 
b3 being 
strict LModMorphism of 
b1  st  
dom b3 =  cod b2 holds 
ex 
b4, 
b5, 
b6 being  
LeftMod of 
b1ex 
b7 being  
Function of 
b4,
b5ex 
b8 being  
Function of 
b5,
b6 st 
( 
b2 =  LModMorphismStr(# 
b4,
b5,
b7 #) & 
b3 =  LModMorphismStr(# 
b5,
b6,
b8 #) & 
b3 * b2 =  LModMorphismStr(# 
b4,
b6,
(b8 * b7) #) )
theorem Th23: :: MOD_2:23
theorem Th24: :: MOD_2:24
theorem Th25: :: MOD_2:25
theorem Th26: :: MOD_2:26
theorem Th27: :: MOD_2:27
canceled; 
theorem Th28: :: MOD_2:28
theorem Th29: :: MOD_2:29
theorem Th30: :: MOD_2:30
Lemma25: 
ex b1 being   Element of {0,1,2} st b1 = 0
 
Lemma26: 
ex b1 being   Element of {0,1,2} st b1 = 1
 
Lemma27: 
ex b1 being   Element of {0,1,2} st b1 = 2
 
definition
let c1 be    
Element of 
{0,1,2};
func  - c1 ->    Element of 
{0,1,2} equals :
Def15: 
:: MOD_2:def 15
0
 if a1 = 0
2
 if a1 = 1
1
 if a1 = 2
;
coherence 
( ( c1 = 0 implies 0 is    Element of {0,1,2} ) & ( c1 = 1 implies 2 is    Element of {0,1,2} ) & ( c1 = 2 implies 1 is    Element of {0,1,2} ) )
 by Lemma26, Lemma27;
consistency 
for b1 being   Element of {0,1,2} holds 
 ( ( c1 = 0 & c1 = 1 implies ( b1 = 0 iff b1 = 2 ) ) & ( c1 = 0 & c1 = 2 implies ( b1 = 0 iff b1 = 1 ) ) & ( c1 = 1 & c1 = 2 implies ( b1 = 2 iff b1 = 1 ) ) )
 ;
let c2 be    
Element of 
{0,1,2};
func c1 + c2 ->    Element of 
{0,1,2} equals :
Def16: 
:: MOD_2:def 16
a2 if a1 = 0
a1 if a2 = 0
2
 if ( 
a1 = 1 & 
a2 = 1 )
0
 if ( 
a1 = 1 & 
a2 = 2 )
0
 if ( 
a1 = 2 & 
a2 = 1 )
1
 if ( 
a1 = 2 & 
a2 = 2 )
;
coherence 
( ( c1 = 0 implies c2 is    Element of {0,1,2} ) & ( c2 = 0 implies c1 is    Element of {0,1,2} ) & ( c1 = 1 & c2 = 1 implies 2 is    Element of {0,1,2} ) & ( c1 = 1 & c2 = 2 implies 0 is    Element of {0,1,2} ) & ( c1 = 2 & c2 = 1 implies 0 is    Element of {0,1,2} ) & ( c1 = 2 & c2 = 2 implies 1 is    Element of {0,1,2} ) )
 by Lemma25, Lemma26, Lemma27;
consistency 
for b1 being   Element of {0,1,2} holds 
 ( ( c1 = 0 & c2 = 0 implies ( b1 = c2 iff b1 = c1 ) ) & ( c1 = 0 & c1 = 1 & c2 = 1 implies ( b1 = c2 iff b1 = 2 ) ) & ( c1 = 0 & c1 = 1 & c2 = 2 implies ( b1 = c2 iff b1 = 0 ) ) & ( c1 = 0 & c1 = 2 & c2 = 1 implies ( b1 = c2 iff b1 = 0 ) ) & ( c1 = 0 & c1 = 2 & c2 = 2 implies ( b1 = c2 iff b1 = 1 ) ) & ( c2 = 0 & c1 = 1 & c2 = 1 implies ( b1 = c1 iff b1 = 2 ) ) & ( c2 = 0 & c1 = 1 & c2 = 2 implies ( b1 = c1 iff b1 = 0 ) ) & ( c2 = 0 & c1 = 2 & c2 = 1 implies ( b1 = c1 iff b1 = 0 ) ) & ( c2 = 0 & c1 = 2 & c2 = 2 implies ( b1 = c1 iff b1 = 1 ) ) & ( c1 = 1 & c2 = 1 & c1 = 1 & c2 = 2 implies ( b1 = 2 iff b1 = 0 ) ) & ( c1 = 1 & c2 = 1 & c1 = 2 & c2 = 1 implies ( b1 = 2 iff b1 = 0 ) ) & ( c1 = 1 & c2 = 1 & c1 = 2 & c2 = 2 implies ( b1 = 2 iff b1 = 1 ) ) & ( c1 = 1 & c2 = 2 & c1 = 2 & c2 = 1 implies ( b1 = 0 iff b1 = 0 ) ) & ( c1 = 1 & c2 = 2 & c1 = 2 & c2 = 2 implies ( b1 = 0 iff b1 = 1 ) ) & ( c1 = 2 & c2 = 1 & c1 = 2 & c2 = 2 implies ( b1 = 0 iff b1 = 1 ) ) )
 ;
func c1 * c2 ->    Element of 
{0,1,2} equals :
Def17: 
:: MOD_2:def 17
0
 if a2 = 0
0
 if a1 = 0
a1 if a2 = 1
a2 if a1 = 1
1
 if ( 
a1 = 2 & 
a2 = 2 )
;
coherence 
( ( c2 = 0 implies 0 is    Element of {0,1,2} ) & ( c1 = 0 implies 0 is    Element of {0,1,2} ) & ( c2 = 1 implies c1 is    Element of {0,1,2} ) & ( c1 = 1 implies c2 is    Element of {0,1,2} ) & ( c1 = 2 & c2 = 2 implies 1 is    Element of {0,1,2} ) )
 by Lemma26;
consistency 
for b1 being   Element of {0,1,2} holds 
 ( ( c2 = 0 & c1 = 0 implies ( b1 = 0 iff b1 = 0 ) ) & ( c2 = 0 & c2 = 1 implies ( b1 = 0 iff b1 = c1 ) ) & ( c2 = 0 & c1 = 1 implies ( b1 = 0 iff b1 = c2 ) ) & ( c2 = 0 & c1 = 2 & c2 = 2 implies ( b1 = 0 iff b1 = 1 ) ) & ( c1 = 0 & c2 = 1 implies ( b1 = 0 iff b1 = c1 ) ) & ( c1 = 0 & c1 = 1 implies ( b1 = 0 iff b1 = c2 ) ) & ( c1 = 0 & c1 = 2 & c2 = 2 implies ( b1 = 0 iff b1 = 1 ) ) & ( c2 = 1 & c1 = 1 implies ( b1 = c1 iff b1 = c2 ) ) & ( c2 = 1 & c1 = 2 & c2 = 2 implies ( b1 = c1 iff b1 = 1 ) ) & ( c1 = 1 & c1 = 2 & c2 = 2 implies ( b1 = c2 iff b1 = 1 ) ) )
 ;
 
end;
 
:: deftheorem Def15   defines - MOD_2:def 15 : 
for 
b1 being   
Element of 
{0,1,2} holds 
 ( ( 
b1 = 0 implies  
- b1 = 0 ) & ( 
b1 = 1 implies  
- b1 = 2 ) & ( 
b1 = 2 implies  
- b1 = 1 ) );
:: deftheorem Def16   defines + MOD_2:def 16 : 
for 
b1, 
b2 being   
Element of 
{0,1,2} holds 
 ( ( 
b1 = 0 implies 
b1 + b2 = b2 ) & ( 
b2 = 0 implies 
b1 + b2 = b1 ) & ( 
b1 = 1 & 
b2 = 1 implies 
b1 + b2 = 2 ) & ( 
b1 = 1 & 
b2 = 2 implies 
b1 + b2 = 0 ) & ( 
b1 = 2 & 
b2 = 1 implies 
b1 + b2 = 0 ) & ( 
b1 = 2 & 
b2 = 2 implies 
b1 + b2 = 1 ) );
:: deftheorem Def17   defines * MOD_2:def 17 : 
for 
b1, 
b2 being   
Element of 
{0,1,2} holds 
 ( ( 
b2 = 0 implies 
b1 * b2 = 0 ) & ( 
b1 = 0 implies 
b1 * b2 = 0 ) & ( 
b2 = 1 implies 
b1 * b2 = b1 ) & ( 
b1 = 1 implies 
b1 * b2 = b2 ) & ( 
b1 = 2 & 
b2 = 2 implies 
b1 * b2 = 1 ) );
definition
func  add3  ->   BinOp of 
{0,1,2} means :
Def18: 
:: MOD_2:def 18
for 
b1, 
b2 being   
Element of 
{0,1,2} holds  
a1 . b1,
b2 = b1 + b2;
existence 
ex b1 being  BinOp of {0,1,2} st 
for b2, b3 being   Element of {0,1,2} holds  b1 . b2,b3 = b2 + b3
 
uniqueness 
for b1, b2 being  BinOp of {0,1,2}  st ( for b3, b4 being   Element of {0,1,2} holds  b1 . b3,b4 = b3 + b4 ) & ( for b3, b4 being   Element of {0,1,2} holds  b2 . b3,b4 = b3 + b4 ) holds 
b1 = b2
 
func  mult3  ->   BinOp of 
{0,1,2} means :
Def19: 
:: MOD_2:def 19
for 
b1, 
b2 being   
Element of 
{0,1,2} holds  
a1 . b1,
b2 = b1 * b2;
existence 
ex b1 being  BinOp of {0,1,2} st 
for b2, b3 being   Element of {0,1,2} holds  b1 . b2,b3 = b2 * b3
 
uniqueness 
for b1, b2 being  BinOp of {0,1,2}  st ( for b3, b4 being   Element of {0,1,2} holds  b1 . b3,b4 = b3 * b4 ) & ( for b3, b4 being   Element of {0,1,2} holds  b2 . b3,b4 = b3 * b4 ) holds 
b1 = b2
 
func  compl3  ->   UnOp of 
{0,1,2} means :
Def20: 
:: MOD_2:def 20
for 
b1 being   
Element of 
{0,1,2} holds  
a1 . b1 =  - b1;
existence 
ex b1 being  UnOp of {0,1,2} st 
for b2 being   Element of {0,1,2} holds  b1 . b2 =  - b2
 
uniqueness 
for b1, b2 being  UnOp of {0,1,2}  st ( for b3 being   Element of {0,1,2} holds  b1 . b3 =  - b3 ) & ( for b3 being   Element of {0,1,2} holds  b2 . b3 =  - b3 ) holds 
b1 = b2
 
func  unit3  ->    Element of 
{0,1,2} equals :: MOD_2:def 21
1;
coherence 
1 is    Element of {0,1,2}
 by ENUMSET1:def 1;
func  zero3  ->    Element of 
{0,1,2} equals :: MOD_2:def 22
0;
coherence 
0 is    Element of {0,1,2}
 by ENUMSET1:def 1;
 
end;
 
:: deftheorem Def18   defines add3 MOD_2:def 18 : 
:: deftheorem Def19   defines mult3 MOD_2:def 19 : 
:: deftheorem Def20   defines compl3 MOD_2:def 20 : 
:: deftheorem Def21   defines unit3 MOD_2:def 21 : 
:: deftheorem Def22   defines zero3 MOD_2:def 22 : 
definition
func  Z3  ->  strict  doubleLoopStr  equals :
Def23: 
:: MOD_2:def 23
 doubleLoopStr(# 
{0,1,2},
add3 ,
mult3 ,
unit3 ,
zero3  #);
coherence 
 doubleLoopStr(# {0,1,2},add3 ,mult3 ,unit3 ,zero3  #) is  strict  doubleLoopStr 
 ;
 
end;
 
:: deftheorem Def23   defines Z3 MOD_2:def 23 : 
Lemma36: 
 1. Z3  = 1
 
theorem Th31: :: MOD_2:31
canceled; 
theorem Th32: :: MOD_2:32
Lemma38: 
for b1, b2 being  Scalar of Z3 
 for b3, b4 being   Element of {0,1,2}  st b3 = b1 & b4 = b2 holds 
( b1 + b2 = b3 + b4 & b1 * b2 = b3 * b4 )
 
Lemma39: 
for b1, b2, b3 being  Scalar of Z3 
 for b4, b5, b6 being   Element of {0,1,2}  st b4 = b1 & b5 = b2 & b6 = b3 holds 
( (b1 + b2) + b3 = (b4 + b5) + b6 & b1 + (b2 + b3) = b4 + (b5 + b6) & (b1 * b2) * b3 = (b4 * b5) * b6 & b1 * (b2 * b3) = b4 * (b5 * b6) )
 
Lemma40: 
for b1, b2, b3, b4 being   Element of {0,1,2}  st b4 = 0 holds 
( b1 + (- b1) = b4 & b1 + b4 = b1 & (b1 + b2) + b3 = b1 + (b2 + b3) )
 
theorem Th33: :: MOD_2:33
for 
b1, 
b2 being  
Scalar of 
Z3  for 
b3, 
b4 being   
Element of 
{0,1,2}  st 
b3 = b1 & 
b4 = b2 holds 
( 
b1 + b2 = b3 + b4 & 
b1 * b2 = b3 * b4 &  
- b1 =  - b3 )
theorem Th34: :: MOD_2:34
for 
b1, 
b2, 
b3 being  
Scalar of 
Z3  for 
b4, 
b5, 
b6 being   
Element of 
{0,1,2}  st 
b4 = b1 & 
b5 = b2 & 
b6 = b3 holds 
( 
(b1 + b2) + b3 = (b4 + b5) + b6 & 
b1 + (b2 + b3) = b4 + (b5 + b6) & 
(b1 * b2) * b3 = (b4 * b5) * b6 & 
b1 * (b2 * b3) = b4 * (b5 * b6) )
theorem Th35: :: MOD_2:35
for 
b1, 
b2, 
b3, 
b4, 
b5 being   
Element of 
{0,1,2}  st 
b4 = 0 & 
b5 = 1 holds 
( 
b1 + b2 = b2 + b1 & 
(b1 + b2) + b3 = b1 + (b2 + b3) & 
b1 + b4 = b1 & 
b1 + (- b1) = b4 & 
b1 * b2 = b2 * b1 & 
(b1 * b2) * b3 = b1 * (b2 * b3) & 
b5 * b1 = b1 & ( 
b1 <> b4 implies ex 
b6 being   
Element of 
{0,1,2} st 
b1 * b6 = b5 ) & 
b4 <> b5 & 
b1 * (b2 + b3) = (b1 * b2) + (b1 * b3) )
theorem Th36: :: MOD_2:36
theorem Th37: :: MOD_2:37
Lemma46: 
for b1 being  Universe holds  the carrier of Z3  in b1
 
theorem Th38: :: MOD_2:38
Lemma48: 
for b1 being non empty  set 
 for b2 being  Universe holds 
 ( ( for b3 being  BinOp of b1  st b1 in b2 holds 
b3 in b2 ) & ( for b3 being  UnOp of b1  st b1 in b2 holds 
b3 in b2 ) )
 
theorem Th39: :: MOD_2:39
canceled; 
theorem Th40: :: MOD_2:40