.. _SectCartanCoxGrph:

.. _coxetergraph:

Coxeter Graphs
==============

A *Coxeter graph* is an undirected labelled graph describing a Coxeter system.
Suppose a Coxeter system has Coxeter matrix :math:`M=(m_{ij})_{i,j=1}^n`. Then
the Coxeter graph has vertices :math:`1,\dots,n`; whenever :math:`m_{ij}>2`
there is an edge connecting :math:`i` and :math:`j` labeled by the value of
:math:`m_{ij}`. When :math:`m_{ij}=3`, the label is usually omitted.

Since :math:`\infty` is not an integer, it will be represented by :math:`0` in
our Coxeter graphs. Clearly a Coxeter graph must be standard, i.e. its vertices
must be the integers :math:`1,2,\dots,n` for some :math:`n`. A Coxeter system is
irreducible if, and only if, its Coxeter graph is connected. Two Coxeter graphs
give rise to Coxeter isomorphic groups if, and only if, they are isomorphic as
labelled graphs. See Chapter :ref:`Graph` for more information on
graphs.

.. magma:function:: IsCoxeterGraph(G)
   :input_types: GrphUnd
   :output_types: BoolElt
   :label: IsCoxeterGraph_GrphUnd

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

.. magma:function:: CoxeterGraph(M)
   :input_types: AlgMatElt
   :output_types: GrphUnd
   :label: CoxeterGraph_AlgMatElt

.. magma:function:: CoxeterGraph(C)
   :input_types: AlgMatElt
   :output_types: GrphUnd
   :label: CoxeterGraph_AlgMatElt_2

.. magma:function:: CoxeterGraph(D)
   :input_types: GrphDir
   :output_types: GrphUnd
   :label: CoxeterGraph_GrphDir

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

.. magma:function:: CoxeterGroupOrder(G)
   :input_types: GrphUnd
   :output_types: .
   :label: CoxeterGroupOrder_GrphUnd

.. magma:function:: CoxeterGroupFactoredOrder(G)
   :input_types: GrphUnd
   :output_types: .
   :label: CoxeterGroupFactoredOrder_GrphUnd

   The (factored) order of the Coxeter group with Coxeter graph :math:`G`.

.. magma:example:: Example: Coxeter Graph Operations
   :label: CoxeterGraphOperations

   .. code-block:: magma

      > G := PathGraph(4);
      > AssignLabel(G, 1,2, 4);
      > AssignLabel(G, 3,4, 4);
      > IsCoxeterGraph(G);
      true
      %%a> assert $1;
      > CoxeterGroupOrder(G);
      Infinity
      > 
      > M := SymmetricMatrix([1, 3,1, 2,5,1]);
      > G := CoxeterGraph(M);
      > Labels(EdgeSet(G));
      [ undef, 5 ]

.. magma:function:: IsSimplyLaced(G)
   :input_types: GrphUnd
   :output_types: BoolElt
   :label: IsSimplyLaced_GrphUnd

   Returns ``true`` if, and only if, the Coxeter graph :math:`G` is simply laced,
   i.e. unlabelled.

.. magma:example:: Example: Coxeter Graph Properties
   :label: CoxeterGraphProperties

   .. code-block:: magma

      > G := PathGraph(2);
      > IsSimplyLaced(G);
      true
      %%a> assert $1;
      > AssignLabel(G, 1,2, 6);
      > IsSimplyLaced(G);
      false
      %%a> assert not $1;
