Closed f29946bc-ee7b-48cd-9abc-3445948c551d closed 8 years ago
Merged. Sorry for wrong term.
Kevin, if you are interested in docs, you might want to review this. It does some polishing together with adding little new functionality.
I still think that formal definitions should come first, without being labelled as formal definitions, and then informal definitions can come after.
I'm not sure if I like the backend code living in hasse_diagram.py
. Even if the code applies to more than lattices, you seem to still be making assumptions about the poset being bounded. Plus the initial docstring there is written in a way that implies it only works for lattices.
Replying to @kevindilks:
I still think that formal definitions should come first, without being labelled as formal definitions, and then informal definitions can come after.
OK, I can change that.
Replying to @kevindilks:
I'm not sure if I like the backend code living in
hasse_diagram.py
. Even if the code applies to more than lattices, you seem to still be making assumptions about the poset being bounded. Plus the initial docstring there is written in a way that implies it only works for lattices.
I think that all code in hasse_diagram.py
is "internal", i.e. it is user's fault if something break for direct call to it.
If this is not in hasse_diagram.py
, then I guess it must be copied if I want to optimize frattini_sublattice()
with it. Or linear_extensions_number()
maybe?
Branch pushed to git repo; I updated commit sha1. New commits:
b408d0c | Change order of formal and informal definition. |
Better docstring now?
If this seems hard one to decide, then I can split the (non-relating) part that rearranges the index of functions.
ping -c 1 Kevin
. This could be nice to have before #18511, as this modifies the index of function.
(Funny. I have a poset of dependencies between poset-related tickets.)
Replying to @nathanncohen:
Also, why is it only defined for lattices? The algorithm works in all cases.
Here is a kind of followup: #19659. I think that it is most natural generalization to all posets.
Documentation part (i.e. index of functions) done in #19854, so this one needs work.
Also this should be thinked about. There is also #19659 waiting, and in principle it is same thing as this one; a poset that is also a lattice can be expressed as an ordinal sum of two posets only if it vertically decomposable. At least http://users.cecs.anu.edu.au/~bdm/papers/posets.pdf by Brinkmann and McKay uses term "vertically decomposable" with non-lattice posets.
(Actually after #19659 it is easy to make a simple function for #19215, and then use it as a "precompiler" for #14126. But that's another story.)
New commits:
0ee8b96 | Merge branch 'u/jmantysalo/vertically_decomposable2' into 7.1.rc0 |
Changed branch from u/jmantysalo/vertically_decomposable2 to public/19123
Minor grammatical corrections:
In vertical_decomposition()
, 'Let d_1, \ldots , d_n
be elements comparable to every element of the lattice, excluding the top and bottom elements.' Should be rephrased as 'Let d_1, \ldots, d_n
be elements (excluding the top and bottom elements) comparable to every element of the lattice.' The original version makes it sound like the top and bottom elements are being excluded from the set of things that d_1...d_n
need to be comparable to, instead of being excluded from the set d_1...d_n
itself.
Immediately following that, 'Let b
be THE bottom element and t
be the top element.'
'Informally said, this returns the lattice SPLIT INTO parts AT every single-element "cutting point".'
Under INPUT:
, 'return the list OF decomposing elements'.
In the definition of is_vertically_decomposable()
, 'A lattice is vertically decomposable if it has an element that is comparable to all elements and is NEITHER the bottom NOR the top element.'
Besides that, I think I'm happy with it. I'll just need to check the rendered documentation once those changes are made.
Branch pushed to git repo; I updated commit sha1. New commits:
bf4d108 | Docstring corrections. |
Replying to @kevindilks:
Minor grammatical corrections:
Thanks! Done those.
- 'Informally said, this returns the lattice SPLIT INTO parts AT every single-element "cutting point".'
These are hard ones... In Finnish 'hila'='lattice', 'hilassani'='in my lattice' etc.
Reviewer: Kevin Dilks
Changed branch from public/19123 to bf4d108
This patch adds a function
is_vertically_decomposable
to finite lattices.For testing see https://oeis.org/A058800 ; for example
returns 7 as it should.
There is a place for possible optimization: If there is, say, covering relations
bottom -> 5
,3 -> 8
and7 -> top
, is suffices to show that the lattice is not vertically decomposable. This might be faster on average. Now the complexity is linear to number of covering relations.CC: @nathanncohen @tscrim @kevindilks
Component: combinatorics
Author: Jori Mäntysalo
Branch/Commit:
bf4d108
Reviewer: Kevin Dilks
Issue created by migration from https://trac.sagemath.org/ticket/19123