Ticket #9125: trac_9125-projective-space.patch

File trac_9125-projective-space.patch, 15.0 KB (added by jhpalmieri, 13 years ago)
  • sage/homology/examples.py

    # HG changeset patch
    # User J. H. Palmieri <palmieri@math.washington.edu>
    # Date 1270769796 25200
    # Node ID e9c828e4ba1902270e3438108b8a669b6e9e19ef
    # Parent  606d017980de8fce527eaa3cf3f7784a44c0635d
    trac 9125: more examples of simplicial complexes
    
    diff -r 606d017980de -r e9c828e4ba19 sage/homology/examples.py
    a b  
     1# -*- coding: utf-8 -*-
    12"""
    23Examples of simplicial complexes
    34
     
    67- John H. Palmieri (2009-04)
    78
    89This file constructs some examples of simplicial complexes.  There are
    9 two main types: surfaces and examples related to graph theory.
     10two main types: manifolds and examples related to graph theory.
    1011
    11 For surfaces (and other manifolds), there are functions defining the
    12 2-sphere, the n-sphere for any n, the torus, the real projective
    13 plane, the Klein bottle, and surfaces of arbitrary genus, all as
    14 simplicial complexes.
     12For manifolds, there are functions defining the `n`-sphere for any
     13`n`, the torus, `n`-dimensional real projective space for any `n`, the
     14complex projective plane, surfaces of arbitrary genus, and some other
     15manifolds, all as simplicial complexes.
    1516
    1617Aside from surfaces, this file also provides some functions for
    1718constructing some other simplicial complexes: the simplicial complex
    18 of not-i-connected graphs on n vertices, the matching complex on n
    19 vertices, and the chessboard complex for an n by i chessboard.  These
    20 provide examples of large simplicial complexes; for example,
    21 not_i_connected_graphs(7,2) has over a million simplices.
     19of not-`i`-connected graphs on `n` vertices, the matching complex on n
     20vertices, and the chessboard complex for an `n` by `i` chessboard.
     21These provide examples of large simplicial complexes; for example,
     22``simplicial_complexes.NotIConnectedGraphs(7,2)`` has over a million
     23simplices.
    2224
    2325All of these examples are accessible by typing
    24 "simplicial_complexes.NAME", where "NAME" is the name of the example;
    25 you can get a list by typing "simplicial_complexes." and hitting the
     26"simplicial_complexes.NAME", where "NAME" is the name of the example.
     27You can get a list by typing "simplicial_complexes." and hitting the
    2628TAB key::
    2729
    28     Sphere
    29     Simplex
    30     Torus
    31     RealProjectivePlane
    32     KleinBottle
    33     SurfaceOfGenus
    34     MooreSpace
    35     NotIConnectedGraphs
    36     MatchingComplex
    37     ChessboardComplex
    38     RandomComplex
     30   simplicial_complexes.ChessboardComplex
     31   simplicial_complexes.ComplexProjectivePlane
     32   simplicial_complexes.KleinBottle
     33   simplicial_complexes.MatchingComplex
     34   simplicial_complexes.MooreSpace
     35   simplicial_complexes.NotIConnectedGraphs
     36   simplicial_complexes.PoincareHomologyThreeSphere
     37   simplicial_complexes.RandomComplex
     38   simplicial_complexes.RealProjectivePlane
     39   simplicial_complexes.RealProjectiveSpace
     40   simplicial_complexes.Simplex
     41   simplicial_complexes.Sphere
     42   simplicial_complexes.SurfaceOfGenus
     43   simplicial_complexes.Torus
    3944
    4045See the documentation for ``simplicial_complexes`` and for each
    4146particular type of example for full details.
     
    8893    Here are the available examples; you can also type
    8994    "simplicial_complexes."  and hit tab to get a list::
    9095
    91         Sphere
    92         Simplex
    93         Torus
    94         RealProjectivePlane
     96        ChessboardComplex
     97        ComplexProjectivePlane
    9598        KleinBottle
    96         SurfaceOfGenus
     99        MatchingComplex
    97100        MooreSpace
    98101        NotIConnectedGraphs
    99         MatchingComplex
    100         ChessboardComplex
     102        PoincareHomologyThreeSphere
    101103        RandomComplex
     104        RealProjectivePlane
     105        RealProjectiveSpace
     106        Simplex
     107        Sphere
     108        SurfaceOfGenus
     109        Torus
    102110
    103111    EXAMPLES::
    104112
     
    317325            facets.append(["A0", Ai, Aiplus])
    318326        return SimplicialComplex(vertices, facets)
    319327
     328    def ComplexProjectivePlane(self):
     329        """
     330        A minimal triangulation of the complex projective plane.
     331
     332        This was constructed by Kühnel and Banchoff.
     333
     334        REFERENCES:
     335
     336        - W. Kühnel and T. F. Banchoff, "The 9-vertex complex
     337          projective plane", Math. Intelligencer 5 (1983), no. 3,
     338          11-22.
     339
     340        EXAMPLES::
     341
     342            sage: C = simplicial_complexes.ComplexProjectivePlane()
     343            sage: C.f_vector()
     344            [1, 9, 36, 84, 90, 36]
     345            sage: C.homology(2)
     346            Z
     347            sage: C.homology(4)
     348            Z
     349        """
     350        return SimplicialComplex(
     351            [[1, 2, 4, 5, 6], [2, 3, 5, 6, 4], [3, 1, 6, 4, 5],
     352             [1, 2, 4, 5, 9], [2, 3, 5, 6, 7], [3, 1, 6, 4, 8],
     353             [2, 3, 6, 4, 9], [3, 1, 4, 5, 7], [1, 2, 5, 6, 8],
     354             [3, 1, 5, 6, 9], [1, 2, 6, 4, 7], [2, 3, 4, 5, 8],
     355             [4, 5, 7, 8, 9], [5, 6, 8, 9, 7], [6, 4, 9, 7, 8],
     356             [4, 5, 7, 8, 3], [5, 6, 8, 9, 1], [6, 4, 9, 7, 2],
     357             [5, 6, 9, 7, 3], [6, 4, 7, 8, 1], [4, 5, 8, 9, 2],
     358             [6, 4, 8, 9, 3], [4, 5, 9, 7, 1], [5, 6, 7, 8, 2],
     359             [7, 8, 1, 2, 3], [8, 9, 2, 3, 1], [9, 7, 3, 1, 2],
     360             [7, 8, 1, 2, 6], [8, 9, 2, 3, 4], [9, 7, 3, 1, 5],
     361             [8, 9, 3, 1, 6], [9, 7, 1, 2, 4], [7, 8, 2, 3, 5],
     362             [9, 7, 2, 3, 6], [7, 8, 3, 1, 4], [8, 9, 1, 2, 5]])
     363
     364    def PoincareHomologyThreeSphere(self):
     365        """
     366        A triangulation of the Poincare homology 3-sphere.
     367
     368        This is a manifold whose integral homology is identical to the
     369        ordinary 3-sphere, but it is not simply connected.  The
     370        triangulation given here has 16 vertices and is due to Björner
     371        and Lutz.
     372
     373        REFERENCES:
     374
     375        - Anders Björner and Frank H. Lutz, "Simplicial manifolds,
     376          bistellar flips and a 16-vertex triangulation of the
     377          Poincaré homology 3-sphere", Experiment. Math. 9 (2000),
     378          no. 2, 275-289.
     379
     380        EXAMPLES::
     381
     382            sage: S3 = simplicial_complexes.Sphere(3)
     383            sage: Sigma3 = simplicial_complexes.PoincareHomologyThreeSphere()
     384            sage: S3.homology() == Sigma3.homology()
     385            True
     386        """
     387        return SimplicialComplex(
     388            [[1, 2, 4, 9], [1, 2, 4, 15], [1, 2, 6, 14], [1, 2, 6, 15],
     389             [1, 2, 9, 14], [1, 3, 4, 12], [1, 3, 4, 15], [1, 3, 7, 10],
     390             [1, 3, 7, 12], [1, 3, 10, 15], [1, 4, 9, 12], [1, 5, 6, 13],
     391             [1, 5, 6, 14], [1, 5, 8, 11], [1, 5, 8, 13], [1, 5, 11, 14],
     392             [1, 6, 13, 15], [1, 7, 8, 10], [1, 7, 8, 11], [1, 7, 11, 12],
     393             [1, 8, 10, 13], [1, 9, 11, 12], [1, 9, 11, 14], [1, 10, 13, 15],
     394             [2, 3, 5, 10], [2, 3, 5, 11], [2, 3, 7, 10], [2, 3, 7, 13],
     395             [2, 3, 11, 13], [2, 4, 9, 13], [2, 4, 11, 13], [2, 4, 11, 15],
     396             [2, 5, 8, 11], [2, 5, 8, 12], [2, 5, 10, 12], [2, 6, 10, 12],
     397             [2, 6, 10, 14], [2, 6, 12, 15], [2, 7, 9, 13], [2, 7, 9, 14],
     398             [2, 7, 10, 14], [2, 8, 11, 15], [2, 8, 12, 15], [3, 4, 5, 14],
     399             [3, 4, 5, 15], [3, 4, 12, 14], [3, 5, 10, 15], [3, 5, 11, 14],
     400             [3, 7, 12, 13], [3, 11, 13, 14], [3, 12, 13, 14], [4, 5, 6, 7],
     401             [4, 5, 6, 14], [4, 5, 7, 15], [4, 6, 7, 11], [4, 6, 10, 11],
     402             [4, 6, 10, 14], [4, 7, 11, 15], [4, 8, 9, 12], [4, 8, 9, 13],
     403             [4, 8, 10, 13], [4, 8, 10, 14], [4, 8, 12, 14], [4, 10, 11, 13],
     404             [5, 6, 7, 13], [5, 7, 9, 13], [5, 7, 9, 15], [5, 8, 9, 12],
     405             [5, 8, 9, 13], [5, 9, 10, 12], [5, 9, 10, 15], [6, 7, 11, 12],
     406             [6, 7, 12, 13], [6, 10, 11, 12], [6, 12, 13, 15], [7, 8, 10, 14],
     407             [7, 8, 11, 15], [7, 8, 14, 15], [7, 9, 14, 15], [8, 12, 14, 15],
     408             [9, 10, 11, 12], [9, 10, 11, 16], [9, 10, 15, 16], [9, 11, 14, 16],
     409             [9, 14, 15, 16], [10, 11, 13, 16], [10, 13, 15, 16],
     410             [11, 13, 14, 16], [12, 13, 14, 15], [13, 14, 15, 16]])
     411
     412    def RealProjectiveSpace(self, n):
     413        r"""
     414        A triangulation of `\Bold{R}P^n` for any `n \geq 0`.
     415
     416        INPUT:
     417
     418        - ``n`` - integer, the dimension of the real projective space
     419          to construct
     420
     421        The first few cases are pretty trivial:
     422
     423        - `\Bold{R}P^0` is a point.
     424
     425        - `\Bold{R}P^1` is a circle, triangulated as the boundary of a
     426          single 2-simplex.
     427
     428        - `\Bold{R}P^2` is the real projective plane, here given its
     429          minimal triangulation with 6 vertices, 15 edges, and 10
     430          triangles.
     431
     432        - `\Bold{R}P^3`: any triangulation has at least 11 vertices by
     433          a result of Walkup; this function returns a
     434          triangulation with 11 vertices, as given by Lutz.
     435
     436        - `\Bold{R}P^4`: any triangulation has at least 16 vertices by
     437          a result of Walkup; this function returns a triangulation
     438          with 16 vertices as given by Lutz; see also Datta, Example
     439          3.12.
     440
     441        - `\Bold{R}P^n`: Lutz has found a triangulation of
     442          `\Bold{R}P^5` with 24 vertices, but it does not seem to have
     443          been published.  Kühnel has described a triangulation of
     444          `\Bold{R}P^n`, in general, with `2^{n+1}-1` vertices; see
     445          also Datta, Example 3.21.  This triangulation is presumably
     446          not minimal, but it seems to be the best in the published
     447          literature as of this writing.  So this function returns it
     448          when `n > 4`.
     449
     450        ALGORITHM: For `n < 4`, these are constructed explicitly by
     451        listing the facets.  For `n = 4`, this is constructed by
     452        specifying 16 vertices, two facets, and a certain subgroup `G`
     453        of the symmetric group `S_{16}`.  Then the set of all facets
     454        is the `G`-orbit of the two given facets.
     455
     456        For `n > 4`, the construction is as follows: let `S` denote
     457        the simplicial complex structure on the `n`-sphere given by
     458        the first barycentric subdivision of the boundary of an
     459        `(n+1)`-simplex.  This has a simplicial antipodal action: if
     460        `V` denotes the vertices in the boundary of the simplex, then
     461        the vertices in its barycentric subdivision `S` correspond to
     462        nonempty proper subsets `U` of `V`, and the antipodal action
     463        sends any subset `U` to its complement.  One can show that
     464        modding out by this action results in a triangulation for
     465        `\Bold{R}P^n`.  To find the facets in this triangulation, find
     466        the facets in `S`.  These are indentified in pairs to form
     467        `\Bold{R}P^n`, so choose a representative from each pair: for
     468        each facet in `S`, replace any vertex in `S` containing 0 with
     469        its complement.
     470
     471        Of course these complexes increase in size pretty quickly as
     472        `n` increases.
     473
     474        REFERENCES:
     475
     476        - Basudeb Datta, "Minimal triangulations of manifolds",
     477          J. Indian Inst. Sci. 87 (2007), no. 4, 429-449.
     478
     479        - W. Kühnel, "Minimal triangulations of Kummer varieties",
     480          Abh. Math. Sem. Univ. Hamburg 57 (1987), 7-20.
     481
     482        - Frank H. Lutz, "Triangulated Manifolds with Few Vertices:
     483          Combinatorial Manifolds", preprint (2005),
     484          arXiv:math/0506372.
     485
     486        - David W. Walkup, "The lower bound conjecture for 3- and
     487          4-manifolds", Acta Math. 125 (1970), 75-107.
     488
     489        EXAMPLES::
     490
     491            sage: P3 = simplicial_complexes.RealProjectiveSpace(3)
     492            sage: P3.f_vector()
     493            [1, 11, 51, 80, 40]
     494            sage: P3.homology()
     495            {0: 0, 1: C2, 2: 0, 3: Z}
     496            sage: P4 = simplicial_complexes.RealProjectiveSpace(4)
     497            sage: P4.f_vector()
     498            [1, 16, 120, 330, 375, 150]
     499            sage: P4.homology()
     500            {0: 0, 1: C2, 2: 0, 3: C2, 4: 0}
     501            sage: P5 = simplicial_complexes.RealProjectiveSpace(5) # long time: 45 seconds
     502            sage: P5.f_vector()  # long time
     503            [1, 63, 903, 4200, 8400, 7560, 2520]
     504            sage: P5.homology()  # long time
     505            {0: 0, 1: C2, 2: 0, 3: C2, 4: 0, 5: Z}
     506            sage: simplicial_complexes.RealProjectiveSpace(2).dimension()
     507            2
     508            sage: P3.dimension()
     509            3
     510            sage: P4.dimension()
     511            4
     512            sage: P5.dimension() # long time
     513            5
     514        """
     515        if n == 0:
     516            return self.Simplex(0)
     517        if n == 1:
     518            return self.Sphere(1)
     519        if n == 2:
     520            return self.RealProjectivePlane()
     521        if n == 3:
     522            # Minimal triangulation found by Walkup and given
     523            # explicitly by Lutz
     524            return SimplicialComplex(
     525                [[1, 2, 3, 7], [1, 4, 7, 9], [2, 3, 4, 8], [2, 5, 8, 10],
     526                 [3, 6, 7, 10], [1, 2, 3, 11], [1, 4, 7, 10], [2, 3, 4, 11],
     527                 [2, 5, 9, 10], [3, 6, 8, 9], [1, 2, 6, 9], [1, 4, 8, 9],
     528                 [2, 3, 7, 8], [2, 6, 9, 10], [3, 6, 9, 10], [1, 2, 6, 11],
     529                 [1, 4, 8, 10], [2, 4, 6, 10], [3, 4, 5, 9], [4, 5, 6, 7],
     530                 [1, 2, 7, 9], [1, 5, 6, 8], [2, 4, 6, 11], [3, 4, 5, 11],
     531                 [4, 5, 6, 11], [1, 3, 5, 10], [1, 5, 6, 11], [2, 4, 8, 10],
     532                 [3, 4, 8, 9], [4, 5, 7, 9], [1, 3, 5, 11], [1, 5, 8, 10],
     533                 [2, 5, 7, 8], [3, 5, 9, 10], [4, 6, 7, 10], [1, 3, 7, 10],
     534                 [1, 6, 8, 9], [2, 5, 7, 9], [3, 6, 7, 8], [5, 6, 7, 8]])
     535        if n == 4:
     536            # The facets in RP^4 are constructed by specifying two
     537            # simplices on 16 vertices, and then finding their orbit
     538            # under a certain subgroup of the permutation group on 16
     539            # letters.  See the description in Example 3.12 in Datta.
     540            #
     541            # Define the group:
     542            from sage.groups.perm_gps.permgroup import PermutationGroup
     543            g1 = '(2,7)(4,10)(5,6)(11,12)'
     544            g2 = '(1, 2, 3, 4, 5, 10)(6, 8, 9)(11, 12, 13, 14, 15, 16)'
     545            G = PermutationGroup([g1, g2])
     546            # Define the two simplices:
     547            t1 = (1, 2, 4, 5, 11)
     548            t2 = (1, 2, 4, 11, 13)
     549            # Apply the group elements to the simplices:
     550            facets = []
     551            for g in G:
     552                d = g.dict()
     553                for t in [t1, t2]:
     554                    new = tuple([d[j] for j in t])
     555                    if new not in facets:
     556                        facets.append(new)
     557            return SimplicialComplex(facets)
     558        if n >= 5:
     559            # Use the construction given by Datta in Example 3.21.
     560            V = set(range(0, n+2))
     561            S = simplicial_complexes.Sphere(n).barycentric_subdivision()
     562            X = S.facets()
     563            facets = set([])
     564            for f in X:
     565                new = []
     566                for v in f:
     567                    if 0 in v:
     568                        new.append(tuple(V.difference(v)))
     569                    else:
     570                        new.append(v)
     571                facets.add(tuple(new))
     572            return SimplicialComplex(list(facets))
     573
     574    ###############################################################
    320575    # examples from graph theory:
    321576
    322577    def NotIConnectedGraphs(self, n, i):