Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lattices and posets #593

Merged
merged 20 commits into from
Aug 23, 2021
Merged

Lattices and posets #593

merged 20 commits into from
Aug 23, 2021

Conversation

mzeuner
Copy link
Contributor

@mzeuner mzeuner commented Aug 12, 2021

This PR adds all the algebraic structures needed to define distributive lattices and rewrites the file on Posets.

@mzeuner mzeuner marked this pull request as ready for review August 17, 2021 12:45
Copy link
Collaborator

@mortberg mortberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! I had a few comments and then it can be merged

∨l-rdist-∧l : ∀ x y z → (y ∧l z) ∨l x ≡ (y ∨l x) ∧l (z ∨l x)
∨l-rdist-∧l x y z = ∨l-comm _ x ∙∙ ∨l-ldist-∧l _ _ _ ∙∙ cong₂ (_∧l_) (∨l-comm _ _) (∨l-comm _ _)

makeDistLattice : {L : Type ℓ} (0l 1l : L) (_∨l_ _∧l_ : L → L → L)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be nicer with an anonymous module here with makeIsDistLattice and makeDistLattice so that you don't have to write the long list of parameters twice?

Copy link
Contributor Author

@mzeuner mzeuner Aug 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good idea, I think we should do that for all the structures in the algebra library.
Had to make the arguments 0l 1l _∨l_ _∧l_ implicit in makeDistLattice but I think that's even better anyways

Copy link
Contributor Author

@mzeuner mzeuner Aug 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also made two versions of makeIsDistLattice.

open DistLatticeStr (snd L')

δ : {n : ℕ} (i j : Fin n) → L
δ i j = if i == j then 1l else 0l
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe there should be a more general delta operation which takes the zero and one?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

like δ x y i j = if i == j then x else y?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah

(makeIsSemilattice is-setL ∧l-assoc ∧l-rid ∧l-lid ∧l-comm ∧l-idem)
λ x y → ∨l-absorb-∧l x y , ∧l-absorb-∨l x y

makeLattice : {L : Type ℓ} (0l 1l : L) (_∨l_ _∧l_ : L → L → L)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Share parameters with makeIsLattice by using an anonymous module?

@@ -0,0 +1,191 @@
{-
following Johnstone we define semilattices to be commutative monoids
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a ref to the Johnstone book?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

makeIsCommMonoid is-setL assoc rid lid comm
IsSemilattice.idem (makeIsSemilattice is-setL assoc rid lid comm idem) = idem

makeSemilattice : {L : Type ℓ} (ε : L) (_·_ : L → L → L)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Share parameters with makeIsSemilattice?

@@ -0,0 +1,326 @@
{-
This an earlier formalization of posets using the old SIP instead of DURGs
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add this to Cubical.Experiments.Everything

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@mzeuner mzeuner marked this pull request as draft August 20, 2021 16:18
@mzeuner
Copy link
Contributor Author

mzeuner commented Aug 20, 2021

Converted back to draft because I'm really not sure about whether we should have anonymous modules for the makeIs... / make... stuff

@mzeuner mzeuner marked this pull request as ready for review August 23, 2021 09:23
@mortberg mortberg merged commit aab4a4c into agda:master Aug 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants