.. _SectCartanCoxMat:

.. _coxetermat:

Coxeter Matrices
================

A Coxeter system is defined by the numbers :math:`m_{ij}\in\{2,3,\dots,\infty\}`
for :math:`i,j=1,\dots n` and :math:`i<j`, as in the previous section. Setting
:math:`m_{ji}=m_{ij}` and :math:`m_{ii}=1`, yields a matrix
:math:`M=(m_{ij})_{i,j=1}^n` that is called the *Coxeter matrix*.

Since :math:`\infty` is not an integer in Magma, it will be represented by
:math:`0` in Coxeter matrices.

.. magma:function:: IsCoxeterMatrix(M)
   :input_types: AlgMatElt
   :output_types: BoolElt
   :label: IsCoxeterMatrix_AlgMatElt

   Returns ``true`` if, and only if, the matrix :math:`M` is the Coxeter matrix of
   some Coxeter group.

.. magma:function:: CoxeterMatrix(G)
   :input_types: GrphUnd
   :output_types: AlgMatElt
   :label: CoxeterMatrix_GrphUnd

.. magma:function:: CoxeterMatrix(C)
   :input_types: AlgMatElt
   :output_types: AlgMatElt
   :label: CoxeterMatrix_AlgMatElt

.. magma:function:: CoxeterMatrix(D)
   :input_types: GrphDir
   :output_types: AlgMatElt
   :label: CoxeterMatrix_GrphDir

   The Coxeter matrix corresponding to a Coxeter graph :math:`G`, Cartan matrix
   :math:`C`, or Dynkin digraph :math:`D`.

.. magma:example:: Example: Coxeter Matrix Construction
   :label: CoxeterMatrixConstruction

   .. code-block:: magma

      > M := SymmetricMatrix([1, 3,1, 2,3,1]);
      > M;
      [1 3 2]
      [3 1 3]
      [2 3 1]
      > IsCoxeterMatrix(M);
      true
      %%a> assert $1;

.. magma:function:: IsCoxeterIsomorphic(M1, M2)
   :input_types: AlgMatElt, AlgMatElt
   :output_types: BoolElt, SeqEnum
   :label: IsCoxeterIsomorphic_AlgMatElt_AlgMatElt

   Returns ``true`` if and only if the Coxeter matrices :math:`M_1` and :math:`M_2`
   give rise to isomorphic Coxeter systems. If so, a sequence giving the
   permutation of the underlying basis which takes :math:`M_1` to :math:`M_2` is
   also returned.

.. magma:function:: CoxeterGroupOrder(M)
   :input_types: AlgMatElt
   :output_types: RngIntElt
   :label: CoxeterGroupOrder_AlgMatElt

.. magma:function:: CoxeterGroupFactoredOrder(M)
   :input_types: AlgMatElt
   :output_types: SeqEnum
   :label: CoxeterGroupFactoredOrder_AlgMatElt

   The (factored) order of the Coxeter group with Coxeter matrix :math:`M`.

.. magma:example:: Example: Coxeter Matrix Operations
   :label: CoxeterMatrixOperations

   .. code-block:: magma

      > M1 := SymmetricMatrix([1, 3,1, 2,3,1]);
      > M2 := SymmetricMatrix([1, 3,1, 3,2,1]);
      > IsCoxeterIsomorphic(M1, M2);
      true [ 2, 1, 3 ]
      > 
      > CoxeterGroupOrder(M1);
      24
      %%a> assert $1 eq 24;

.. magma:function:: IsCoxeterIrreducible(M)
   :input_types: AlgMatElt
   :output_types: BoolElt
   :label: IsCoxeterIrreducible_AlgMatElt

   Returns ``true`` if, and only if, the matrix :math:`M` is the Coxeter matrix of
   an irreducible Coxeter system. If the Coxeter matrix is reducible, this function
   also returns a nontrivial subset :math:`I` of :math:`\{1,\dots,n\}` such that
   :math:`m_{ij}=2` whenever :math:`i\in I`, :math:`j\notin I`.

.. magma:function:: IsSimplyLaced(M)
   :input_types: AlgMatElt
   :output_types: BoolElt
   :label: IsSimplyLaced_AlgMatElt

   Returns ``true`` if, and only if, the Coxeter matrix :math:`M` is simply laced,
   i.e. all its entries are 1, 2, or 3.

.. magma:example:: Example: Coxeter Matrix Properties
   :label: CoxeterMatrixProperties

   .. code-block:: magma

      > M := SymmetricMatrix([1, 3,1, 2,3,1]);
      > IsCoxeterIrreducible(M);
      true
      %%a> assert $1;
      > M := SymmetricMatrix([1, 2,1, 2,3,1]);
      > IsCoxeterIrreducible(M);
      false { 1 }
