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

ext on structures should use subsingleton instances to avoid unnecessary hypotheses #4336

Open
rwbarton opened this issue Sep 30, 2020 · 1 comment
Labels
t-meta Tactics, attributes or user commands

Comments

@rwbarton
Copy link
Collaborator

Toy example:

import tactic.ext

@[ext] structure foo (α : Type*) :=
(a : α)
(b : unit)

#check @foo.ext

The generated lemma has type foo.ext : ∀ {α : Type u_1} (x y : foo α), x.a = y.a → x.b = y.b → x = y, in which the hypothesis x.b = y.b is always satisfied; instead the lemma should only take the x.a = y.a hypothesis.

In this example, the extra hypothesis doesn't matter so much, because unit also has an extensionality lemma which will be applied by the ext tactic. But you might want to apply the foo.ext lemma by hand, and there are other subsingleton types without ext lemmas (e.g. trunc β).

@bryangingechen bryangingechen added the t-meta Tactics, attributes or user commands label Oct 7, 2020
@eric-wieser
Copy link
Member

I'm not refuting the suggestion here that @[ext] should be smarter, but...

and there are other subsingleton types without ext lemmas (e.g. trunc β).

IMO these types should have ext lemmas anyway, otherwise calling ext on trunc α × β won't eliminate the trunc either.

Can we make the ext tactic
perform this search for subsingletons automatically?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t-meta Tactics, attributes or user commands
Projects
None yet
Development

No branches or pull requests

3 participants