Extension of semi-lattices and lattices
Extension of meet semi-lattices
[1]:
from galactic.algebras.examples.arithmetic import PrimeFactors
from galactic.algebras.examples.arithmetic.renderer import PrimeFactorsRenderer
from galactic.algebras.lattice import ExtensibleFiniteMeetSemiLattice
from galactic.algebras.poset.renderer import HasseDiagram
[2]:
meet_semi_lattice = ExtensibleFiniteMeetSemiLattice[PrimeFactors](
elements=[
PrimeFactors(3),
PrimeFactors(7),
PrimeFactors(2 * 7),
PrimeFactors(3 * 5),
],
)
HasseDiagram[PrimeFactors](
meet_semi_lattice,
domain_renderer=PrimeFactorsRenderer(meet_semi_lattice=True),
)
[2]:
[3]:
meet_semi_lattice.extend([PrimeFactors(3 * 7)])
HasseDiagram[PrimeFactors](
meet_semi_lattice,
domain_renderer=PrimeFactorsRenderer(meet_semi_lattice=True),
)
[3]:
[4]:
meet_semi_lattice.extend([PrimeFactors(2 * 11)])
HasseDiagram[PrimeFactors](
meet_semi_lattice,
domain_renderer=PrimeFactorsRenderer(meet_semi_lattice=True),
)
[4]:
[5]:
meet_semi_lattice.extend([PrimeFactors(11)])
HasseDiagram[PrimeFactors](
meet_semi_lattice,
domain_renderer=PrimeFactorsRenderer(meet_semi_lattice=True),
)
[5]:
[6]:
meet_semi_lattice.extend([PrimeFactors(3 * 11)])
HasseDiagram[PrimeFactors](
meet_semi_lattice,
domain_renderer=PrimeFactorsRenderer(meet_semi_lattice=True),
)
[6]:
[7]:
meet_semi_lattice.extend([PrimeFactors(2 * 7 * 11)])
HasseDiagram[PrimeFactors](
meet_semi_lattice,
domain_renderer=PrimeFactorsRenderer(meet_semi_lattice=True),
)
[7]:
[8]:
meet_semi_lattice.extend([PrimeFactors(2 * 2 * 3 * 5 * 7 * 11)])
HasseDiagram[PrimeFactors](
meet_semi_lattice,
domain_renderer=PrimeFactorsRenderer(meet_semi_lattice=True),
)
[8]:
[9]:
meet_semi_lattice.extend([PrimeFactors(2 * 3 * 7 * 11)])
HasseDiagram[PrimeFactors](
meet_semi_lattice,
domain_renderer=PrimeFactorsRenderer(meet_semi_lattice=True),
)
[9]:
[10]:
meet_semi_lattice.extend([PrimeFactors(3 * 7 * 11)])
HasseDiagram[PrimeFactors](
meet_semi_lattice,
domain_renderer=PrimeFactorsRenderer(meet_semi_lattice=True),
)
[10]:
[11]:
meet_semi_lattice.extend([PrimeFactors(5)])
HasseDiagram[PrimeFactors](
meet_semi_lattice,
domain_renderer=PrimeFactorsRenderer(meet_semi_lattice=True),
)
[11]:
[12]:
meet_semi_lattice.extend([PrimeFactors(3 * 5 * 13)])
HasseDiagram[PrimeFactors](
meet_semi_lattice,
domain_renderer=PrimeFactorsRenderer(meet_semi_lattice=True),
)
[12]:
[13]:
meet_semi_lattice.extend([PrimeFactors(2 * 5)])
HasseDiagram[PrimeFactors](
meet_semi_lattice,
domain_renderer=PrimeFactorsRenderer(meet_semi_lattice=True),
)
[13]:
[14]:
meet_semi_lattice.extend([PrimeFactors(35)])
HasseDiagram[PrimeFactors](
meet_semi_lattice,
domain_renderer=PrimeFactorsRenderer(meet_semi_lattice=True),
)
[14]:
[15]:
meet_semi_lattice.extend([PrimeFactors(2 * 3 * 3 * 5 * 7 * 11)])
HasseDiagram[PrimeFactors](
meet_semi_lattice,
domain_renderer=PrimeFactorsRenderer(meet_semi_lattice=True),
)
[15]:
Extension of join semi-lattices
[16]:
from galactic.algebras.examples.arithmetic import PrimeFactors
from galactic.algebras.examples.arithmetic.renderer import PrimeFactorsRenderer
from galactic.algebras.lattice import ExtensibleFiniteJoinSemiLattice
from galactic.algebras.poset.renderer import HasseDiagram
[17]:
join_semi_lattice = ExtensibleFiniteJoinSemiLattice[PrimeFactors](
elements=[
PrimeFactors(3),
PrimeFactors(7),
PrimeFactors(2 * 7),
PrimeFactors(3 * 5),
],
)
HasseDiagram[PrimeFactors](
join_semi_lattice,
domain_renderer=PrimeFactorsRenderer(join_semi_lattice=True),
)
[17]:
[18]:
join_semi_lattice.extend([PrimeFactors(2 * 11)])
HasseDiagram[PrimeFactors](
join_semi_lattice,
domain_renderer=PrimeFactorsRenderer(join_semi_lattice=True),
)
[18]:
[19]:
join_semi_lattice.extend([PrimeFactors(11)])
HasseDiagram[PrimeFactors](
join_semi_lattice,
domain_renderer=PrimeFactorsRenderer(join_semi_lattice=True),
)
[19]:
[20]:
join_semi_lattice.extend([PrimeFactors(3 * 11)])
HasseDiagram[PrimeFactors](
join_semi_lattice,
domain_renderer=PrimeFactorsRenderer(join_semi_lattice=True),
)
[20]:
[21]:
join_semi_lattice.extend([PrimeFactors(2 * 7 * 11)])
HasseDiagram[PrimeFactors](
join_semi_lattice,
domain_renderer=PrimeFactorsRenderer(join_semi_lattice=True),
)
[21]:
[22]:
join_semi_lattice.extend([PrimeFactors(2 * 2 * 3 * 5 * 7 * 11)])
HasseDiagram[PrimeFactors](
join_semi_lattice,
domain_renderer=PrimeFactorsRenderer(join_semi_lattice=True),
)
[22]:
[23]:
join_semi_lattice.extend([PrimeFactors(3 * 7 * 11)])
HasseDiagram[PrimeFactors](
join_semi_lattice,
domain_renderer=PrimeFactorsRenderer(join_semi_lattice=True),
)
[23]:
[24]:
join_semi_lattice.extend([PrimeFactors(5)])
HasseDiagram[PrimeFactors](
join_semi_lattice,
domain_renderer=PrimeFactorsRenderer(join_semi_lattice=True),
)
[24]:
[25]:
join_semi_lattice.extend([PrimeFactors(3 * 5 * 13)])
HasseDiagram[PrimeFactors](
join_semi_lattice,
domain_renderer=PrimeFactorsRenderer(join_semi_lattice=True),
)
[25]:
[26]:
join_semi_lattice.extend([PrimeFactors(2 * 5)])
HasseDiagram[PrimeFactors](
join_semi_lattice,
domain_renderer=PrimeFactorsRenderer(join_semi_lattice=True),
)
[26]:
[27]:
join_semi_lattice.extend([PrimeFactors(35)])
HasseDiagram[PrimeFactors](
join_semi_lattice,
domain_renderer=PrimeFactorsRenderer(join_semi_lattice=True),
)
[27]:
[28]:
join_semi_lattice.extend([PrimeFactors(2 * 3 * 3 * 5 * 7 * 11)])
HasseDiagram[PrimeFactors](
join_semi_lattice,
domain_renderer=PrimeFactorsRenderer(join_semi_lattice=True),
)
[28]:
Extension of lattices
First example
[29]:
from galactic.algebras.examples.arithmetic import PrimeFactors
from galactic.algebras.examples.arithmetic.renderer import PrimeFactorsRenderer
from galactic.algebras.lattice import ExtensibleFiniteLattice
from galactic.algebras.poset.renderer import HasseDiagram
[30]:
lattice = ExtensibleFiniteLattice[PrimeFactors](
elements=[
PrimeFactors(3),
PrimeFactors(7),
PrimeFactors(2 * 7),
PrimeFactors(3 * 5),
],
)
HasseDiagram[PrimeFactors](
lattice,
domain_renderer=PrimeFactorsRenderer(
join_semi_lattice=True,
meet_semi_lattice=True,
),
)
[30]:
[31]:
lattice.extend([PrimeFactors(3 * 7)])
HasseDiagram[PrimeFactors](
lattice,
domain_renderer=PrimeFactorsRenderer(
join_semi_lattice=True,
meet_semi_lattice=True,
),
)
[31]:
[32]:
lattice.extend([PrimeFactors(2 * 11)])
HasseDiagram[PrimeFactors](
lattice,
domain_renderer=PrimeFactorsRenderer(
join_semi_lattice=True,
meet_semi_lattice=True,
),
)
[32]:
[33]:
lattice.extend([PrimeFactors(11)])
HasseDiagram[PrimeFactors](
lattice,
domain_renderer=PrimeFactorsRenderer(
join_semi_lattice=True,
meet_semi_lattice=True,
),
)
[33]:
[34]:
lattice.extend([PrimeFactors(3 * 11)])
HasseDiagram[PrimeFactors](
lattice,
domain_renderer=PrimeFactorsRenderer(
join_semi_lattice=True,
meet_semi_lattice=True,
),
)
[34]:
[35]:
lattice.extend([PrimeFactors(2 * 7 * 11)])
HasseDiagram[PrimeFactors](
lattice,
domain_renderer=PrimeFactorsRenderer(
join_semi_lattice=True,
meet_semi_lattice=True,
),
)
[35]:
[36]:
lattice.extend([PrimeFactors(2 * 2 * 3 * 5 * 7 * 11)])
HasseDiagram[PrimeFactors](
lattice,
domain_renderer=PrimeFactorsRenderer(
join_semi_lattice=True,
meet_semi_lattice=True,
),
)
[36]:
[37]:
lattice.extend([PrimeFactors(3 * 7 * 11)])
HasseDiagram[PrimeFactors](
lattice,
domain_renderer=PrimeFactorsRenderer(
join_semi_lattice=True,
meet_semi_lattice=True,
),
)
[37]:
[38]:
lattice.extend([PrimeFactors(5)])
HasseDiagram[PrimeFactors](
lattice,
domain_renderer=PrimeFactorsRenderer(
join_semi_lattice=True,
meet_semi_lattice=True,
),
)
[38]:
[39]:
lattice.extend([PrimeFactors(3 * 5 * 13)])
HasseDiagram[PrimeFactors](
lattice,
domain_renderer=PrimeFactorsRenderer(
join_semi_lattice=True,
meet_semi_lattice=True,
),
)
[39]:
[40]:
lattice.extend([PrimeFactors(2 * 5)])
HasseDiagram[PrimeFactors](
lattice,
domain_renderer=PrimeFactorsRenderer(
join_semi_lattice=True,
meet_semi_lattice=True,
),
)
[40]:
[41]:
lattice.extend([PrimeFactors(5 * 7)])
HasseDiagram[PrimeFactors](
lattice,
domain_renderer=PrimeFactorsRenderer(
join_semi_lattice=True,
meet_semi_lattice=True,
),
)
[41]:
[42]:
lattice.extend([PrimeFactors(2 * 3 * 3 * 5 * 7 * 11)])
HasseDiagram[PrimeFactors](
lattice,
domain_renderer=PrimeFactorsRenderer(
join_semi_lattice=True,
meet_semi_lattice=True,
),
)
[42]:
[43]:
from galactic.algebras.lattice.renderer import ReducedContextDiagram
ReducedContextDiagram(
lattice,
domain_renderer=PrimeFactorsRenderer(meet_irreducible=True),
co_domain_renderer=PrimeFactorsRenderer(join_irreducible=True),
)
[43]:
[44]:
from galactic.algebras.relational.renderer import BinaryTable
BinaryTable(
lattice.reduced_context,
domain_renderer=PrimeFactorsRenderer(),
co_domain_renderer=PrimeFactorsRenderer(meet_irreducible=True),
)
[44]:
462 | 770 | 2730 | 4290 | 15015 | 60060 | 13860 | 90090 | |
---|---|---|---|---|---|---|---|---|
$5=5$ | $\checkmark$ | $\checkmark$ | $\checkmark$ | $\checkmark$ | $\checkmark$ | $\checkmark$ | $\checkmark$ | |
$3=3$ | $\checkmark$ | $\checkmark$ | $\checkmark$ | $\checkmark$ | $\checkmark$ | $\checkmark$ | $\checkmark$ | |
$11=11$ | $\checkmark$ | $\checkmark$ | $\checkmark$ | $\checkmark$ | $\checkmark$ | $\checkmark$ | $\checkmark$ | |
$2=2$ | $\checkmark$ | $\checkmark$ | $\checkmark$ | $\checkmark$ | $\checkmark$ | $\checkmark$ | $\checkmark$ | |
$7=7$ | $\checkmark$ | $\checkmark$ | $\checkmark$ | $\checkmark$ | $\checkmark$ | $\checkmark$ | $\checkmark$ | |
$4620=2^2·3·5·7·11$ | $\checkmark$ | $\checkmark$ | ||||||
$6930=2·3^2·5·7·11$ | $\checkmark$ | $\checkmark$ | ||||||
$195=3·5·13$ | $\checkmark$ | $\checkmark$ | $\checkmark$ | $\checkmark$ | $\checkmark$ |
Second example
[45]:
lattice = ExtensibleFiniteLattice[PrimeFactors]()
HasseDiagram[PrimeFactors](
lattice,
domain_renderer=PrimeFactorsRenderer(
join_semi_lattice=True,
meet_semi_lattice=True,
),
)
[45]:
[46]:
lattice.extend([PrimeFactors(2)])
HasseDiagram[PrimeFactors](
lattice,
domain_renderer=PrimeFactorsRenderer(
join_semi_lattice=True,
meet_semi_lattice=True,
),
)
[46]:
[47]:
lattice.extend([PrimeFactors(12)])
HasseDiagram[PrimeFactors](
lattice,
domain_renderer=PrimeFactorsRenderer(
join_semi_lattice=True,
meet_semi_lattice=True,
),
)
[47]:
[48]:
lattice.extend([PrimeFactors(18)])
HasseDiagram[PrimeFactors](
lattice,
domain_renderer=PrimeFactorsRenderer(
join_semi_lattice=True,
meet_semi_lattice=True,
),
)
[48]:
[49]:
lattice.extend([PrimeFactors(30)])
HasseDiagram[PrimeFactors](
lattice,
domain_renderer=PrimeFactorsRenderer(
join_semi_lattice=True,
meet_semi_lattice=True,
),
)
[49]:
[50]:
lattice.extend([PrimeFactors(42)])
HasseDiagram[PrimeFactors](
lattice,
domain_renderer=PrimeFactorsRenderer(
join_semi_lattice=True,
meet_semi_lattice=True,
),
)
[50]:
[51]:
lattice.extend([PrimeFactors(5040)])
HasseDiagram[PrimeFactors](
lattice,
domain_renderer=PrimeFactorsRenderer(
join_semi_lattice=True,
meet_semi_lattice=True,
),
)
[51]:
[52]:
lattice.extend([PrimeFactors(7560)])
HasseDiagram[PrimeFactors](
lattice,
domain_renderer=PrimeFactorsRenderer(
join_semi_lattice=True,
meet_semi_lattice=True,
),
)
[52]:
[53]:
lattice.extend([PrimeFactors(30240)])
HasseDiagram[PrimeFactors](
lattice,
domain_renderer=PrimeFactorsRenderer(
join_semi_lattice=True,
meet_semi_lattice=True,
),
)
[53]:
[54]:
lattice.extend([PrimeFactors(60480)])
HasseDiagram[PrimeFactors](
lattice,
domain_renderer=PrimeFactorsRenderer(
join_semi_lattice=True,
meet_semi_lattice=True,
),
)
[54]: