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(category_theory): add reassoc
annotations
#1558
Conversation
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.
Looks good to me... but I'm a metamateur...
Definitions need docstrings. What does this actually change? I'm surprised to see the attribute added with no proofs affected. |
Okay, my take on this PR is that the real content is a new tactic, [ Along the way, the PR adds a handful of correct, harmless, not-immediately necessary Under the hood, it does some refactoring (with no change in behaviour) of the machinery for creating @cipher1024, is this a correct summary? Have I missed anything? |
@cipher1024, I added some documentation suggestions, but I'll let you merge them if you like them. |
Co-Authored-By: Scott Morrison <scott@tqft.net>
Co-Authored-By: Scott Morrison <scott@tqft.net>
Co-Authored-By: Scott Morrison <scott@tqft.net>
Thanks! |
We also need some test cases. I'm not sure that the |
I use it more than I don't use it. I must admit that I don't like keeping such a complicated assumption in my context though. Maybe I should try reworking it so that I can write |
Hi that sounds like fun (-; But I'm also worried a bit. |
I don't think I would generate them whenever needed for lemmas, only assumptions. Here is an example where the notation is less cryptic: namespace tactic
def Prop' {α} (β : Prop) (hh : α) := β
meta def foo_tac : tactic unit :=
do `(Prop' %%v %%h) ← target,
(t,pr) ← prove_reassoc h,
unify v t,
exact pr
end tactic
def reassoc_of {α} (hh : α) {β} (x : tactic.Prop' β hh . tactic.foo_tac) : β := x
open category_theory
variables {C : Type} [category.{1} C]
example (X Y Z W : C) (x : X ⟶ Y) (y : Y ⟶ Z) (z z' : Z ⟶ W) (w : X ⟶ Z)
(h : x ≫ y = w)
(h' : y ≫ z = y ≫ z') :
x ≫ y ≫ z = w ≫ z' :=
begin
rw [h',reassoc_of h],
end |
(from experience, doing |
Aah, that seems nice. |
I like this example. What is the plan for this PR? |
I think I would just merge it as is. What do you think @semorrison? |
…y#1558) * feat(category_theory): add `reassoc` annotations * Update reassoc_axiom.lean * Update src/tactic/reassoc_axiom.lean Co-Authored-By: Scott Morrison <scott@tqft.net> * Update src/tactic/reassoc_axiom.lean Co-Authored-By: Scott Morrison <scott@tqft.net> * Update src/tactic/reassoc_axiom.lean Co-Authored-By: Scott Morrison <scott@tqft.net> * Update src/tactic/reassoc_axiom.lean * Update src/tactic/reassoc_axiom.lean * Update reassoc_axiom.lean * Update tactics.lean * Update tactics.md * Update reassoc_axiom.lean
TO CONTRIBUTORS:
Make sure you have:
If this PR is related to a discussion on Zulip, please include a link in the discussion.
For reviewers: code review check list