8. Catalog of Small Posets and Lattices

Along with the package itself, we have supplied two more files, allposets1-7 
and alllattices1-9.  These contain descriptions of all non-isomorphic posets 
of size ² 7, and all non-isomorphic lattices of size ² 9. They were generated 
using John Stembridge's Maple package for posets, and then translated into 
Mathematica format.

This data can be accessed as follows. First be sure that the two files are in 
a directory that Mathematica searches when input is requested (for example, 
the Packages folder in the Macintosh version). Then, for example, execute 

<<allposets1-7;

The data is now recorded in a variable called AllPosets. For example, 
AllPosets[3] is a list of all posets of size 3.  Each entry consists of a list 
of relations.  Thus, to build the kth poset, one executes the command 
Build[{AllPosets[3][[k]],3}].

AllPosets[3]

{{}, {{1, 2}}, {{1, 3}, {2, 3}}, {{1, 2}, {2, 3}}, {{1, 2}, {1, 3}}}

For[k=1,k<=5,k++,
  Build[{AllPosets[3][[k]],3},sample];
  Diagram[sample]
  ]











The command NumPosets assumes that allposets1-7 has been read, and returns the 
number of posets of each size. For example,

Table[NumPosets[n],{n,1,7}]

{1, 2, 5, 16, 63, 318, 2045}

Exercise:  check this sequence and the next one by looking in Neil Sloane's 
book.

<<alllattices1-9

Table[NumLattices[n],{n,1,9}]

{1, 1, 1, 2, 5, 15, 53, 222, 1078}

We can build all the posets of a size n and test them for various properties.  
Beware that for large N this may consume a lot of memory.  We illustrate by 
checking all of the posets with 4 elements to be sure there that no two are 
isomorphic.

For[k=1,k<=16,k++,
Build[{AllPosets[4][[k]],4},test[k]]
]


For[j=1,j<=16,j++,
For[k=j+1,k<=16,k++,
  Print["------------------------"];
  Print["Testing posets ",j,", ",k];
  If[IsomorphicQ[test[j],test[k]],
    Print["***** Posets ",j," and ",k," are isomorphic!"]];
  ]]

------------------------
Testing posets 1, 2
Different number of CoverRelations.
------------------------
Testing posets 1, 3
Different number of CoverRelations.
------------------------
Testing posets 1, 4
Different number of CoverRelations.
------------------------
Testing posets 1, 5
Different number of CoverRelations.
------------------------
.
.
.
------------------------
Testing posets 6, 9
Different number of CoverRelations.
------------------------
Testing posets 6, 10
UpDegree distribution is different.
------------------------
Testing posets 6, 11
UpDegree distribution is different.
------------------------
.
.
.
------------------------
Testing posets 9, 16
Different number of CoverRelations.
------------------------
Testing posets 10, 11
Number of ones in Zeta matrix is different.
------------------------
Testing posets 10, 12
DownDegree distribution is different.
------------------------
Testing posets 10, 13
UpDegree distribution is different.
------------------------
Testing posets 10, 14
UpDegree distribution is different.
------------------------
Testing posets 10, 15
Different number of CoverRelations.
------------------------
.
.
.
------------------------
Testing posets 13, 15
Different number of CoverRelations.
------------------------
Testing posets 13, 16
UpDegree distribution is different.
------------------------
Testing posets 14, 15
Different number of CoverRelations.
------------------------
Testing posets 14, 16
UpDegree distribution is different.
------------------------
Testing posets 15, 16
Different number of CoverRelations.