Extension of semi-lattices and lattices

Extension of meet semi-lattices

[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]:
../../../_images/notebooks_algebras_lattice_extensions_2_0.png
[3]:
meet_semi_lattice.extend([PrimeFactors(3 * 7)])
HasseDiagram[PrimeFactors](
    meet_semi_lattice,
    domain_renderer=PrimeFactorsRenderer(meet_semi_lattice=True),
)
[3]:
../../../_images/notebooks_algebras_lattice_extensions_3_0.png
[4]:
meet_semi_lattice.extend([PrimeFactors(2 * 11)])
HasseDiagram[PrimeFactors](
    meet_semi_lattice,
    domain_renderer=PrimeFactorsRenderer(meet_semi_lattice=True),
)
[4]:
../../../_images/notebooks_algebras_lattice_extensions_4_0.png
[5]:
meet_semi_lattice.extend([PrimeFactors(11)])
HasseDiagram[PrimeFactors](
    meet_semi_lattice,
    domain_renderer=PrimeFactorsRenderer(meet_semi_lattice=True),
)
[5]:
../../../_images/notebooks_algebras_lattice_extensions_5_0.png
[6]:
meet_semi_lattice.extend([PrimeFactors(3 * 11)])
HasseDiagram[PrimeFactors](
    meet_semi_lattice,
    domain_renderer=PrimeFactorsRenderer(meet_semi_lattice=True),
)
[6]:
../../../_images/notebooks_algebras_lattice_extensions_6_0.png
[7]:
meet_semi_lattice.extend([PrimeFactors(2 * 7 * 11)])
HasseDiagram[PrimeFactors](
    meet_semi_lattice,
    domain_renderer=PrimeFactorsRenderer(meet_semi_lattice=True),
)
[7]:
../../../_images/notebooks_algebras_lattice_extensions_7_0.png
[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]:
../../../_images/notebooks_algebras_lattice_extensions_8_0.png
[9]:
meet_semi_lattice.extend([PrimeFactors(2 * 3 * 7 * 11)])
HasseDiagram[PrimeFactors](
    meet_semi_lattice,
    domain_renderer=PrimeFactorsRenderer(meet_semi_lattice=True),
)
[9]:
../../../_images/notebooks_algebras_lattice_extensions_9_0.png
[10]:
meet_semi_lattice.extend([PrimeFactors(3 * 7 * 11)])
HasseDiagram[PrimeFactors](
    meet_semi_lattice,
    domain_renderer=PrimeFactorsRenderer(meet_semi_lattice=True),
)
[10]:
../../../_images/notebooks_algebras_lattice_extensions_10_0.png
[11]:
meet_semi_lattice.extend([PrimeFactors(5)])
HasseDiagram[PrimeFactors](
    meet_semi_lattice,
    domain_renderer=PrimeFactorsRenderer(meet_semi_lattice=True),
)
[11]:
../../../_images/notebooks_algebras_lattice_extensions_11_0.png
[12]:
meet_semi_lattice.extend([PrimeFactors(3 * 5 * 13)])
HasseDiagram[PrimeFactors](
    meet_semi_lattice,
    domain_renderer=PrimeFactorsRenderer(meet_semi_lattice=True),
)
[12]:
../../../_images/notebooks_algebras_lattice_extensions_12_0.png
[13]:
meet_semi_lattice.extend([PrimeFactors(2 * 5)])
HasseDiagram[PrimeFactors](
    meet_semi_lattice,
    domain_renderer=PrimeFactorsRenderer(meet_semi_lattice=True),
)
[13]:
../../../_images/notebooks_algebras_lattice_extensions_13_0.png
[14]:
meet_semi_lattice.extend([PrimeFactors(35)])
HasseDiagram[PrimeFactors](
    meet_semi_lattice,
    domain_renderer=PrimeFactorsRenderer(meet_semi_lattice=True),
)
[14]:
../../../_images/notebooks_algebras_lattice_extensions_14_0.png
[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]:
../../../_images/notebooks_algebras_lattice_extensions_15_0.png

Extension of join semi-lattices

[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]:
../../../_images/notebooks_algebras_lattice_extensions_18_0.png
[18]:
join_semi_lattice.extend([PrimeFactors(2 * 11)])
HasseDiagram[PrimeFactors](
    join_semi_lattice,
    domain_renderer=PrimeFactorsRenderer(join_semi_lattice=True),
)
[18]:
../../../_images/notebooks_algebras_lattice_extensions_19_0.png
[19]:
join_semi_lattice.extend([PrimeFactors(11)])
HasseDiagram[PrimeFactors](
    join_semi_lattice,
    domain_renderer=PrimeFactorsRenderer(join_semi_lattice=True),
)
[19]:
../../../_images/notebooks_algebras_lattice_extensions_20_0.png
[20]:
join_semi_lattice.extend([PrimeFactors(3 * 11)])
HasseDiagram[PrimeFactors](
    join_semi_lattice,
    domain_renderer=PrimeFactorsRenderer(join_semi_lattice=True),
)
[20]:
../../../_images/notebooks_algebras_lattice_extensions_21_0.png
[21]:
join_semi_lattice.extend([PrimeFactors(2 * 7 * 11)])
HasseDiagram[PrimeFactors](
    join_semi_lattice,
    domain_renderer=PrimeFactorsRenderer(join_semi_lattice=True),
)
[21]:
../../../_images/notebooks_algebras_lattice_extensions_22_0.png
[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]:
../../../_images/notebooks_algebras_lattice_extensions_23_0.png
[23]:
join_semi_lattice.extend([PrimeFactors(3 * 7 * 11)])
HasseDiagram[PrimeFactors](
    join_semi_lattice,
    domain_renderer=PrimeFactorsRenderer(join_semi_lattice=True),
)
[23]:
../../../_images/notebooks_algebras_lattice_extensions_24_0.png
[24]:
join_semi_lattice.extend([PrimeFactors(5)])
HasseDiagram[PrimeFactors](
    join_semi_lattice,
    domain_renderer=PrimeFactorsRenderer(join_semi_lattice=True),
)
[24]:
../../../_images/notebooks_algebras_lattice_extensions_25_0.png
[25]:
join_semi_lattice.extend([PrimeFactors(3 * 5 * 13)])
HasseDiagram[PrimeFactors](
    join_semi_lattice,
    domain_renderer=PrimeFactorsRenderer(join_semi_lattice=True),
)
[25]:
../../../_images/notebooks_algebras_lattice_extensions_26_0.png
[26]:
join_semi_lattice.extend([PrimeFactors(2 * 5)])
HasseDiagram[PrimeFactors](
    join_semi_lattice,
    domain_renderer=PrimeFactorsRenderer(join_semi_lattice=True),
)
[26]:
../../../_images/notebooks_algebras_lattice_extensions_27_0.png
[27]:
join_semi_lattice.extend([PrimeFactors(35)])
HasseDiagram[PrimeFactors](
    join_semi_lattice,
    domain_renderer=PrimeFactorsRenderer(join_semi_lattice=True),
)
[27]:
../../../_images/notebooks_algebras_lattice_extensions_28_0.png
[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]:
../../../_images/notebooks_algebras_lattice_extensions_29_0.png

Extension of lattices

First example

[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]:
../../../_images/notebooks_algebras_lattice_extensions_32_0.png
[31]:
lattice.extend([PrimeFactors(3 * 7)])
HasseDiagram[PrimeFactors](
    lattice,
    domain_renderer=PrimeFactorsRenderer(
        join_semi_lattice=True,
        meet_semi_lattice=True,
    ),
)
[31]:
../../../_images/notebooks_algebras_lattice_extensions_33_0.png
[32]:
lattice.extend([PrimeFactors(2 * 11)])
HasseDiagram[PrimeFactors](
    lattice,
    domain_renderer=PrimeFactorsRenderer(
        join_semi_lattice=True,
        meet_semi_lattice=True,
    ),
)
[32]:
../../../_images/notebooks_algebras_lattice_extensions_34_0.png
[33]:
lattice.extend([PrimeFactors(11)])
HasseDiagram[PrimeFactors](
    lattice,
    domain_renderer=PrimeFactorsRenderer(
        join_semi_lattice=True,
        meet_semi_lattice=True,
    ),
)
[33]:
../../../_images/notebooks_algebras_lattice_extensions_35_0.png
[34]:
lattice.extend([PrimeFactors(3 * 11)])
HasseDiagram[PrimeFactors](
    lattice,
    domain_renderer=PrimeFactorsRenderer(
        join_semi_lattice=True,
        meet_semi_lattice=True,
    ),
)
[34]:
../../../_images/notebooks_algebras_lattice_extensions_36_0.png
[35]:
lattice.extend([PrimeFactors(2 * 7 * 11)])
HasseDiagram[PrimeFactors](
    lattice,
    domain_renderer=PrimeFactorsRenderer(
        join_semi_lattice=True,
        meet_semi_lattice=True,
    ),
)
[35]:
../../../_images/notebooks_algebras_lattice_extensions_37_0.png
[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]:
../../../_images/notebooks_algebras_lattice_extensions_38_0.png
[37]:
lattice.extend([PrimeFactors(3 * 7 * 11)])
HasseDiagram[PrimeFactors](
    lattice,
    domain_renderer=PrimeFactorsRenderer(
        join_semi_lattice=True,
        meet_semi_lattice=True,
    ),
)
[37]:
../../../_images/notebooks_algebras_lattice_extensions_39_0.png
[38]:
lattice.extend([PrimeFactors(5)])
HasseDiagram[PrimeFactors](
    lattice,
    domain_renderer=PrimeFactorsRenderer(
        join_semi_lattice=True,
        meet_semi_lattice=True,
    ),
)
[38]:
../../../_images/notebooks_algebras_lattice_extensions_40_0.png
[39]:
lattice.extend([PrimeFactors(3 * 5 * 13)])
HasseDiagram[PrimeFactors](
    lattice,
    domain_renderer=PrimeFactorsRenderer(
        join_semi_lattice=True,
        meet_semi_lattice=True,
    ),
)
[39]:
../../../_images/notebooks_algebras_lattice_extensions_41_0.png
[40]:
lattice.extend([PrimeFactors(2 * 5)])
HasseDiagram[PrimeFactors](
    lattice,
    domain_renderer=PrimeFactorsRenderer(
        join_semi_lattice=True,
        meet_semi_lattice=True,
    ),
)
[40]:
../../../_images/notebooks_algebras_lattice_extensions_42_0.png
[41]:
lattice.extend([PrimeFactors(5 * 7)])
HasseDiagram[PrimeFactors](
    lattice,
    domain_renderer=PrimeFactorsRenderer(
        join_semi_lattice=True,
        meet_semi_lattice=True,
    ),
)
[41]:
../../../_images/notebooks_algebras_lattice_extensions_43_0.png
[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]:
../../../_images/notebooks_algebras_lattice_extensions_44_0.png
[43]:
from galactic.algebras.lattice.renderer import ReducedContextDiagram

ReducedContextDiagram(
    lattice,
    domain_renderer=PrimeFactorsRenderer(meet_irreducible=True),
    co_domain_renderer=PrimeFactorsRenderer(join_irreducible=True),
)
[43]:
../../../_images/notebooks_algebras_lattice_extensions_45_0.png
[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]:
../../../_images/notebooks_algebras_lattice_extensions_48_0.png
[46]:
lattice.extend([PrimeFactors(2)])
HasseDiagram[PrimeFactors](
    lattice,
    domain_renderer=PrimeFactorsRenderer(
        join_semi_lattice=True,
        meet_semi_lattice=True,
    ),
)
[46]:
../../../_images/notebooks_algebras_lattice_extensions_49_0.png
[47]:
lattice.extend([PrimeFactors(12)])
HasseDiagram[PrimeFactors](
    lattice,
    domain_renderer=PrimeFactorsRenderer(
        join_semi_lattice=True,
        meet_semi_lattice=True,
    ),
)
[47]:
../../../_images/notebooks_algebras_lattice_extensions_50_0.png
[48]:
lattice.extend([PrimeFactors(18)])
HasseDiagram[PrimeFactors](
    lattice,
    domain_renderer=PrimeFactorsRenderer(
        join_semi_lattice=True,
        meet_semi_lattice=True,
    ),
)
[48]:
../../../_images/notebooks_algebras_lattice_extensions_51_0.png
[49]:
lattice.extend([PrimeFactors(30)])
HasseDiagram[PrimeFactors](
    lattice,
    domain_renderer=PrimeFactorsRenderer(
        join_semi_lattice=True,
        meet_semi_lattice=True,
    ),
)
[49]:
../../../_images/notebooks_algebras_lattice_extensions_52_0.png
[50]:
lattice.extend([PrimeFactors(42)])
HasseDiagram[PrimeFactors](
    lattice,
    domain_renderer=PrimeFactorsRenderer(
        join_semi_lattice=True,
        meet_semi_lattice=True,
    ),
)
[50]:
../../../_images/notebooks_algebras_lattice_extensions_53_0.png
[51]:
lattice.extend([PrimeFactors(5040)])
HasseDiagram[PrimeFactors](
    lattice,
    domain_renderer=PrimeFactorsRenderer(
        join_semi_lattice=True,
        meet_semi_lattice=True,
    ),
)
[51]:
../../../_images/notebooks_algebras_lattice_extensions_54_0.png
[52]:
lattice.extend([PrimeFactors(7560)])
HasseDiagram[PrimeFactors](
    lattice,
    domain_renderer=PrimeFactorsRenderer(
        join_semi_lattice=True,
        meet_semi_lattice=True,
    ),
)
[52]:
../../../_images/notebooks_algebras_lattice_extensions_55_0.png
[53]:
lattice.extend([PrimeFactors(30240)])
HasseDiagram[PrimeFactors](
    lattice,
    domain_renderer=PrimeFactorsRenderer(
        join_semi_lattice=True,
        meet_semi_lattice=True,
    ),
)
[53]:
../../../_images/notebooks_algebras_lattice_extensions_56_0.png
[54]:
lattice.extend([PrimeFactors(60480)])
HasseDiagram[PrimeFactors](
    lattice,
    domain_renderer=PrimeFactorsRenderer(
        join_semi_lattice=True,
        meet_semi_lattice=True,
    ),
)
[54]:
../../../_images/notebooks_algebras_lattice_extensions_57_0.png