Skip to content

Conversation

@fgdorais
Copy link
Collaborator

No description provided.

@github-actions github-actions bot added the awaiting-review This PR is ready for review; the author thinks it is ready to be merged. label Sep 29, 2025
@leanprover-community-bot
Copy link
Collaborator

Mathlib CI status (docs):

theorem all_eq_true_iff {p : Fin n → Bool} : Fin.all p = true ↔ ∀ i, p i = true := by simp

theorem all_eq_false_iff {p : Fin n → Bool} : Fin.all p = false ↔ ∃ i, p i = false := by simp

Copy link
Contributor

Choose a reason for hiding this comment

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

So arguably we are missing some lemmas but you could argue they are covered by the fact this is just an abbrev.

I would expect any_zero, all_zero, any_succ and all_succ, though.

I also think you want something like not_any_eq_all_not and not_all_eq_any_not which are not hard proofs but I think are probably worth having. You could also have all_eq_not_any_not in the same way. In general I would consider what lemmas from here: https://leanprover-community.github.io/mathlib4_docs/Init/Data/List/Lemmas.html#List.not_any_eq_all_not are wanted by analogy.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

How about going a step further and have classes to standardize the basic API for all and any?

Short-circuits upon encountering the first false.
-/
protected abbrev all (p : Fin n → Bool) := find? (! p ·) |>.isNone
Copy link
Contributor

Choose a reason for hiding this comment

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

Could also consider simply ! any (! p ·).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Potatoes/Tomatoes? I don't have a preference either way.

@linesthatinterlace
Copy link
Contributor

Some good work here! I think we have slightly different tastes for number of lemmas etc. in some ways - but I absolutely agree we should have this. (We're also missing, say, findIdx? - if you want another thing to think about after this...)

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the merge-conflict This PR has merge conflicts with the `main` branch which must be resolved by the author. label Oct 11, 2025
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot removed the merge-conflict This PR has merge conflicts with the `main` branch which must be resolved by the author. label Oct 12, 2025
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the merge-conflict This PR has merge conflicts with the `main` branch which must be resolved by the author. label Oct 22, 2025
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot removed the merge-conflict This PR has merge conflicts with the `main` branch which must be resolved by the author. label Oct 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-review This PR is ready for review; the author thinks it is ready to be merged. builds-mathlib

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants