# finite simplicial complexes, projective spaces, facets, giving strange output

The code

```
n=2; x=simplicial_complexes.RealProjectiveSpace(n);
fcts=x.facets(); out=file('P'+str(n)+'.txt','w');
for a in fcts: out.write(str(a)+'\n')
out.close();
```

writes a nice result in the file `P2.txt`

:

```
(0, 2, 3)
(0, 3, 4)
(0, 1, 5)
(0, 4, 5)
(2, 3, 5)
(1, 2, 4)
(0, 1, 2)
(1, 3, 4)
(1, 3, 5)
(2, 4, 5)
```

This works for $n=1,\ldots,4$. However, for $n=5$, the file contains

```
((1, 5, 6), (1, 6), (1, 3, 5, 6), (6,), (2,), (2, 4))
((1, 2, 4, 6), (5,), (1, 4), (3, 5), (4,), (1, 4, 6))
((3, 4, 6), (1, 3, 4, 5, 6), (4, 6), (1, 3, 4, 6), (6,), (2,))
((1, 5, 6), (1, 2, 3, 4, 5, 6), (1, 3, 5, 6), (1,), (1, 5), (1, 3, 4, 5, 6))
((1, 6), (1, 3, 5, 6), (1,), (1, 2, 3, 5, 6), (1, 3, 6), (4,))
((1, 2), (3,), (3, 5, 6), (1, 2, 4), (3, 5), (2,))
((1, 2), (1,), (3,), (3, 6), (1, 2, 4), (1, 2, 4, 5))
((1, 2), (1,), (1, 2, 3, 6), (4, 5), (1, 2, 6), (4,))
((2, 3, 4), (2, 3, 4, 5), (1, 2, 3, 4, 5), (2, 3), (6,), (2,))
((1, 3, 4, 5), (1, 3, 4, 5, 6), (5,), (3, 5), (2,), (3, 4, 5))
...
```

What am I doing wrong here? Why don't I get a list of 5-dimensional simplices? I would like to obtain only the facets of the first 10 projective spaces.

That's because the vertices are no longer integers, but rather tuples of integers.

@FrédéricC Not even that, since some tuples end in a comma, not an integer. Anyway, how can I get maximal simplices which have integers for vertices?

Tuples with only one element have a final comma in python :

"I would like to obtain only the facets of the first 10 projective spaces." Please look at the documentation. When

`n`

is at least 5, there will be`(n+2)!/2`

facets in Sage's triangulation of n-dimensional real projective space. When`n=10`

, this will produce over 200 million facets.