Examples.Setoid.SubgroupLattice¶
Worked example: the subgroup lattice of the Klein four-group¶
This is the Examples.Setoid.SubgroupLattice module of the Agda Universal Algebra Library.
We formalize the Klein four-group Vβ = β€/2β€ Γ β€/2β€ as a setoid algebra over the
group signature Sig-Group and study its lattice of
subuniverses via Setoid.Subalgebras.CompleteLattice.
Two remarks make this a group-theoretic example rather than a bare subset example.
First, because Sig-Group carries the binary β, the unary inverse β»ΒΉ, and the
nullary identity Ξ΅, a subuniverse (i.e., a subset closed under all the operations)
is exactly a subgroup. Second, the nullary Ξ΅ forces every subuniverse to contain
the identity, so the bottom subuniverse Sg β
is already the trivial subgroup
{e}; we get it for free as the lattice bottom 0Λ’.
Vβ has exactly five subgroups: the trivial group {e}, the whole group, and three
non-trivial, order-two subgroups in between, pairwise incomparable, any two of which
meet at {e} and join to the whole group. That is the lattice Mβ β the
five-element diamond, and the smallest non-distributive lattice.
This module exhibits the three middle subgroups as elements of Sub Vβ, instantiates
the lattice bundles, and proves that the subgroup lattice is an Mβ lattice: the
three atoms are pairwise incomparable and proper, any two meet at {e}, and any two
join to the whole group. The one piece left for future work is to prove that these
five are the only subgroups.
The Klein four-group Vβ¶
The carrier is Bool Γ Bool; the group operation is componentwise exclusive-or,
every element is its own inverse, and the identity is (false , false). We define
_β_ through the projections (rather than by matching the pairs) so that it computes
on arbitrary (not just literal) arguments, which keeps the closure proofs below
definitional.
infixl 6 _β_ _β_ : Bool Γ Bool β Bool Γ Bool β Bool Γ Bool x β y = projβ x xor projβ y , projβ x xor projβ y Vβ : Algebra 0β 0β Vβ = record { Domain = setoid (Bool Γ Bool) ; Interp = interp } where interp : Func (β¨ Sig-Group β© (setoid (Bool Γ Bool))) (setoid (Bool Γ Bool)) interp β¨$β© (β-Op , args) = args 0F β args 1F interp β¨$β© (Ξ΅-Op , _) = false , false interp β¨$β© (β»ΒΉ-Op , args) = args 0F cong interp {β-Op , _} {.β-Op , _} (refl , aβ) = congβ _β_ (aβ 0F) (aβ 1F) cong interp {Ξ΅-Op , _} {.Ξ΅-Op , _} (refl , _) = refl cong interp {β»ΒΉ-Op , _} {.β»ΒΉ-Op , _} (refl , aβ) = aβ 0F
The three order-two subgroups¶
Each order-two subgroup is cut out by one linear condition on the coordinates:
Hβ = {(0,y)} (first coordinate trivial), Hβ = {(x,0)} (second coordinate
trivial), and Hβ = {(x,x)} (the diagonal). Each is closed under the operations,
hence a subuniverse: closure under β is xor respecting the condition (via
congβ), closure under Ξ΅ is immediate, and closure under β»ΒΉ is trivial since the
inverse is the identity map.
open import Setoid.Subalgebras.Subuniverses {π = Sig-Group} using ( Subuniverses ; var ; app ) Hβ Hβ Hβ : Pred (Bool Γ Bool) 0β Hβ x = projβ x β‘ false Hβ x = projβ x β‘ false Hβ x = projβ x β‘ projβ x Hβ-isSub : Hβ β Subuniverses Vβ Hβ-isSub β-Op _ im = congβ _xor_ (im 0F) (im 1F) Hβ-isSub Ξ΅-Op _ _ = refl Hβ-isSub β»ΒΉ-Op _ im = im 0F Hβ-isSub : Hβ β Subuniverses Vβ Hβ-isSub β-Op _ im = congβ _xor_ (im 0F) (im 1F) Hβ-isSub Ξ΅-Op _ _ = refl Hβ-isSub β»ΒΉ-Op _ im = im 0F Hβ-isSub : Hβ β Subuniverses Vβ Hβ-isSub β-Op _ im = congβ _xor_ (im 0F) (im 1F) Hβ-isSub Ξ΅-Op _ _ = refl Hβ-isSub β»ΒΉ-Op _ im = im 0F
Instantiating the lattice bundles¶
With base level ββ = 0β the absorbing level L is 0β. We open Sublattice Vβ 0β
to bring the order, operations, bounds, and bundles into scope specialized to Vβ β
so we write π―β β€ π―β, π―β β§ π―β, 0Λ’, etc. directly. All three bundles type-check.
open import Setoid.Subalgebras.CompleteLattice {π = Sig-Group} using ( module Sublattice ) open Sublattice Vβ 0β -- The three middle subgroups as elements of Sub Vβ. π―β π―β π―β : Subα΄Έ π―β = Hβ , Hβ-isSub π―β = Hβ , Hβ-isSub π―β = Hβ , Hβ-isSub
The Mβ shape¶
Each middle subgroup lies strictly between the bottom {e} and the top: it is above
0Λ’ (every subgroup is, since 0Λ’ is least) and below 1Λ’ (likewise), and it is
proper β distinct from the top, because it omits some element of the group.
0β€π―β : 0Λ’ β€ π―β 0β€π―β = 0Λ’-minimum π―β π―ββ€1 : π―β β€ 1Λ’ π―ββ€1 _ = lift tt -- π―β is a *proper* subgroup: the top is not contained in it (it omits (true , false)). 1β¬π―β : Β¬ ( 1Λ’ β€ π―β ) 1β¬π―β le = ex falso where ex : (true , false) β projβ π―β β β₯ ex () falso : (true , false) β projβ π―β falso = le {true , false} (lift tt) 0β€π―β : 0Λ’ β€ π―β 0β€π―β = 0Λ’-minimum π―β π―ββ€1 : π―β β€ 1Λ’ π―ββ€1 _ = lift tt -- π―β omits (false , true) (its second coordinate is not trivial). 1β¬π―β : Β¬ ( 1Λ’ β€ π―β ) 1β¬π―β le = ex falso where ex : (false , true) β projβ π―β β β₯ ex () falso : (false , true) β projβ π―β falso = le {false , true} (lift tt) 0β€π―β : 0Λ’ β€ π―β 0β€π―β = 0Λ’-minimum π―β π―ββ€1 : π―β β€ 1Λ’ π―ββ€1 _ = lift tt -- π―β omits (true , false) (its coordinates differ). 1β¬π―β : Β¬ ( 1Λ’ β€ π―β ) 1β¬π―β le = ex (le (lift tt)) where ex : (true , false) β projβ π―β β β₯ ex ()
The three middle subgroups are pairwise incomparable: each contains a non-identity
element the others lack β (false , true) β Hβ, (true , false) β Hβ,
(true , true) β Hβ.
π―ββ¬π―β : Β¬ ( π―β β€ π―β ) π―ββ¬π―β le = ex (le refl) where ex : (false , true) β projβ π―β β β₯ ex () π―ββ¬π―β : Β¬ ( π―β β€ π―β ) π―ββ¬π―β le = ex (le refl) where ex : (true , false) β projβ π―β β β₯ ex () π―ββ¬π―β : Β¬ ( π―β β€ π―β ) π―ββ¬π―β le = ex (le refl) where ex : (false , true) β projβ π―β β β₯ ex () π―ββ¬π―β : Β¬ ( π―β β€ π―β ) π―ββ¬π―β le = ex (le refl) where ex : (true , false) β projβ π―β β β₯ ex () π―ββ¬π―β : Β¬ ( π―β β€ π―β ) π―ββ¬π―β le = ex (le refl) where ex : (true , false) β projβ π―β β β₯ ex () π―ββ¬π―β : Β¬ ( π―β β€ π―β ) π―ββ¬π―β le = ex (le refl) where ex : (true , true) β projβ π―β β β₯ ex ()
Together these facts give the order skeleton of Mβ: three pairwise-incomparable
proper subgroups, each strictly between 0Λ’ = {e} and 1Λ’.
The meet/join table: Mβ is non-distributive¶
The lattice is Mβ: any two atoms meet at {e} and join to the whole group.
For a meet, an element trivial in both relevant coordinates is the identity
(false , false), which the nullary Ξ΅ generates, so it lies in 0Λ’ = Sg β
.
For a join, the union of two atoms generates all four elements β the fourth as the
β of the other two atom witnesses
(e.g., (true , true) = (false , true) β (true , false)).
π―ββ§π―βββ₯ : π―β β§ π―β β 0Λ’ π―ββ§π―βββ₯ = m , 0Λ’-minimum (π―β β§ π―β) where m : π―β β§ π―β β€ 0Λ’ m (refl , refl) = app Ξ΅-Op (Ξ» ()) Ξ» () π―ββ§π―βββ₯ : (π―β β§ π―β) β 0Λ’ π―ββ§π―βββ₯ = m , 0Λ’-minimum (π―β β§ π―β) where m : (π―β β§ π―β) β€ 0Λ’ m (refl , refl) = app Ξ΅-Op (Ξ» ()) (Ξ» ()) π―ββ§π―βββ₯ : (π―β β§ π―β) β 0Λ’ π―ββ§π―βββ₯ = m , 0Λ’-minimum (π―β β§ π―β) where m : (π―β β§ π―β) β€ 0Λ’ m (refl , refl) = app Ξ΅-Op (Ξ» ()) (Ξ» ()) π―ββ¨π―βββ€ : (π―β β¨ π―β) β 1Λ’ π―ββ¨π―βββ€ = (Ξ» _ β lift tt) , j where j : 1Λ’ β€ (π―β β¨ π―β) j {false , false} _ = var (injβ refl) j {false , true} _ = var (injβ refl) j {true , false} _ = var (injβ refl) j {true , true} _ = app β-Op (Ξ» { 0F β false , true ; 1F β true , false }) (Ξ» { 0F β var (injβ refl) ; 1F β var (injβ refl) }) π―ββ¨π―βββ€ : (π―β β¨ π―β) β 1Λ’ π―ββ¨π―βββ€ = (Ξ» _ β lift tt) , j where j : 1Λ’ β€ (π―β β¨ π―β) j {false , false} _ = var (injβ refl) j {false , true} _ = var (injβ refl) j {true , true} _ = var (injβ refl) j {true , false} _ = app β-Op (Ξ» { 0F β false , true ; 1F β true , true }) (Ξ» { 0F β var (injβ refl) ; 1F β var (injβ refl) }) π―ββ¨π―βββ€ : (π―β β¨ π―β) β 1Λ’ π―ββ¨π―βββ€ = (Ξ» _ β lift tt) , j where j : 1Λ’ β€ (π―β β¨ π―β) j {false , false} _ = var (injβ refl) j {true , false} _ = var (injβ refl) j {true , true} _ = var (injβ refl) j {false , true} _ = app β-Op (Ξ» { 0F β true , false ; 1F β true , true }) (Ξ» { 0F β var (injβ refl) ; 1F β var (injβ refl) })
These equalities are exactly non-distributivity: with x = π―β, y = π―β, z = π―β,
the meet x β§ (y β¨ z) = x β§ 1Λ’ = x (a proper, nonzero subgroup), whereas
(x β§ y) β¨ (x β§ z) = 0Λ’ β¨ 0Λ’ = 0Λ’ β so Mβ is not distributive.
Remaining work¶
What remains is completeness: that 0Λ’, 1Λ’, π―β, π―β, π―β are all the
subgroups β a finite case analysis over the four group elements.