feat(PFunctor): Add API of basic constructions - #803
Conversation
| This is kept as a `def` alongside the `HAdd` instance below, even though that instance is | ||
| exactly as universe-general as `add` itself: the `binop%` elaborator behind `+` eagerly | ||
| unifies the types of both operands with the expected type, so when the expected type carries | ||
| universe metavariables (e.g. inside `PFunctor.W (P.add (.const α))` with `α : Type v`), | ||
| `P + Q` can fail to elaborate where `P.add Q` succeeds; see `CslibTests/PFunctor.lean`. -/ |
There was a problem hiding this comment.
It would be great to raise this issue on Zulip and link the post from the PR description.
eric-wieser
left a comment
There was a problem hiding this comment.
It would be great to have another PFunctor expert review this for docstrings, but this all looks pretty reasonable to me.
|
Also cc @quangvdao would be good to get your review too. Also more generally I'm unsure about adding |
To expand on this, I think |
PR to add various basic
PFunctordefinitions from PolyFun , split off from #731 to better isolate changes for review.Main definitions are
PFunctor.monomial,PFunctor.add, andPFunctor.mul, with abbreviations for common special cases ofPFunctor.monomial.Discussion about the addition notation:
https://leanprover.zulipchat.com/#narrow/channel/270676-lean4/topic/Universe.20unification.20with.20.60HAdd.2EhAdd.60.20vs.2E.20.60.2B.60.20notation/with/617534952.01