:: MATRIX_9 semantic presentation

Lemma1: for b1 being Nat holds idseq b1 in Permutations b1
by MATRIX_2:def 11;

theorem Th1: :: MATRIX_9:1
for b1, b2 being set holds
( b1 in b2 implies {b1} in Fin b2 )
proof end;

registration
let c1 be Nat;
cluster non empty Element of Fin (Permutations a1);
existence
not for b1 being Element of Fin (Permutations c1) holds b1 is empty
proof end;
end;

scheme :: MATRIX_9:sch 1
s1{ F1() -> Nat, F2() -> non empty Element of Fin (Permutations F1()), P1[ set ] } :
P1[F2()]
provided
E3: for b1 being Element of Permutations F1() holds
( b1 in F2() implies P1[{b1}] ) and E4: for b1 being Element of Permutations F1()
for b2 being non empty Element of Fin (Permutations F1()) holds
( b1 in F2() & b2 c= F2() & not b1 in b2 & P1[b2] implies P1[b2 \/ {b1}] )
proof end;

Lemma3: <*1,2*> <> <*2,1*>
by GROUP_7:2;

Lemma4: <*2,1*> in Permutations 2
by TARSKI:def 2, MATRIX_7:3;

Lemma5: for b1 being Nat
for b2, b3 being Element of the carrier of (Group_of_Perm b1)
for b4, b5 being Element of Permutations b1 holds
( b2 = b4 & b3 = b5 implies b2 * b3 = b5 * b4 )
by MATRIX_7:9;

registration
let c1 be Nat;
cluster one-to-one FinSequence-like M4( Seg a1, Seg a1);
existence
ex b1 being Function of Seg c1, Seg c1 st
( b1 is one-to-one & b1 is FinSequence-like )
proof end;
end;

Lemma6: for b1 being FinSequence-like Function holds
( b1 is one-to-one implies Rev b1 is one-to-one )
proof end;

registration
let c1 be Nat;
cluster id (Seg a1) -> FinSequence-like ;
coherence
id (Seg c1) is FinSequence-like
proof end;
end;

theorem Th2: :: MATRIX_9:2
( (Rev (idseq 2)) . 1 = 2 & (Rev (idseq 2)) . 2 = 1 )
proof end;

theorem Th3: :: MATRIX_9:3
for b1 being one-to-one Function holds
not ( dom b1 = Seg 2 & rng b1 = Seg 2 & not b1 = id (Seg 2) & not b1 = Rev (id (Seg 2)) )
proof end;

theorem Th4: :: MATRIX_9:4
for b1 being Nat holds Rev (idseq b1) in Permutations b1
proof end;

theorem Th5: :: MATRIX_9:5
for b1 being Nat
for b2 being FinSequence holds
( b1 <> 0 & b2 in Permutations b1 implies Rev b2 in Permutations b1 )
proof end;

theorem Th6: :: MATRIX_9:6
Permutations 2 = {(idseq 2),(Rev (idseq 2))}
proof end;

definition
let c1 be Nat;
let c2 be Field;
let c3 be Matrix of c1,c2;
func PPath_product c3 -> Function of Permutations a1,the carrier of a2 means :Def1: :: MATRIX_9:def 1
for b1 being Element of Permutations a1 holds a4 . b1 = the mult of a2 $$ (Path_matrix b1,a3);
existence
ex b1 being Function of Permutations c1,the carrier of c2 st
for b2 being Element of Permutations c1 holds b1 . b2 = the mult of c2 $$ (Path_matrix b2,c3)
proof end;
uniqueness
for b1, b2 being Function of Permutations c1,the carrier of c2 holds
( ( for b3 being Element of Permutations c1 holds b1 . b3 = the mult of c2 $$ (Path_matrix b3,c3) ) & ( for b3 being Element of Permutations c1 holds b2 . b3 = the mult of c2 $$ (Path_matrix b3,c3) ) implies b1 = b2 )
proof end;
end;

:: deftheorem Def1 defines PPath_product MATRIX_9:def 1 :
for b1 being Nat
for b2 being Field
for b3 being Matrix of b1,b2
for b4 being Function of Permutations b1,the carrier of b2 holds
( b4 = PPath_product b3 iff for b5 being Element of Permutations b1 holds b4 . b5 = the mult of b2 $$ (Path_matrix b5,b3) );

definition
let c1 be Nat;
let c2 be Field;
let c3 be Matrix of c1,c2;
func Per c3 -> Element of a2 equals :: MATRIX_9:def 2
the add of a2 $$ (FinOmega (Permutations a1)),(PPath_product a3);
coherence
the add of c2 $$ (FinOmega (Permutations c1)),(PPath_product c3) is Element of c2
;
end;

:: deftheorem Def2 defines Per MATRIX_9:def 2 :
for b1 being Nat
for b2 being Field
for b3 being Matrix of b1,b2 holds Per b3 = the add of b2 $$ (FinOmega (Permutations b1)),(PPath_product b3);

theorem Th7: :: MATRIX_9:7
for b1 being Field
for b2 being Element of b1 holds Per <*<*b2*>*> = b2
proof end;

theorem Th8: :: MATRIX_9:8
for b1 being Field
for b2 being Nat holds
( b2 >= 1 implies Per (0. b1,b2,b2) = 0. b1 )
proof end;

theorem Th9: :: MATRIX_9:9
for b1 being Field
for b2, b3, b4, b5 being Element of b1
for b6 being Element of Permutations 2 holds
( b6 = idseq 2 implies Path_matrix b6,(b2,b3 ][ b4,b5) = <*b2,b5*> )
proof end;

theorem Th10: :: MATRIX_9:10
for b1 being Field
for b2, b3, b4, b5 being Element of b1
for b6 being Element of Permutations 2 holds
( b6 = Rev (idseq 2) implies Path_matrix b6,(b2,b3 ][ b4,b5) = <*b3,b4*> )
proof end;

theorem Th11: :: MATRIX_9:11
for b1 being Field
for b2, b3 being Element of b1 holds the mult of b1 $$ <*b2,b3*> = b2 * b3
proof end;

registration
cluster odd M4( Seg 2, Seg 2);
existence
not for b1 being Permutation of Seg 2 holds b1 is even
proof end;
end;

registration
let c1 be Nat;
cluster even M4( Seg a1, Seg a1);
existence
ex b1 being Permutation of Seg c1 st b1 is even
proof end;
end;

theorem Th12: :: MATRIX_9:12
<*2,1*> is odd Permutation of Seg 2
proof end;

theorem Th13: :: MATRIX_9:13
for b1 being Field
for b2, b3, b4, b5 being Element of b1 holds Det (b2,b3 ][ b4,b5) = (b2 * b5) - (b3 * b4)
proof end;

theorem Th14: :: MATRIX_9:14
for b1 being Field
for b2, b3, b4, b5 being Element of b1 holds Per (b2,b3 ][ b4,b5) = (b2 * b5) + (b3 * b4)
proof end;

theorem Th15: :: MATRIX_9:15
Rev (idseq 3) = <*3,2,1*>
proof end;

theorem Th16: :: MATRIX_9:16
for b1 being non empty set
for b2, b3, b4 being Element of b1
for b5 being FinSequence of b1 holds
( b5 = <*b2,b3,b4*> implies Rev b5 = <*b4,b3,b2*> )
proof end;

theorem Th17: :: MATRIX_9:17
for b1 being Nat
for b2, b3 being FinSequence holds
( b2 ^ b3 in Permutations b1 implies b2 ^ (Rev b3) in Permutations b1 )
proof end;

theorem Th18: :: MATRIX_9:18
for b1 being Nat
for b2, b3 being FinSequence holds
( b2 ^ b3 in Permutations b1 implies b3 ^ b2 in Permutations b1 )
proof end;

theorem Th19: :: MATRIX_9:19
Permutations 3 = {<*1,2,3*>,<*3,2,1*>,<*1,3,2*>,<*2,3,1*>,<*2,1,3*>,<*3,1,2*>}
proof end;

theorem Th20: :: MATRIX_9:20
for b1 being Field
for b2, b3, b4, b5, b6, b7, b8, b9, b10 being Element of b1
for b11 being Matrix of 3,b1 holds
( b11 = <*<*b2,b3,b4*>,<*b5,b6,b7*>,<*b8,b9,b10*>*> implies for b12 being Element of Permutations 3 holds
( b12 = <*1,2,3*> implies Path_matrix b12,b11 = <*b2,b6,b10*> ) )
proof end;

theorem Th21: :: MATRIX_9:21
for b1 being Field
for b2, b3, b4, b5, b6, b7, b8, b9, b10 being Element of b1
for b11 being Matrix of 3,b1 holds
( b11 = <*<*b2,b3,b4*>,<*b5,b6,b7*>,<*b8,b9,b10*>*> implies for b12 being Element of Permutations 3 holds
( b12 = <*3,2,1*> implies Path_matrix b12,b11 = <*b4,b6,b8*> ) )
proof end;

theorem Th22: :: MATRIX_9:22
for b1 being Field
for b2, b3, b4, b5, b6, b7, b8, b9, b10 being Element of b1
for b11 being Matrix of 3,b1 holds
( b11 = <*<*b2,b3,b4*>,<*b5,b6,b7*>,<*b8,b9,b10*>*> implies for b12 being Element of Permutations 3 holds
( b12 = <*1,3,2*> implies Path_matrix b12,b11 = <*b2,b7,b9*> ) )
proof end;

theorem Th23: :: MATRIX_9:23
for b1 being Field
for b2, b3, b4, b5, b6, b7, b8, b9, b10 being Element of b1
for b11 being Matrix of 3,b1 holds
( b11 = <*<*b2,b3,b4*>,<*b5,b6,b7*>,<*b8,b9,b10*>*> implies for b12 being Element of Permutations 3 holds
( b12 = <*2,3,1*> implies Path_matrix b12,b11 = <*b3,b7,b8*> ) )
proof end;

theorem Th24: :: MATRIX_9:24
for b1 being Field
for b2, b3, b4, b5, b6, b7, b8, b9, b10 being Element of b1
for b11 being Matrix of 3,b1 holds
( b11 = <*<*b2,b3,b4*>,<*b5,b6,b7*>,<*b8,b9,b10*>*> implies for b12 being Element of Permutations 3 holds
( b12 = <*2,1,3*> implies Path_matrix b12,b11 = <*b3,b5,b10*> ) )
proof end;

theorem Th25: :: MATRIX_9:25
for b1 being Field
for b2, b3, b4, b5, b6, b7, b8, b9, b10 being Element of b1
for b11 being Matrix of 3,b1 holds
( b11 = <*<*b2,b3,b4*>,<*b5,b6,b7*>,<*b8,b9,b10*>*> implies for b12 being Element of Permutations 3 holds
( b12 = <*3,1,2*> implies Path_matrix b12,b11 = <*b4,b5,b9*> ) )
proof end;

theorem Th26: :: MATRIX_9:26
for b1 being Field
for b2, b3, b4 being Element of b1 holds the mult of b1 $$ <*b2,b3,b4*> = (b2 * b3) * b4
proof end;

theorem Th27: :: MATRIX_9:27
( <*1,3,2*> in Permutations 3 & <*2,3,1*> in Permutations 3 & <*2,1,3*> in Permutations 3 & <*3,1,2*> in Permutations 3 & <*1,2,3*> in Permutations 3 & <*3,2,1*> in Permutations 3 )
proof end;

Lemma29: ( <*1,2,3*> <> <*3,2,1*> & <*1,2,3*> <> <*1,3,2*> & <*1,2,3*> <> <*2,3,1*> & <*1,2,3*> <> <*2,1,3*> & <*1,2,3*> <> <*3,1,2*> & <*3,2,1*> <> <*1,3,2*> & <*3,2,1*> <> <*2,3,1*> & <*3,2,1*> <> <*2,1,3*> & <*3,2,1*> <> <*3,1,2*> & <*1,3,2*> <> <*2,3,1*> & <*1,3,2*> <> <*2,1,3*> & <*1,3,2*> <> <*3,1,2*> & <*2,3,1*> <> <*2,1,3*> & <*2,3,1*> <> <*3,1,2*> & <*2,1,3*> <> <*3,1,2*> )
by GROUP_7:3;

theorem Th28: :: MATRIX_9:28
<*2,3,1*> " = <*3,1,2*>
proof end;

theorem Th29: :: MATRIX_9:29
for b1 being Element of (Group_of_Perm 3) holds
( b1 = <*2,3,1*> implies b1 " = <*3,1,2*> )
proof end;

theorem Th30: :: MATRIX_9:30
for b1 being Permutation of Seg 3 holds
( b1 = <*1,3,2*> implies b1 is_transposition )
proof end;

theorem Th31: :: MATRIX_9:31
for b1 being Permutation of Seg 3 holds
( b1 = <*2,1,3*> implies b1 is_transposition )
proof end;

theorem Th32: :: MATRIX_9:32
for b1 being Permutation of Seg 3 holds
( b1 = <*3,2,1*> implies b1 is_transposition )
proof end;

theorem Th33: :: MATRIX_9:33
for b1 being Nat
for b2 being Permutation of Seg b1 holds
not ( b2 = id (Seg b1) & b2 is_transposition )
proof end;

theorem Th34: :: MATRIX_9:34
for b1 being Permutation of Seg 3 holds
not ( b1 = <*3,1,2*> & b1 is_transposition )
proof end;

theorem Th35: :: MATRIX_9:35
for b1 being Permutation of Seg 3 holds
not ( b1 = <*2,3,1*> & b1 is_transposition )
proof end;

theorem Th36: :: MATRIX_9:36
for b1 being Nat
for b2 being Permutation of Seg b1 holds
b2 is FinSequence of Seg b1
proof end;

theorem Th37: :: MATRIX_9:37
( <*2,1,3*> * <*1,3,2*> = <*2,3,1*> & <*1,3,2*> * <*2,1,3*> = <*3,1,2*> & <*2,1,3*> * <*3,2,1*> = <*3,1,2*> & <*3,2,1*> * <*2,1,3*> = <*2,3,1*> & <*3,2,1*> * <*3,2,1*> = <*1,2,3*> & <*2,1,3*> * <*2,1,3*> = <*1,2,3*> & <*1,3,2*> * <*1,3,2*> = <*1,2,3*> & <*1,3,2*> * <*2,3,1*> = <*3,2,1*> & <*2,3,1*> * <*2,3,1*> = <*3,1,2*> & <*2,3,1*> * <*3,1,2*> = <*1,2,3*> & <*3,1,2*> * <*2,3,1*> = <*1,2,3*> & <*3,1,2*> * <*3,1,2*> = <*2,3,1*> & <*1,3,2*> * <*3,2,1*> = <*2,3,1*> & <*3,2,1*> * <*1,3,2*> = <*3,1,2*> )
proof end;

theorem Th38: :: MATRIX_9:38
for b1 being Permutation of Seg 3 holds
not ( b1 is_transposition & not b1 = <*2,1,3*> & not b1 = <*1,3,2*> & not b1 = <*3,2,1*> )
proof end;

theorem Th39: :: MATRIX_9:39
for b1 being Nat
for b2, b3 being Element of Permutations b1 holds b2 * b3 in Permutations b1
proof end;

Lemma40: <*1,2,3*> is even Permutation of Seg 3
by MATRIX_2:29, FINSEQ_2:62;

Lemma41: <*2,3,1*> is even Permutation of Seg 3
proof end;

Lemma42: <*3,1,2*> is even Permutation of Seg 3
proof end;

theorem Th40: :: MATRIX_9:40
for b1 being Nat
for b2 being FinSequence of (Group_of_Perm b1) holds
( (len b2) mod 2 = 0 & ( for b3 being Nat holds
not ( b3 in dom b2 & ( for b4 being Element of Permutations b1 holds
not ( b2 . b3 = b4 & b4 is_transposition ) ) ) ) implies Product b2 is even Permutation of Seg b1 )
proof end;

Lemma43: for b1 being Permutation of Seg 3 holds b1 * <*1,2,3*> = b1
proof end;

Lemma44: for b1 being Permutation of Seg 3 holds <*1,2,3*> * b1 = b1
proof end;

theorem Th41: :: MATRIX_9:41
for b1 being FinSequence of (Group_of_Perm 3) holds
not ( (len b1) mod 2 = 0 & ( for b2 being Nat holds
not ( b2 in dom b1 & ( for b3 being Element of Permutations 3 holds
not ( b1 . b2 = b3 & b3 is_transposition ) ) ) ) & not Product b1 = <*1,2,3*> & not Product b1 = <*2,3,1*> & not Product b1 = <*3,1,2*> )
proof end;

registration
cluster odd M4( Seg 3, Seg 3);
existence
not for b1 being Permutation of Seg 3 holds b1 is even
proof end;
end;

theorem Th42: :: MATRIX_9:42
<*3,2,1*> is odd Permutation of Seg 3
proof end;

theorem Th43: :: MATRIX_9:43
<*2,1,3*> is odd Permutation of Seg 3
proof end;

theorem Th44: :: MATRIX_9:44
<*1,3,2*> is odd Permutation of Seg 3
proof end;

theorem Th45: :: MATRIX_9:45
for b1 being odd Permutation of Seg 3 holds
not ( not b1 = <*3,2,1*> & not b1 = <*1,3,2*> & not b1 = <*2,1,3*> )
proof end;

theorem Th46: :: MATRIX_9:46
for b1 being Field
for b2, b3, b4, b5, b6, b7, b8, b9, b10 being Element of b1
for b11 being Matrix of 3,b1 holds
( b11 = <*<*b2,b3,b4*>,<*b5,b6,b7*>,<*b8,b9,b10*>*> implies Det b11 = ((((((b2 * b6) * b10) - ((b4 * b6) * b8)) - ((b2 * b7) * b9)) + ((b3 * b7) * b8)) - ((b3 * b5) * b10)) + ((b4 * b5) * b9) )
proof end;

theorem Th47: :: MATRIX_9:47
for b1 being Field
for b2, b3, b4, b5, b6, b7, b8, b9, b10 being Element of b1
for b11 being Matrix of 3,b1 holds
( b11 = <*<*b2,b3,b4*>,<*b5,b6,b7*>,<*b8,b9,b10*>*> implies Per b11 = ((((((b2 * b6) * b10) + ((b4 * b6) * b8)) + ((b2 * b7) * b9)) + ((b3 * b7) * b8)) + ((b3 * b5) * b10)) + ((b4 * b5) * b9) )
proof end;

theorem Th48: :: MATRIX_9:48
for b1, b2 being Nat
for b3 being Element of Permutations b2 holds
not ( b1 in Seg b2 & ( for b4 being Nat holds
not ( b4 in Seg b2 & b1 = b3 . b4 ) ) )
proof end;

theorem Th49: :: MATRIX_9:49
for b1 being Nat
for b2 being Field
for b3 being Matrix of b1,b2 holds
( ex b4 being Nat st
( b4 in Seg b1 & ( for b5 being Nat holds
( b5 in Seg b1 implies (Col b3,b4) . b5 = 0. b2 ) ) ) implies for b4 being Element of Permutations b1 holds
ex b5 being Nat st
( b5 in Seg b1 & (Path_matrix b4,b3) . b5 = 0. b2 ) )
proof end;

theorem Th50: :: MATRIX_9:50
for b1 being Nat
for b2 being Field
for b3 being Element of Permutations b1
for b4 being Matrix of b1,b2 holds
( ex b5 being Nat st
( b5 in Seg b1 & ( for b6 being Nat holds
( b6 in Seg b1 implies (Col b4,b5) . b6 = 0. b2 ) ) ) implies (Path_product b4) . b3 = 0. b2 )
proof end;

theorem Th51: :: MATRIX_9:51
for b1 being Nat
for b2 being Field
for b3 being Matrix of b1,b2 holds
( ex b4 being Nat st
( b4 in Seg b1 & ( for b5 being Nat holds
( b5 in Seg b1 implies (Col b3,b4) . b5 = 0. b2 ) ) ) implies the add of b2 $$ (FinOmega (Permutations b1)),(Path_product b3) = 0. b2 )
proof end;

theorem Th52: :: MATRIX_9:52
for b1 being Nat
for b2 being Field
for b3 being Element of Permutations b1
for b4 being Matrix of b1,b2 holds
( ex b5 being Nat st
( b5 in Seg b1 & ( for b6 being Nat holds
( b6 in Seg b1 implies (Col b4,b5) . b6 = 0. b2 ) ) ) implies (PPath_product b4) . b3 = 0. b2 )
proof end;

Lemma54: for b1 being Nat
for b2 being Field
for b3 being Matrix of b1,b2 holds
( ex b4 being Nat st
( b4 in Seg b1 & ( for b5 being Nat holds
( b5 in Seg b1 implies (Col b3,b4) . b5 = 0. b2 ) ) ) implies the add of b2 $$ (FinOmega (Permutations b1)),(PPath_product b3) = 0. b2 )
proof end;

theorem Th53: :: MATRIX_9:53
for b1 being Nat
for b2 being Field
for b3 being Matrix of b1,b2 holds
( ex b4 being Nat st
( b4 in Seg b1 & ( for b5 being Nat holds
( b5 in Seg b1 implies (Col b3,b4) . b5 = 0. b2 ) ) ) implies Det b3 = 0. b2 )
proof end;

theorem Th54: :: MATRIX_9:54
for b1 being Nat
for b2 being Field
for b3 being Matrix of b1,b2 holds
( ex b4 being Nat st
( b4 in Seg b1 & ( for b5 being Nat holds
( b5 in Seg b1 implies (Col b3,b4) . b5 = 0. b2 ) ) ) implies Per b3 = 0. b2 ) by Lemma54;

theorem Th55: :: MATRIX_9:55
for b1, b2 being Nat
for b3 being Field
for b4, b5 being Matrix of b1,b3 holds
( b2 in Seg b1 implies for b6 being Element of Permutations b1 holds
ex b7 being Nat st
( b7 in Seg b1 & b2 = b6 . b7 & (Col b5,b2) /. b7 = (Path_matrix b6,b5) /. b7 ) )
proof end;

theorem Th56: :: MATRIX_9:56
for b1 being Nat
for b2 being Field
for b3 being Element of b2
for b4, b5 being Matrix of b1,b2 holds
( ex b6 being Nat st
( b6 in Seg b1 & ( for b7 being Nat holds
( b7 in Seg b1 implies (Col b4,b6) . b7 = b3 * ((Col b5,b6) /. b7) ) ) & ( for b7 being Nat holds
( b7 <> b6 & b7 in Seg b1 implies Col b4,b7 = Col b5,b7 ) ) ) implies for b6 being Element of Permutations b1 holds
ex b7 being Nat st
( b7 in Seg b1 & (Path_matrix b6,b4) /. b7 = b3 * ((Path_matrix b6,b5) /. b7) ) )
proof end;