-
Notifications
You must be signed in to change notification settings - Fork 641
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
Extend app_inj_tail and other list lemmas #12094
Conversation
97f2c0f
to
b6e2254
Compare
This raises two questions for me:
Lemma app_inj_tail_inv :
forall (x y:list A) (a b:A), x = y /\ a = b -> x ++ [a] = y ++ [b].
Proof. intros ? ? ? ? [-> ->]; reflexivity. Qed.
(* alternative proofs
Proof. intros ? ? ? ? [? ?]; subst; reflexivity. Qed.
Proof. now intros; repeat f_equal. Qed.
*) |
It looks like this change is not backwards compatible. And as already mentioned by @olaure01 the reverse directions are simple congruence lemmas, so I personally am not sure if it's worth it. |
That is a good point. I stumbled upon this issue as a Coq user from using If you think this is not worthwhile, I can close this and the accompanying issue, though it might be interesting to consider this from a user perspective. |
Do you have a concrete example where the other direction is needed? Because in simple cases it can be solved with something as trivial as Also, to really merge this PR in its current form you would need to fix the failing dependencies. It might be easier to introduce new names for the equivalences. |
That's a fair point. I had a goal of the form |
Some people like the In the failures, here,
Here again, the opinions diverge. Some people like to state common lemma even if is is only to save a few tactics and/or because they consider that it makes sense as an algebraic property.
A common name used for equivalences is to add the suffix |
@edwardcwang: it seems that you rally to the arguments of @olaure01 and @anton-trunov. Maybe shall we close the PR then? |
Apologies for the delay in responding; I've been a bit busier lately. I also agree with your point @herbelin on using |
OK |
@herbelin I resolved the previous issues using the
|
I don't understand the point of the new direction, isn't it just
These CI failures are indeed spurious, rebase to rerun. |
Here I refer to Hugo's commentary on April 22 with regards to the desirability of |
This was somehow the discussion above. As I said, I know that some people like Anyway, my proposal, unless there is a strong objection, would be to validate the PR as it is, by a couple of days. I'm also assigning. |
@herbelin Hi Hugo, any updates on this? Thank you for your help! |
@olaure01, @anton-trunov: would you like some changes? If not, I would merge within a couple of days. |
@herbelin I left a comment inplace. Also, this PR needs a changelog entry. How to add it is described here: https://github.com/coq/coq/tree/master/doc/changelog |
The lemma is true in the other direction and can be useful in proofs.
21c55bf
to
216215c
Compare
216215c
to
f2ba2ad
Compare
@edwardcwang Thank you! @herbelin LGTM |
Looks indeed very good. If no other comments by then, I'll merge tomorrow. |
The lemma is true in the other direction and can be useful in proofs.
Kind: feature.
Fixes / closes #12093