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

Utilize dependent pairs more #422

Open
Engreyight opened this issue Jan 16, 2024 · 0 comments
Open

Utilize dependent pairs more #422

Engreyight opened this issue Jan 16, 2024 · 0 comments
Labels
enhancement Enhancement of existing features new feature Addition of new features

Comments

@Engreyight
Copy link
Collaborator

Engreyight commented Jan 16, 2024

Practically every lemma and theorem is only defined for well-formed patterns, so it would make sense to represent these patterns specifically using sig well_formed. Then wrappers may be defined for pattern operators, like this example for patt_and:

Definition patt_and_wrapper : forall (a b : sig well_formed), sig well_formed.
Proof.
  intros [a wfa] [b wfb].
  exists (a and b).
  now apply well_formed_and.
Defined.

Building the well-formedness proofs into the patterns themselves would significantly reduce, or in simpler cases possibly even eliminate, the need for providing these proofs manually (which are mostly trivial with auto and wf_auto2 anyway).

Another usecase of dependent pairs would be creating fresh variables, like this:

Definition get_fresh_evar (φ : Pattern) : sig (.∉ free_evars φ).
Proof.
  exists (fresh_evar φ); auto.
Defined.

A version for a list of patterns may be defined similarly. Not only would pose proofing this as [y Hy] be cleaner than the current remember (fresh_evar φ) as y. assert (y ∉ free_evars φ) as Hy by auto. method, it could also be used directly in a slightly modified version of total_phi_impl_phi, for example.

@Engreyight Engreyight added enhancement Enhancement of existing features new feature Addition of new features labels Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement of existing features new feature Addition of new features
Projects
None yet
Development

No branches or pull requests

1 participant