reserve x,X for set,
        r,r1,r2,s for Real,
        i,j,k,m,n for Nat;
reserve p,q for Point of TOP-REAL n;

theorem Th7:
 i in Seg n implies AxialSymmetry(i,n) is diagonal &
   AxialSymmetry(i,n)~ = AxialSymmetry(i,n)
proof
  set S=Seg n,A=AxialSymmetry(i,n);
  set ONE=1.(F_Real,n),AA=A*A;
  assume A1: i in S;
  for k,m st [k,m] in Indices A & A*(k,m)<>0.F_Real holds k=m by A1,Def2;
  hence A is diagonal by MATRIX_1:def 6;
  for k,m st[k,m] in Indices AA holds AA*(k,m)=ONE*(k,m)
  proof
    let k,m such that
    A2: [k,m] in Indices AA;
    A3: width A=n by MATRIX_0:24;
    then len@Line(A,k)=n by CARD_1:def 7;
    then reconsider L=@Line(A,k) as Element of TOP-REAL n by TOPREAL3:46;
    len A=n by MATRIX_0:25;
    then A4: AA*(k,m)=@L"*"Col(A,m) by A2,A3,MATRIX_3:def 4;
    A5: Indices AA=[:S,S:] by MATRIX_0:24;
    then A6: m in S by A2,ZFMISC_1:87;
    then A7: Line(A,k).m=A*(k,m) by A3,MATRIX_0:def 7;
    A8: Indices A=[:S,S:] by MATRIX_0:24;
    A9: Indices ONE=[:S,S:] by MATRIX_0:24;
    per cases;
    suppose A10: m<>i;
      then A11: AA*(k,m)=A*(k,m) by A1,A4,A6,A7,Th5;
      per cases;
      suppose A12: k<>m;
        then ONE*(k,m)=0.F_Real by A2,A5,A9,MATRIX_1:def 3;
        hence thesis by A1,A2,A5,A8,A11,A12,Def2;
      end;
      suppose A13: k=m;
        then ONE*(k,m)=1.F_Real by A2,A5,A9,MATRIX_1:def 3;
        hence thesis by A1,A2,A5,A8,A10,A11,A13,Def2;
      end;
    end;
    suppose A14: m=i;
      then A15: AA*(k,m)=-A*(k,m) by A4,A6,A7,Th6;
      per cases;
      suppose A16: k<>m;
        then A*(k,m)=0.F_Real by A1,A2,A5,A8,Def2;
        hence thesis by A2,A5,A9,A15,A16,MATRIX_1:def 3;
      end;
      suppose A17: k=m;
        then AA*(k,m)=-(-1.F_Real) by A1,A14,A15,Def2;
        hence thesis by A2,A5,A9,A17,MATRIX_1:def 3;
      end;
    end;
  end;
  then AA=ONE by MATRIX_0:27;
  then A is_reverse_of A by MATRIX_6:def 2;
  hence thesis by MATRIX_6:def 4;
end;
