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

exact_mod_cast unification leaves extra goal #4805

Closed
PatrickMassot opened this issue Oct 27, 2020 · 4 comments
Closed

exact_mod_cast unification leaves extra goal #4805

PatrickMassot opened this issue Oct 27, 2020 · 4 comments

Comments

@PatrickMassot
Copy link
Member

import data.complex.basic

example : (((real.sqrt 2) / 2) : ℂ).im = 0 :=
begin
  exact_mod_cast complex.of_real_im _,
end

is expected to close the goal, but actually creates a new goal asking for a real number (any real number, not necessarily (real.sqrt 2 / 2) which is relevant here). Note that exact_mod_cast complex.of_real_im (real.sqrt 2 / 2) does work.

See https://leanprover.zulipchat.com/#narrow/stream/116395-maths/topic/Exponential.20form.20of.20a.20complex.20number/near/214770391

@digama0
Copy link
Member

digama0 commented Oct 27, 2020

Did you notice that by exact_mod_cast complex.of_real_im 37 also works? I don't think there is anything wrong with exact_mod_cast - the _ is not determined by exact_mod_cast.

@robertylewis
Copy link
Member

The problem is that norm_cast closes the goal on its own which I don't think was ever expected in exact_mod_cast. The (\u r).im = 0 norm_cast lemmas are a little pathological.

@digama0
Copy link
Member

digama0 commented Oct 27, 2020

You can also use exact_mod_cast rfl (which also makes it clear that plain norm_cast works). I don't see anything about exact_mod_cast behavior that needs changing here.

@PatrickMassot
Copy link
Member Author

Oh, it didn't occur to me that norm_cast could do the job by itself! I guess I'll close this then.

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

No branches or pull requests

3 participants