Skip to content

Conversation

jfehrle
Copy link
Member

@jfehrle jfehrle commented Aug 21, 2025

No description provided.

@jfehrle jfehrle requested a review from a team as a code owner August 21, 2025 20:09
@jfehrle jfehrle added the kind: documentation Additions or improvement to documentation. label Aug 21, 2025
@coqbot-app coqbot-app bot added the needs: full CI The latest GitLab pipeline that ran was a light CI. Say "@coqbot run full ci" to get a full CI. label Aug 21, 2025
which can result in more than one success (e.g. for `\\/`) when using
backtracking tactics such as `constructor; ...`. See :tacn:`ltac-seq`.

To use :n:`constructor` on a hypothesis :n:`H`, use :tacn:`destruct` :n:`H`.
Copy link
Contributor

Choose a reason for hiding this comment

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

This makes no sense, to "use a constructor on a hypothesis", you use apply c in H and this has no connection to destruct. I assume this was written to mirror split, but this doesn't feel needed and would feel more confusing than anything.

Copy link
Member Author

Choose a reason for hiding this comment

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

This makes no sense, to "use a constructor on a hypothesis", you use apply c in H and this has no connection to destruct

You added "a", which changes the meaning. I am referring to the 'constructor' tactic. 'constructor'' doesn't require specifying 'c', which may be useful if you're using 'auto''.

Copy link
Contributor

@yannl35133 yannl35133 Sep 1, 2025

Choose a reason for hiding this comment

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

I should have said "to use constructor on a hypothesis", but the rest of the sentence still holds.
You can't use constructor on a hypothesis, its reasonable semantics is apply c in H which is the best way to do it (and barely makes sense since "applying constructor to a hypothesis" barely makes sense by itself), and most importantly none of this has anything to do with using destruct.

typically used to split conjunctions in the conclusion such as `A /\\ B` into
two new goals `A` and `B`.

To :n:`split` a hypothesis :n:`H`, use :tacn:`destruct` :n:`H`.
Copy link
Contributor

Choose a reason for hiding this comment

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

It is too confusing to tell newcomers that we "split" hypotheses; I could see such a sentence if it said
To split a conjunction in a hypothesis :n:`H` instead of the conclusion, use :tacn:`destruct` :n:`H`.

Comment on lines 201 to 235
.. example:: Using :tacn:`destruct` on the conclusion

Creates a subgoal for each constructor, substituting the constructor
into the conclusion.

.. rocqtop:: reset none

Goal forall m n: nat, m + n = n + m.

.. rocqtop:: out

intros.

.. rocqtop:: all

destruct n. (* n is an inductive *)
.. _example_split_hypothesis:

.. example:: Using :tacn:`destruct` on a hypothesis

This gives the effect of a :tacn:`split` or :tacn:`constructor` on the
hypothesis. Creates hypotheses for each constructor of the head constant.

.. rocqtop:: reset none

Goal forall A B: Prop, A /\ B -> True.

.. rocqtop:: out

intros.

.. rocqtop:: all

destruct H. (* H is a hypothesis *)
Copy link
Contributor

Choose a reason for hiding this comment

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

There is no practical difference between "destruct on the conclusion" and "destruct on a hypothesis" since the former is really impossible, you need to destruct a hypothesis or a term constructed from hypotheses.
Here, the difference is really between using destruct on a dependent premise (example 1) or a non-dependent premise (example 2).
As said above, I can't see any way in which this resembles constructor, and it can resemble "a split" (not split) if the hypothesis is a conjunction, but it's way more general.

@jfehrle
Copy link
Member Author

jfehrle commented Sep 20, 2025

Hi @yannl35133, I think this revised version will be more to your liking. Let me know what you think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: documentation Additions or improvement to documentation. needs: full CI The latest GitLab pipeline that ran was a light CI. Say "@coqbot run full ci" to get a full CI.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants