-
Notifications
You must be signed in to change notification settings - Fork 298
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
[Merged by Bors] - feat(logic/basic): add eq_iff_true_of_subsingleton #3308
Conversation
bors merge |
I'm surprised we didn't have this already. ```lean example (x y : unit) : x = y := by simp ```
bors r- |
Canceled. |
Ah this broke a bit more than expected. Apparently I weakened the |
@@ -46,7 +46,8 @@ meta def fin_cases_at_aux : Π (with_list : list expr) (e : expr), tactic unit | |||
(to_rhs >> conv.interactive.change (to_pexpr h)) | |||
-- Otherwise, call `norm_num`. We let `norm_num` unfold `max` and `min` | |||
-- because it's helpful for the `interval_cases` tactic. | |||
| _ := try $ tactic.interactive.norm_num |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if you made this norm_num1
instead of norm_num
to avoid calling simp
? I'm not sure if it's powerful enough for whatever norm_num
is intended to do here, but maybe it is, and that would be an easier fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried this as well, but interval_cases
seems to heavily rely on the simplifier. Otherwise you get goals like this:
w₂: ⊥ < 2
⊢ ⊥ = 0 ∨ ⊥ = 1
w₂: ⊥ + 1 < 2
⊢ ⊥ + 1 = 0 ∨ ⊥ + 1 = 1
Just to recap the issues:
fin_cases
should usesubst
on hypotheses likei = 0
- the new simp lemma simplifies those to
true
- however in general we want the full simplifier because of
interval_cases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, I think I've fixed this. The issue was that I've been using tactic.interactive.norm_num
in the conv monad, which (in hindsight) obviously doesn't work. Then I tried conv.interactive.norm_num
, which also failed because it used the simplifier from the tactic monad. After fixing conv.interactive.norm_num
, the tests pass. I'm keeping my fingers crossed.
It finally builds! |
test/tidy.lean
Outdated
intro1, | ||
induction x, | ||
refl | ||
simp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this test be testing something about tidy
in some way? @semorrison
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It had been a test about chain
, checking that it failed when it was meant to fail. The test has become a bad one, because now the underlying tactic is succeeding (yay!). I propose we just delete this test entirely.
To quote @semorrison: > It had been a test about `chain`, checking that it failed when it was > meant to fail. The test has become a bad one, because now the underlying > tactic is succeeding (yay!). I propose we just delete this test > entirely.
bors merge |
Wait, did you mean to delete the entire test file? bors r- |
I think @semorrison was just suggesting to delete |
Ooops! I should learn to be more careful! |
This reverts commit 771305d.
LGTM! |
I'm surprised we didn't have this already. ```lean example (x y : unit) : x = y := by simp ``` Co-authored-by: Johan Commelin <johan@commelin.net>
Pull request successfully merged into master. Build succeeded: |
…ity#3308) I'm surprised we didn't have this already. ```lean example (x y : unit) : x = y := by simp ``` Co-authored-by: Johan Commelin <johan@commelin.net>
I'm surprised we didn't have this already.
I'm not sure if this breaks anything.