Article MATRIX_2, MML version 4.99.1005

:: MATRIX_2:funcnot 1 => MATRIX_2:func 1
definition
  let a1, a2 be natural set;
  let a3 be set;
  func (A1,A2)--> A3 -> Relation-like Function-like FinSequence-like tabular set equals
    a1 |-> (a2 |-> a3);
end;

:: MATRIX_2:def 1
theorem
for b1, b2 being natural set
for b3 being set holds
   (b1,b2)--> b3 = b1 |-> (b2 |-> b3);

:: MATRIX_2:funcnot 2 => MATRIX_2:func 2
definition
  let a1 be non empty set;
  let a2, a3 be natural set;
  let a4 be Element of a1;
  redefine func (a2,a3)--> a4 -> Matrix of a2,a3,a1;
end;

:: MATRIX_2:th 1
theorem
for b1, b2, b3, b4 being natural set
for b5 being non empty set
for b6 being Element of b5
      st [b1,b2] in Indices ((b3,b4)--> b6)
   holds ((b3,b4)--> b6) *(b1,b2) = b6;

:: MATRIX_2:th 2
theorem
for b1 being natural set
for b2 being non empty non degenerated right_complementable almost_left_invertible associative commutative Abelian add-associative right_zeroed well-unital distributive doubleLoopStr
for b3, b4 being Element of the carrier of b2 holds
((b1,b1)--> b3) + ((b1,b1)--> b4) = (b1,b1)--> (b3 + b4);

:: MATRIX_2:funcnot 3 => MATRIX_2:func 3
definition
  let a1, a2, a3, a4 be set;
  func (A1,A2)][(A3,A4) -> Relation-like Function-like FinSequence-like tabular set equals
    <*<*a1,a2*>,<*a3,a4*>*>;
end;

:: MATRIX_2:def 2
theorem
for b1, b2, b3, b4 being set holds
(b1,b2)][(b3,b4) = <*<*b1,b2*>,<*b3,b4*>*>;

:: MATRIX_2:th 3
theorem
for b1, b2, b3, b4 being set holds
len ((b1,b2)][(b3,b4)) = 2 &
 width ((b1,b2)][(b3,b4)) = 2 &
 Indices ((b1,b2)][(b3,b4)) = [:Seg 2,Seg 2:];

:: MATRIX_2:th 4
theorem
for b1, b2, b3, b4 being set holds
[1,1] in Indices ((b1,b2)][(b3,b4)) &
 [1,2] in Indices ((b1,b2)][(b3,b4)) &
 [2,1] in Indices ((b1,b2)][(b3,b4)) &
 [2,2] in Indices ((b1,b2)][(b3,b4));

:: MATRIX_2:funcnot 4 => MATRIX_2:func 4
definition
  let a1 be non empty set;
  let a2 be Element of a1;
  redefine func <*a2*> -> Element of 1 -tuples_on a1;
end;

:: MATRIX_2:funcnot 5 => MATRIX_2:func 5
definition
  let a1 be non empty set;
  let a2 be natural set;
  let a3 be Element of a2 -tuples_on a1;
  redefine func <*a3*> -> Matrix of 1,a2,a1;
end;

:: MATRIX_2:th 5
theorem
for b1 being non empty set
for b2 being Element of b1 holds
   [1,1] in Indices <*<*b2*>*> &
    <*<*b2*>*> *(1,1) = b2;

:: MATRIX_2:funcnot 6 => MATRIX_2:func 6
definition
  let a1 be non empty set;
  let a2, a3, a4, a5 be Element of a1;
  redefine func (a2,a3)][(a4,a5) -> Matrix of 2,2,a1;
end;

:: MATRIX_2:th 6
theorem
for b1 being non empty set
for b2, b3, b4, b5 being Element of b1 holds
((b2,b3)][(b4,b5)) *(1,1) = b2 & ((b2,b3)][(b4,b5)) *(1,2) = b3 & ((b2,b3)][(b4,b5)) *(2,1) = b4 & ((b2,b3)][(b4,b5)) *(2,2) = b5;

:: MATRIX_2:attrnot 1 => MATRIX_2:attr 1
definition
  let a1 be natural set;
  let a2 be non empty non degenerated right_complementable almost_left_invertible associative commutative Abelian add-associative right_zeroed well-unital distributive doubleLoopStr;
  let a3 be Matrix of a1,a1,the carrier of a2;
  attr a3 is upper_triangular means
    for b1, b2 being natural set
          st [b1,b2] in Indices a3 & b2 < b1
       holds a3 *(b1,b2) = 0. a2;
end;

:: MATRIX_2:dfs 3
definiens
  let a1 be natural set;
  let a2 be non empty non degenerated right_complementable almost_left_invertible associative commutative Abelian add-associative right_zeroed well-unital distributive doubleLoopStr;
  let a3 be Matrix of a1,a1,the carrier of a2;
To prove
     a3 is upper_triangular
it is sufficient to prove
  thus for b1, b2 being natural set
          st [b1,b2] in Indices a3 & b2 < b1
       holds a3 *(b1,b2) = 0. a2;

:: MATRIX_2:def 3
theorem
for b1 being natural set
for b2 being non empty non degenerated right_complementable almost_left_invertible associative commutative Abelian add-associative right_zeroed well-unital distributive doubleLoopStr
for b3 being Matrix of b1,b1,the carrier of b2 holds
      b3 is upper_triangular(b1, b2)
   iff
      for b4, b5 being natural set
            st [b4,b5] in Indices b3 & b5 < b4
         holds b3 *(b4,b5) = 0. b2;

:: MATRIX_2:attrnot 2 => MATRIX_2:attr 2
definition
  let a1 be natural set;
  let a2 be non empty non degenerated right_complementable almost_left_invertible associative commutative Abelian add-associative right_zeroed well-unital distributive doubleLoopStr;
  let a3 be Matrix of a1,a1,the carrier of a2;
  attr a3 is lower_triangular means
    for b1, b2 being natural set
          st [b1,b2] in Indices a3 & b1 < b2
       holds a3 *(b1,b2) = 0. a2;
end;

:: MATRIX_2:dfs 4
definiens
  let a1 be natural set;
  let a2 be non empty non degenerated right_complementable almost_left_invertible associative commutative Abelian add-associative right_zeroed well-unital distributive doubleLoopStr;
  let a3 be Matrix of a1,a1,the carrier of a2;
To prove
     a3 is lower_triangular
it is sufficient to prove
  thus for b1, b2 being natural set
          st [b1,b2] in Indices a3 & b1 < b2
       holds a3 *(b1,b2) = 0. a2;

:: MATRIX_2:def 4
theorem
for b1 being natural set
for b2 being non empty non degenerated right_complementable almost_left_invertible associative commutative Abelian add-associative right_zeroed well-unital distributive doubleLoopStr
for b3 being Matrix of b1,b1,the carrier of b2 holds
      b3 is lower_triangular(b1, b2)
   iff
      for b4, b5 being natural set
            st [b4,b5] in Indices b3 & b4 < b5
         holds b3 *(b4,b5) = 0. b2;

:: MATRIX_2:condreg 1
registration
  let a1 be natural set;
  let a2 be non empty non degenerated right_complementable almost_left_invertible associative commutative Abelian add-associative right_zeroed well-unital distributive doubleLoopStr;
  cluster diagonal -> upper_triangular lower_triangular (Matrix of a1,a1,the carrier of a2);
end;

:: MATRIX_2:exreg 1
registration
  let a1 be natural set;
  let a2 be non empty non degenerated right_complementable almost_left_invertible associative commutative Abelian add-associative right_zeroed well-unital distributive doubleLoopStr;
  cluster Relation-like Function-like finite FinSequence-like tabular upper_triangular lower_triangular Matrix of a1,a1,the carrier of a2;
end;

:: MATRIX_2:modenot 1
definition
  let a1 be natural set;
  let a2 be non empty non degenerated right_complementable almost_left_invertible associative commutative Abelian add-associative right_zeroed well-unital distributive doubleLoopStr;
  mode Upper_Triangular_Matrix of a1,a2 is upper_triangular Matrix of a1,a1,the carrier of a2;
end;

:: MATRIX_2:modenot 2
definition
  let a1 be natural set;
  let a2 be non empty non degenerated right_complementable almost_left_invertible associative commutative Abelian add-associative right_zeroed well-unital distributive doubleLoopStr;
  mode Lower_Triangular_Matrix of a1,a2 is lower_triangular Matrix of a1,a1,the carrier of a2;
end;

:: MATRIX_2:th 7
theorem
for b1 being natural set
for b2 being non empty set
for b3 being tabular FinSequence of b2 *
      st len b3 = b1
   holds b3 is Matrix of b1,width b3,b2;

:: MATRIX_2:th 10
theorem
for b1, b2 being natural set
for b3 being non empty set
for b4 being Matrix of b1,b2,b3
for b5 being natural set
      st b5 in Seg b1
   holds b4 . b5 = Line(b4,b5);

:: MATRIX_2:funcnot 7 => MATRIX_2:func 7
definition
  let a1 be natural set;
  let a2 be non empty non degenerated right_complementable almost_left_invertible associative commutative Abelian add-associative right_zeroed well-unital distributive doubleLoopStr;
  let a3 be tabular FinSequence of (the carrier of a2) *;
  func DelCol(A3,A1) -> tabular FinSequence of (the carrier of a2) * means
    len it = len a3 &
     (for b1 being natural set
           st b1 in dom a3
        holds it . b1 = Del(Line(a3,b1),a1));
end;

:: MATRIX_2:def 6
theorem
for b1 being natural set
for b2 being non empty non degenerated right_complementable almost_left_invertible associative commutative Abelian add-associative right_zeroed well-unital distributive doubleLoopStr
for b3, b4 being tabular FinSequence of (the carrier of b2) * holds
   b4 = DelCol(b3,b1)
iff
   len b4 = len b3 &
    (for b5 being natural set
          st b5 in dom b3
       holds b4 . b5 = Del(Line(b3,b5),b1));

:: MATRIX_2:th 11
theorem
for b1 being non empty set
for b2, b3 being tabular FinSequence of b1 *
      st b2 @ = b3 @ & len b2 = len b3
   holds b2 = b3;

:: MATRIX_2:th 12
theorem
for b1 being non empty set
for b2 being tabular FinSequence of b1 *
      st 0 < width b2
   holds len (b2 @) = width b2 & width (b2 @) = len b2;

:: MATRIX_2:th 13
theorem
for b1 being non empty set
for b2, b3 being tabular FinSequence of b1 *
      st 0 < width b2 & 0 < width b3 & b2 @ = b3 @ & width (b2 @) = width (b3 @)
   holds b2 = b3;

:: MATRIX_2:th 14
theorem
for b1 being non empty set
for b2, b3 being tabular FinSequence of b1 *
      st 0 < width b2 & 0 < width b3
   holds    b2 = b3
   iff
      b2 @ = b3 @ & width b2 = width b3;

:: MATRIX_2:th 15
theorem
for b1 being non empty set
for b2 being tabular FinSequence of b1 *
      st 0 < len b2 & 0 < width b2
   holds b2 @ @ = b2;

:: MATRIX_2:th 16
theorem
for b1 being non empty set
for b2 being tabular FinSequence of b1 *
for b3 being natural set
      st b3 in dom b2
   holds Line(b2,b3) = Col(b2 @,b3);

:: MATRIX_2:th 17
theorem
for b1 being non empty set
for b2 being tabular FinSequence of b1 *
for b3 being natural set
      st b3 in Seg width b2
   holds Line(b2 @,b3) = Col(b2,b3);

:: MATRIX_2:th 18
theorem
for b1 being non empty set
for b2 being tabular FinSequence of b1 *
for b3 being natural set
      st b3 in dom b2
   holds b2 . b3 = Line(b2,b3);

:: MATRIX_2:funcnot 8 => FINSEQ_3:func 2
notation
  let a1 be non empty non degenerated right_complementable almost_left_invertible associative commutative Abelian add-associative right_zeroed well-unital distributive doubleLoopStr;
  let a2 be natural set;
  let a3 be tabular FinSequence of (the carrier of a1) *;
  synonym DelLine(a3,a2) for Del(a2,a1);
end;

:: MATRIX_2:funcreg 1
registration
  let a1 be non empty non degenerated right_complementable almost_left_invertible associative commutative Abelian add-associative right_zeroed well-unital distributive doubleLoopStr;
  let a2 be natural set;
  let a3 be tabular FinSequence of (the carrier of a1) *;
  cluster Del(a3,a2) -> Relation-like Function-like FinSequence-like tabular;
end;

:: MATRIX_2:funcnot 9 => MATRIX_2:func 8
definition
  let a1 be non empty non degenerated right_complementable almost_left_invertible associative commutative Abelian add-associative right_zeroed well-unital distributive doubleLoopStr;
  let a2 be natural set;
  let a3 be tabular FinSequence of (the carrier of a1) *;
  redefine func DelLine(a3,a2) -> tabular FinSequence of (the carrier of a1) *;
end;

:: MATRIX_2:funcnot 10 => MATRIX_2:func 9
definition
  let a1, a2, a3 be natural set;
  let a4 be non empty non degenerated right_complementable almost_left_invertible associative commutative Abelian add-associative right_zeroed well-unital distributive doubleLoopStr;
  let a5 be Matrix of a3,a3,the carrier of a4;
  func Deleting(A5,A1,A2) -> tabular FinSequence of (the carrier of a4) * equals
    DelCol(DelLine(a5,a1),a2);
end;

:: MATRIX_2:def 8
theorem
for b1, b2, b3 being natural set
for b4 being non empty non degenerated right_complementable almost_left_invertible associative commutative Abelian add-associative right_zeroed well-unital distributive doubleLoopStr
for b5 being Matrix of b3,b3,the carrier of b4 holds
   Deleting(b5,b1,b2) = DelCol(DelLine(b5,b1),b2);

:: MATRIX_2:attrnot 3 => MATRIX_2:attr 3
definition
  let a1 be set;
  attr a1 is permutational means
    ex b1 being natural set st
       for b2 being set
             st b2 in a1
          holds b2 is Function-like quasi_total bijective Relation of Seg b1,Seg b1;
end;

:: MATRIX_2:dfs 7
definiens
  let a1 be set;
To prove
     a1 is permutational
it is sufficient to prove
  thus ex b1 being natural set st
       for b2 being set
             st b2 in a1
          holds b2 is Function-like quasi_total bijective Relation of Seg b1,Seg b1;

:: MATRIX_2:def 9
theorem
for b1 being set holds
      b1 is permutational
   iff
      ex b2 being natural set st
         for b3 being set
               st b3 in b1
            holds b3 is Function-like quasi_total bijective Relation of Seg b2,Seg b2;

:: MATRIX_2:exreg 2
registration
  cluster non empty permutational set;
end;

:: MATRIX_2:funcnot 11 => MATRIX_2:func 10
definition
  let a1 be non empty permutational set;
  func len A1 -> natural set means
    ex b1 being Relation-like Function-like FinSequence-like set st
       b1 in a1 & it = len b1;
end;

:: MATRIX_2:def 10
theorem
for b1 being non empty permutational set
for b2 being natural set holds
      b2 = len b1
   iff
      ex b3 being Relation-like Function-like FinSequence-like set st
         b3 in b1 & b2 = len b3;

:: MATRIX_2:funcnot 12 => MATRIX_2:func 11
definition
  let a1 be non empty permutational set;
  redefine func len a1 -> Element of NAT;
end;

:: MATRIX_2:modenot 3 => MATRIX_2:mode 1
definition
  let a1 be non empty permutational set;
  redefine mode Element of a1 -> Function-like quasi_total bijective Relation of Seg len a1,Seg len a1;
end;

:: MATRIX_2:th 19
theorem
for b1 being natural set holds
   ex b2 being non empty permutational set st
      len b2 = b1;

:: MATRIX_2:funcnot 13 => MATRIX_2:func 12
definition
  let a1 be natural set;
  func Permutations A1 -> set means
    for b1 being set holds
          b1 in it
       iff
          b1 is Function-like quasi_total bijective Relation of Seg a1,Seg a1;
end;

:: MATRIX_2:def 11
theorem
for b1 being natural set
for b2 being set holds
      b2 = Permutations b1
   iff
      for b3 being set holds
            b3 in b2
         iff
            b3 is Function-like quasi_total bijective Relation of Seg b1,Seg b1;

:: MATRIX_2:funcreg 2
registration
  let a1 be natural set;
  cluster Permutations a1 -> non empty permutational;
end;

:: MATRIX_2:th 20
theorem
for b1 being natural set holds
   len Permutations b1 = b1;

:: MATRIX_2:th 21
theorem
Permutations 1 = {idseq 1};

:: MATRIX_2:funcnot 14 => MATRIX_2:func 13
definition
  let a1 be natural set;
  func Group_of_Perm A1 -> strict multMagma means
    the carrier of it = Permutations a1 &
     (for b1, b2 being Element of Permutations a1 holds
     (the multF of it) .(b1,b2) = b2 * b1);
end;

:: MATRIX_2:def 13
theorem
for b1 being natural set
for b2 being strict multMagma holds
      b2 = Group_of_Perm b1
   iff
      the carrier of b2 = Permutations b1 &
       (for b3, b4 being Element of Permutations b1 holds
       (the multF of b2) .(b3,b4) = b4 * b3);

:: MATRIX_2:funcreg 3
registration
  let a1 be natural set;
  cluster Group_of_Perm a1 -> non empty strict;
end;

:: MATRIX_2:th 23
theorem
for b1 being natural set holds
   idseq b1 is Element of the carrier of Group_of_Perm b1;

:: MATRIX_2:th 24
theorem
for b1 being natural set
for b2 being Element of Permutations b1 holds
   (idseq b1) * b2 = b2 & b2 * idseq b1 = b2;

:: MATRIX_2:th 25
theorem
for b1 being natural set
for b2 being Element of Permutations b1 holds
   b2 * (b2 ") = idseq b1 & b2 " * b2 = idseq b1;

:: MATRIX_2:th 26
theorem
for b1 being natural set
for b2 being Element of Permutations b1 holds
   b2 " is Element of the carrier of Group_of_Perm b1;

:: MATRIX_2:funcreg 4
registration
  let a1 be natural set;
  cluster Group_of_Perm a1 -> strict Group-like associative;
end;

:: MATRIX_2:th 28
theorem
for b1 being natural set holds
   idseq b1 = 1_ Group_of_Perm b1;

:: MATRIX_2:attrnot 4 => MATRIX_2:attr 4
definition
  let a1 be natural set;
  let a2 be Function-like quasi_total bijective Relation of Seg a1,Seg a1;
  attr a2 is being_transposition means
    ex b1, b2 being natural set st
       b1 in proj1 a2 &
        b2 in proj1 a2 &
        b1 <> b2 &
        a2 . b1 = b2 &
        a2 . b2 = b1 &
        (for b3 being natural set
              st b3 <> b1 & b3 <> b2 & b3 in proj1 a2
           holds a2 . b3 = b3);
end;

:: MATRIX_2:dfs 11
definiens
  let a1 be natural set;
  let a2 be Function-like quasi_total bijective Relation of Seg a1,Seg a1;
To prove
     a2 is being_transposition
it is sufficient to prove
  thus ex b1, b2 being natural set st
       b1 in proj1 a2 &
        b2 in proj1 a2 &
        b1 <> b2 &
        a2 . b1 = b2 &
        a2 . b2 = b1 &
        (for b3 being natural set
              st b3 <> b1 & b3 <> b2 & b3 in proj1 a2
           holds a2 . b3 = b3);

:: MATRIX_2:def 14
theorem
for b1 being natural set
for b2 being Function-like quasi_total bijective Relation of Seg b1,Seg b1 holds
      b2 is being_transposition(b1)
   iff
      ex b3, b4 being natural set st
         b3 in proj1 b2 &
          b4 in proj1 b2 &
          b3 <> b4 &
          b2 . b3 = b4 &
          b2 . b4 = b3 &
          (for b5 being natural set
                st b5 <> b3 & b5 <> b4 & b5 in proj1 b2
             holds b2 . b5 = b5);

:: MATRIX_2:prednot 1 => MATRIX_2:attr 4
notation
  let a1 be natural set;
  let a2 be Function-like quasi_total bijective Relation of Seg a1,Seg a1;
  synonym a2 is_transposition for being_transposition;
end;

:: MATRIX_2:attrnot 5 => MATRIX_2:attr 5
definition
  let a1 be natural set;
  let a2 be Function-like quasi_total bijective Relation of Seg a1,Seg a1;
  attr a2 is even means
    ex b1 being FinSequence of the carrier of Group_of_Perm a1 st
       (len b1) mod 2 = 0 &
        a2 = Product b1 &
        (for b2 being natural set
              st b2 in dom b1
           holds ex b3 being Element of Permutations a1 st
              b1 . b2 = b3 & b3 is being_transposition(len Permutations a1));
end;

:: MATRIX_2:dfs 12
definiens
  let a1 be natural set;
  let a2 be Function-like quasi_total bijective Relation of Seg a1,Seg a1;
To prove
     a2 is even
it is sufficient to prove
  thus ex b1 being FinSequence of the carrier of Group_of_Perm a1 st
       (len b1) mod 2 = 0 &
        a2 = Product b1 &
        (for b2 being natural set
              st b2 in dom b1
           holds ex b3 being Element of Permutations a1 st
              b1 . b2 = b3 & b3 is being_transposition(len Permutations a1));

:: MATRIX_2:def 15
theorem
for b1 being natural set
for b2 being Function-like quasi_total bijective Relation of Seg b1,Seg b1 holds
      b2 is even(b1)
   iff
      ex b3 being FinSequence of the carrier of Group_of_Perm b1 st
         (len b3) mod 2 = 0 &
          b2 = Product b3 &
          (for b4 being natural set
                st b4 in dom b3
             holds ex b5 being Element of Permutations b1 st
                b3 . b4 = b5 & b5 is being_transposition(len Permutations b1));

:: MATRIX_2:attrnot 6 => MATRIX_2:attr 5
notation
  let a1 be natural set;
  let a2 be Function-like quasi_total bijective Relation of Seg a1,Seg a1;
  antonym odd for even;
end;

:: MATRIX_2:th 29
theorem
for b1 being natural set holds
   id Seg b1 is even(b1);

:: MATRIX_2:funcnot 15 => MATRIX_2:func 14
definition
  let a1 be non empty non degenerated right_complementable almost_left_invertible associative commutative Abelian add-associative right_zeroed well-unital distributive doubleLoopStr;
  let a2 be natural set;
  let a3 be Element of the carrier of a1;
  let a4 be Element of Permutations a2;
  func -(A3,A4) -> Element of the carrier of a1 equals
    a3
    if a4 is even(len Permutations a2)
    otherwise - a3;
end;

:: MATRIX_2:def 16
theorem
for b1 being non empty non degenerated right_complementable almost_left_invertible associative commutative Abelian add-associative right_zeroed well-unital distributive doubleLoopStr
for b2 being natural set
for b3 being Element of the carrier of b1
for b4 being Element of Permutations b2 holds
   (b4 is even(len Permutations b2) implies -(b3,b4) = b3) &
    (b4 is even(len Permutations b2) or -(b3,b4) = - b3);

:: MATRIX_2:funcnot 16 => MATRIX_2:func 15
definition
  let a1 be set;
  assume a1 is finite;
  func FinOmega A1 -> Element of Fin a1 equals
    a1;
end;

:: MATRIX_2:def 17
theorem
for b1 being set
      st b1 is finite
   holds FinOmega b1 = b1;

:: MATRIX_2:th 30
theorem
for b1 being natural set holds
   Permutations b1 is finite;