Repository navigation
Conversation
PR summary 25333c500cImport changes for modified filesNo significant changes to the import graph Import changes for all files
|
| Current number | Change | Type |
|---|---|---|
| 275 | -1 | documentation nolint entries |
Current commit 3715253ae7
Reference commit 25333c500c
You can run this locally as
./scripts/technical-debt-metrics.sh pr_summary
- The
relativevalue is the weighted sum of the differences with weight given by the inverse of the current value of the statistic. - The
absolutevalue is therelativevalue divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).
CoeFun instance for SimplexCoeFun instance for Simplex
| run_cmd Lean.Elab.Command.liftTermElabM do | ||
| Lean.Meta.registerCoercion ``points | ||
| (some { numArgs := 9, coercee := 8, type := .coeFun }) |
There was a problem hiding this comment.
What is this code for? I wouldn't expect a straightforward coercion such as this one to need more than the CoeFun instance plus a coe attribute. If it needs extra meta code such as this, I think it should come with a comment referencing an open bug against either Lean itself, for needing such code at all, or the Lean reference manual, for failing to discuss anywhere in the coercions section when and why you might want to do things like this with Lean.Meta.registerCoercion.
There was a problem hiding this comment.
The reason for this code is that I want s i instead of ↑s i and ⇑s instead of ↑s. So we need a @[coe_fun] attribute, but this attribute doesn't exist. Do you think it should exist? And do you agree we want to have the ⇑ arrow?
There was a problem hiding this comment.
I agree that delaborating with ⇑ would be good. I don't think each individual instance of coercion to a function should be running special-case meta code to achieve that; it would be better to have an open issue against Lean to request an improvement (such as a @[coe_fun] attribute) to achieve better delaboration for coercion to functions, and then once fixed the attribute could be added to relevant coercions in mathlib without needing to remove lots of custom meta code as well.
There was a problem hiding this comment.
I think it's not such a big deal to have to run this meta code. The same is used for DFunLike.coe. Or do you think there are many places in Mathlib that would need a @[coeFun] attribute?
There was a problem hiding this comment.
There are lots of CoeFun instances in mathlib, and only two cases of this meta code (DFunLike.coe and Setoid.r). The first step before adding more should be to have an open Lean issue about the need for this meta code and then ensure that every instance of that meta code in mathlib has a comment referencing that Lean issue.
There was a problem hiding this comment.
I've commented on an old Zulip thread that was already proposing this: #lean4 > `coe` attribute for CoeFun/CoeSort @ 💬
|
This pull request has conflicts, please merge |
|
What should we do about the lemmas that refer to |
|
That would seem reasonable for references to
|
|
This pull request has conflicts, please merge |
|
My view is still that we should have an issue filed against Lean about the need for a |
|
This pull request has conflicts, please merge |
My take is that we should ignore coercions in theorem names, and name theorems after what you get when you hover over the arrow. If you don't do this, then it becomes very annoying to name things with multiple coercions. Phrased another way, I'd suggest reserving |
This PR introduces the notation
s ito refer to theith vertex of simplexs, which replaces the currents.points i. It does this by adding aCoeFuninstance.I first tried using
FunLike, but this came with some different problems related to discrimination tree indexing insimp.