class_docstr: Properties
  ==========
  
  [1] `0 \in \Omega` and `\tau(1) = \epsilon`
  [2] `\alpha^x = \beta \Leftrightarrow \beta^{x^{-1}} = \alpha`
  [3] If `\alpha^x = \beta`, then `H \tau(\alpha)x = H \tau(\beta)`
  [4] `\forall \alpha \in \Omega, 1^{\tau(\alpha)} = \alpha`
  
  References
  ==========
  
  .. [1] Holt, D., Eick, B., O'Brien, E.
         "Handbook of Computational Group Theory"
  
  .. [2] John J. Cannon; Lucien A. Dimino; George Havas; Jane M. Watson
         Mathematics of Computation, Vol. 27, No. 123. (Jul., 1973), pp. 463-490.
         "Implementation and Analysis of the Todd-Coxeter Algorithm"
class_docstr_tok: ["Properties","==========","[","1","]","`","0","\\in","\\Omega","`","and","`","\\tau","(","1",")","=","\\epsilon","`","[","2","]","`","\\alpha^x","=","\\beta","\\Leftrightarrow","\\beta^","{","x^","{","-1","}","}","=","\\alpha","`","[","3","]","If","`","\\alpha^x","=","\\beta","`",",","then","`","H","\\tau","(","\\alpha",")","x","=","H","\\tau","(","\\beta",")","`","[","4","]","`","\\forall","\\alpha","\\in","\\Omega",",","1^","{","\\tau","(","\\alpha",")","}","=","\\alpha","`","References","==========","..","[","1","]","Holt",",","D.",",","Eick",",","B.",",","O'Brien",",","E.","``","Handbook","of","Computational","Group","Theory","''","..","[","2","]","John","J.","Cannon",";","Lucien","A.","Dimino",";","George","Havas",";","Jane","M.","Watson","Mathematics","of","Computation",",","Vol",".","27",",","No",".","123",".","(","Jul.",",","1973",")",",","pp",".","463-490",".","``","Implementation","and","Analysis","of","the","Todd-Coxeter","Algorithm","''"]
docstr: Compute the coset representative of a given coset.
  
  Examples
  ========
  
  >>> from sympy.combinatorics import free_group
  >>> from sympy.combinatorics.fp_groups import FpGroup, coset_enumeration_r
  >>> F, x, y = free_group("x, y")
  >>> f = FpGroup(F, [x**3, y**3, x**-1*y**-1*x*y])
  >>> C = coset_enumeration_r(f, [x])
  >>> C.compress()
  >>> C.table
  [[0, 0, 1, 2], [1, 1, 2, 0], [2, 2, 0, 1]]
  >>> C.coset_representative(0)
  <identity>
  >>> C.coset_representative(1)
  y
  >>> C.coset_representative(2)
  y**-1
docstr_tok: ["Compute","the","coset","representative","of","a","given","coset",".","Examples","========",">",">",">","from","sympy.combinatorics","import","free_group",">",">",">","from","sympy.combinatorics.fp_groups","import","FpGroup",",","coset_enumeration_r",">",">",">","F",",","x",",","y","=","free_group","(","``","x",",","y","''",")",">",">",">","f","=","FpGroup","(","F",",","[","x","*","*","3",",","y","*","*","3",",","x","*","*","-1","*","y","*","*","-1","*","x","*","y","]",")",">",">",">","C","=","coset_enumeration_r","(","f",",","[","x","]",")",">",">",">","C.compress","(",")",">",">",">","C.table","[","[","0",",","0",",","1",",","2","]",",","[","1",",","1",",","2",",","0","]",",","[","2",",","2",",","0",",","1","]","]",">",">",">","C.coset_representative","(","0",")","<","identity",">",">",">",">","C.coset_representative","(","1",")","y",">",">",">","C.coset_representative","(","2",")","y","*","*","-1"]
code: def coset_representative(self, coset):
      """
      Compute the coset representative of a given coset.
  
      Examples
      ========
  
      >>> from sympy.combinatorics import free_group
      >>> from sympy.combinatorics.fp_groups import FpGroup, coset_enumeration_r
      >>> F, x, y = free_group("x, y")
      >>> f = FpGroup(F, [x**3, y**3, x**-1*y**-1*x*y])
      >>> C = coset_enumeration_r(f, [x])
      >>> C.compress()
      >>> C.table
      [[0, 0, 1, 2], [1, 1, 2, 0], [2, 2, 0, 1]]
      >>> C.coset_representative(0)
      <identity>
      >>> C.coset_representative(1)
      y
      >>> C.coset_representative(2)
      y**-1
  
      """
      for x in self.A:
          gamma = self.table[coset][self.A_dict[x]]
          if coset == 0:
              return self.fp_group.identity
          if gamma < coset:
              return self.coset_representative(gamma) * x**-1
  
imports: from sympy.combinatorics.free_groups import free_group
  from sympy.printing.defaults import DefaultPrinting
  from itertools import chain, product
  from bisect import bisect_left
label_desc: Use image node_id 25 for calling the CosetTable obj's underlying member method code with example usage: obj.coset_representative(coset) and returns: self, unknown