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

feat(tactic/ext): add apply_cfg argument to ext1 #346

Merged

Conversation

semorrison
Copy link
Collaborator

This causes goals to appear in the same order they appear as hypotheses of the
@[extensionality] lemma, rather than being reordered to put dependent
goals first.

This doesn't appear to affect any uses of ext in mathlib,
but is occasionally helpful in the development of category theory.

(Indeed, I have been running into tactic mode proofs that fail to
typecheck, when using ext, and this avoids the problem. My
actual dependent ext lemma is at here, and the place where I need
to swap the goals back into order by hand is here.)

TO CONTRIBUTORS:

Make sure you have:

  • reviewed and applied the coding style: coding, naming
  • for tactics:

For reviewers: code review check list

This causes goals to appear in the same order they appear as hypotheses of the
`@[extensionality]` lemma, rather than being reordered to put dependent
goals first.

This doesn't appear to affect any uses of `ext` in mathlib,
but is occasionally helpful in the development of category theory.

(Indeed, I have been running into tactic mode proofs that fail to
typecheck, when using ext, and this avoids the problem)
@digama0
Copy link
Member

digama0 commented Sep 13, 2018

I think you should add a configuration option rather than changing the default.

and a wrapper so tidy can sometimes produce shorter tactic scripts
@semorrison
Copy link
Collaborator Author

I added an optional apply_cfg argument, just to the non-interactive tactic. I also added a short wrapper in tidy, that decides whether to just report ext or also report passing a configuration. This logic could be further improved, perhaps.

@semorrison
Copy link
Collaborator Author

Perhaps in Lean 4 we can discuss the best default value for apply_cfg.new_goals!

@semorrison semorrison changed the title feat(tactics/ext): use applyc _ {new_goals := new_goals.all} feat(tactics/ext): add apply_cfg argument to ext1 Sep 14, 2018
@semorrison semorrison changed the title feat(tactics/ext): add apply_cfg argument to ext1 feat(tactic/ext): add apply_cfg argument to ext1 Sep 20, 2018
@johoelzl johoelzl merged commit 87a963b into leanprover-community:master Oct 1, 2018
@semorrison semorrison deleted the ext-goal-ordering branch October 2, 2018 09:39
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.

None yet

3 participants