Skip to content

Some lemmata for non-empty lists #2730

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

Open
wants to merge 21 commits into
base: master
Choose a base branch
from

Conversation

pmbittner
Copy link

These are some lemmata we needed in our project Vatras for reasoning on non-empty lists. It seemed these lemmata could be generally useful to other people as well.

-- PR is part of Zurihac 2025

@Taneb
Copy link
Member

Taneb commented Jun 8, 2025

These look like good additions! Can you update Changelog.md with these?

@pmbittner pmbittner force-pushed the non-empty-list branch 2 times, most recently from ad38846 to f4737f0 Compare June 8, 2025 13:37
@pmbittner
Copy link
Author

Ok, I updated the changelog as well. :)

@pmbittner
Copy link
Author

I also migrated some additional lemmas from Data.List.Properties.

Copy link
Contributor

@JacquesCarette JacquesCarette left a comment

Choose a reason for hiding this comment

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

A few nits, but otherwise this is looking nice.

[Not a big fan of rewrite, but it's not a showstopper.]

@pmbittner
Copy link
Author

Thank you for the review. :) I integrated the requested changes. I also got rid of the rewrite by introducing an analogous lemma to Data.List.Properties and then reusing that.

Copy link
Member

@gallais gallais left a comment

Choose a reason for hiding this comment

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

Happy with this; apart from two small naming issues (and related completeness question).

@@ -260,6 +260,7 @@ Additions to existing modules

* In `Data.List.Properties`:
```agda
length-++-≤ : ∀ (xs : List A) → length xs ≤ length (xs ++ ys)
Copy link
Member

Choose a reason for hiding this comment

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

Feels like this should have a ˡ suffix and we should have the ʳ variant too.

∷⁺→∷ : (x List⁺.∷ xs) ≡ (y List⁺.∷ ys) →
(x List.∷ xs) ≡ (y List.∷ ys)
length-⁺++⁺ : (xs ys : List⁺ A) → length (xs ⁺++⁺ ys) ≡ length xs + length ys
length-⁺++⁺-≤ : (xs ys : List⁺ A) → length xs ≤ length (xs ⁺++⁺ ys)
Copy link
Member

Choose a reason for hiding this comment

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

Same remark about suffixes.

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.

4 participants